MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_eos.fpp.f90 File Reference

Contains module m_eos. More...

Go to the source code of this file.

Modules

module  m_eos
 Equations of state in Gamma/Pi form, rho e = Gamma(rho) p + Pi(rho).

Functions/Subroutines

impure subroutine, public m_eos::s_initialize_eos_module ()
 Resolve every fluid's EOS coefficients once, before any conversion runs.
impure subroutine, public m_eos::s_finalize_eos_module ()
 Deallocate the fluid property arrays allocated in s_initialize_eos_module.
subroutine m_eos::s_reference_curve (rho, i, p_ref, e_ref, dp_drho, de_drho, g0, dg0)
 The reference curve of a state-dependent EOS at rho: p_ref, e_ref, their d/drho, and Gamma_G with its d/drho. A new family adds one case here and nothing else.
logical function, public m_eos::f_is_state_dependent (i)
 Whether the EOS of fluid i is a family whose coefficients vary with density.
logical function m_eos::f_has_isentropic_reference (i)
 True when fluid i's reference curve is itself an isentrope (de_ref = -p_ref d(1/rho), which holds for JWL and Vinet but not for the Mie-Gruneisen Hugoniot) and its Gruneisen coefficient is constant. Those two together make the isentrope through any state closed-form, so it never has to be integrated.
impure real(wp) function m_eos::f_hugoniot_compression_limit (c0, s, s2, s3)
 The largest compression a cubic Hugoniot fit can represent. mu(u_p) = u_p/(u_s - u_p) rises, peaks where c0 = s2 u_p^2 + 2 s3 u_p^3, and falls after; only the rising branch is a physical shock. Returns a huge value for the linear fit, which never turns over. Host-side: called once per fluid at initialization.
subroutine m_eos::s_eos_coefficients (rho, i, gamma, pi_inf, dpi, dgamma)
 Gamma, Pi, dPi/drho and dGamma/drho of fluid i at density rho, the coefficients of rho e = Gamma p + Pi(rho). Stiffened and ideal gas keep the constants resolved at init, bit for bit.
real(wp) function, public m_eos::f_isentrope_exponent (gamma)
 Exponent of the stiffened-gas isentrope p + B = const rho**n. Precomputed per fluid as isentrope_n.
real(wp) function, public m_eos::f_isentrope_pressure (pi_inf, gamma)
 Reference pressure of that isentrope. Precomputed per fluid as isentrope_B.
real(wp) function, public m_eos::f_sg_thermal (pres, rho_or_t, n, b, cv)
 Stiffened-gas thermal law p + B = (n - 1)*cv*rho*T. Pass rho to get T, or T to get rho.
real(wp) function, public m_eos::f_mixture_temperature (alpha_rho_k, pres, gamma_k, pi_inf_k)
 Thermal-equilibrium mixture temperature for stiffened gas, from primitives. Algebraically identical to the conservative form in m_phase_change's s_infinite_pt_relaxation_k, T = (rho*e + p - sum(alpha_rho_i*qv_i)) / sum(alpha_rho_i*cv_i*n_i), because rho*e = gamma_mix*p + pi_inf_mix + sum(alpha_rho_i*qv_i) in MFC's stored variables.
subroutine, public m_eos::s_phase_coefficients (alpha_rho, alpha, i, rho, gamma, pi_inf, dpi, dgamma)
 Coefficients of phase i at its own density alpha_rho/alpha: the per-cell dispatch when some fluid's EOS is state dependent, the constants resolved at init otherwise (bit for bit).
real(wp) function m_eos::f_c2_from_coefficients (rho, pres, gamma, pi_inf, dpi, dgamma)
 c^2 = [((Gamma + 1) p + Pi)/rho - dPi/drho - p dGamma/drho]/Gamma, the frozen speed of one phase.
subroutine m_eos::s_phase_c2 (rho, pres, i, c2)
 Frozen sound speed squared of one phase at (rho, p) from its own coefficients. These helpers are subroutines, not functions: a device function that calls a device subroutine is a pattern no other backend-tested code in MFC uses.
subroutine m_eos::s_ode_slope (kind, i, x, y, dydx)
 Slope of the ODE kind for fluid i: dp/drho = c^2 along an isentrope (x = rho, y = p), or the reference temperature dT/dV = (de_ref/dV + p_ref)/c_v - Gamma_G T/V (x = V, y = T), the Maxwell relation applied to e = e_ref + c_v (T - T_ref).
