Clapeyron provides a framework for the development and use of fluid-thermodynamic models, including SAFT, cubic, activity, multi-parameter, and COSMO-SAC.
Technical details:
the reference state is stored in a new struct, ReferenceState <: ClapeyronParam. this struct was added to almost all ideal models (except BasicIdeal). Clapeyron.eos was modified into the following:
function eos(model,V,T,z=SA[1.0])
return Rgas(model)*T*sum(z)*(a_ideal(idealmodel(model),V,T,z) + a_res(model,V,T,z) + reference_state_eval(model,V,T,z)
end
were reference_state_eval(model,V,T,z) is just:
ref = reference_state(model)
a0 = dot(z,ref.a0) #constant term
a1 = dot(z,ref.a1) #temperature dependent term
return a0 + a1*T
a0 and a1 are a function of the entropy and enthalpy at the reference conditions and can be obtained easily.
The @newmodel macros automatically add the keyword argument reference_state = nothing to each model created this way.
Most of the changes were in the docs department :sweat_smile: , formatting fixes and adding the reference_state keyword to each documented eos
This PR adds support for setting reference states for enthalpy and entropy:
Technical details: the reference state is stored in a new struct,
ReferenceState <: ClapeyronParam
. this struct was added to almost all ideal models (exceptBasicIdeal
).Clapeyron.eos
was modified into the following:were
reference_state_eval(model,V,T,z)
is just:a0 and a1 are a function of the entropy and enthalpy at the reference conditions and can be obtained easily.
The
@newmodel
macros automatically add the keyword argumentreference_state = nothing
to each model created this way.Most of the changes were in the docs department :sweat_smile: , formatting fixes and adding the
reference_state
keyword to each documented eos