diff --git a/dumux/material/fluidsystems/h2o_n2_system.hh b/dumux/material/fluidsystems/h2o_n2_system.hh index 5f7dbf708054438381744b41890e0a4001e95abd..0704ac1cee15ee36a48b463459392f7f6ec4cbf7 100644 --- a/dumux/material/fluidsystems/h2o_n2_system.hh +++ b/dumux/material/fluidsystems/h2o_n2_system.hh @@ -451,6 +451,10 @@ public: * \brief Given a phase's composition, temperature and pressure, * return its specific enthalpy [J/kg]. */ + /*! + * \todo This system neglects the contribution of gas-molecules in the liquid phase. + * This contribution is probably not big. Somebody would have to find out the enthalpy of solution for this system. ... + */ template <class FluidState> static Scalar phaseEnthalpy(int phaseIdx, Scalar temperature, @@ -458,32 +462,18 @@ public: const FluidState &fluidState) { if (phaseIdx == lPhaseIdx) { - Scalar cN2 = fluidState.concentration(lPhaseIdx, N2Idx); - Scalar pN2 = N2::gasPressure(temperature, cN2*N2::molarMass()); - // TODO: correct way to deal with the solutes??? return - fluidState.massFrac(lPhaseIdx, H2OIdx)* - H2O::liquidEnthalpy(temperature, pressure) - + - fluidState.massFrac(lPhaseIdx, N2Idx)* - N2::gasEnthalpy(temperature, pN2); + H2O::liquidEnthalpy(temperature, pressure); } else { - Scalar cH2O = fluidState.concentration(gPhaseIdx, H2OIdx); - Scalar cN2 = fluidState.concentration(gPhaseIdx, N2Idx); - - Scalar pH2O = H2O::gasPressure(temperature, cH2O*H2O::molarMass()); - Scalar pN2 = N2::gasPressure(temperature, cN2*N2::molarMass()); - Scalar result = 0; result += - H2O::gasEnthalpy(temperature, pH2O) * + H2O::gasEnthalpy(temperature, pressure) * fluidState.massFrac(gPhaseIdx, H2OIdx); result += - N2::gasEnthalpy(temperature, pN2) * + N2::gasEnthalpy(temperature, pressure) * fluidState.massFrac(gPhaseIdx, N2Idx); - return result; } } diff --git a/dumux/material/fluidsystems/simplefluidsystem.hh b/dumux/material/fluidsystems/simplefluidsystem.hh index 95fc8162be928075126d9798a86e5e8da790c2c6..bc80d5d062523fb5823a0e0dde96fca402d5f278 100644 --- a/dumux/material/fluidsystems/simplefluidsystem.hh +++ b/dumux/material/fluidsystems/simplefluidsystem.hh @@ -270,6 +270,10 @@ public: * \brief Given a phase's composition, temperature, pressure and * density, calculate its specific enthalpy [J/kg]. */ + /*! + * \todo This system neglects the contribution of gas-molecules in the liquid phase. + * This contribution is probably not big. Somebody would have to find out the enthalpy of solution for this system. ... + */ static Scalar computeEnthalpy(const MutableParameters ¶ms, int phaseIdx) { @@ -280,39 +284,21 @@ public: if (phaseIdx == SP::lPhaseIdx) { #warning hack T = 300.0; - - Scalar cN2 = fs.molarity(SP::lPhaseIdx, SP::N2Idx); - Scalar pN2 = SP::N2::gasPressure(T, cN2*SP::N2::molarMass()); - - Scalar XH2O = fs.massFrac(SP::lPhaseIdx, SP::H2OIdx); - Scalar XN2 = fs.massFrac(SP::lPhaseIdx, SP::N2Idx); // TODO: correct way to deal with the solutes??? return - (XH2O*SP::H2O::liquidEnthalpy(T, p) - + - XN2*SP::N2::gasEnthalpy(T, pN2)) - / - (XH2O + XN2); + SP::H2O::liquidEnthalpy(T, p); } else { - Scalar cH2O = fs.molarity(SP::gPhaseIdx, SP::H2OIdx); - Scalar cN2 = fs.molarity(SP::gPhaseIdx, SP::N2Idx); - // assume ideal gas - Scalar pH2O = SP::H2O::gasPressure(T, cH2O*SP::H2O::molarMass()); - Scalar pN2 = SP::N2::gasPressure(T, cN2*SP::H2O::molarMass()); - Scalar XH2O = fs.massFrac(SP::lPhaseIdx, SP::H2OIdx); Scalar XN2 = fs.massFrac(SP::lPhaseIdx, SP::N2Idx); Scalar result = 0; result += - SP::H2O::gasEnthalpy(T, pH2O) * + SP::H2O::gasEnthalpy(T, p) * fs.massFrac(SP::gPhaseIdx, SP::H2OIdx); result += - SP::N2::gasEnthalpy(T, pN2) * + SP::N2::gasEnthalpy(T, p) * fs.massFrac(SP::gPhaseIdx, SP::N2Idx); - result /= XH2O + XN2; - return result; } }; diff --git a/dumux/material/new_fluidsystems/h2on2fluidsystem.hh b/dumux/material/new_fluidsystems/h2on2fluidsystem.hh index d60b7e33cc825685a7105890c4aaf0541ed05b3f..7ef1e59a842d9ec746731ba9b37b1172535fbab2 100644 --- a/dumux/material/new_fluidsystems/h2on2fluidsystem.hh +++ b/dumux/material/new_fluidsystems/h2on2fluidsystem.hh @@ -439,6 +439,11 @@ public: * \brief Given a phase's composition, temperature, pressure and * density, calculate its specific enthalpy [J/kg]. */ + + /*! + * \todo This system neglects the contribution of gas-molecules in the liquid phase. + * This contribution is probably not big. Somebody would have to find out the enthalpy of solution for this system. ... + */ static Scalar computeEnthalpy(MutableParameters ¶ms, int phaseIdx) { @@ -448,37 +453,20 @@ public: Valgrind::CheckDefined(T); Valgrind::CheckDefined(p); if (phaseIdx == SP::lPhaseIdx) { - Scalar cN2 = params.molarity(SP::lPhaseIdx, SP::N2Idx); - Scalar pN2 = SP::N2::gasPressure(T, cN2*SP::N2::molarMass()); - - Scalar XH2O = params.massFrac(SP::lPhaseIdx, SP::H2OIdx); - Scalar XN2 = params.massFrac(SP::lPhaseIdx, SP::N2Idx); - // TODO: correct way to deal with the solutes??? return - (XH2O*SP::H2O::liquidEnthalpy(T, p) + - XN2*SP::N2::gasEnthalpy(T, pN2)) - / - (XH2O + XN2); + SP::H2O::liquidEnthalpy(T, p) ; } else { - Scalar cH2O = params.molarity(SP::gPhaseIdx, SP::H2OIdx); - Scalar cN2 = params.molarity(SP::gPhaseIdx, SP::N2Idx); - // assume ideal gas - Scalar pH2O = SP::H2O::gasPressure(T, cH2O*SP::H2O::molarMass()); - Scalar pN2 = SP::N2::gasPressure(T, cN2*SP::H2O::molarMass()); - Scalar XH2O = params.massFrac(SP::gPhaseIdx, SP::H2OIdx); Scalar XN2 = params.massFrac(SP::gPhaseIdx, SP::N2Idx); Scalar result = 0; - result += XH2O*SP::H2O::gasEnthalpy(T, pH2O); - result += XN2*SP::N2::gasEnthalpy(T, pN2); - result /= XH2O + XN2; - + result += XH2O*SP::H2O::gasEnthalpy(T, p); + result += XN2*SP::N2::gasEnthalpy(T, p); return result; } - }; + } /*! * \brief Given a phase's composition, temperature, pressure and