@@ -276,9 +276,9 @@ def shear_modulus(self, pressure, temperature, volume, params):
276276 elif self .order == 3 :
277277 return shear_modulus_third_order (volume , params )
278278
279- def _molar_internal_energy (self , pressure , temperature , volume , params ):
279+ def _molar_helmholtz_energy (self , pressure , temperature , volume , params ):
280280 """
281- Returns the internal energy :math:`\\ mathcal{E }`
281+ Returns the Helmholtz energy :math:`\\ mathcal{F }`
282282 of the mineral. :math:`[J/mol]`
283283 """
284284 x = np .power (volume / params ["V_0" ], - 1.0 / 3.0 )
@@ -299,7 +299,7 @@ def _molar_internal_energy(self, pressure, temperature, volume, params):
299299 )
300300 )
301301
302- return - intPdV + params ["E_0 " ]
302+ return - intPdV + params ["F_0 " ]
303303
304304 def gibbs_energy (self , pressure , temperature , volume , params ):
305305 """
@@ -309,7 +309,7 @@ def gibbs_energy(self, pressure, temperature, volume, params):
309309 # G = int VdP = [PV] - int PdV = E + PV
310310
311311 return (
312- self ._molar_internal_energy (pressure , temperature , volume , params )
312+ self ._molar_helmholtz_energy (pressure , temperature , volume , params )
313313 + volume * pressure
314314 )
315315
@@ -318,11 +318,18 @@ def validate_parameters(self, params):
318318 Check for existence and validity of the parameters
319319 """
320320
321- if "E_0 " not in params :
322- params ["E_0 " ] = 0.0
321+ if "F_0 " not in params :
322+ params ["F_0 " ] = 0.0
323323 if "P_0" not in params :
324324 params ["P_0" ] = 0.0
325325
326+ if "E_0" in params :
327+ raise KeyError (
328+ "Isothermal equations of state should be "
329+ "defined in terms of Helmholtz free energy "
330+ "F_0, not internal energy E_0."
331+ )
332+
326333 # If G and Gprime are not included this is presumably deliberate,
327334 # as we can model density and bulk modulus just fine without them,
328335 # so just add them to the dictionary as nans
@@ -400,9 +407,9 @@ def shear_modulus(self, pressure, temperature, volume, params):
400407 """
401408 return 0.0
402409
403- def _molar_internal_energy (self , pressure , temperature , volume , params ):
410+ def _molar_helmholtz_energy (self , pressure , temperature , volume , params ):
404411 """
405- Returns the internal energy :math:`\\ mathcal{E }` of the mineral. :math:`[J/mol]`
412+ Returns the Helmholtz free energy :math:`\\ mathcal{F }` of the mineral. :math:`[J/mol]`
406413 """
407414 x = np .power (volume / params ["V_0" ], - 1.0 / 3.0 )
408415 x2 = x * x
@@ -433,7 +440,7 @@ def _molar_internal_energy(self, pressure, temperature, volume, params):
433440 )
434441 )
435442
436- return - intPdV + params ["E_0 " ]
443+ return - intPdV + params ["F_0 " ]
437444
438445 def validate_parameters (self , params ):
439446 """
0 commit comments