Can you explain why they depend on T_ref? That means we no longer just add a different constant but also change the factor in front of (T - T_ref). Sounds like a different thing to me.
Currently, all quantities are given for a certain temperature (e.g. 99.6°C for the gas heat capacity). Wouldn't it make more sense to chose all (constant) values based on the chosen ref temp?
I don't think so. The temperature they should depend on is the actual temperature not the reference temperature. For example for water gasHeatCapacity(T_ref = 20°C) makes little sense?
yes I was wrong. It makes sense to evaluate at 20°C. But it still doesn't make sense to evaluate it at T_ref. Let's choose T_ref (which should be arbitrary) as 0K. What is your heat capacity then and why would it make sense?
After discussion with Kilian: we can have a user-defined constant "mean temperature" and "mean pressure" for SimpleH2O and just evaluate the IAPWS H20 once at this (T,p) (local static variables). This makes it possible to have consistent set of simple values (no computations required) in difference to the current randomly chosen constants.
I've seen that you discussed these points a lot previously and also changed and harmonized the implementations. What I do not really get is the following point, that also refers to #1015 (closed).
h_vap = h_gas - h_liq, by definition, no?
However, then with the current way we calculate gas and liquid enthalpies that would not work as
even if we add h_vap to the gas enthalpy, that is not the same.
However, for an incompressible liquid we can assume:
h_liq = cp*T + p/rho
and for an ideal gas we can calculate
h_gas = cp*T
What am I missing here? Is it just that the values we use for the gas and liquid heat capacities need to be adapted? Or am I wrong with anything stated above?
That's why I thought the enthalpy of vaporization also has to change with temperature if the two enthalpies change with T no? But then somehow the reference state has to be adjusted so that the difference equals a certain value at the reference temperature (I want to specify the enthalpy of vaporization at the reference temperature I guess?)
No I thought so as well but the gas heat capacity is smaller than the liquid heat capacity so the gas enthalpy is always less than the liquid (which is not correct). That is why I guess also Kilian said it needs to be added here.
Ah yeah so at t_ref both enthalpies are zero. So at t_ref I would have to add the enthalpy of vaporization and then everything is correct. I when I deviate from t_ref I guess the enthalpy of vaporization just varies then with T and p. But if the variation induced by the formulas for liquid and gas enthalpy results in the correct variations of the enthalpy of vaporization, I don't know.
but even at t_ref there is still p/rho from the liquid enthalpy, so the liquid enthalpy is not zero?
I'll look into how much the heat capacities change with temperature and pressure to see if we can use these constants here and then i'll check this again
I talked to Holger and now things are clearer for me: When we have a phase-change we need to add the vaporization enthalpy to get the gas enthalpy.
we can use c_p dT without adding the vaporization enthalpy for an ideal gas when there is no phase change for the component (e.g. O2 which is always a gas in our case). I will adapt that here and also check that constant component does that correctly.