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

Multi-species chemistry interface for thermodynamic properties, reaction rates, and transport coefficients. More...

Functions/Subroutines

subroutine compute_viscosity_and_inversion (t_l, ys_l, t_r, ys_r, re_l, re_r)
 Compute mixture viscosities for left and right states and invert them for use as reciprocal Reynolds numbers.
subroutine s_compute_transport_dt_re (pres, rho, t, ys, re)
 Effective Reynolds numbers 1/(rho*D) from the largest local transport diffusivity D – mu/rho with viscous, and lambda/(rho*cv) and the mixture-averaged diffusivities of the species present with chem_paramsdiffusion – so the viscous dt limit (dx^2*rho*Re) tracks the transport actually integrated, summed over the num_dims directions.
subroutine s_compute_q_t_sf (q_t_sf, q_cons_vf, bounds)
 Initialize the temperature field from conservative variables by inverting the energy equation.
subroutine s_compute_t_from_primitives (q_t_sf, q_prim_vf, bounds)
 Compute the temperature field from primitive variables using the ideal gas law and mixture molecular weight.
subroutine s_compute_chemistry_reaction_flux (rhs_vf, q_cons_qp, q_t_sf, q_prim_qp, bounds, track_stiff)
 Add chemical reaction source terms to the species transport RHS using net production rates.
subroutine s_chemistry_reaction_substep (q_cons_vf, q_t_sf, dtime, bounds)
 Operator-split integration of the reaction source with an alpha-QSS (Mott quasi-steady-state) reactor. Called after the flow update: each cell's constant-(rho, e) reactor is advanced over dtime with chem_paramsreaction_substeps predictor-corrector sub-steps – or, when adap_substeps = T, an adaptive count nsub clamped to [reaction_substeps, reaction_substeps_max] and sized once per rank from the rank's stiffest cell – updating the species partial densities and temperature in place. Mixture density, momentum, and total energy are unchanged (reactions convert chemical to thermal energy at fixed internal energy). The alpha-QSS update treats each species' destruction as a pseudo-first-order loss, so it is stable for stiff ignition where an explicit source would overshoot and diverge, and relaxes to the correct chemical equilibrium rather than over-heating. Reaction is split from the flow update at first order (Lie-Trotter), and each sub-step renormalizes the mass fractions to sum to one (which does not strictly conserve elemental composition).
pure real(wp) function f_qss_alpha (r)
 alpha-QSS weight for a sub-step with dt*(loss rate) = r. (1 - alpha)*r < 1 for every r >= 0, so a step from non-negative mass fractions with non-negative production stays non-negative.
subroutine s_compute_chemistry_diffusion_flux (idir, q_prim_qp, flux_src_flat, irx, iry, irz, q_t_sf, ib_marks, wall_a, ib_mode)
 Compute species mass diffusion fluxes at cell interfaces using mixture-averaged diffusivities.
real(wp) function f_property_temperature (t, p, mw, rho, ib_marks, x, y, z)
 Temperature the diffusion properties of cell (x, y, z) are evaluated at: q_T_sf's value T, except in an immersed-body cell, where T is the conduction temperature (m_ibm) and the cell's own state temperature p W/(rho R) is used.
logical function f_flux_wall_face (x, y, z, offsets, ib_marks, wall_a)
 Whether the face between cell (x, y, z) and its neighbour at + offsets is a flux-wall face (ib_flux_wall): one side is an immersed-body cell with a wall area share.

Variables

type(int_bounds_info) isc1
type(int_bounds_info) isc2
type(int_bounds_info) isc3
real(wp) chem_loss_max = 0._wp
 Largest species loss rate (1/s) of the explicit reaction source since last reset: a bound on the Jacobian spectral radius.
real(wp), parameter y_floor_stiff = 1.e-16_wp

Detailed Description

Multi-species chemistry interface for thermodynamic properties, reaction rates, and transport coefficients.

Function/Subroutine Documentation

◆ compute_viscosity_and_inversion()

