aragog.eos
The aragog.eos package provides the pressure-entropy equation of state used by the solver. The production path is a single phase-aware evaluator backed by SPIDER-format \((P, S)\) tables; there is no abstract evaluator protocol or single/mixed/composite hierarchy.
| Name | Role |
|---|---|
EntropyEOS |
P-S table loader and bilinear interpolator. Provides temperature(P, S), density(P, S), melt_fraction(P, S), solidus_entropy(P), liquidus_entropy(P), latent_heat(P), solidus_entropy_dP(P), liquidus_entropy_dP(P). |
EntropyPhaseEvaluator |
Wraps EntropyEOS with the SPIDER-parity two-stage phase blend, viscosity tanh transition, gravitational-separation velocity, and the per-cell property cache. |
For the file format expected by EntropyEOS, see Reference: data.
eos
EOS subpackage: equation of state evaluators.
Provides entropy-formulation EOS (PALEOS P-S tables) and phase evaluator.
EntropyEOS(eos_dir)
Entropy-based EOS from PALEOS P-S tables.
Provides property lookups (P, S) -> T, rho, Cp, alpha, dTdPs, phi for a single mantle material with solid and melt phases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
eos_dir
|
Path or str
|
Directory containing the SPIDER-format P-S table files. |
required |
Source code in src/aragog/eos/entropy.py
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 | |
dTdPs(P, S)
Adiabatic temperature gradient dT/dP|_S (P, S) [K/Pa].
This is the SPIDER convention: dT/dP along the adiabat, NOT the dimensionless nabla_ad = d ln T / d ln P.
Source code in src/aragog/eos/entropy.py
1010 1011 1012 1013 1014 1015 1016 | |
density(P, S)
Density rho(P, S) [kg/m^3].
In the mushy zone (0 < phi < 1): harmonic mean of end-member densities evaluated at phase boundary entropies (SPIDER eos_composite.c:236-237).
Outside the mushy zone (phi=0 or phi=1): single-phase table evaluated at the actual S (clamped to table range), matching SPIDER's combine_matprop(smth=0, mixed, single) path.
Source code in src/aragog/eos/entropy.py
792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 | |
heat_capacity(P, S)
Specific heat capacity Cp(P, S) [J/kg/K].
Linear blend of solid and melt P-S tables by melt fraction
(the cp_blend = 'linear' convention). Use
heat_capacity_latent_blend for SPIDER-parity mushy-zone
Cp that includes the latent-heat contribution.
Source code in src/aragog/eos/entropy.py
837 838 839 840 841 842 843 844 845 | |
heat_capacity_latent_blend(P, S, width=0.01)
Latent-heat-augmented Cp(P, S), matching SPIDER convention.
Mirrors SPIDER's eos_composite.c:226-232 formula:
Cp_mix = (S_liq - S_sol) / (T_liq - T_sol)
* (T_sol + 0.5 * (T_liq - T_sol))
which captures the latent-heat contribution to apparent heat capacity in the mushy zone. Outside the phase boundary the result reduces to the pure-phase Cp via tanh smoothing.
The plain linear blend used by heat_capacity above misses
the latent-heat term and underestimates Cp by up to a factor
of 6 in the deep mushy regime relative to SPIDER's internal
cp_s. This formula closes that gap.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
P
|
array or float
|
Pressure [Pa]. |
required |
S
|
array or float
|
Entropy [J/kg/K]. |
required |
width
|
float
|
Tanh smoothing width across the phase boundary, in units of melt fraction. SPIDER default is 0.01. |
0.01
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Heat capacity [J/kg/K] with the same shape as the inputs. |
Source code in src/aragog/eos/entropy.py
847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 | |
invert_temperature(P, T_target)
Find entropy S such that T(P, S) = T_target.
Uses Brent root-finding with pure-Python bilinear interpolation on the P-S temperature tables. All arithmetic inside the brentq callback uses only Python floats, avoiding numpy scalar conversions that break on numpy >= 2.4 (where ndim > 0 arrays cannot be implicitly converted to scalars).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
P
|
float
|
Pressure [Pa]. |
required |
T_target
|
float
|
Target temperature [K]. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Entropy [J/kg/K] such that T(P, S) ~ T_target. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If T_target is outside the range of T(P, S) for this P. |
Source code in src/aragog/eos/entropy.py
1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 | |
latent_heat(P)
Latent heat L(P) = T_fus × (S_liq - S_sol) [J/kg].
P-dependent, following SPIDER convention. T_fus is the average of solidus and liquidus temperatures at the given pressure.
Source code in src/aragog/eos/entropy.py
1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 | |
liquidus_entropy(P)
Liquidus entropy S_liq(P) [J/kg/K].
Source code in src/aragog/eos/entropy.py
543 544 545 | |
liquidus_entropy_dP(P)
dS_liq/dP at the given pressure(s), in J/(kg·K·Pa).
Source code in src/aragog/eos/entropy.py
560 561 562 | |
melt_fraction(P, S)
Melt fraction phi from position between solidus and liquidus.
phi = 0 for S <= S_sol, phi = 1 for S >= S_liq, linear between.
Source code in src/aragog/eos/entropy.py
692 693 694 695 696 697 698 699 700 701 702 703 | |
solidus_entropy(P)
Solidus entropy S_sol(P) [J/kg/K].
Source code in src/aragog/eos/entropy.py
539 540 541 | |
solidus_entropy_dP(P)
dS_sol/dP at the given pressure(s), in J/(kg·K·Pa).
Needed by the SPIDER-parity mixing-flux formula in
entropy_state.update. SPIDER computes Jmix via a bracket
expression dS/dr − [φ dS_liq/dP + (1−φ) dS_sol/dP] dP/dr
(energy.c::GetMixingHeatFlux lines 307-309). Exposing the
phase-boundary P-derivatives here lets Aragog match SPIDER's
formula exactly without resorting to un-truncated gphi
arithmetic.
Source code in src/aragog/eos/entropy.py
547 548 549 550 551 552 553 554 555 556 557 558 | |
specific_enthalpy(P, S)
EOS-consistent specific enthalpy h(P, S) [J/kg].
Bilinear interpolation on the precomputed table built in
_build_enthalpy_table. Inputs outside the table P or S
range are clamped to the nearest table edge so the lookup
never returns NaN; callers querying out-of-range states
receive the boundary value instead of an exception.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
P
|
array or float
|
Pressure [Pa]. |
required |
S
|
array or float
|
Entropy [J/kg/K]. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Specific enthalpy [J/kg], same shape as broadcast(P, S). |
Source code in src/aragog/eos/entropy.py
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 | |
temperature(P, S)
Temperature T(P, S) [K].
Source code in src/aragog/eos/entropy.py
788 789 790 | |
temperature_scalar(P, S)
Temperature T(P, S) for a single point, pure Python.
Uses the same Lever Rule blending as temperature() but
with pure-Python arithmetic throughout. Safe for use inside
scipy.optimize callbacks on numpy >= 2.4.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
P
|
float
|
Pressure [Pa]. |
required |
S
|
float
|
Entropy [J/kg/K]. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Temperature [K]. |
Source code in src/aragog/eos/entropy.py
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 | |
thermal_expansivity(P, S)
Thermal expansivity alpha(P, S) [1/K].
When P-S thermal_exp tables are available (generated alongside SPIDER tables), uses them directly for exact parity with SPIDER. Otherwise, derives alpha from the thermodynamic identity: alpha = rho * Cp * |dT/dP|_S| / T.
Source code in src/aragog/eos/entropy.py
1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 | |
thermal_expansivity_composite_blend(P, S, width=0.01)
Composite two-phase thermal expansivity, matching SPIDER.
Mirrors SPIDER's eos_composite.c:246 formula:
alpha_mix = (rho_solid - rho_melt) / (T_liq - T_sol) / rho
where rho is the harmonic-mean composite density. This
effective alpha captures the density change from the phase
transition (Clausius-Clapeyron contribution), which dominates
over the single-phase alpha by a factor of ~5 in the deep
mushy zone. Outside the mushy band the result reduces to the
pure-phase alpha from the P-S tables via tanh smoothing
(SPIDER eos_composite.c:279).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
P
|
array or float
|
Pressure [Pa]. |
required |
S
|
array or float
|
Entropy [J/kg/K]. |
required |
width
|
float
|
Tanh smoothing width across the phase boundary. |
0.01
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Thermal expansivity [1/K]. |
Source code in src/aragog/eos/entropy.py
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | |
EntropyPhaseEvaluator(entropy_eos, gravitational_acceleration, rheological_transition_melt_fraction=0.4, rheological_transition_width=0.15, viscosity_solid=1e+21, viscosity_liquid=0.1, grain_size=0.001, thermal_conductivity_solid=4.0, thermal_conductivity_liquid=2.0, cp_blend='latent', matprop_smooth_width=0.0, const_properties=False, const_rho=4000.0, const_Cp=1000.0, const_alpha=1e-05, const_cond=4.0, const_log10visc=2.0, const_T_ref=3500.0, const_S_ref=3000.0)
Phase evaluator using entropy as the state variable.
Implements the same interface as MixedPhaseEvaluator / CompositePhaseEvaluator, but all lookups use (P, S) from the EntropyEOS tables. No solidus/liquidus root-finding is needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entropy_eos
|
EntropyEOS
|
Loaded P-S EOS tables. |
required |
gravitational_acceleration
|
float or array
|
Gravitational acceleration profile [m/s^2]. |
required |
rheological_transition_melt_fraction
|
float
|
Melt fraction at which viscosity transitions from solid to liquid. |
0.4
|
rheological_transition_width
|
float
|
Width of the tanh viscosity transition. |
0.15
|
viscosity_solid
|
float
|
Reference solid viscosity [Pa s]. |
1e+21
|
viscosity_liquid
|
float
|
Reference liquid viscosity [Pa s]. |
0.1
|
grain_size
|
float
|
Grain size for permeability calculation [m]. |
0.001
|
latent_heat_constant
|
float
|
Latent heat of fusion [J/kg]. Used for gravitational separation flux. |
required |
Source code in src/aragog/eos/entropy_phase.py
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 | |
capacitance()
Capacitance for the entropy equation: rho * T [kg K / m^3].
The entropy equation is rho * T * dS/dt = div(F).
Source code in src/aragog/eos/entropy_phase.py
503 504 505 506 507 508 | |
dTdPs()
Adiabatic temperature gradient dT/dP|_S [K/Pa].
Source code in src/aragog/eos/entropy_phase.py
378 379 380 | |
dTdrs()
Adiabatic temperature gradient dT/dr|_S [K/m].
dT/dr|_S = -g * alpha * T / Cp
Source code in src/aragog/eos/entropy_phase.py
382 383 384 385 386 387 | |
delta_specific_volume()
Specific volume difference between solid and liquid [m^3/kg].
Source code in src/aragog/eos/entropy_phase.py
493 494 495 496 497 498 499 | |
latent_heat()
Latent heat L(P) = T_fus × (S_liq - S_sol) [J/kg].
P-dependent from EOS tables, matching SPIDER convention.
Source code in src/aragog/eos/entropy_phase.py
401 402 403 404 405 406 | |
relative_velocity()
Melt-solid relative velocity for gravitational separation [m/s].
Returns zero in const_properties mode (no phase contrast).
Uses Abe (1993) three-regime permeability model based on porosity (volume fraction of melt, not mass fraction), matching SPIDER's GetGravitationalHeatFlux in energy.c.
Regimes (F = K/porosity, the quantity multiplying delta_rho*g/eta): 1. Blake-Kozeny-Carman (low porosity): F = d^2 por^2 / ((1-por)^2 * 1000) 2. Rumpf-Gupte (intermediate): F = d^2 por^4.5 * (5/7) 3. Stokes settling (high porosity): F = d^2 * 2/9
Source code in src/aragog/eos/entropy_phase.py
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | |
set_entropy(entropy)
Set the entropy profile.
Source code in src/aragog/eos/entropy_phase.py
115 116 117 | |
set_pressure(pressure)
Set the pressure profile.
Source code in src/aragog/eos/entropy_phase.py
126 127 128 | |
set_temperature(temperature)
Not used in entropy mode. Use set_entropy() instead.
Source code in src/aragog/eos/entropy_phase.py
119 120 121 122 123 124 | |
temperature()
Temperature from EOS lookup (not a state variable).
Source code in src/aragog/eos/entropy_phase.py
374 375 376 | |
update()
Recompute all cached properties from current (P, S).
Two modes: - const_properties=True: analytical T(S) with constant rho, Cp, alpha, k, visc. Matches SPIDER's -use_const_properties. No EOS table lookups. phi=1 always (no phase transitions). - const_properties=False (default): single-pass EOS evaluation mirroring SPIDER's EOSEval_Composite_TwoPhase.
Source code in src/aragog/eos/entropy_phase.py
130 131 132 133 134 135 136 137 138 139 140 141 142 | |