Skip to content

Commit cd663b5

Browse files
committed
scale anharmonic entropy
1 parent 5ed30e1 commit cd663b5

File tree

4 files changed

+65
-23
lines changed

4 files changed

+65
-23
lines changed

burnman/eos/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
from .mie_grueneisen_debye import MGD2, MGD3
1919
from .slb import SLB2, SLB3, SLB3Conductive
2020
from .modular_mie_grueneisen_debye import ModularMGD
21-
from .debye_temperature_models import (
22-
DebyeTemperatureModelBase,
23-
SLB,
24-
PowerLawGammaSimple,
25-
PowerLawGamma,
26-
)
2721
from .modified_tait import MT
2822
from .hp import HP_TMT
2923
from .hp import HP_TMTL

burnman/eos/anharmonic_debye_pade.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def _nondimensional_helmholtz_energy(T, debye_T):
153153
:rtype: float
154154
"""
155155
t = T / debye_T
156-
return _helmholtz_pade(t)
156+
return _helmholtz_pade(t) * debye_T
157157

158158

159159
@jit(nopython=True)
@@ -170,7 +170,7 @@ def _nondimensional_entropy(T, debye_T):
170170
:rtype: float
171171
"""
172172
t = T / debye_T
173-
return -_dhelmholtzdt_pade(t) / debye_T
173+
return -_dhelmholtzdt_pade(t)
174174

175175

176176
@jit(nopython=True)
@@ -187,7 +187,7 @@ def _nondimensional_heat_capacity(T, debye_T):
187187
:rtype: float
188188
"""
189189
t = T / debye_T
190-
return -t * _d2helmholtzdt2_pade(t) / debye_T
190+
return -t * _d2helmholtzdt2_pade(t)
191191

192192

193193
@jit(nopython=True)
@@ -205,7 +205,7 @@ def _nondimensional_dhelmholtz_dTheta(T, debye_T):
205205
:rtype: float
206206
"""
207207
t = T / debye_T
208-
return -_dhelmholtzdt_pade(t) * t / debye_T
208+
return _helmholtz_pade(t) - _dhelmholtzdt_pade(t) * t
209209

210210

211211
@jit(nopython=True)
@@ -223,7 +223,7 @@ def _nondimensional_d2helmholtz_dTheta2(T, debye_T):
223223
:rtype: float
224224
"""
225225
t = T / debye_T
226-
return t * (t * _d2helmholtzdt2_pade(t) + 2.0 * _dhelmholtzdt_pade(t)) / debye_T**2
226+
return t * t * _d2helmholtzdt2_pade(t) / debye_T
227227

228228

229229
@jit(nopython=True)
@@ -241,7 +241,7 @@ def _nondimensional_dentropy_dTheta(T, debye_T):
241241
:rtype: float
242242
"""
243243
t = T / debye_T
244-
return (_d2helmholtzdt2_pade(t) * t + _dhelmholtzdt_pade(t)) / debye_T**2
244+
return _d2helmholtzdt2_pade(t) * t / debye_T
245245

246246

247247
class AnharmonicDebyePade:
@@ -256,17 +256,22 @@ class AnharmonicDebyePade:
256256
:math:`A = a_{anh} * (V/V_0)^{m_{anh}}`, with both :math:`a_{anh}`
257257
and :math:`m_{anh}` being parameters of the model.
258258
The term :math:`F_a` is calculated using the 3-5 Pade approximant to
259-
the function: :math:`\\int_0^x (E_{D}/3nR) dt / x^{4}`, then
259+
the function: :math:`\\int_0^x E_{D}(T)/3nR dT / x^{4}`, then
260260
post-multiplied by :math:`x^{4}`.
261261
262262
The :math:`E_{D}` term inside the integral is the thermal energy of a
263-
Debye solid per mole of atoms. This expression is chosen because it
264-
matches the behaviour of the anharmonic contribution to the entropy
265-
at low and high temperatures - i.e., it is equal to zero at low temperature
266-
(with all derivatives also equal to zero) and linear at high temperature.
263+
Debye solid per mole of atoms where the Debye temperature is 1 K.
264+
This expression is chosen because it matches the behaviour of the
265+
anharmonic contribution to the entropy at low and high temperatures;
266+
i.e., it is equal to zero at low temperature (with all derivatives
267+
also equal to zero) and linear at high temperature.
267268
See Figure 3 in Oganov and Dorogokupets
268269
(2004; dx.doi.org/10.1088/0953-8984/16/8/018).
269270
271+
The model is such that the entropy at the Debye temperature is equal to
272+
-A * debye.thermal_energy(T=1., debye_T=1., n=1.) / (3R), which is
273+
roughly -0.6744 J/K/mol when A = 1. Note the negative sign.
274+
270275
:return: _description_
271276
:rtype: _type_
272277
"""

docs/eos.rst

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
Equations of state
2-
==================
1+
Isothermal Equations of state
2+
=============================
33

44
Base class
55
----------
6-
.. autoclass:: burnman.eos.EquationOfState
6+
7+
.. autoclass:: burnman.eos.IsothermalEquationOfState
78

89
Murnaghan
910
---------
@@ -49,6 +50,19 @@ Reciprocal K-prime
4950

5051
.. autoclass:: burnman.eos.RKprime
5152

53+
SPOCK
54+
-----
55+
56+
.. autoclass:: burnman.eos.SPOCK
57+
58+
Thermal Equations of state
59+
==========================
60+
61+
Base class
62+
^^^^^^^^^^
63+
64+
.. autoclass:: burnman.eos.EquationOfState
65+
5266
Stixrude and Lithgow-Bertelloni Formulation
5367
-------------------------------------------
5468

@@ -68,7 +82,7 @@ SLB3
6882
.. autoclass:: burnman.eos.SLB3
6983

7084
Mie-Grüneisen-Debye
71-
-------------------------------------------
85+
-------------------
7286

7387
Base class
7488
^^^^^^^^^^
@@ -85,6 +99,23 @@ MGD3
8599

86100
.. autoclass:: burnman.eos.MGD3
87101

102+
Modular Mie-Grüneisen-Debye
103+
---------------------------
104+
105+
.. autoclass:: burnman.eos.ModularMGD
106+
107+
Debye Temperature Models
108+
^^^^^^^^^^^^^^^^^^^^^^^^
109+
110+
.. autoclass:: burnman.eos.debye_temperature_models.DebyeTemperatureModelBase
111+
112+
.. autoclass:: burnman.eos.debye_temperature_models.SLB
113+
114+
.. autoclass:: burnman.eos.debye_temperature_models.PowerLawGammaSimple
115+
116+
.. autoclass:: burnman.eos.debye_temperature_models.PowerLawGamma
117+
118+
88119
Modified Tait
89120
-------------
90121

tests/test_anharmonic.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import unittest
22
from util import BurnManTest
33

4+
import burnman
45
from burnman.eos.anharmonic_debye_pade import AnharmonicDebyePade
56
from burnman.eos.debye_temperature_models import SLB as theta_SLB
6-
7+
from burnman.eos import debye
8+
from burnman.constants import gas_constant
79

810
params = {
9-
"a_anh": 1500.0,
11+
"a_anh": 1.5,
1012
"V_0": 2.0e-6,
1113
"m_anh": 3.0,
1214
"Debye_0": 1000.0,
@@ -67,6 +69,16 @@ def test_derivatives(self):
6769
self.assertAlmostEqual(alphaK_T / 1.0e3, dSdV / 1.0e3, places=6)
6870
self.assertAlmostEqual(alphaK_T / 1.0e3, dPdT / 1.0e3, places=6)
6971

72+
def test_standard_entropy(self):
73+
V = params["V_0"]
74+
T = params["debye_temperature_model"](Vrel=1.0, params=params)
75+
self.assertAlmostEqual(T, params["Debye_0"], places=6)
76+
77+
S = AnharmonicDebyePade.entropy(T, V, params) / params["a_anh"]
78+
S1 = -debye.thermal_energy(1.0, 1.0, 1.0) / gas_constant / 3.0
79+
self.assertAlmostEqual(S, S1, places=4)
80+
self.assertAlmostEqual(S, -0.6744, places=4)
81+
7082

7183
if __name__ == "__main__":
7284
unittest.main()

0 commit comments

Comments
 (0)