Commit c0528eeb authored by Henning Francke's avatar Henning Francke
Browse files

improved T check

parent 87377f56
......@@ -7,12 +7,12 @@ function solubility_H2_pTX_Chabab2020
extends partial_solubility_pTX;
protected
Types.Molality molalities[size(X, 1)]= Utilities.massFractionsToMolalities(X,MM_vec);
// SI.Temp_C T_C = SI.Conversions.to_degC(T);
// Real c = X[1]/Salt_Data.M_NaCl/X[end];
SI.Temp_C T_min = if molalities[iNaCl] > 0 then 273.15 else 323.15;
algorithm
// print("mola_N2("+String(p_gas)+","+String(T-273.16)+") (solubility_N2_pTX_Duan2006)");
if AssertLevel>0 then
assert(ignoreTlimit or ignoreLimitH2_T or ((if molalities[iNaCl] > 0 then 273.15 else 323.15)<T and T<373.15), "Temperature out of validity range: T=" + String(T - 273.15) + ".\nTo ignore set ignoreLimitN2_T=true",aLevel);
assert(ignoreTlimit or ignoreLimitH2_T or (T_min<T and T<373.15), "Temperature out of validity range["+String(T_min-273.15)+"...100°C]: T=" + String(T - 273.15) + ".\nTo ignore set ignoreLimitH2_T=true",aLevel);
assert(ignoreLimitH2_p or ((if molalities[iNaCl] > 0 then 10e5 else 1e5)<p and p<203e5),"Pressure out of validity range. p=" + String(p/1e5) + " bar.\nTo ignore set ignoreLimitN2_p=true",aLevel);
assert(ignoreLimitH2_b or molalities[iNaCl]<5,"Molality out of validity range: mola[NaCl]=" + String(molalities[iNaCl]) + " mol/kg.\nTo ignore set ignoreLimitH2_b=true",aLevel);
end if;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment