Zalmoxis.eos analytic
eos_analytic
Analytic EOS from Seager et al. (2007), Table 3, Eq. 11.
Modified polytropic fit:
\[
\rho(P) = \rho_0 + c \cdot P^n
\]
Valid for \(P < 10^{16}\) Pa. Approximates the full merged Vinet/BME + TFD EOS to 2-12% accuracy for all planetary pressures.
P_MAX = 1e+16
module-attribute
SEAGER2007_MATERIALS = {'iron': (8300.0, 0.00349, 0.528), 'MgSiO3': (4100.0, 0.00161, 0.541), 'MgFeSiO3': (4260.0, 0.00127, 0.549), 'H2O': (1460.0, 0.00311, 0.513), 'graphite': (2250.0, 0.0035, 0.514), 'SiC': (3220.0, 0.00172, 0.537)}
module-attribute
VALID_MATERIAL_KEYS = set(SEAGER2007_MATERIALS.keys())
module-attribute
logger = logging.getLogger(__name__)
module-attribute
get_analytic_density(pressure, material_key)
Compute density from the Seager et al. (2007) analytic modified polytrope.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
float
|
Pressure in Pa. |
required |
material_key
|
str
|
One of the keys in SEAGER2007_MATERIALS (e.g., "iron", "MgSiO3", "H2O", "graphite", "SiC", "MgFeSiO3"). |
required |
Returns:
| Type | Description |
|---|---|
float
|
Density in kg/m^3. Returns rho_0 for non-positive pressure (allows the ODE solver to remain stable during pressure adjustment iterations). Returns None only for NaN pressure. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If material_key is not recognized. |
Source code in src/zalmoxis/eos_analytic.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |