thermotools / thermopack

Thermopack is a thermodynamic model library for fluid properties and PVT calculations
Other
51 stars 13 forks source link

Triple point for CO2 #122

Closed laods closed 9 months ago

laods commented 9 months ago

Hello.

I have some issues with the solid CO2 EOS. The problem is that the evaluated triple point is wrong which in turn gives problem when calling a flash calculation as the phase flag is wrong. See the attached minimal working example (solidCO2.f90) which produces the output given by solidCO2.log. (Note: .f90 files are not supported here, so renamed to .txt)

For SRK and PR the reported triple points are reasonable. However, for MEOS and GERG2008, the deviation is quite substantial. If I use reference_state "ASHRAE" instead of "DEFAULT" when initializing MEOS, I get the correct triple point, but for GERG2008, the triple point seems independent of the reference state.

To me it seems like the error is introduced somewhere in calc_single_comp_triple_point called in initDryIce (both in solideos.f90).

Thanks and best regards, Lars

solidCO2.txt solidCO2.log

morteham commented 9 months ago

Hi Lars,

There was an issue with the ideal gas model used together with the solid Gibbs free energy when calculating the fugacity coefficient for the solid phase. I have corrected this in the linked PR #123.

laods commented 9 months ago

Thanks!

laods commented 9 months ago

Actually, I think there might be a small bug on line 1028-1029 of multiparameter_base.f90. The variable alp_del_calculated is defined twice, but I guess that it should be alp_tau_calculated in on of the instances. This problem was only a problem when compiling with ifort, while it seems to work with gfortran.