mu.f
50 lines · 1 definitions · on GitHub (7be4133)
Python version: mu.py, 46 lines, on the right (switch to Python above the code).
Purpose
Computes the gas's mean molecular weight terms for the equation-of-state routines: the ions' contribution AMU, the free electrons' contribution EMU, and RMU $= \mathcal{R}\,(\mathrm{AMU}+\mathrm{EMU})$.
How it fits
- Inputs: $T$, $P$, $\rho$ (
D), $X$, $Z$, andBETA(probably the ratio of gas to total pressure, as the name suggests); the envelope composition and itsAMUENVfromCOMP_MOD; the gas constantCGASfromCONSTANTS_MOD. - Who calls it: the equation-of-state routine OEQOS06 (at
rp_1alsoMEQOS,OEQOSandOEQOS01, removed sincerp_1). - Outputs:
AMU,EMU,RMU. - Modules:
COMP_MOD,CONSTANTS_MOD. The unused/CTLIM/,/CONST1/and/CCOUT2/ofrp_1are no longer declared.
The method
-
Ions. If $X$ and $Z$ differ from the envelope's by less than $10^{-5}$ in total,
AMU = AMUENV. Otherwise the change is added species by species, with "excess Z (metals) … in the form of carbon(12)": $$\mathrm{AMU} = \mathrm{AMU_{env}} + \frac{\Delta X}{1.008} + \frac{\Delta Y}{4.004} + \frac{\Delta Z}{12.016},\qquad \Delta Y = -(\Delta X + \Delta Z),$$ (the weightsATOMWTare 0.9921, 0.24975 and 0.08322, i.e. $1/A$; a fourth,ATOMWT(4)$= 0.4995$ ($2/4.004$), is set but never read: unused? line 29↗). SoAMUis the number of ions per unit mass in units of $1/m_u$, the inverse of the ions' mean molecular weight. -
Electrons. From the gas pressure, $\beta P = \rho\,\mathcal{R}\,T\,(\mathrm{AMU}+\mathrm{EMU})$, so $$\mathrm{EMU} = \mathrm{AMU}\left(\frac{\beta P}{\rho\,T\,\mathcal{R}\,\mathrm{AMU}} - 1\right),\qquad \mathrm{RMU} = \mathcal{R}\,(\mathrm{AMU}+\mathrm{EMU}) = \frac{\beta P}{\rho T}.$$
Definitions
subroutineMU
Uses modules COMP_MOD, CONSTANTS_MOD
Called by OEQOS06
Change log
The changes since rp_1
Changed since rp_1. Declarations only: COMMON blocks to modules, IMPLICIT NONE; its callers other than OEQOS06 are removed.