I came across an inconsistency in units in OGS which is worrying me.
We ran a coupled H2T model (PP model for multiphase flow), where T is defined in [°C]. We found that when the density function is called from CalCoefMass2() for example, T is converted to [K] by
TG = interpolate(NodalValC1) + T_KILVIN_ZERO;
Then Density(variables) is called. In our model, rho=f(P,T) (model 6) and the reference T_0 = 21 °C is mfp-input value in [°C], which is intuitive, as her whole model runs with BCs and IC T in [°C].
In this case
delta_T = variables in [K] - T_0 in [°C]
which gives quite a large delta_T (~274°) and thus a very large density change (-110 kg/m³).
So in order to correctly use the PP model and T-dependent density,
it seems to me we have to define IC, BC etc. in [°C], but the mfp-density parameter for rho(T) in [K]. If this is true, I think we should generally think about the way we handle T-units in OGS, as user errors are very likely with the current implementation.
I also found that for other processes the + T_KILVIN_ZERO temperature transformation is applied:
- Richards (if(MediaProp->permeability_stress_mode > 1))
- Liquidflow (if(MediaProp->permeability_stress_mode > 1))
- Heat (if(FluidProp->density_model == 14)
and several CalCoef_RHS... functions
These seem to be mostly special cases (but I'm not completely sure) but some warning messages should probably be be added as long as there is no standard internal T unit.
What do you think?
Have a nice evening,
Dr. Christof Beyer
Institute of Geosciences