subroutine m_chemistry::compute_viscosity_and_inversion ( real(wp), intent(inout) t_l,
real(wp), dimension(num_species), intent(inout) ys_l,
real(wp), intent(inout) t_r,
real(wp), dimension(num_species), intent(inout) ys_r,
real(wp), intent(inout) re_l,
real(wp), intent(inout) re_r )

Compute mixture viscosities for left and right states and invert them for use as reciprocal Reynolds numbers.

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

Here is the caller graph for this function:

◆ f_flux_wall_face()

logical function m_chemistry::f_flux_wall_face ( integer, intent(in) x,
integer, intent(in) y,
integer, intent(in) z,
integer, dimension(3), intent(in) offsets,
type(integer_field), intent(in) ib_marks,
type(scalar_field), intent(in) wall_a )

Whether the face between cell (x, y, z) and its neighbour at + offsets is a flux-wall face (ib_flux_wall): one side is an immersed-body cell with a wall area share.

Definition at line 2624 of file m_chemistry.fpp.f90.

Here is the caller graph for this function:

◆ f_property_temperature()

real(wp) function m_chemistry::f_property_temperature ( real(wp), intent(in) t,
real(wp), intent(in) p,
real(wp), intent(in) mw,
real(wp), intent(in) rho,
type(integer_field), intent(in) ib_marks,
integer, intent(in) x,
integer, intent(in) y,
integer, intent(in) z )

Temperature the diffusion properties of cell (x, y, z) are evaluated at: q_T_sf's value T, except in an immersed-body cell, where T is the conduction temperature (m_ibm) and the cell's own state temperature p W/(rho R) is used.

Definition at line 2573 of file m_chemistry.fpp.f90.

Here is the caller graph for this function:

◆ f_qss_alpha()

pure real(wp) function m_chemistry::f_qss_alpha ( real(wp), intent(in) r)

alpha-QSS weight for a sub-step with dt*(loss rate) = r. (1 - alpha)*r < 1 for every r >= 0, so a step from non-negative mass fractions with non-negative production stays non-negative.

Definition at line 1070 of file m_chemistry.fpp.f90.

Here is the caller graph for this function:

◆ s_chemistry_reaction_substep()

subroutine m_chemistry::s_chemistry_reaction_substep ( type(scalar_field), dimension(sys_size), intent(inout) q_cons_vf,
type(scalar_field), intent(inout) q_t_sf,
real(wp), intent(in) dtime,
type(int_bounds_info), dimension(1:3), intent(in) bounds )

Operator-split integration of the reaction source with an alpha-QSS (Mott quasi-steady-state) reactor. Called after the flow update: each cell's constant-(rho, e) reactor is advanced over dtime with chem_paramsreaction_substeps predictor-corrector sub-steps – or, when adap_substeps = T, an adaptive count nsub clamped to [reaction_substeps, reaction_substeps_max] and sized once per rank from the rank's stiffest cell – updating the species partial densities and temperature in place. Mixture density, momentum, and total energy are unchanged (reactions convert chemical to thermal energy at fixed internal energy). The alpha-QSS update treats each species' destruction as a pseudo-first-order loss, so it is stable for stiff ignition where an explicit source would overshoot and diverge, and relaxes to the correct chemical equilibrium rather than over-heating. Reaction is split from the flow update at first order (Lie-Trotter), and each sub-step renormalizes the mass fractions to sum to one (which does not strictly conserve elemental composition).

Definition at line 741 of file m_chemistry.fpp.f90.

Here is the call graph for this function:

◆ s_compute_chemistry_diffusion_flux()

subroutine m_chemistry::s_compute_chemistry_diffusion_flux ( integer, intent(in) idir,
type(scalar_field), dimension(sys_size), intent(in) q_prim_qp,
real(wp), dimension(-1:,-1:,-1:,1:), intent(inout) flux_src_flat,
type(int_bounds_info), intent(in) irx,
type(int_bounds_info), intent(in) iry,
type(int_bounds_info), intent(in) irz,
type(scalar_field), intent(in) q_t_sf,
type(integer_field), intent(in) ib_marks,
type(scalar_field), intent(in) wall_a,
integer, intent(in) ib_mode )