subroutine m_eos::s_rk4 (kind, i, x0, y0, x1, y)
 Fixed-step classical RK4 for the ODE kind from (x0, y0) to x1.
subroutine, public m_eos::s_phase_pressure_on_isentrope (pres, rho, xi, i, p_isen)
 Pressure of phase i after the isentropic density change rho -> xi rho: closed form for the constant-coefficient families, integrated for a state-dependent EOS (the star states it serves are close to rho).
subroutine, public m_eos::s_phase_temperature (rho, pres, i, t)
 Temperature of phase i at (rho, p): the stiffened-gas relation, or T_ref(rho) + (e - e_ref)/c_v.
subroutine, public m_eos::s_phase_density_on_isentrope (i, rho_from, p_from, p_to, rho_to, c2_to)
 Density of phase i on the isentrope through (rho_from, p_from) at p_to, and c^2 there: Newton on the pressure integrator, whose slope is c^2. The relaxation's own Newton wraps this, so a few steps suffice.
subroutine, public m_eos::s_phase_internal_energy (pres, alpha, alpha_rho, i, e_phase)
 Internal energy per unit volume of phase i at pressure pres: alpha (Gamma p + Pi) + alpha_rho qv, with the coefficients at the phase's own density.
subroutine, public m_eos::s_phase_bulk_modulus (pres, alpha, alpha_rho, i, blkmod)
 Bulk modulus rho c^2 of phase i at pressure pres: f_bulk_modulus for a constant-coefficient fluid, bit for bit, minus the reference-curve terms rho (dPi/drho + p dGamma/drho)/Gamma otherwise.
real(wp) function, public m_eos::f_pressure (e_int, gamma, pi_inf, qv)
 Pressure of a stiffened gas from its internal energy density - the inverse of s_compute_energy. Callers subtract the kinetic, magnetic and elastic energy first; none of those are equation-of-state terms.
real(wp) function, public m_eos::f_bulk_modulus (pres, gamma, pi_inf)
 Isentropic bulk modulus. Takes coefficients rather than a fluid index, so a mixture - whose effective gamma and pi_inf come from s_compute_mixture_coefficients - is the same call as a single fluid. Elastic callers add their own shear term.
real(wp) function, public m_eos::f_relativistic_enthalpy (pres, rho, gamma)
 Relativistic specific enthalpy, h = 1 + (Gamma + 1)p/rho. Ideal gas only: the stiffness does not appear, so a fluid with a nonzero pi_inf is not represented here (the validator refuses that combination).
subroutine, public m_eos::s_compute_mixture_coefficients (alpha_rho_k, alpha_k, rho_k, gamma_k, pi_inf_k, qv_k)
 Mixture coefficients of one state. Under bubbles_euler with num_fluids == 1 the sole advection slot aliases the void fraction (eqn_idxalf == eqn_idxadvend), so alpha is not a composition there and the coefficients are the liquid's. Clipping stays with callers; it differs between solvers and cannot coincide with that case, as mpp_lim requires num_fluids > 1.
subroutine, public m_eos::s_compute_mixture_coefficients_dt (dalpha_rho_dt, dadv_dt, alpha_rho, adv, drho_dt, dgamma_dt, dpi_inf_dt, dqv_dt)
 Time derivative of the mixture coefficients, mirroring s_compute_mixture_coefficients.
subroutine, public m_eos::s_compute_speed_of_sound (pres, rho, gamma, pi_inf, adv, c, alpha_rho)
 Speed of sound of a thermodynamic state. Enthalpy is not an argument: for a real state H, |u|^2 and qv all cancel out of c^2 = ((Gamma + 1)p + Pi)/(Gamma rho). Averaged states, whose enthalpy is a free input, use the _avg variant.
subroutine, public m_eos::s_compute_speed_of_sound_avg (pres, rho, gamma, pi_inf, qv, vel_sum, h, c_c, adv, c, alpha_rho)
 Speed of sound of an interface-averaged state. An average of two states is not a state - its enthalpy is not the one its pressure and density imply - so the caller supplies H, |u|^2 and qv. Only the enthalpy-reading branches differ from s_compute_speed_of_sound; keep the condition below in step with the branch list there.

Detailed Description

Contains module m_eos.

Definition in file m_eos.fpp.f90.