MPI-AMRVAC 3.2
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
Loading...
Searching...
No Matches
mod_eos_lte Module Reference

LTE (Saha-table) EoS kernels and finalise for the eos% family. More...

Functions/Subroutines

subroutine, public eos_init_lte ()
 update_eos_LTE, get_Te_LTE, get_temperature_from_eint_LTE and Rfactor_from_LTE are PRIVATE: all bound to eos% pointers inside eos_finalise_LTE, so no external module names them. get_temperature_from_eint_fast_LTE stays public – the seam binds it to tc_flget_temperature_ciso2_from_eint (fast TC path, optional p/rho)
subroutine, public eos_finalise_lte ()
 LTE arm of eos_finalise: wire the LTE runtime pointer targets, then dispatch on eos_method to the per-method finaliser, each owned by its method module (analytic->mod_eos_lte_saha, entropy->mod_eos_lte_entropy, tables->mod_eos_lte_tables).
subroutine, public get_temperature_from_eint_fast_lte (w, x, ixil, ixol, res, ciso2)
double precision function, public y_from_nh_eint (nh, eint_nh)
 Scalar EoS kernels: one cell on (log10 nH, log10 eint/nH) or (log10 nH, log10 p/nH), in code units, each dispatching to the analytic Saha solve, the entropy tables or the tables.
double precision function, public t_from_nh_eint (nh, eint_nh)
 Temperature from (log10 nH, log10 eint/nH).
double precision function, public p2eint_from_nh_p (nh, ponh)
 Ratio eint/p from (log10 nH, log10 p/nH).
double precision function, public gamma1_from_nh_p (log_nh, log_p_nh)
 Gamma_1 from (log10 nH, log10 p/nH), one lookup on the pressure-indexed table.
double precision function, public lte_gamma1_from_p (pres, rho_val)
 Gamma_1 of one cell from (p, rho): the ideal value where fully ionised, else the pressure- indexed table of the method.
double precision function, public p_nh_from_eint (log_nh, log_eint_nh)
 p/nH = (1 + He + y) T from (log10 nH, log10 eint/nH)
double precision function, public eint_nh_from_t (log_nh, log_t)
 eint/nH from (log10 nH, log10 T), from the inverse table when one is built and the Saha solve otherwise
subroutine, public eint_from_p_bisect (log_nh_val, log_p_val, log_eint_nh_out)
 Given log10(nH) and log10(p), find log10(eint/nH) by table-guessed bisection on the forward pressure table. Wraps the bracketing logic and log_p_bisect_cached into a single call for use by both HD and MHD from_conserved routines.
subroutine, public eos_get_eintt_grid (n_nh, lg_nh_min, lg_nh_max)
 ####################################################################### Table-metadata helpers: expose inverse-table grid bounds without reaching into EoS table internals. #######################################################################
double precision function, public lte_p_from_eint (eint_val, nh_val, log_nh_val, inv_rho)
 LTE pressure from internal energy in one cell: ideal without ionE, else the table floor, the FI bypass or p(nH, eint). log_nH_val is read only with ionE.
double precision function, public lte_eint_from_p (pres, nh_val, log_nh_val, rho_val)
 LTE internal energy from pressure in one cell: FI bypass, else eint(nH, p).

Detailed Description

LTE (Saha-table) EoS kernels and finalise for the eos% family.

Carved out of mod_eos.t (the per-type split). Owns everything LTE: the per-substep update_eos_LTE (caches Te_/Ne_), the cached-Te/Rfactor getters, the scalar table kernels (T, y, p2eint, gamma1, p/nH, eint, bisections), the per-method table finalisers, and eos_finalise_LTE (the LTE arm of the eos_finalise dispatcher). Depends only on the EoS leaf modules + shared accessors, never on mod_eos -> no circular use. mod_eos re-exports the public kernels so existing use mod_eos callers are unaffected.

Function/Subroutine Documentation

◆ eint_from_p_bisect()

subroutine, public mod_eos_lte::eint_from_p_bisect ( double precision, intent(in) log_nh_val,
double precision, intent(in) log_p_val,
double precision, intent(out) log_eint_nh_out )

Given log10(nH) and log10(p), find log10(eint/nH) by table-guessed bisection on the forward pressure table. Wraps the bracketing logic and log_p_bisect_cached into a single call for use by both HD and MHD from_conserved routines.

eint-axis limits: var2_min/var2_max are set for uniform tables only, so an adaptive log_p table takes its end nodes, which keeps the clamps below inside the bicubic stencil

