EOS Package
The zalmoxis.eos package provides equation-of-state functionality organized by EOS family.
eos
EOS package for Zalmoxis.
Re-exports all public and private functions from the submodules so that
from zalmoxis.eos import calculate_density works identically to the
old monolithic eos_functions.py.
__all__ = ['load_paleos_table', 'load_paleos_unified_table', '_fast_bilinear', '_paleos_clamp_temperature', '_ensure_unified_cache', 'get_tabulated_eos', 'get_paleos_unified_density', 'get_paleos_unified_density_batch', '_get_paleos_unified_nabla_ad', 'load_melting_curve', 'get_solidus_liquidus_functions', 'get_Tdep_density', 'get_Tdep_material', '_get_paleos_nabla_ad', 'calculate_density', 'calculate_density_batch', 'compute_adiabatic_temperature', '_compute_paleos_dtdp', 'calculate_temperature_profile', 'create_pressure_density_files']
module-attribute
_compute_paleos_dtdp(pressure, temperature, mat_PALEOS, solidus_func, liquidus_func, interpolation_functions)
Compute dT/dP from PALEOS nabla_ad with phase-aware weighting.
Uses solid nabla_ad below solidus, liquid nabla_ad above liquidus, and melt-fraction-weighted average in the mushy zone.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
float
|
Pressure in Pa. |
required |
temperature
|
float
|
Temperature in K. |
required |
mat_PALEOS
|
dict
|
PALEOS material properties dict. |
required |
solidus_func
|
callable or None
|
Solidus melting curve interpolation function. |
required |
liquidus_func
|
callable or None
|
Liquidus melting curve interpolation function. |
required |
interpolation_functions
|
dict
|
Shared interpolation cache. |
required |
Returns:
| Type | Description |
|---|---|
float or None
|
dT/dP in K/Pa, or None if lookup fails. |
Source code in src/zalmoxis/eos/temperature.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
_ensure_unified_cache(eos_file, interpolation_functions)
Ensure a unified PALEOS table is loaded into the interpolation cache.
Tries loading from a binary pickle cache first (fast), then falls back to the text table (slow). Saves a pickle cache after the first text load.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
eos_file
|
str
|
Path to the unified PALEOS table file. |
required |
interpolation_functions
|
dict
|
Shared interpolation cache. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
The cache entry for this file. |
Source code in src/zalmoxis/eos/interpolation.py
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 | |
_fast_bilinear(log_p, log_t, grid, cached)
O(1) bilinear interpolation on a log-uniform grid (scalar).
Optimized for the hot path: called ~2M times per structure solve. Uses direct floor indexing (no rounding, no max/min builtins).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_p
|
float
|
log10 of pressure, already clamped to grid bounds. |
required |
log_t
|
float
|
log10 of temperature, already clamped to valid range. |
required |
grid
|
ndarray
|
2D array of values, shape (n_p, n_t). |
required |
cached
|
dict
|
Cache entry with grid metadata. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Interpolated value. NaN if any corner is NaN. |
Source code in src/zalmoxis/eos/interpolation.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | |
_get_paleos_nabla_ad(pressure, temperature, material_dict, phase, interpolation_functions)
Look up nabla_ad from a PALEOS cache entry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
float
|
Pressure in Pa. |
required |
temperature
|
float
|
Temperature in K. |
required |
material_dict
|
dict
|
Material properties dict (e.g. |
required |
phase
|
str
|
|
required |
interpolation_functions
|
dict
|
Shared interpolation cache. |
required |
Returns:
| Type | Description |
|---|---|
float or None
|
Dimensionless adiabatic gradient nabla_ad, or None if lookup fails. |
Source code in src/zalmoxis/eos/tdep.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | |
_get_paleos_unified_nabla_ad(pressure, temperature, material_dict, interpolation_functions)
Look up nabla_ad from a unified PALEOS cache entry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
float
|
Pressure in Pa. |
required |
temperature
|
float
|
Temperature in K. |
required |
material_dict
|
dict
|
Material properties dict with 'eos_file' key. |
required |
interpolation_functions
|
dict
|
Shared interpolation cache. |
required |
Returns:
| Type | Description |
|---|---|
float or None
|
Dimensionless adiabatic gradient, or None if lookup fails. |
Source code in src/zalmoxis/eos/paleos.py
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 | |
_paleos_clamp_temperature(log_p, log_t, cached)
Clamp log10(T) to the per-pressure valid range of a PALEOS table.
Uses O(1) index computation on the log-uniform pressure grid instead of np.interp (which does binary search on 1000+ elements). This is called millions of times in the scalar ODE path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_p
|
float
|
log10 of pressure in Pa (already clamped to table bounds). |
required |
log_t
|
float
|
log10 of temperature in K. |
required |
cached
|
dict
|
PALEOS cache entry. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Clamped log10(T). |
bool
|
True if clamping was applied. |
Source code in src/zalmoxis/eos/interpolation.py
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 | |
calculate_density(pressure, material_dictionaries, layer_eos, temperature, solidus_func, liquidus_func, interpolation_functions=None, mushy_zone_factor=1.0)
Calculate density for a single layer given its EOS identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
float
|
Pressure at which to evaluate the EOS, in Pa. |
required |
material_dictionaries
|
dict
|
EOS registry dict keyed by EOS identifier string
(from |
required |
layer_eos
|
str
|
Per-layer EOS identifier, for example |
required |
temperature
|
float
|
Temperature at which to evaluate the EOS, in K. |
required |
solidus_func
|
callable or None
|
Interpolation function for the solidus melting curve. |
required |
liquidus_func
|
callable or None
|
Interpolation function for the liquidus melting curve. |
required |
interpolation_functions
|
dict
|
Cache of interpolation functions used to avoid redundant loading. |
None
|
mushy_zone_factor
|
float
|
Cryoscopic depression factor for unified PALEOS tables. 1.0 = no mushy zone (sharp boundary from table). Default 1.0. |
1.0
|
Returns:
| Type | Description |
|---|---|
float or None
|
Density in kg/m^3, or |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/zalmoxis/eos/dispatch.py
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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
calculate_density_batch(pressures, temperatures, material_dictionaries, layer_eos, solidus_func, liquidus_func, interpolation_functions, mushy_zone_factor=1.0)
Vectorized density lookup for a batch of (P, T) points sharing one EOS.
For unified PALEOS tables, uses the vectorized interpolator path. For other EOS types, falls back to scalar calculate_density per point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressures
|
ndarray
|
1D array of pressures in Pa. |
required |
temperatures
|
ndarray
|
1D array of temperatures in K. |
required |
material_dictionaries
|
dict
|
EOS registry. |
required |
layer_eos
|
str
|
EOS identifier string. |
required |
solidus_func
|
callable or None
|
Solidus melting curve function. |
required |
liquidus_func
|
callable or None
|
Liquidus melting curve function. |
required |
interpolation_functions
|
dict
|
Interpolation cache. |
required |
mushy_zone_factor
|
float
|
Cryoscopic depression factor. |
1.0
|
Returns:
| Type | Description |
|---|---|
ndarray
|
1D array of densities in kg/m^3. NaN where lookup fails. |
Source code in src/zalmoxis/eos/dispatch.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
calculate_temperature_profile(radii, temperature_mode, surface_temperature, center_temperature, input_dir, temp_profile_file, cmb_temperature=None)
Return a callable temperature profile for a planetary interior model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radii
|
array_like
|
Radial grid of the planet, in m. |
required |
temperature_mode
|
('isothermal', 'linear', 'prescribed', 'adiabatic', 'adiabatic_from_cmb')
|
Temperature profile mode.
|
"isothermal"
|
surface_temperature
|
float
|
Temperature at the surface, in K. |
required |
center_temperature
|
float
|
Temperature at the center, in K. Used for |
required |
cmb_temperature
|
float
|
Temperature at the core-mantle boundary, in K. Required for
|
None
|
input_dir
|
str or path - like
|
Directory containing the prescribed temperature profile file. |
required |
temp_profile_file
|
str
|
Name of the file containing the prescribed temperature profile from
center to surface. Required when |
required |
Returns:
| Type | Description |
|---|---|
callable
|
Function of radius returning temperature in K. The callable accepts a scalar or array-like radius and returns a float or NumPy array. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
ValueError
|
If the prescribed temperature profile length does not match
|
ValueError
|
If |
Source code in src/zalmoxis/eos/temperature.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | |
compute_adiabatic_temperature(radii, pressure, mass_enclosed, surface_temperature, cmb_mass, core_mantle_mass, layer_mixtures, material_dictionaries, interpolation_functions=None, solidus_func=None, liquidus_func=None, mushy_zone_factors=None, condensed_rho_min=CONDENSED_RHO_MIN_DEFAULT, condensed_rho_scale=CONDENSED_RHO_SCALE_DEFAULT, binodal_T_scale=50.0, anchor='surface', cmb_temperature=None)
Compute an adiabatic temperature profile using native EOS gradient tables.
Supports single-material and multi-material (volume-additive) layers. For multi-material layers, nabla_ad is mass-fraction-weighted across components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radii
|
ndarray
|
Radial grid in ascending order from center to surface, in m. |
required |
pressure
|
ndarray
|
Pressure at each radius, in Pa. |
required |
mass_enclosed
|
ndarray
|
Enclosed mass at each radius, in kg. |
required |
surface_temperature
|
float
|
Temperature at the surface, in K. Used as the anchor when
|
required |
cmb_mass
|
float
|
Core-mantle boundary mass, in kg. |
required |
core_mantle_mass
|
float
|
Total core-plus-mantle mass, in kg. |
required |
layer_mixtures
|
dict
|
Per-layer LayerMixture objects. |
required |
material_dictionaries
|
dict
|
EOS registry dict keyed by EOS identifier string. |
required |
interpolation_functions
|
dict
|
Cache of interpolation functions used to avoid redundant loading. |
None
|
solidus_func
|
callable
|
Interpolation function for the solidus melting curve. |
None
|
liquidus_func
|
callable
|
Interpolation function for the liquidus melting curve. |
None
|
mushy_zone_factors
|
dict or float or None
|
Per-EOS mushy zone factors. Dict keyed by EOS name, a single float (applied to all), or None (default 1.0 for all). |
None
|
condensed_rho_min
|
float
|
Sigmoid center for phase-aware suppression (kg/m^3). Default 322. |
CONDENSED_RHO_MIN_DEFAULT
|
condensed_rho_scale
|
float
|
Sigmoid width for phase-aware suppression (kg/m^3). Default 50. |
CONDENSED_RHO_SCALE_DEFAULT
|
binodal_T_scale
|
float
|
Binodal sigmoid width in K for H2 miscibility suppression. Default 50. |
50.0
|
anchor
|
('surface', 'cmb')
|
Where the adiabat is anchored. |
'surface'
|
cmb_temperature
|
float
|
Temperature at the core-mantle boundary, in K. Required when
|
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Temperature at each radial point, in K. |
Source code in src/zalmoxis/eos/temperature.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
create_pressure_density_files(outer_iter, inner_iter, pressure_iter, radii, pressure, density)
Append pressure and density profiles to output files for a given iteration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outer_iter
|
int
|
Current outer iteration index. |
required |
inner_iter
|
int
|
Current inner iteration index. |
required |
pressure_iter
|
int
|
Current pressure iteration index. |
required |
radii
|
ndarray
|
Radial positions, in m. |
required |
pressure
|
ndarray
|
Pressure values corresponding to |
required |
density
|
ndarray
|
Density values corresponding to |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in src/zalmoxis/eos/output.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
get_Tdep_density(pressure, temperature, material_properties_iron_Tdep_silicate_planets, solidus_func, liquidus_func, interpolation_functions=None)
Compute mantle density for a temperature-dependent EOS with phase changes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
float
|
Pressure at which to evaluate the EOS, in Pa. |
required |
temperature
|
float
|
Temperature at which to evaluate the EOS, in K. |
required |
material_properties_iron_Tdep_silicate_planets
|
dict
|
Dictionary containing temperature-dependent material properties for the MgSiO3 EOS. |
required |
solidus_func
|
callable
|
Interpolation function for the solidus melting curve. |
required |
liquidus_func
|
callable
|
Interpolation function for the liquidus melting curve. |
required |
interpolation_functions
|
dict
|
Cache of interpolation functions used to avoid redundant loading of EOS tables. |
None
|
Returns:
| Type | Description |
|---|---|
float or None
|
Density in kg/m^3. Returns |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Notes
The mantle phase is determined by comparing the input temperature to the solidus and liquidus temperatures at the given pressure.
In the mixed-phase region, the density is computed using linear melt fraction and volume additivity.
Source code in src/zalmoxis/eos/tdep.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
get_Tdep_material(pressure, temperature, solidus_func, liquidus_func)
Determine the mantle phase for a temperature-dependent EOS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
float or array_like
|
Pressure in Pa. May be a scalar or an array. |
required |
temperature
|
float or array_like
|
Temperature in K. May be a scalar or an array. |
required |
solidus_func
|
callable
|
Interpolation function for the solidus melting curve. |
required |
liquidus_func
|
callable
|
Interpolation function for the liquidus melting curve. |
required |
Returns:
| Type | Description |
|---|---|
str or ndarray
|
Material phase label(s). Possible values are |
Source code in src/zalmoxis/eos/tdep.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
get_paleos_unified_density(pressure, temperature, material_dict, mushy_zone_factor, interpolation_functions)
Look up density from a unified PALEOS table.
When mushy_zone_factor == 1.0 (no mushy zone), the density is read
directly from the table (the stable phase at each (P, T) is already
encoded). When mushy_zone_factor < 1.0, a synthetic solidus is
derived as T_sol = T_liq * mushy_zone_factor and the density in the
mushy zone is volume-averaged between the solid-side and liquid-side
table values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
float
|
Pressure in Pa. |
required |
temperature
|
float
|
Temperature in K. |
required |
material_dict
|
dict
|
Material properties dict with 'eos_file' and 'format' keys. |
required |
mushy_zone_factor
|
float
|
Cryoscopic depression factor. 1.0 = no mushy zone (sharp boundary). < 1.0 = solidus at this fraction of the extracted liquidus. |
required |
interpolation_functions
|
dict
|
Shared interpolation cache. |
required |
Returns:
| Type | Description |
|---|---|
float or None
|
Density in kg/m^3, or None on failure. |
Source code in src/zalmoxis/eos/paleos.py
35 36 37 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |
get_paleos_unified_density_batch(pressures, temperatures, material_dict, mushy_zone_factor, interpolation_functions)
Vectorized density lookup from a unified PALEOS table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressures
|
ndarray
|
1D array of pressures in Pa. |
required |
temperatures
|
ndarray
|
1D array of temperatures in K. |
required |
material_dict
|
dict
|
Material properties dict with 'eos_file' and 'format' keys. |
required |
mushy_zone_factor
|
float
|
Cryoscopic depression factor. 1.0 = no mushy zone. |
required |
interpolation_functions
|
dict
|
Shared interpolation cache. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
1D array of densities in kg/m^3. NaN where lookup fails. |
Source code in src/zalmoxis/eos/paleos.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | |
get_solidus_liquidus_functions(solidus_id='Stixrude14-solidus', liquidus_id='Stixrude14-liquidus')
Load solidus and liquidus melting curves by config identifier.
Delegates to :func:zalmoxis.melting_curves.get_solidus_liquidus_functions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
solidus_id
|
str
|
Solidus curve identifier. |
'Stixrude14-solidus'
|
liquidus_id
|
str
|
Liquidus curve identifier. |
'Stixrude14-liquidus'
|
Returns:
| Type | Description |
|---|---|
tuple of callable
|
|
Source code in src/zalmoxis/eos/tdep.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
get_tabulated_eos(pressure, material_dictionary, material, temperature=None, interpolation_functions=None)
Retrieve density from tabulated EOS data for a given material.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pressure
|
float
|
Pressure at which to evaluate the EOS, in Pa. |
required |
material_dictionary
|
dict
|
Dictionary containing material properties and EOS file paths. |
required |
material
|
str
|
Material type, for example |
required |
temperature
|
float
|
Temperature at which to evaluate the EOS, in K. Required for
temperature-dependent materials such as |
None
|
interpolation_functions
|
dict
|
Cache of interpolation functions used to avoid reloading and rebuilding interpolators for EOS tables. |
None
|
Returns:
| Type | Description |
|---|---|
float or None
|
Density in kg/m^3 if the interpolation succeeds, otherwise |
Source code in src/zalmoxis/eos/seager.py
30 31 32 33 34 35 36 37 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | |
load_melting_curve(melt_file)
Load a melting curve for MgSiO3 from a text file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
melt_file
|
str or path - like
|
Path to the melting curve data file. The file is expected to contain two columns: pressure in Pa and temperature in K. |
required |
Returns:
| Type | Description |
|---|---|
interp1d or None
|
One-dimensional interpolation function returning temperature as a
function of pressure. Returns |
Source code in src/zalmoxis/eos/tdep.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
load_paleos_table(eos_file)
Load a PALEOS MgSiO3 table and build RegularGridInterpolator objects.
The PALEOS tables have 10 columns (SI units): P, T, rho, u, s, cp, cv, alpha, nabla_ad, phase_id(string). The grid is log-uniform in both P and T with 150 points per decade. Some grid cells are missing (unconverged corners), filled with NaN. A P=0 row may exist and is excluded for log interpolation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
eos_file
|
str
|
Path to the PALEOS table file. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Cache entry with keys:
- |
Source code in src/zalmoxis/eos/interpolation.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
load_paleos_unified_table(eos_file)
Load a unified PALEOS table (single file per material) and build interpolators.
The unified tables use the same 10-column format as the 2-phase tables (P, T, rho, u, s, cp, cv, alpha, nabla_ad, phase_id) but contain all stable phases for a material in a single file. The thermodynamically stable phase at each (P, T) is encoded in the phase column.
In addition to density and nabla_ad interpolators, this function extracts the liquidus boundary from the phase column: for each pressure row, it finds the lowest temperature where the phase is 'liquid'.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
eos_file
|
str
|
Path to the unified PALEOS table file. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Cache entry with keys:
- |
Source code in src/zalmoxis/eos/interpolation.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |