MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_variables_conversion Module Reference

Conservative-to-primitive variable conversion, mixture property evaluation, and pressure computation. More...

Functions/Subroutines

subroutine, public s_convert_to_mixture_variables (q_vf, i, j, k, rho, gamma, pi_inf, qv, re_k, g_k, g)
 Dispatch to the s_convert_mixture_to_mixture_variables and s_convert_species_to_mixture_variables subroutines. Replaces a procedure pointer.
subroutine, public s_compute_pressure (energy, alf, dyn_p, pi_inf, gamma, rho, qv, rhoyks, pres, t, e_e_in, pres_mag)
 Compute the pressure from the appropriate equation of state.
subroutine, public s_convert_mixture_to_mixture_variables (q_vf, i, j, k, rho, gamma, pi_inf, qv)
 Convert mixture variables to density, gamma, pi_inf, and qv for the gamma/pi_inf model. Given conservative or primitive variables, transfers the density, specific heat ratio function and the liquid stiffness function from q_vf to rho, gamma and pi_inf.
subroutine, public s_convert_species_to_mixture_variables (q_vf, k, l, r, rho, gamma, pi_inf, qv, re_k, g_k, g)
 Convert species volume fractions and partial densities to mixture density, gamma, pi_inf, and qv. Given conservative or primitive variables, computes the density, the specific heat ratio function and the liquid stiffness function from q_vf and stores the results into rho, gamma and pi_inf.
subroutine, public s_convert_species_to_mixture_variables_kernel (rho_k, gamma_k, pi_inf_k, qv_k, alpha_k, alpha_rho_k, re_k, g_k, g)
 Host- and device-callable conversion kernel for species and mixture variables.
impure subroutine, public s_initialize_variables_conversion_module (store_mixture_fields, enforce_density_floor, preserve_qbmm_number, lagrange_beta_index)
 Initialize the variables conversion module.
subroutine, public s_initialize_mv (qk_cons_vf, mv)
 Initialize bubble mass-vapor values at quadrature nodes from the conserved moment statistics.
subroutine, public s_initialize_pb (qk_cons_vf, mv, pb)
 Initialize bubble internal pressures at quadrature nodes using isothermal relations from the Preston model.
subroutine, public s_convert_conservative_to_primitive_variables (qk_cons_vf, q_t_sf, qk_prim_vf, ibounds)
 Convert conserved variables (rho*alpha, rho*u, E, alpha) to primitives (rho, u, p, alpha). Conversion depends on model_eqns: each model has different variable sets and EOS.
impure subroutine, public s_convert_primitive_to_conservative_variables (q_prim_vf, q_cons_vf)
 Convert primitives (rho, u, p, alpha) to conserved variables (rho*alpha, rho*u, E, alpha).
subroutine, public s_convert_primitive_to_flux_variables (qk_prim_vf, fk_vf, fk_src_vf, is1, is2, is3, s2b, s3b, dir_idx_in, dir_flg_in, hll_u_interface_in)
 Convert primitive variables to Eulerian flux variables.
subroutine, public s_compute_species_fraction (q_vf, k, l, r, alpha_rho_k, alpha_k)
 Compute partial densities and volume fractions.
impure subroutine, public s_finalize_variables_conversion_module ()
 Deallocate fluid property arrays and post-processing fields allocated during module initialization.
subroutine, public 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 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 s_compute_energy (pres, alpha_rho_k, alpha_k, vel_sum, e)
 Total energy per unit volume, thermodynamic terms only. Callers add magnetic and elastic energy, which are not equation-of-state terms. The chemistry and relativistic branches use a different relation and stay open-coded.
subroutine 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 f_is_state_dependent (i)
 Whether the EOS of fluid i is a family whose coefficients vary with density.
logical function 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 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, public 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 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 f_isentrope_pressure (pi_inf, gamma)
 Reference pressure of that isentrope. Precomputed per fluid as isentrope_B.
