PyREC scaffolding (from YREC development, 7be4133)/ eqrelv.fGlossary

eqrelv.f

331 lines · 1 definitions · on GitHub (7be4133)

Python version: eqrelv.py, 291 lines, on the right (switch to Python above the code).

Variables on this page (17)

cdh, cgas, cln, clni, dhnue, dtable, dval, etadh0, etadh1, etat8, iden, ishort, ldh, xxdh, yydh, zdh, zzdh

Purpose

EQRELV is the equation of state for fully ionized gas with partially degenerate, possibly relativistic electrons. Given $\log T$ and $\log P$, it finds the density whose total pressure (ions, electrons and radiation, plus an optional Debye–Hückel correction) equals $P$, and then the thermodynamic derivatives the structure equations need. The comment points to "Prather's thesis" for details.

How it fits

  • Who calls it: only EQSTAT2: alone where the gas is fully ionized ($\log T \ge$ TSCUT), and blended with the Saha solution (EQSAHA) in a transition band below that.
  • Inputs: TL, PL ($\log_{10}$ of T and P), BETA ($P_\mathrm{gas}/P$), AMU (ions per unit mass, in units of $1/m_\mathrm{H}$), EMU (electrons per unit mass, same units); DL is the starting guess.
  • Outputs: density DL, D; electron degeneracy ETA; and the derivatives: QDT $=\partial\ln\rho/\partial\ln T$, QDP $=\partial\ln\rho/\partial\ln P$, QCP ($c_P$), DELA ($\nabla_\mathrm{ad}$), and their logarithmic derivatives QDTT, QDTP, QCPT, QCPP, QAT, QAP.
  • Modules: CCR_MOD (formerly /CCR/) holds the electron (Fermi) table DTABLE, its abscissae DVAL, the degeneracy ETAT8 and an index table IDEN; it is shared only with SETUPS, which reads it from the Fermi-table file (unit IFERMI) and builds IDEN. DEBHU_MOD (formerly /DEBHU/) holds the Debye–Hückel constant CDH and the composition, and NMLPAR_MOD the settings ETADH0, ETADH1 (the ramp limits) and the flag LDH; the callers of the equation of state (PHYSIC, COEFFT, CRRECT, SCONVEC, HSUBP, GETNEWENV, STARIN, WRTMOD, WRTOUT) set its composition XXDH, YYDH, ZZDH, ZDH from the shell's HCOMP before each call. CONSTANTS_MOD holds the constants ($\ln 10$ = CLN, $R$ = CGAS); IOUNITS_MOD the output unit ISHORT.

The method

  1. Table lookup. The electron pressure is tabulated as a function of $x = \log\rho + \log\mu_e^{-1} - \tfrac32\log T$ and $y = \log T$ (columns of DTABLE: $\log P_e$, $\log U_e$, and derivatives). The code interpolates with three points in each direction: Newton (equal spacing) in $y$, column $j$ at $\log T = 5 + 0.2j$, so the 20 columns span $\log T = 5.2$ to 9.0; Lagrange in $x$ (unequal spacing).

From YREC's documentation

Microphysics in YREC (The Base YREC EOS) and Physics Options: LDH applies the Debye–Hückel correction, the reduction of pressure by the mutual repulsion of electrons, within the degeneracy range set by ETADH0 and ETADH1; the documentation recommends the defaults and gives them as LDH = TRUE, ETADH0 = −2, ETADH1 = 1.

Definitions

subroutineEQRELV

lines 6–331 · GitHub

Solves the pressure balance for $\rho$ with the electron table and returns $\rho$, $\eta$, $c_P$, $\nabla_\mathrm{ad}$ and their derivatives for fully ionized gas (method above).

Uses modules CCR_MOD, CONSTANTS_MOD, DEBHU_MOD, IOUNITS_MOD, NMLPAR_MOD

Called by EQSTAT2 ×2

Change log

The changes since rp_1

Changed since rp_1. Declarations only: COMMON blocks to modules, IMPLICIT NONE. This settles two former questions: /DEBHU/'s X element, named XXDY in EQSTAT, now has the one name XXDH in DEBHU_MOD, and the unused /CONST3/ is gone.