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 []; further discussion of its origin and applicability is provided by [].For porous media (packed bed in the context) with enhanced radiative effects the model by [] as discussed by [] 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.
For keeping the API simple (as are the main use cases of this class), after accessing solution to setting its state, it is up to the user to call update as there is no pre-defined hook. It is not possible to implement such behavior of automatic call because you may simply retrieve the solution object and set the state later, after a hook has been called. The recommended way of setting state of the mixture is through set_state (see below).
- 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 = constants.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 = constants.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: str | None = 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(name=None, loc=2, *, plot=None, **kwargs)#
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.
Radiation properties#
- class majordome.transport.WSGGRadlibBordbar2020#
Weighted sum of gray gases radiation properties model.
Pure Python implementation of Radlib model from Bordbar (2020).
- Attributes:
- NUM_COEFS = 5
Number of coefficients in polynomials (order + 1).
- NUM_GRAYS = 4
Number of gray gases accounted for without clear gas.
- T_MIN = 300.0
Minimum temperature accepted by the model [K].
- T_MAX = 2400.0
Maximum temperature accepted by the model [K].
- T_RED = 1200.0
Temperature used for computing dimensionless temperature [K].
- P_TOL = 1.0e-10
Tolerance of carbon dioxide partial pressure [atm].
- MR_LIM_CO2 = 0.01
Limit of Mr corresponding to CO2-rich mixtures.
- MR_LIM_H2O = 4.0
Limit of Mr corresponding to H2O-rich mixtures.
- MR_LIM_INF = 1.0e+08
Maximum allowed value of Mr.
Internals#
- class majordome.transport.AbstractRadiationModel#
- static load_raw_data(name: str) Any#
Load raw data for feeding an implementation.
- static relax(alpha, a, b)#
Compute a fractional mixture of values.
- class majordome.transport.AbstractWSGG(num_gases)#
Abstract weighted sum of gray gases (WSGG) model.
- property absorption_coefs: ndarray[tuple[Any, ...], dtype[float64]]#
Component gases absorption coefficients [1/m].
- emissivity(pl: float) float#
Compute integral emissivity over optical path.
- static eval_emissivity(a: ndarray[tuple[Any, ...], dtype[float64]], k: ndarray[tuple[Any, ...], dtype[float64]], pL: float) ndarray[tuple[Any, ...], dtype[float64]]#
Compute integral emissivity over optical path.
- property gases_weights: ndarray[tuple[Any, ...], dtype[float64]]#
Fractional weight of model component gases [-].