majordome.transport#

Effective thermal conductivity#

In some fields of research, such as porous media or composite materials, the evaluation of effective thermal properties are key for simulation of macroscopic application cases. Class EffectiveThermalConductivity implements thermal conductivity models for this sort of applications, including:

  • Maxwell-Garnett approximation (maxwell_garnett()) as exposed in [1]; further discussion of its origin and applicability is provided by [3].

  • For porous media (packed bed in the context) with enhanced radiative effects the model by [4] as discussed by [2] is implemented (singh1994()).

class majordome.transport.EffectiveThermalConductivity#

Models for effective thermal conductivity of granular media.

static maxwell_garnett(phi: float, k_g: float, k_s: float) float#

Maxwell-Garnett effective medium theory approximation.

Parameters:
phi: float

Solids packing fraction in packed bed [-].

k_g: float

Thermal conductivity of gas [W/(m.K)]

k_s: float

Thermal conductivity of solids [W/(m.K)]

Returns:
float

Effective domain thermal conductivity [W/(m.K)].

static singh1994(T: float, phi: float, d_p: float, k_s: float, epsilon: float) float#

Singh (1994) model for effective thermal conductivity.

Parameters:
T: float

Temperature of solids [K].

phi: float

Solids packing fraction in packed bed [-].

d_p: float

Solids characteristic particle size [m].

k_s: float

Thermal conductivity of solids [W/(m.K)]

epsilon: float

Average emissivity of solids [-]. For solids with temperature dependent emissivity, it is worth estimating the right value for the temperature range being studied.

Returns:
float

Effective domain thermal conductivity [W/(m.K)].

Dimensionless numbers#

class majordome.transport.SolutionDimless(mech: str, *, name=None)#

Provides evaluation of dimensionless numbers for a solution.

Parameters:
mech: str

Name or path to Cantera YAML solution mechanism.

name = None

Name of phase in mechanism if not a single one is present.

static bydef_grashof(Tw, T, beta, nu, g, H)#

Grashof number by definition.

static bydef_peclet(U, L, D)#

Péclet number by definition.

static bydef_prandtl(cp, mu, k)#

Prandtl number by definition.

static bydef_rayleigh(Tw, T, alpha, beta, nu, g, H)#

Rayleigh number by definition.

static bydef_reynolds(rho, mu, U, L)#

Reynolds number by definition.

static bydef_schmidt(rho, mu, D)#

Schmidt number by definition.

grashof(Tw: float, H: float, g: float = 9.80665) float#

Evaluates the Grashof number for solution.

Parameters:
Twfloat

Reactor characteristic wall temperature [K].

Hfloat

Problem characteristic (often vertical) length [m].

g: float = GRAVITY

Acceleration of gravity at location [m/s²].

peclet_heat(U: float, L: float) float#

Evaluates the heat Péclet number for solution.

Parameters:
Ufloat

Flow characteristic velocity [m/s].

Lfloat

Problem characteristic axial length [m].

peclet_mass(U: float, L: float, vname: str = 'mix_diff_coeffs') float#

Evaluates the mass Péclet number for solution.

Parameters:
Ufloat

Flow characteristic velocity [m/s].

Lfloat

Problem characteristic axial length [m].

vname: str = “mix_diff_coeffs”

Name of diffusion coefficient attribute to use, depending on the mass/mole units needs in your calculations. For more details please consult cantera.Solution documentation.

prandtl() float#

Evaluates Prandtl number for solution.

rayleigh(Tw: float, H: float, g: float = 9.80665) float#

Evaluates the Rayleigh number for solution.

Parameters:
Twfloat

Reactor characteristic wall temperature [K].

Hfloat

Problem characteristic (often vertical) length [m].

g: float = GRAVITY

Acceleration of gravity at location [m/s²].

report(show_fitting_errors: bool = False, tablefmt: str = 'simple') str#

Produces a table for inspecting all computed values.

reynolds(U: float, L: float) float#

Evaluates Reynolds number for solution.

Parameters:
Ufloat

Flow characteristic velocity [m/s].

Lfloat

Problem characteristic length [m].

schmidt(vname: str = 'mix_diff_coeffs') float#

Evaluates Schmidt number for solution.

Parameters:
vname: str = “mix_diff_coeffs”

Name of diffusion coefficient attribute to use, depending on the mass/mole units needs in your calculations. For more details please consult cantera.Solution documentation.

set_state(*args, tuple_name='TPX')#

Set state of system with given arguments.

property solution: Solution#

Provides handle for setting state of solution.

update()#

Retrieve all required properties from solution.

Sutherland fitting#

class majordome.transport.SutherlandFitting(mech: str, *, name=None)#

Helper for fitting Sutherland parameters for all species in solution.

Parameters:
mech: str

Name or path to Cantera YAML solution mechanism.

name = None

Name of phase in mechanism if not a single one is present.

static bydef(T: ndarray[tuple[Any, ...], dtype[float64]], As: float, Ts: float) ndarray[tuple[Any, ...], dtype[float64]]#

Sutherland transport parametric model as used in OpenFOAM.

Function provided to be used in curve fitting to establish Sutherland coefficients from data computed by Cantera using Lennard-Jones model. Reference: https://cfd.direct/openfoam/user-guide/thermophysical.

Parameters:
TNDArray[np.float64]

Temperature array given in kelvin.

Asfloat

Sutherland coefficient.

Tsfloat

Sutherland temperature.

Returns:
NDArray[np.float64]

The viscosity in terms of temperature.

property coefs_table: DataFrame#

Retrieve table of fitted model for all species.

fit(T: ndarray[tuple[Any, ...], dtype[float64]], P: float = 101325.0, species_names: list[str] = None, p0: tuple[float, float] = (1.0, 1000)) None#

Manage fitting of selected species from mechanism.

Parameters:
T: NDArray[float]

Array of temperatures over which fit model [K].

P: float = ct.one_atm

Operating pressure for fitting [Pa].

species_names: list[str] = None

Names of species to be fitted; if none is provided, then all species in database are processed.

p0: tuple[float, float] = (1.0, 1000)

Initial guess for fitting; values are provided in (uPa.s, K) units (not the usual Pa.s values for readability of values).

Returns:
pd.DataFrame

Table with evaluated proper

plot_species(fig, ax, name, loc=2)#

Generate verification plot for a given species.

to_openfoam() str#

Convert fitting to OpenFOAM format.

property viscosity: DataFrame#

Retrieve viscosity of species used in fitting.