Definition at line 728 of file mod_eos_lte.t.

Here is the call graph for this function:

◆ eint_nh_from_t()

double precision function, public mod_eos_lte::eint_nh_from_t ( double precision, intent(in) log_nh,
double precision, intent(in) log_t )

eint/nH from (log10 nH, log10 T), from the inverse table when one is built and the Saha solve otherwise

Definition at line 510 of file mod_eos_lte.t.

Here is the call graph for this function:

◆ eos_finalise_lte()

subroutine, public mod_eos_lte::eos_finalise_lte

LTE arm of eos_finalise: wire the LTE runtime pointer targets, then dispatch on eos_method to the per-method finaliser, each owned by its method module (analytic->mod_eos_lte_saha, entropy->mod_eos_lte_entropy, tables->mod_eos_lte_tables).

R-factor: physics-independent (cached-Ne lookup), bound here rather than in the hd/mhd/ffhd link arms so the target stays private.

Definition at line 60 of file mod_eos_lte.t.

Here is the call graph for this function:

◆ eos_get_eintt_grid()

subroutine, public mod_eos_lte::eos_get_eintt_grid ( integer, intent(out) n_nh,
double precision, intent(out) lg_nh_min,
double precision, intent(out) lg_nh_max )

####################################################################### Table-metadata helpers: expose inverse-table grid bounds without reaching into EoS table internals. #######################################################################

log_nH grid metadata of the (log_nH, log_T) inverse table (eint from T), choosing the container by method ('tables'->eint_from_T, 'entropy'->eintT). n_nH=0 if no such table (analytic/FI). Lets cooling's build_Y_mod_table get its grid without reaching into EoS table internals.

Definition at line 794 of file mod_eos_lte.t.

◆ eos_init_lte()

subroutine, public mod_eos_lte::eos_init_lte

update_eos_LTE, get_Te_LTE, get_temperature_from_eint_LTE and Rfactor_from_LTE are PRIVATE: all bound to eos% pointers inside eos_finalise_LTE, so no external module names them. get_temperature_from_eint_fast_LTE stays public – the seam binds it to tc_flget_temperature_ciso2_from_eint (fast TC path, optional p/rho)

Scalar table kernels (re-exported by mod_eos for the hd/mhd/ffhd seams). T_and_y_from_nH_eint is internal-only (entropy update path). LTE arms of the eos_init / eos_finalise dispatchers LTE arm of eos_init (before units are known): dispatch on eos_method to the chosen method's loader, each owned by its method module (analytic loads nothing). The LTE temperature-from-pressure getter is a later pass, so unlike FI/PI it is left unset here.

Definition at line 48 of file mod_eos_lte.t.

Here is the call graph for this function:

◆ gamma1_from_nh_p()

double precision function, public mod_eos_lte::gamma1_from_nh_p ( double precision, intent(in) log_nh,
double precision, intent(in) log_p_nh )

Gamma_1 from (log10 nH, log10 p/nH), one lookup on the pressure-indexed table.

Definition at line 462 of file mod_eos_lte.t.

◆ get_temperature_from_eint_fast_lte()

subroutine, public mod_eos_lte::get_temperature_from_eint_fast_lte ( double precision, dimension(ixi^s,1:nw), intent(in) w,
double precision, dimension(ixi^s,1:ndim), intent(in) x,
integer, intent(in) ixi,
integer, intent(in) l,
integer, intent(in) ixo,
l,
double precision, dimension(ixi^s), intent(out) res,
double precision, dimension(ixi^s), intent(out), optional ciso2 )
Parameters
[in]ixiFast TC variant: two-pass regime-aware bypass.

Pass 1 (vectorised): compute FI formula for ALL cells as array ops. The compiler vectorises this with SVML (no branches, pure arithmetic).

Pass 2 (scalar): overwrite ionisation-zone cells with bilinear table lookup + dexp. Threshold check uses multiply (eint <= threshold * rho) to avoid a 14-cycle scalar division. With ciso2 present it also returns p/rho = (1 + He + y) T / nH2rhoFactor at the current eint

Parameters
[in]lFast TC variant: two-pass regime-aware bypass.

Pass 1 (vectorised): compute FI formula for ALL cells as array ops. The compiler vectorises this with SVML (no branches, pure arithmetic).

