feos-org / feos

FeOs - A Framework for Equations of State and Classical Density Functional Theory
Other
110 stars 22 forks source link

Question regarding the calculation of the ideal gas molar entropy #199

Closed LoGaL93 closed 9 months ago

LoGaL93 commented 9 months ago

Hello,

Perhaps a not so smart question, but I was wondering what is the reason for this discrepancy:

Given joback Cp ig parameters for Hexane:

a=-2.566 b=0.57384 c=-0.0003026 d=0.0000000602 e=0

given Temperature = 350K and Pressure = 1 bar

if i request the ideal gas entropy to feOs ( in case i assembled hexane from groups) I obtain: 24.278895875604746 J/mol/K

If i calculate it analytically by using: s_ig = a log(T/T0) + b(T-T0) + c/2(T^2-T0^2) + d/3(T^3-T0^3) + e/4(T^4-T0^4) - 8.314np.log(P/P0) with T0 = 298.15, P0 = 1e5

I obtain: 24.586025472033747 J/mol/K

Am I missing something?

prehner commented 9 months ago

Hello,

the expression for the ideal gas entropy that you use calculates the entropy for given temperature and pressure.

If you use State.molar_entropy(Contributions.IdealGas), you calculate the entropy of an ideal gas at the same temperature and density as your state, rather than at the same temperature and pressure. You can calculate

T = 350 * KELVIN
P = BAR

State(eos, T, density=P / (RGAS * T)).molar_entropy(Contributions.IdealGas)

to validate that both implementations of the Joback model are equivalent.

LoGaL93 commented 9 months ago

ok, great thanks :)