Compute species mass diffusion fluxes at cell interfaces using mixture-averaged diffusivities.

Parameters
[in,out]flux_src_flatFlat (x, y, z, var) source-flux buffer; a plain-array dummy because src/common cannot use m_riemann_state.
[in]ib_marksib_mode 0: no immersed body. 1: q_T_sf holds the mirrored conduction temperature in body cells (m_ibm), which supply only the face temperature difference, so their properties use the cell's own state temperature p W/(rho R). 2: also the reacting-wall area share of each body cell (ib_flux_wall, wall_a): those faces carry the surface rates in the Riemann flux, so diffusion keeps only conduction there. A kernel names ib_marks (and wall_a) only in the modes that use them, so they may be unallocated otherwise

Definition at line 1096 of file m_chemistry.fpp.f90.

Here is the call graph for this function:

◆ s_compute_chemistry_reaction_flux()

subroutine m_chemistry::s_compute_chemistry_reaction_flux ( type(scalar_field), dimension(sys_size), intent(inout) rhs_vf,
type(scalar_field), dimension(sys_size), intent(inout) q_cons_qp,
type(scalar_field), intent(inout) q_t_sf,
type(scalar_field), dimension(sys_size), intent(inout) q_prim_qp,
type(int_bounds_info), dimension(1:3), intent(in) bounds,
logical, intent(in) track_stiff )

Add chemical reaction source terms to the species transport RHS using net production rates.

Parameters
[in]track_stiffalso record the max species loss rate (chem_loss_max)

Definition at line 611 of file m_chemistry.fpp.f90.

◆ s_compute_q_t_sf()

subroutine m_chemistry::s_compute_q_t_sf ( type(scalar_field), intent(inout) q_t_sf,
type(scalar_field), dimension(sys_size), intent(in) q_cons_vf,
type(int_bounds_info), dimension(1:3), intent(in) bounds )

Initialize the temperature field from conservative variables by inverting the energy equation.

Definition at line 550 of file m_chemistry.fpp.f90.

Here is the caller graph for this function:

◆ s_compute_t_from_primitives()

subroutine m_chemistry::s_compute_t_from_primitives ( type(scalar_field), intent(inout) q_t_sf,
type(scalar_field), dimension(sys_size), intent(in) q_prim_vf,
type(int_bounds_info), dimension(1:3), intent(in) bounds )

Compute the temperature field from primitive variables using the ideal gas law and mixture molecular weight.

Definition at line 586 of file m_chemistry.fpp.f90.

◆ s_compute_transport_dt_re()

subroutine m_chemistry::s_compute_transport_dt_re ( real(wp), intent(in) pres,
real(wp), intent(in) rho,
real(wp), intent(in) t,
real(wp), dimension(num_species), intent(in) ys,
real(wp), dimension(2), intent(out) re )

Effective Reynolds numbers 1/(rho*D) from the largest local transport diffusivity D – mu/rho with viscous, and lambda/(rho*cv) and the mixture-averaged diffusivities of the species present with chem_paramsdiffusion – so the viscous dt limit (dx^2*rho*Re) tracks the transport actually integrated, summed over the num_dims directions.

Definition at line 468 of file m_chemistry.fpp.f90.

Variable Documentation

◆ chem_loss_max

real(wp) m_chemistry::chem_loss_max = 0._wp

Largest species loss rate (1/s) of the explicit reaction source since last reset: a bound on the Jacobian spectral radius.

Definition at line 409 of file m_chemistry.fpp.f90.

◆ isc1

type(int_bounds_info) m_chemistry::isc1

Definition at line 394 of file m_chemistry.fpp.f90.

◆ isc2

type(int_bounds_info) m_chemistry::isc2

Definition at line 394 of file m_chemistry.fpp.f90.

◆ isc3

type(int_bounds_info) m_chemistry::isc3

Definition at line 394 of file m_chemistry.fpp.f90.

◆ y_floor_stiff

real(wp), parameter m_chemistry::y_floor_stiff = 1.e-16_wp

Definition at line 410 of file m_chemistry.fpp.f90.