jaxprop.perfect_gas.perfect_gas module#

class jaxprop.perfect_gas.perfect_gas.FluidPerfectGas(name, T_ref=300.0, p_ref=101325.0, identifier=None)[source]#

Bases: Module

Attributes:
fluid_name
identifier

Methods

get_state(input_pair, x, y)

Evaluate thermodynamic state for a perfect gas.

constants: PerfectGasConstants#
fluid_name: str = None#
get_state(input_pair: str, x: float, y: float)[source]#

Evaluate thermodynamic state for a perfect gas.

identifier: str = None#
class jaxprop.perfect_gas.perfect_gas.PerfectGasConstants(R: jax.Array, gamma: jax.Array, T_ref: jax.Array, P_ref: jax.Array, s_ref: jax.Array, k_ref: jax.Array, mu_ref: jax.Array, S_k: jax.Array, S_mu: jax.Array)[source]#

Bases: Module

P_ref: Array#
R: Array#
S_k: Array#
S_mu: Array#
T_ref: Array#
gamma: Array#
k_ref: Array#
mu_ref: Array#
s_ref: Array#
jaxprop.perfect_gas.perfect_gas.assemble_properties(T, p, rho, h, s, constants)[source]#
jaxprop.perfect_gas.perfect_gas.calculate_properties_PT(p, T, constants)[source]#
jaxprop.perfect_gas.perfect_gas.calculate_properties_Ps(p, s, constants)[source]#
jaxprop.perfect_gas.perfect_gas.calculate_properties_hP(h, p, constants)[source]#
jaxprop.perfect_gas.perfect_gas.calculate_properties_hs(h, s, constants)[source]#
jaxprop.perfect_gas.perfect_gas.calculate_properties_rhoh(rho, h, constants)[source]#
jaxprop.perfect_gas.perfect_gas.calculate_properties_rhop(rho, p, constants)[source]#
jaxprop.perfect_gas.perfect_gas.conductivity_from_T(T, constants)[source]#
jaxprop.perfect_gas.perfect_gas.entropy_from_PT(p, T, constants)[source]#
jaxprop.perfect_gas.perfect_gas.entropy_from_rhoP(rho, p, constants)[source]#
jaxprop.perfect_gas.perfect_gas.estimate_sutherland_constant(T1, mu1, T2, mu2)[source]#

Estimate the Sutherland constant [K] from two values of a transport property (viscosity or thermal conductivity) at two temperatures, assuming a Sutherland-like law:

mu(T) = mu_ref * (T / T_ref)^{3/2} * (T_ref + S) / (T + S)

Parameters:
T1, T2float

Temperatures in kelvin [K].

mu1, mu2float

Transport property values at T1 and T2 (e.g. viscosity in Pa·s or conductivity in W/m·K).

Returns:
float

Estimated Sutherland constant in kelvin [K].

jaxprop.perfect_gas.perfect_gas.get_constants(fluid_name, T_ref, p_ref, dT=100.0)[source]#

Compute perfect-gas constants from a real-fluid model at a reference state, and estimate Sutherland constants using offset temperatures.

Parameters:
fluid_namestr

Name of the fluid (passed to CoolProp).

T_reffloat

Reference temperature in kelvin [K].

P_reffloat

Reference pressure in pascal [Pa].

dTfloat, optional

Temperature offset used to evaluate mu and k at T_ref ± dT for Sutherland constant estimation [K]. Default is 100.0.

Returns:
GasConstants

An Equinox module containing the perfect-gas constants: - R : specific gas constant [J/(kg·K)] - gamma : specific heat ratio [-] - T_ref : reference temperature [K] - P_ref : reference pressure [Pa] - s_ref : reference entropy [J/(kg·K)] - mu_ref : dynamic viscosity at T_ref [Pa·s] - S_mu : Sutherland constant for viscosity [K] - k_ref : thermal conductivity at T_ref [W/(m·K)] - S_k : Sutherland constant for thermal conductivity [K]

Raises:
ValueError

If required properties are missing or invalid.

ZeroDivisionError

If the Sutherland estimation becomes numerically unstable.

jaxprop.perfect_gas.perfect_gas.get_props_gradient(fluid, input_pair, x, y, method='auto', eps_rel=1e-06, eps_abs=1e-06)[source]#

Return dict of gradients for perfect_gas_props at (x, y). Each entry: grads[prop] = jnp.array([∂prop/∂x, ∂prop/∂y])

jaxprop.perfect_gas.perfect_gas.specific_heat(constants)[source]#
jaxprop.perfect_gas.perfect_gas.speed_of_sound_from_T(T, constants)[source]#
jaxprop.perfect_gas.perfect_gas.temperature_from_Ps(p, s, constants)[source]#
jaxprop.perfect_gas.perfect_gas.temperature_from_h(h, constants)[source]#
jaxprop.perfect_gas.perfect_gas.temperature_from_rhoP(rho, p, constants)[source]#
jaxprop.perfect_gas.perfect_gas.viscosity_from_T(T, constants)[source]#