real(wp) function, public 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 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 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 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 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 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 s_rk4 (kind, i, x0, y0, x1, y)
 Fixed-step classical RK4 for the ODE kind from (x0, y0) to x1.
subroutine, public 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 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 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 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 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 f_elastic_energy (tau, g, is_shear)
 Elastic strain energy of one stress component, doubled for a shear component: the tensor stores it once, the energy counts both off-diagonal entries. Zero without a shear modulus.
real(wp) function, public f_hypoelastic_energy (q_cons_vf, j, k, l, rho, g)
 Hypoelastic strain energy at one cell, summed over the stress components.
real(wp) function, public 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 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 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 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 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.
subroutine, public s_compute_fast_magnetosonic_speed (rho, c, b, norm, c_fast, h)
 Compute the fast magnetosonic wave speed from the sound speed, density, and magnetic field components.

Variables

real(wp), dimension(:), allocatable gs_vc
integer, dimension(:), allocatable bubrs_vc
real(wp), dimension(:,:), allocatable res_vc
integer is1b
integer is2b
integer is3b
integer is1e
integer is2e
integer is3e
logical enforce_density_floor_vc = .false.
logical preserve_qbmm_number_vc = .false.
integer lagrange_beta_index_vc = 0
real(wp), dimension(:,:,:), allocatable, public rho_sf
 Scalar density function.
real(wp), dimension(:,:,:), allocatable, public gamma_sf
 Scalar sp. heat ratio function.
real(wp), dimension(:,:,:), allocatable, public pi_inf_sf
 Scalar liquid stiffness function.

Detailed Description

Conservative-to-primitive variable conversion, mixture property evaluation, and pressure computation.

Function/Subroutine Documentation

◆ f_bulk_modulus()