Pass 2 (scalar): overwrite ionisation-zone cells with bilinear table lookup + dexp. Threshold check uses multiply (eint <= threshold * rho) to avoid a 14-cycle scalar division. With ciso2 present it also returns p/rho = (1 + He + y) T / nH2rhoFactor at the current eint

Parameters
[in]ixoFast TC variant: two-pass regime-aware bypass.

Pass 1 (vectorised): compute FI formula for ALL cells as array ops. The compiler vectorises this with SVML (no branches, pure arithmetic).

Pass 2 (scalar): overwrite ionisation-zone cells with bilinear table lookup + dexp. Threshold check uses multiply (eint <= threshold * rho) to avoid a 14-cycle scalar division. With ciso2 present it also returns p/rho = (1 + He + y) T / nH2rhoFactor at the current eint

Parameters
[in]lFast TC variant: two-pass regime-aware bypass.

Pass 1 (vectorised): compute FI formula for ALL cells as array ops. The compiler vectorises this with SVML (no branches, pure arithmetic).

Pass 2 (scalar): overwrite ionisation-zone cells with bilinear table lookup + dexp. Threshold check uses multiply (eint <= threshold * rho) to avoid a 14-cycle scalar division. With ciso2 present it also returns p/rho = (1 + He + y) T / nH2rhoFactor at the current eint

Precompute scalar constants (avoid per-cell divisions)

Pass 1: FI formula for ALL cells (vectorisable array operations). T = (gamma-1) * (eint - eion_per_rho * rho) / (Rfactor_FI * rho)

Pass 2: overwrite ionisation-zone cells.

Inlined uniform bilinear (hot path: no function call).

Non-uniform: dispatch to the binary-search bilinear. Slightly slower per cell (binary search adds ~8 cmps per axis) but unavoidable when the grid is non-uniform.

Definition at line 244 of file mod_eos_lte.t.

Here is the call graph for this function:

◆ lte_eint_from_p()

double precision function, public mod_eos_lte::lte_eint_from_p ( double precision, intent(in) pres,
double precision, intent(in) nh_val,
double precision, intent(in) log_nh_val,
double precision, intent(in) rho_val )

LTE internal energy from pressure in one cell: FI bypass, else eint(nH, p).

Definition at line 835 of file mod_eos_lte.t.

Here is the call graph for this function:

◆ lte_gamma1_from_p()

double precision function, public mod_eos_lte::lte_gamma1_from_p ( double precision, intent(in) pres,
double precision, intent(in) rho_val )

Gamma_1 of one cell from (p, rho): the ideal value where fully ionised, else the pressure- indexed table of the method.

Definition at line 474 of file mod_eos_lte.t.

Here is the call graph for this function:

◆ lte_p_from_eint()

double precision function, public mod_eos_lte::lte_p_from_eint ( double precision, intent(in) eint_val,
double precision, intent(in) nh_val,
double precision, intent(in) log_nh_val,
double precision, intent(in) inv_rho )

LTE pressure from internal energy in one cell: ideal without ionE, else the table floor, the FI bypass or p(nH, eint). log_nH_val is read only with ionE.

Definition at line 816 of file mod_eos_lte.t.

Here is the call graph for this function:

◆ p2eint_from_nh_p()

double precision function, public mod_eos_lte::p2eint_from_nh_p ( double precision, intent(in) nh,
double precision, intent(in) ponh )

Ratio eint/p from (log10 nH, log10 p/nH).

Definition at line 437 of file mod_eos_lte.t.

◆ p_nh_from_eint()

double precision function, public mod_eos_lte::p_nh_from_eint ( double precision, intent(in) log_nh,
double precision, intent(in) log_eint_nh )

p/nH = (1 + He + y) T from (log10 nH, log10 eint/nH)

Definition at line 492 of file mod_eos_lte.t.

◆ t_from_nh_eint()

double precision function, public mod_eos_lte::t_from_nh_eint ( double precision, intent(in) nh,
double precision, intent(in) eint_nh )

Temperature from (log10 nH, log10 eint/nH).

Definition at line 378 of file mod_eos_lte.t.

◆ y_from_nh_eint()

double precision function, public mod_eos_lte::y_from_nh_eint ( double precision, intent(in) nh,
double precision, intent(in) eint_nh )

Scalar EoS kernels: one cell on (log10 nH, log10 eint/nH) or (log10 nH, log10 p/nH), in code units, each dispatching to the analytic Saha solve, the entropy tables or the tables.

Ionisation fraction ne/nH from (log10 nH, log10 eint/nH)

Definition at line 355 of file mod_eos_lte.t.