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

Contains module m_variables_conversion. More...

Go to the source code of this file.

Modules

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

Functions/Subroutines

subroutine, public m_variables_conversion::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 m_variables_conversion::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 m_variables_conversion::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 m_variables_conversion::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 m_variables_conversion::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 m_variables_conversion::s_initialize_variables_conversion_module (store_mixture_fields, enforce_density_floor, preserve_qbmm_number, lagrange_beta_index)
 Initialize the variables conversion module.
subroutine, public m_variables_conversion::s_initialize_mv (qk_cons_vf, mv)
 Initialize bubble mass-vapor values at quadrature nodes from the conserved moment statistics.
subroutine, public m_variables_conversion::s_initialize_pb (qk_cons_vf, mv, pb)
 Initialize bubble internal pressures at quadrature nodes using isothermal relations from the Preston model.
subroutine, public m_variables_conversion::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 m_variables_conversion::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 m_variables_conversion::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 m_variables_conversion::s_compute_species_fraction (q_vf, k, l, r, alpha_rho_k, alpha_k)
 Compute partial densities and volume fractions.
impure subroutine, public m_variables_conversion::s_finalize_variables_conversion_module ()
 Deallocate fluid property arrays and post-processing fields allocated during module initialization.
subroutine, public m_variables_conversion::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_variables_conversion::s_compute_mixture_coefficients_dt (dalpha_rho_dt, dadv_dt, drho_dt, dgamma_dt, dpi_inf_dt, dqv_dt)
 Time derivative of the mixture coefficients, mirroring s_compute_mixture_coefficients.
subroutine, public m_variables_conversion::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.
real(wp) function, public m_variables_conversion::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_variables_conversion::f_isentrope_pressure (pi_inf, gamma)
 Reference pressure of that isentrope. Precomputed per fluid as isentrope_B.
real(wp) function, public m_variables_conversion::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_variables_conversion::f_pressure_on_isentrope (pres, xi, n, b)
 Pressure after isentropic compression from pres through density ratio xi.
real(wp) function, public m_variables_conversion::f_phase_internal_energy (pres, alpha, alpha_rho, gamma, pi_inf, qv)
 Internal energy of one six-equation phase: volume-fraction-weighted stiffened-gas energy plus the heat of formation its partial density carries. No kinetic term - that belongs to the mixture, not a phase.
real(wp) function, public m_variables_conversion::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 m_variables_conversion::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 m_variables_conversion::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_variables_conversion::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_variables_conversion::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_variables_conversion::s_compute_speed_of_sound (pres, rho, gamma, pi_inf, adv, c)
 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_variables_conversion::s_compute_speed_of_sound_avg (pres, rho, gamma, pi_inf, qv, vel_sum, h, c_c, adv, c)
 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 m_variables_conversion::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 m_variables_conversion::gs_vc
integer, dimension(:), allocatable m_variables_conversion::bubrs_vc
real(wp), dimension(:,:), allocatable m_variables_conversion::res_vc
integer m_variables_conversion::is1b
integer m_variables_conversion::is2b
integer m_variables_conversion::is3b
integer m_variables_conversion::is1e
integer m_variables_conversion::is2e
integer m_variables_conversion::is3e
logical m_variables_conversion::enforce_density_floor_vc = .false.
logical m_variables_conversion::preserve_qbmm_number_vc = .false.
integer m_variables_conversion::lagrange_beta_index_vc = 0
real(wp), dimension(:,:,:), allocatable, public m_variables_conversion::rho_sf
 Scalar density function.
real(wp), dimension(:,:,:), allocatable, public m_variables_conversion::gamma_sf
 Scalar sp. heat ratio function.
real(wp), dimension(:,:,:), allocatable, public m_variables_conversion::pi_inf_sf
 Scalar liquid stiffness function.

Detailed Description

Contains module m_variables_conversion.

Definition in file m_variables_conversion.fpp.f90.