real(wp) function, public m_variables_conversion::f_bulk_modulus ( real(wp), intent(in) pres,
real(wp), intent(in) gamma,
real(wp), intent(in) 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.

Definition at line 3928 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ f_c2_from_coefficients()

real(wp) function m_variables_conversion::f_c2_from_coefficients ( real(wp), intent(in) rho,
real(wp), intent(in) pres,
real(wp), intent(in) gamma,
real(wp), intent(in) pi_inf,
real(wp), intent(in) dpi,
real(wp), intent(in) dgamma )
private

c^2 = [((Gamma + 1) p + Pi)/rho - dPi/drho - p dGamma/drho]/Gamma, the frozen speed of one phase.

Definition at line 3430 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ f_elastic_energy()

real(wp) function, public m_variables_conversion::f_elastic_energy ( real(wp), intent(in) tau,
real(wp), intent(in) g,
logical, intent(in) is_shear )

Elastic strain energy of one stress component, doubled for a shear component: the tensor stores it once, the energy counts both off-diagonal entries. Zero without a shear modulus.

Definition at line 3813 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ f_has_isentropic_reference()

logical function m_variables_conversion::f_has_isentropic_reference ( integer, intent(in) i)
private

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.

Definition at line 3054 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ f_hugoniot_compression_limit()

impure real(wp) function m_variables_conversion::f_hugoniot_compression_limit ( real(wp), intent(in) c0,
real(wp), intent(in) s,
real(wp), intent(in) s2,
real(wp), intent(in) s3 )
private

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.

Definition at line 3102 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ f_hypoelastic_energy()

real(wp) function, public m_variables_conversion::f_hypoelastic_energy ( type(scalar_field), dimension(sys_size), intent(in) q_cons_vf,
integer, intent(in) j,
integer, intent(in) k,
integer, intent(in) l,
real(wp), intent(in) rho,
real(wp), intent(in) g )

Hypoelastic strain energy at one cell, summed over the stress components.

Definition at line 3864 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:

◆ f_is_state_dependent()

logical function, public m_variables_conversion::f_is_state_dependent ( integer, intent(in) i)

Whether the EOS of fluid i is a family whose coefficients vary with density.

Definition at line 3006 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ f_isentrope_exponent()

real(wp) function, public m_variables_conversion::f_isentrope_exponent ( real(wp), intent(in) gamma)

Exponent of the stiffened-gas isentrope p + B = const rho**n. Precomputed per fluid as isentrope_n.

Definition at line 3167 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ f_isentrope_pressure()

real(wp) function, public m_variables_conversion::f_isentrope_pressure ( real(wp), intent(in) pi_inf,
real(wp), intent(in) gamma )

Reference pressure of that isentrope. Precomputed per fluid as isentrope_B.

Definition at line 3213 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ f_mixture_temperature()

real(wp) function, public m_variables_conversion::f_mixture_temperature ( real(wp), dimension(num_fluids), intent(in) alpha_rho_k,
real(wp), intent(in) pres,
real(wp), intent(in) gamma_k,
real(wp), intent(in) 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.

Definition at line 3307 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ f_pressure()

real(wp) function, public m_variables_conversion::f_pressure ( real(wp), intent(in) e_int,
real(wp), intent(in) gamma,
real(wp), intent(in) pi_inf,
real(wp), intent(in) 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.

Definition at line 3881 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ f_relativistic_enthalpy()

real(wp) function, public m_variables_conversion::f_relativistic_enthalpy ( real(wp), intent(in) pres,
real(wp), intent(in) rho,
real(wp), intent(in) 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).

Definition at line 3975 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ f_sg_thermal()

real(wp) function, public m_variables_conversion::f_sg_thermal ( real(wp), intent(in) pres,
real(wp), intent(in) rho_or_t,
real(wp), intent(in) n,
real(wp), intent(in) b,
real(wp), intent(in) cv )

Stiffened-gas thermal law p + B = (n - 1)*cv*rho*T. Pass rho to get T, or T to get rho.

Definition at line 3259 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ s_compute_energy()

subroutine, public m_variables_conversion::s_compute_energy ( real(wp), intent(in) pres,
real(wp), dimension(num_fluids), intent(in) alpha_rho_k,
real(wp), dimension(num_fluids), intent(in) alpha_k,
real(wp), intent(in) vel_sum,
real(wp), intent(out) e )

Total energy per unit volume, thermodynamic terms only. Callers add magnetic and elastic energy, which are not equation-of-state terms. The chemistry and relativistic branches use a different relation and stay open-coded.

Definition at line 2851 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:

◆ s_compute_fast_magnetosonic_speed()

subroutine, public m_variables_conversion::s_compute_fast_magnetosonic_speed ( real(wp), intent(in) rho,
real(wp), intent(in) c,
real(wp), dimension(3), intent(in) b,
integer, intent(in) norm,
real(wp), intent(out) c_fast,
real(wp), intent(in) h )

Compute the fast magnetosonic wave speed from the sound speed, density, and magnetic field components.

Parameters
[in]honly used for relativity

Definition at line 4200 of file m_variables_conversion.fpp.f90.

◆ s_compute_mixture_coefficients()

subroutine, public m_variables_conversion::s_compute_mixture_coefficients ( real(wp), dimension(num_fluids), intent(in) alpha_rho_k,
real(wp), dimension(num_fluids), intent(in) alpha_k,
real(wp), intent(out) rho_k,
real(wp), intent(out) gamma_k,
real(wp), intent(out) pi_inf_k,
real(wp), intent(out) 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.

Definition at line 2682 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_compute_mixture_coefficients_dt()

subroutine, public m_variables_conversion::s_compute_mixture_coefficients_dt ( real(wp), dimension(num_fluids), intent(in) dalpha_rho_dt,
real(wp), dimension(num_fluids), intent(in) dadv_dt,
real(wp), dimension(num_fluids), intent(in) alpha_rho,
real(wp), dimension(num_fluids), intent(in) adv,
real(wp), intent(out) drho_dt,
real(wp), intent(out) dgamma_dt,
real(wp), intent(out) dpi_inf_dt,
real(wp), intent(out) dqv_dt )

Time derivative of the mixture coefficients, mirroring s_compute_mixture_coefficients.

Definition at line 2769 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:

◆ s_compute_pressure()

subroutine, public m_variables_conversion::s_compute_pressure ( real(stp), intent(in) energy,
real(stp), intent(in) alf,
real(wp), intent(in) dyn_p,
real(wp), intent(in) pi_inf,
real(wp), intent(in) gamma,
real(wp), intent(in) rho,
real(wp), intent(in) qv,
real(wp), dimension(1:num_species), intent(in) rhoyks,
real(wp), intent(out) pres,
real(wp), intent(inout) t,
real(wp), intent(in), optional e_e_in,
real(wp), intent(in), optional pres_mag )

Compute the pressure from the appropriate equation of state.

Definition at line 441 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_compute_species_fraction()

subroutine, public m_variables_conversion::s_compute_species_fraction ( type(scalar_field), dimension(sys_size), intent(in) q_vf,
integer, intent(in) k,
integer, intent(in) l,
integer, intent(in) r,
real(wp), dimension(num_fluids), intent(out) alpha_rho_k,
real(wp), dimension(num_fluids), intent(out) alpha_k )

Compute partial densities and volume fractions.

Definition at line 2492 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ s_compute_speed_of_sound()

subroutine, public m_variables_conversion::s_compute_speed_of_sound ( real(wp), intent(in) pres,
real(wp), intent(in) rho,
real(wp), intent(in) gamma,
real(wp), intent(in) pi_inf,
real(wp), dimension(num_fluids), intent(in) adv,
real(wp), intent(out) c,
real(wp), dimension(num_fluids), intent(in), optional 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.

Definition at line 4022 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_compute_speed_of_sound_avg()

subroutine, public m_variables_conversion::s_compute_speed_of_sound_avg ( real(wp), intent(in) pres,
real(wp), intent(in) rho,
real(wp), intent(in) gamma,
real(wp), intent(in) pi_inf,
real(wp), intent(in) qv,
real(wp), intent(in) vel_sum,
real(wp), intent(in) h,
real(wp), intent(in) c_c,
real(wp), dimension(num_fluids), intent(in) adv,
real(wp), intent(out) c,
real(wp), dimension(num_fluids), intent(in), optional 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.

Definition at line 4149 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:

◆ s_convert_conservative_to_primitive_variables()

subroutine, public m_variables_conversion::s_convert_conservative_to_primitive_variables ( type(scalar_field), dimension(sys_size), intent(in) qk_cons_vf,
type(scalar_field), intent(inout) q_t_sf,
type(scalar_field), dimension(sys_size), intent(inout) qk_prim_vf,
type(int_bounds_info), dimension(1:3), intent(in) ibounds )

Convert conserved variables (rho*alpha, rho*u, E, alpha) to primitives (rho, u, p, alpha). Conversion depends on model_eqns: each model has different variable sets and EOS.

Definition at line 1352 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_convert_mixture_to_mixture_variables()

subroutine, public m_variables_conversion::s_convert_mixture_to_mixture_variables ( type(scalar_field), dimension(sys_size), intent(in) q_vf,
integer, intent(in) i,
integer, intent(in) j,
integer, intent(in) k,
real(wp), intent(out), target rho,
real(wp), intent(out), target gamma,
real(wp), intent(out), target pi_inf,
real(wp), intent(out), target qv )

Convert mixture variables to density, gamma, pi_inf, and qv for the gamma/pi_inf model. Given conservative or primitive variables, transfers the density, specific heat ratio function and the liquid stiffness function from q_vf to rho, gamma and pi_inf.

Definition at line 519 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ s_convert_primitive_to_conservative_variables()

impure subroutine, public m_variables_conversion::s_convert_primitive_to_conservative_variables ( type(scalar_field), dimension(sys_size), intent(in) q_prim_vf,
type(scalar_field), dimension(sys_size), intent(inout) q_cons_vf )

Convert primitives (rho, u, p, alpha) to conserved variables (rho*alpha, rho*u, E, alpha).

Definition at line 1889 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:

◆ s_convert_primitive_to_flux_variables()

subroutine, public m_variables_conversion::s_convert_primitive_to_flux_variables ( real(wp), dimension(0:,idwbuff(2)%beg:,idwbuff(3)%beg:,1:), intent(in) qk_prim_vf,
real(wp), dimension(0:,idwbuff(2)%beg:,idwbuff(3)%beg:,1:), intent(inout) fk_vf,
real(wp), dimension(0:,idwbuff(2)%beg:,idwbuff(3)%beg:,eqn_idx%adv%beg:), intent(inout) fk_src_vf,
type(int_bounds_info), intent(in) is1,
type(int_bounds_info), intent(in) is2,
type(int_bounds_info), intent(in) is3,
integer, intent(in) s2b,
integer, intent(in) s3b,
integer, dimension(3), intent(in) dir_idx_in,
real(wp), dimension(3), intent(in) dir_flg_in,
logical, intent(in) hll_u_interface_in )

Convert primitive variables to Eulerian flux variables.

Parameters
[in]dir_idx_inWorking-direction mapping, passed explicitly: it is simulation state (m_global_parameters), and use-associating it into this common kernel spills registers on AMD OpenMP offload.

Definition at line 2132 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:

◆ s_convert_species_to_mixture_variables()

subroutine, public m_variables_conversion::s_convert_species_to_mixture_variables ( type(scalar_field), dimension(sys_size), intent(in) q_vf,
integer, intent(in) k,
integer, intent(in) l,
integer, intent(in) r,
real(wp), intent(out), target rho,
real(wp), intent(out), target gamma,
real(wp), intent(out), target pi_inf,
real(wp), intent(out), target qv,
real(wp), dimension(2), intent(out), optional re_k,
real(wp), intent(out), optional g_k,
real(wp), dimension(num_fluids), intent(in), optional g )

Convert species volume fractions and partial densities to mixture density, gamma, pi_inf, and qv. Given conservative or primitive variables, computes the density, the specific heat ratio function and the liquid stiffness function from q_vf and stores the results into rho, gamma and pi_inf.

Definition at line 547 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_convert_species_to_mixture_variables_kernel()

subroutine, public m_variables_conversion::s_convert_species_to_mixture_variables_kernel ( real(wp), intent(out) rho_k,
real(wp), intent(out) gamma_k,
real(wp), intent(out) pi_inf_k,
real(wp), intent(out) qv_k,
real(wp), dimension(num_fluids), intent(inout) alpha_k,
real(wp), dimension(num_fluids), intent(inout) alpha_rho_k,
real(wp), dimension(2), intent(out), optional re_k,
real(wp), intent(out), optional g_k,
real(wp), dimension(num_fluids), intent(in), optional g )

Host- and device-callable conversion kernel for species and mixture variables.

Definition at line 578 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_convert_to_mixture_variables()

subroutine, public m_variables_conversion::s_convert_to_mixture_variables ( type(scalar_field), dimension(sys_size), intent(in) q_vf,
integer, intent(in) i,
integer, intent(in) j,
integer, intent(in) k,
real(wp), intent(out), target rho,
real(wp), intent(out), target gamma,
real(wp), intent(out), target pi_inf,
real(wp), intent(out), target qv,
real(wp), dimension(2), intent(out), optional re_k,
real(wp), intent(out), optional g_k,
real(wp), dimension(num_fluids), intent(in), optional g )

Dispatch to the s_convert_mixture_to_mixture_variables and s_convert_species_to_mixture_variables subroutines. Replaces a procedure pointer.

Definition at line 423 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_eos_coefficients()

subroutine, public m_variables_conversion::s_eos_coefficients ( real(wp), intent(in) rho,
integer, intent(in) i,
real(wp), intent(out) gamma,
real(wp), intent(out) pi_inf,
real(wp), intent(out) dpi,
real(wp), intent(out) 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.

Definition at line 3128 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_finalize_variables_conversion_module()

impure subroutine, public m_variables_conversion::s_finalize_variables_conversion_module

Deallocate fluid property arrays and post-processing fields allocated during module initialization.

Definition at line 2575 of file m_variables_conversion.fpp.f90.

◆ s_initialize_mv()

subroutine, public m_variables_conversion::s_initialize_mv ( type(scalar_field), dimension(sys_size), intent(in) qk_cons_vf,
real(stp), dimension(idwint(1)%beg:,idwint(2)%beg:,idwint(3)%beg:,1:,1:), intent(inout) mv )

Initialize bubble mass-vapor values at quadrature nodes from the conserved moment statistics.

Definition at line 1267 of file m_variables_conversion.fpp.f90.

◆ s_initialize_pb()

subroutine, public m_variables_conversion::s_initialize_pb ( type(scalar_field), dimension(sys_size), intent(in) qk_cons_vf,
real(stp), dimension(idwint(1)%beg:,idwint(2)%beg:,idwint(3)%beg:,1:,1:), intent(in) mv,
real(stp), dimension(idwint(1)%beg:,idwint(2)%beg:,idwint(3)%beg:,1:,1:), intent(inout) pb )

Initialize bubble internal pressures at quadrature nodes using isothermal relations from the Preston model.

Definition at line 1306 of file m_variables_conversion.fpp.f90.

◆ s_initialize_variables_conversion_module()

impure subroutine, public m_variables_conversion::s_initialize_variables_conversion_module ( logical, intent(in), optional store_mixture_fields,
logical, intent(in), optional enforce_density_floor,
logical, intent(in), optional preserve_qbmm_number,
integer, intent(in), optional lagrange_beta_index )

Initialize the variables conversion module.

Definition at line 671 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_ode_slope()

subroutine m_variables_conversion::s_ode_slope ( integer, intent(in) kind,
integer, intent(in) i,
real(wp), intent(in) x,
real(wp), intent(in) y,
real(wp), intent(out) dydx )
private

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).

Definition at line 3507 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_phase_bulk_modulus()

subroutine, public m_variables_conversion::s_phase_bulk_modulus ( real(wp), intent(in) pres,
real(wp), intent(in) alpha,
real(wp), intent(in) alpha_rho,
integer, intent(in) i,
real(wp), intent(out) 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.

Definition at line 3763 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_phase_c2()

subroutine m_variables_conversion::s_phase_c2 ( real(wp), intent(in) rho,
real(wp), intent(in) pres,
integer, intent(in) i,
real(wp), intent(out) c2 )
private

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.

Definition at line 3477 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_phase_coefficients()

subroutine, public m_variables_conversion::s_phase_coefficients ( real(wp), intent(in) alpha_rho,
real(wp), intent(in) alpha,
integer, intent(in) i,
real(wp), intent(out) rho,
real(wp), intent(out) gamma,
real(wp), intent(out) pi_inf,
real(wp), intent(out) dpi,
real(wp), intent(out) 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).

Definition at line 3375 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_phase_density_on_isentrope()

subroutine, public m_variables_conversion::s_phase_density_on_isentrope ( integer, intent(in) i,
real(wp), intent(in) rho_from,
real(wp), intent(in) p_from,
real(wp), intent(in) p_to,
real(wp), intent(out) rho_to,
real(wp), intent(out) 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.

Definition at line 3666 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:

◆ s_phase_internal_energy()

subroutine, public m_variables_conversion::s_phase_internal_energy ( real(wp), intent(in) pres,
real(wp), intent(in) alpha,
real(wp), intent(in) alpha_rho,
integer, intent(in) i,
real(wp), intent(out) 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.

Definition at line 3713 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_phase_pressure_on_isentrope()

subroutine, public m_variables_conversion::s_phase_pressure_on_isentrope ( real(wp), intent(in) pres,
real(wp), intent(in) rho,
real(wp), intent(in) xi,
integer, intent(in) i,
real(wp), intent(out) 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).

Definition at line 3591 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_phase_temperature()

subroutine, public m_variables_conversion::s_phase_temperature ( real(wp), intent(in) rho,
real(wp), intent(in) pres,
integer, intent(in) i,
real(wp), intent(out) t )

Temperature of phase i at (rho, p): the stiffened-gas relation, or T_ref(rho) + (e - e_ref)/c_v.

Definition at line 3630 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_reference_curve()

subroutine m_variables_conversion::s_reference_curve ( real(wp), intent(in) rho,
integer, intent(in) i,
real(wp), intent(out) p_ref,
real(wp), intent(out) e_ref,
real(wp), intent(out) dp_drho,
real(wp), intent(out) de_drho,
real(wp), intent(out) g0,
real(wp), intent(out) dg0 )
private

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.

Definition at line 2908 of file m_variables_conversion.fpp.f90.

Here is the caller graph for this function:

◆ s_rk4()

subroutine m_variables_conversion::s_rk4 ( integer, intent(in) kind,
integer, intent(in) i,
real(wp), intent(in) x0,
real(wp), intent(in) y0,
real(wp), intent(in) x1,
real(wp), intent(out) y )
private

Fixed-step classical RK4 for the ODE kind from (x0, y0) to x1.

Definition at line 3540 of file m_variables_conversion.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ bubrs_vc

integer, dimension(:), allocatable m_variables_conversion::bubrs_vc
private

Definition at line 373 of file m_variables_conversion.fpp.f90.

◆ enforce_density_floor_vc

logical m_variables_conversion::enforce_density_floor_vc = .false.
private

Definition at line 400 of file m_variables_conversion.fpp.f90.

◆ gamma_sf

real(wp), dimension(:,:,:), allocatable, public m_variables_conversion::gamma_sf

Scalar sp. heat ratio function.

Definition at line 416 of file m_variables_conversion.fpp.f90.

◆ gs_vc

real(wp), dimension(:), allocatable m_variables_conversion::gs_vc
private

Definition at line 372 of file m_variables_conversion.fpp.f90.

◆ is1b

integer m_variables_conversion::is1b
private

Definition at line 387 of file m_variables_conversion.fpp.f90.

◆ is1e

integer m_variables_conversion::is1e
private

Definition at line 387 of file m_variables_conversion.fpp.f90.

◆ is2b

integer m_variables_conversion::is2b
private

Definition at line 387 of file m_variables_conversion.fpp.f90.

◆ is2e

integer m_variables_conversion::is2e
private

Definition at line 387 of file m_variables_conversion.fpp.f90.

◆ is3b

integer m_variables_conversion::is3b
private

Definition at line 387 of file m_variables_conversion.fpp.f90.

◆ is3e

integer m_variables_conversion::is3e
private

Definition at line 387 of file m_variables_conversion.fpp.f90.

◆ lagrange_beta_index_vc

integer m_variables_conversion::lagrange_beta_index_vc = 0
private

Definition at line 402 of file m_variables_conversion.fpp.f90.

◆ pi_inf_sf

real(wp), dimension(:,:,:), allocatable, public m_variables_conversion::pi_inf_sf

Scalar liquid stiffness function.

Definition at line 417 of file m_variables_conversion.fpp.f90.

◆ preserve_qbmm_number_vc

logical m_variables_conversion::preserve_qbmm_number_vc = .false.
private

Definition at line 401 of file m_variables_conversion.fpp.f90.

◆ res_vc

real(wp), dimension(:,:), allocatable m_variables_conversion::res_vc
private

Definition at line 374 of file m_variables_conversion.fpp.f90.

◆ rho_sf

real(wp), dimension(:,:,:), allocatable, public m_variables_conversion::rho_sf

Scalar density function.

Definition at line 415 of file m_variables_conversion.fpp.f90.