diff --git a/dumux/material/components/air.hh b/dumux/material/components/air.hh index a6d212bc7e7b435ce02d8d60ccd2db2cc1beea90..196b3a207ebc14d1853dbcde02b9be811c7df0ff 100644 --- a/dumux/material/components/air.hh +++ b/dumux/material/components/air.hh @@ -87,6 +87,15 @@ public: return IdealGas::density(molarMass(), temperature, pressure); } + /*! + * \brief The molar density of air in \f$\mathrm{[mol/m^3]}\f$, + * depending on pressure and temperature. + * \param temperature The temperature of the gas + * \param pressure The pressure of the gas + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return IdealGas::molarDensity(temperature, pressure); } + /*! * \brief Returns true, the gas phase is assumed to be compressible */ diff --git a/dumux/material/components/benzene.hh b/dumux/material/components/benzene.hh index 0d81c39326e0d065fa327183c34b332180232952..d08f1b6388598e3c221f093d1651f806bdcae8ca 100644 --- a/dumux/material/components/benzene.hh +++ b/dumux/material/components/benzene.hh @@ -45,7 +45,7 @@ class Benzene , public Components::Liquid<Scalar, Benzene<Scalar> > , public Components::Gas<Scalar, Benzene<Scalar> > { - + using IdealGas = Dumux::IdealGas<Scalar>; public: /*! * \brief A human readable name for the benzene @@ -67,11 +67,20 @@ public: */ static Scalar gasDensity(Scalar temperature, Scalar pressure) { - return IdealGas<Scalar>::density(molarMass(), - temperature, - pressure); + return IdealGas::density(molarMass(), + temperature, + pressure); } + /*! + * \brief The molar density of steam in \f$\mathrm{[mol/m^3]}\f$, + * depending on pressure and temperature. + * \param temperature The temperature of the gas + * \param pressure The pressure of the gas + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return IdealGas::molarDensity(temperature, pressure); } + /*! * \brief The density of pure benzene at a given pressure and temperature \f$\mathrm{[kg/m^3]}\f$. * @@ -80,7 +89,18 @@ public: */ static Scalar liquidDensity(Scalar temperature, Scalar pressure) { - return 889.51; // [kg/m^3] + return 889.51; + } + + /*! + * \brief The molar density of pure benzene at a given pressure and temperature \f$\mathrm{[mol/m^3]}\f$. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure) + { + return liquidDensity(temperature, pressure)/molarMass(); } /*! diff --git a/dumux/material/components/brine.hh b/dumux/material/components/brine.hh index e543ad1065b263a0da63c2a7b94872b31ea189f9..422bee5dae03103d7293875bd0d4d94dd6511ee2 100644 --- a/dumux/material/components/brine.hh +++ b/dumux/material/components/brine.hh @@ -57,6 +57,9 @@ public: //HACK: If salinity is a pseudo-component, a constat value is used static Scalar constantSalinity; + //! The ideal gas constant \f$\mathrm{[J/mol/K]}\f$ + static constexpr Scalar R = Constants<Scalar>::R; + /*! * \brief A human readable name for the brine. */ @@ -72,8 +75,7 @@ public: { const Scalar M1 = H2O::molarMass(); const Scalar M2 = Components::NaCl<Scalar>::molarMass(); // molar mass of NaCl [kg/mol] - const Scalar X2 = salinity; // mass fraction of salt in brine - return M1*M2/(M2 + X2*(M1 - M2)); + return M1*M2/(M2 + salinity*(M1 - M2)); }; /*! @@ -106,8 +108,19 @@ public: * * \param T temperature of component in \f$\mathrm{[K]}\f$ */ - static Scalar vaporPressure(Scalar T) - { return H2O::vaporPressure(T); } + static Scalar vaporPressure(Scalar temperature, Scalar salinity = constantSalinity) + { + Scalar ps = H2O::vaporPressure(temperature); //Saturation vapor pressure for pure water + Scalar pi = 0; + using std::log; + if (salinity < 0.26) // here we have hard coded the solubility limit for NaCl + pi = (R * temperature * log(1- salinity)); // simplified version of Eq 2.29 in Vishal Jambhekar's Promo + else + pi = (R * temperature * log(0.74)); + using std::exp; + ps *= exp((pi)/(R*temperature));// Kelvin's law for reduction in saturation vapor pressure due to osmotic potential + return ps; + } /*! * \brief Specific enthalpy of gaseous brine \f$\mathrm{[J/kg]}\f$. @@ -241,8 +254,8 @@ public: Scalar pressure, Scalar salinity = constantSalinity) { return - liquidEnthalpy(temperature, pressure) - - pressure/liquidDensity(temperature, pressure); + liquidEnthalpy(temperature, pressure, salinity) - + pressure/liquidDensity(temperature, pressure, salinity); } /*! @@ -254,6 +267,17 @@ public: static Scalar gasDensity(Scalar temperature, Scalar pressure) { return H2O::gasDensity(temperature, pressure); } + /*! + * \brief The molar density of steam in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * We take the value of the H2O gas molar density here because salt is not in the gas phase. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return H2O::gasMolarDensity(temperature, pressure); } + /*! * \brief Returns true if the gas phase is assumed to be ideal */ @@ -309,6 +333,16 @@ public: return density; } + /*! + * \brief The molar density of brine in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure, Scalar salinity = constantSalinity) + { return liquidDensity(temperature, pressure, salinity)/molarMass(salinity); } + /*! * \brief The pressure of steam in \f$\mathrm{[Pa]}\f$ at a given density and temperature. * @@ -331,18 +365,18 @@ public: // We use the Newton method for this. For the initial value we // assume the pressure to be 10% higher than the vapor // pressure - Scalar pressure = 1.1*vaporPressure(temperature); + Scalar pressure = 1.1*vaporPressure(temperature, salinity); const Scalar eps = pressure*1e-7; Scalar deltaP = pressure*2; using std::abs; for (int i = 0; i < 5 && abs(pressure*1e-9) < abs(deltaP); ++i) { - Scalar f = liquidDensity(temperature, pressure) - density; + Scalar f = liquidDensity(temperature, pressure, salinity) - density; Scalar df_dp; - df_dp = liquidDensity(temperature, pressure + eps); - df_dp -= liquidDensity(temperature, pressure - eps); + df_dp = liquidDensity(temperature, pressure + eps, salinity); + df_dp -= liquidDensity(temperature, pressure - eps, salinity); df_dp /= 2*eps; deltaP = - f/df_dp; diff --git a/dumux/material/components/cao.hh b/dumux/material/components/cao.hh index 320b29865ed67526d2aa405efc756f394547e26b..46d235f1da26673b1524ed27f64e582a6110badc 100644 --- a/dumux/material/components/cao.hh +++ b/dumux/material/components/cao.hh @@ -69,6 +69,15 @@ public: return 3370; } + /*! + * \brief The molar density \f$\mathrm{[mol/m^3]}\f$ of CaO. + * Molar density at 293 K. Literature value from Shao et al. (2013). + */ + static Scalar solidMolarDensity(Scalar temperature) + { + return solidDensity(temperature)/molarMass(); + } + /*! * \brief The specific heat capacity \f$\mathrm{[J/kg K]}\f$ of CaO. */ diff --git a/dumux/material/components/cao2h2.hh b/dumux/material/components/cao2h2.hh index d70baffe7843cf02097112117b5dcb2820605fd1..b972105db8a4b102f9f99efc5bae8f14387cae38 100644 --- a/dumux/material/components/cao2h2.hh +++ b/dumux/material/components/cao2h2.hh @@ -70,6 +70,15 @@ public: return 2200.0; //at 293 K ; Shao et al. (2013) } + /*! + * \brief The molar density \f$\mathrm{[mol/m^3]}\f$ of CaO2H2. + * Molar density at 293 K. Literature value from Shao et al. (2013). + */ + static Scalar solidMolarDensity(Scalar temperature) + { + return solidDensity(temperature)/molarMass(); + } + /*! * \brief The specific heat capacity \f$\mathrm{[J/kgK]}\f$ of CaO2H2. */ diff --git a/dumux/material/components/ch4.hh b/dumux/material/components/ch4.hh index 85e9cb307bfd9826153c9f0d8c187967b72eb33d..6011d61751ad5c3455727ffc29a0fa95f7279354 100644 --- a/dumux/material/components/ch4.hh +++ b/dumux/material/components/ch4.hh @@ -110,6 +110,15 @@ public: return IdealGas::density(molarMass(), temperature, pressure); } + /*! + * \brief The molar density of \f$CH_4\f$ gas in \f$\mathrm{[mol/m^3]}\f$, + * depending on pressure and temperature. + * \param temperature The temperature of the gas + * \param pressure The pressure of the gas + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return IdealGas::molarDensity(temperature, pressure); } + /*! * \brief Returns true if the gas phase is assumed to be ideal */ diff --git a/dumux/material/components/co2.hh b/dumux/material/components/co2.hh index feef02dbd32beacc63c95ea41d22f205ec61adec..940803413a7cd432fec968e9332b3b058184cf2c 100644 --- a/dumux/material/components/co2.hh +++ b/dumux/material/components/co2.hh @@ -227,6 +227,16 @@ public: return CO2Tables::tabulatedDensity.at(temperature, pressure); } + /*! + * \brief The molar density of CO2 gas in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return gasDensity(temperature, pressure)/molarMass(); } + /*! * \brief The density of pure CO2 at a given pressure and temperature \f$\mathrm{[kg/m^3]}\f$. * \param temperature the temperature \f$\mathrm{[K]}\f$ @@ -242,6 +252,17 @@ public: } return CO2Tables::tabulatedDensity.at(temperature, pressure); } + + /*! + * \brief The molar density of CO2 in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure) + { return liquidDensity(temperature, pressure)/molarMass(); } + /*! * \brief The pressure of steam in \f$\mathrm{[Pa]}\f$ at a given density and temperature. * diff --git a/dumux/material/components/constant.hh b/dumux/material/components/constant.hh index ce14c3f2ae8fa740ff1f32b9809de9a5fef86779..03cbc8a128d0d52dc232ffbe4d46f6d1e507b9c3 100644 --- a/dumux/material/components/constant.hh +++ b/dumux/material/components/constant.hh @@ -118,6 +118,16 @@ public: return density; } + /*! + * \brief The molar density in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure) + { return liquidDensity(temperature, pressure)/molarMass(); } + /*! * \brief Sets the liquid dynamic viscosity in \f$\mathrm{[Pa*s]}\f$. * @@ -145,6 +155,17 @@ public: return density; } + /*! + * \brief The molar density in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return gasDensity(temperature, pressure)/molarMass(); } + + /*! * \brief Sets the gas dynamic viscosity in \f$\mathrm{[Pa*s]}\f$. * diff --git a/dumux/material/components/gas.hh b/dumux/material/components/gas.hh index 0dea8837a51be446067dbd08899d07328fdafed8..7c1fef38ffdb408abf006cf2b1f9b4c23c71953e 100644 --- a/dumux/material/components/gas.hh +++ b/dumux/material/components/gas.hh @@ -80,6 +80,20 @@ public: DUNE_THROW(Dune::NotImplemented, "gasDensity(t,p)"); } + /*! + * \brief The molar density in \f$\mathrm{[mol/m^3]}\f$ of the component at a given pressure in + * \f$\mathrm{[Pa]}\f$ and temperature in \f$\mathrm{[K]}\f$. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + template<class C = Component> + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { + static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: gasMolarDensity(t,p)"); + DUNE_THROW(Dune::NotImplemented, "gasMolarDensity(t,p)"); + } + /*! * \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of the pure component in gas. * diff --git a/dumux/material/components/h2.hh b/dumux/material/components/h2.hh index 9b4c619896addcc90e101a68b851ed4b96905189..18fa7907c132e2e0667cc8a1cd6ed30d0eda885d 100644 --- a/dumux/material/components/h2.hh +++ b/dumux/material/components/h2.hh @@ -121,6 +121,15 @@ public: return IdealGas::density(molarMass(), temperature, pressure); } + /*! + * \brief The molar density of \f$H_2\f$ in \f$\mathrm{[mol/m^3]}\f$, + * depending on pressure and temperature. + * \param temperature The temperature of the gas + * \param pressure The pressure of the gas + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return IdealGas::molarDensity(temperature, pressure); } + /*! * \brief Returns true if the gas phase is assumed to be compressible */ diff --git a/dumux/material/components/h2o.hh b/dumux/material/components/h2o.hh index 2cffd8829b25784855de3b162941489eea882959..137e6862ec86dfdce84e8b9b6f3393a0ca26687b 100644 --- a/dumux/material/components/h2o.hh +++ b/dumux/material/components/h2o.hh @@ -545,6 +545,16 @@ public: return 1.0/volumeRegion2_(temperature, pressure); } + /*! + * \brief The molar density of steam in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return gasDensity(temperature, pressure)/molarMass(); } + /*! * \brief Returns true if the gas phase is assumed to be ideal */ @@ -650,6 +660,16 @@ public: return 1/volumeRegion1_(temperature, pressure); } + /*! + * \brief The molar density of water in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure) + { return liquidDensity(temperature, pressure)/molarMass(); } + /*! * \brief The pressure of liquid water in \f$\mathrm{[Pa]}\f$ at a given density and * temperature. diff --git a/dumux/material/components/heavyoil.hh b/dumux/material/components/heavyoil.hh index 332d55a6a0620532d4eab3dafff961952103754c..8dd4653f26ac00e2f8848adfcd9a045df8318bbd 100644 --- a/dumux/material/components/heavyoil.hh +++ b/dumux/material/components/heavyoil.hh @@ -48,7 +48,7 @@ class HeavyOil , public Components::Gas<Scalar, HeavyOil<Scalar> > { using Consts = Dumux::Constants<Scalar>; - + using IdealGas = Dumux::IdealGas<Scalar>; public: /*! * \brief A human readable name for heavyoil @@ -340,11 +340,20 @@ public: */ static Scalar gasDensity(Scalar temperature, Scalar pressure) { - return IdealGas<Scalar>::density(molarMass(), + return IdealGas::density(molarMass(), temperature, pressure); } + /*! + * \brief The molar density of pure heavyoil in \f$\mathrm{[mol/m^3]}\f$, + * depending on pressure and temperature. + * \param temperature The temperature of the gas + * \param pressure The pressure of the gas + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return IdealGas::molarDensity(temperature, pressure); } + /*! * \brief The density of pure heavyoil at a given pressure and temperature \f$\mathrm{[kg/m^3]}\f$. * @@ -364,6 +373,16 @@ public: return rho; // [kg/m^3] } + /*! + * \brief The molar density of pure heavyoil in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure) + { return liquidDensity(temperature, pressure)/molarMass(); } + /*! * \brief Returns true if the gas phase is assumed to be compressible */ @@ -464,31 +483,6 @@ public: { return 0.127; } - -protected: - /*! - * \brief The molar density of pure heavyoil at a given pressure and temperature - * \f$\mathrm{[mol/m^3]}\f$. - * - * source : Reid et al. (fourth edition): Modified Racket technique (chap. 3-11, eq. 3-11.9) - * - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - */ - static Scalar molarLiquidDensity_(Scalar temperature) - { - using std::min; - using std::max; - temperature = min(temperature, 500.0); // regularization - temperature = max(temperature, 250.0); - - using std::pow; - const Scalar Z_RA = 0.2556; // from equation - const Scalar expo = 1.0 + pow(1.0 - temperature/criticalTemperature(), 2.0/7.0); - Scalar V = Consts::R*criticalTemperature()/criticalPressure()*pow(Z_RA, expo); // liquid molar volume [cm^3/mol] - - return 1.0/V; // molar density [mol/m^3] - } - }; } // end namespace Components diff --git a/dumux/material/components/liquid.hh b/dumux/material/components/liquid.hh index 171cae6a692880405d8e0e8b1d86921cedca7783..ef11d214492ce90d52a0bb4eb3bdad6625df1546 100644 --- a/dumux/material/components/liquid.hh +++ b/dumux/material/components/liquid.hh @@ -70,6 +70,20 @@ public: DUNE_THROW(Dune::NotImplemented, "liquidDensity(t,p)"); } + /*! + * \brief The molar density \f$\mathrm{[mole/m^3]}\f$ of the liquid component at a given pressure in + * \f$\mathrm{[Pa]}\f$ and temperature in \f$\mathrm{[K]}\f$. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + template<class C = Component> + static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure) + { + static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: liquidMolarDensity(t,p)"); + DUNE_THROW(Dune::NotImplemented, "Component::liquidMolarDensity(t,p)"); + } + /*! * \brief The dynamic liquid viscosity \f$\mathrm{[Pa*s]}\f$ of the pure component. * diff --git a/dumux/material/components/mesitylene.hh b/dumux/material/components/mesitylene.hh index 33cf0af734443106064d9ccd8d9a09b2833e97f4..ec732d2d10e1b3d17a302cfe94e1edf333847268 100644 --- a/dumux/material/components/mesitylene.hh +++ b/dumux/material/components/mesitylene.hh @@ -48,7 +48,7 @@ class Mesitylene , public Components::Gas<Scalar, Mesitylene<Scalar> > { using Consts = Constants<Scalar>; - + using IdealGas = Dumux::IdealGas<Scalar>; public: /*! * \brief A human readable name for the mesitylene @@ -206,11 +206,20 @@ public: */ static Scalar gasDensity(Scalar temperature, Scalar pressure) { - return IdealGas<Scalar>::density(molarMass(), - temperature, - pressure); + return IdealGas::density(molarMass(), + temperature, + pressure); } + /*! + * \brief The molar density of mesitylene in \f$\mathrm{[mol/m^3]}\f$, + * depending on pressure and temperature. + * \param temperature The temperature of the gas + * \param pressure The pressure of the gas + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return IdealGas::molarDensity(temperature, pressure); } + /*! * \brief The density of pure mesitylene at a given pressure and temperature \f$\mathrm{[kg/m^3]}\f$. * @@ -219,7 +228,31 @@ public: */ static Scalar liquidDensity(Scalar temperature, Scalar pressure) { - return molarLiquidDensity_(temperature)*molarMass(); // [kg/m^3] + return liquidMolarDensity(temperature, pressure)*molarMass(); + } + + /*! + * \brief The molar density of pure mesitylene at a given pressure and temperature + * \f$\mathrm{[mol/m^3]}\f$. + * + * source : Reid et al. (1987, Modified Racket technique (chap. 3-11, eq. 3-11.9)) \cite reid1987 + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + */ + static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure) + { + using std::min; + using std::max; + temperature = min(temperature, 500.0); // regularization + temperature = max(temperature, 250.0); + + const Scalar Z_RA = 0.2556; // from equation + + using std::pow; + const Scalar expo = 1.0 + pow(1.0 - temperature/criticalTemperature(), 2.0/7.0); + Scalar V = Consts::R*criticalTemperature()/criticalPressure()*pow(Z_RA, expo); // liquid molar volume [cm^3/mol] + + return 1.0/V; // molar density [mol/m^3] } /*! @@ -347,32 +380,6 @@ public: { return 0.1351; } - -protected: - /*! - * \brief The molar density of pure mesitylene at a given pressure and temperature - * \f$\mathrm{[mol/m^3]}\f$. - * - * source : Reid et al. (1987, Modified Racket technique (chap. 3-11, eq. 3-11.9)) \cite reid1987 - * - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - */ - static Scalar molarLiquidDensity_(Scalar temperature) - { - using std::min; - using std::max; - temperature = min(temperature, 500.0); // regularization - temperature = max(temperature, 250.0); - - const Scalar Z_RA = 0.2556; // from equation - - using std::pow; - const Scalar expo = 1.0 + pow(1.0 - temperature/criticalTemperature(), 2.0/7.0); - Scalar V = Consts::R*criticalTemperature()/criticalPressure()*pow(Z_RA, expo); // liquid molar volume [cm^3/mol] - - return 1.0/V; // molar density [mol/m^3] - } - }; } // end namespace Components diff --git a/dumux/material/components/n2.hh b/dumux/material/components/n2.hh index 0df4f76e572af7661e161a6355805969c0311606..04a953e6b769f3dd3affb98243fa99ff860a731c 100644 --- a/dumux/material/components/n2.hh +++ b/dumux/material/components/n2.hh @@ -133,6 +133,16 @@ public: return IdealGas::density(molarMass(), temperature, pressure); } + /*! + * \brief The molar density of \f$N_2\f$ gas in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return IdealGas::molarDensity(temperature, pressure); } + /*! * \brief Returns true if the gas phase is assumed to be compressible */ diff --git a/dumux/material/components/nacl.hh b/dumux/material/components/nacl.hh index cb7d7d62528c013eb8e974aa39575b518f37f573..4fd0e1071d6a5a5cabbc1f12c81bec6f77ee849e 100644 --- a/dumux/material/components/nacl.hh +++ b/dumux/material/components/nacl.hh @@ -81,6 +81,14 @@ public: return 2165.0; } + /*! + * \brief The mass density \f$\mathrm{[kg/m^3]}\f$ of NaCl. + */ + static Scalar solidMolarDensity(Scalar temperature) + { + return solidDensity(temperature)/molarMass(); + } + /*! * \brief The specific heat capacity \f$\mathrm{[J/molK]}\f$ of NaCl. */ diff --git a/dumux/material/components/o2.hh b/dumux/material/components/o2.hh index 95c75bc5c650c76d8117674df9d5ed6bd0cb5bdb..6f27a752d4dfd46f3f4ffe35a58f93108eb5d92b 100644 --- a/dumux/material/components/o2.hh +++ b/dumux/material/components/o2.hh @@ -137,6 +137,15 @@ public: return IdealGas::density(molarMass(), temperature, pressure); } + /*! + * \brief The molar density of pure \f$O_2\f$ in \f$\mathrm{[mol/m^3]}\f$, + * depending on pressure and temperature. + * \param temperature The temperature of the gas + * \param pressure The pressure of the gas + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return IdealGas::molarDensity(temperature, pressure); } + /*! * \brief Returns true if the gas phase is assumed to be ideal */ diff --git a/dumux/material/components/simpleh2o.hh b/dumux/material/components/simpleh2o.hh index f01aef360df47f73b8f123558633805dc17fdadc..c6f34a39e293c7f86c1acc90082f2a792b0e07ab 100644 --- a/dumux/material/components/simpleh2o.hh +++ b/dumux/material/components/simpleh2o.hh @@ -219,9 +219,19 @@ public: static Scalar gasDensity(Scalar temperature, Scalar pressure) { // Assume an ideal gas - return molarMass()*IdealGas::molarDensity(temperature, pressure); + return IdealGas::density(molarMass(), temperature, pressure); } + /*! + * \brief The molar density of steam in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return IdealGas::molarDensity(temperature, pressure); } + /*! * \brief Returns true if the gas phase is assumed to be ideal */ @@ -251,6 +261,16 @@ public: return 1000.; } + /*! + * \brief The molar density of pure water in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure) + { return liquidDensity(temperature, pressure)/molarMass(); } + /*! * \brief The pressure of water in \f$\mathrm{[Pa]}\f$ at a given density and temperature. * diff --git a/dumux/material/components/tabulatedcomponent.hh b/dumux/material/components/tabulatedcomponent.hh index 103c82cd9df9b1296bbda816a8d8c61cbdc8f8d6..36f828245d10dd1a4ad946e979c94dd6d7e71cd7 100644 --- a/dumux/material/components/tabulatedcomponent.hh +++ b/dumux/material/components/tabulatedcomponent.hh @@ -447,6 +447,17 @@ public: return result; } + /*! + * \brief The molar density of gas in \f$\mathrm{[mol/m^3]}\f$ + * at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return gasDensity(temperature, pressure)/molarMass(); } + /*! * \brief The density of liquid at a given pressure and * temperature \f$\mathrm{[kg/m^3]}\f$. @@ -480,6 +491,17 @@ public: return result; } + /*! + * \brief The molar density of liquid in \f$\mathrm{[mol/m^3]}\f$ + * at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure) + { return liquidDensity(temperature, pressure)/molarMass(); } + /*! * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of gas. * diff --git a/dumux/material/components/trichloroethene.hh b/dumux/material/components/trichloroethene.hh index 41bd5aa1957ff4feac1b88eb1c0f8007575c6078..d1364126ec054a0c4649acd4dc006c942b7ef763 100644 --- a/dumux/material/components/trichloroethene.hh +++ b/dumux/material/components/trichloroethene.hh @@ -45,6 +45,7 @@ class Trichloroethene , public Components::Liquid<Scalar, Trichloroethene<Scalar> > , public Components::Gas<Scalar, Trichloroethene<Scalar> > { + typedef Dumux::IdealGas<Scalar> IdealGas; public: /*! @@ -130,11 +131,21 @@ public: */ static Scalar gasDensity(Scalar temperature, Scalar pressure) { - return IdealGas<Scalar>::density(molarMass(), - temperature, - pressure); + return IdealGas::density(molarMass(), + temperature, + pressure); } + /*! + * \brief The molar density of steam in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return IdealGas::molarDensity(temperature, pressure); } + /*! * \brief Returns true if the gas phase is assumed to be ideal */ @@ -152,6 +163,16 @@ public: return 1460.0; // [kg/m^3] } + /*! + * \brief The molar density of pure TCE in \f$\mathrm{[mol/m^3]}\f$ at a given pressure and temperature. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + * + */ + static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure) + { return liquidDensity(temperature, pressure)/molarMass(); } + /*! * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of pure TCE. * diff --git a/dumux/material/components/xylene.hh b/dumux/material/components/xylene.hh index aa88cc20b314fd94c66dda4d588a23433df153e2..050612a15ae64605089f3278cabe621c5875d6a9 100644 --- a/dumux/material/components/xylene.hh +++ b/dumux/material/components/xylene.hh @@ -48,6 +48,7 @@ class Xylene , public Components::Gas<Scalar, Xylene<Scalar> > { using Consts = Constants<Scalar>; + using IdealGas = Dumux::IdealGas<Scalar>; public: /*! @@ -247,9 +248,9 @@ public: */ static Scalar gasDensity(Scalar temperature, Scalar pressure) { - return IdealGas<Scalar>::density(molarMass(), - temperature, - pressure); + return IdealGas::density(molarMass(), + temperature, + pressure); } /*! @@ -258,10 +259,8 @@ public: * \param temperature temperature of component in \f$\mathrm{[K]}\f$ * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ - static Scalar molarGasDensity(Scalar temperature, Scalar pressure) - { - return (gasDensity(temperature, pressure) / molarMass()); - } + static Scalar gasMolarDensity(Scalar temperature, Scalar pressure) + { return IdealGas::molarDensity(temperature, pressure); } /*! * \brief The molar liquid density of pure xylene at a given pressure and temperature @@ -272,7 +271,7 @@ public: * \param temp temperature of component in \f$\mathrm{[K]}\f$ * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ */ - static Scalar molarLiquidDensity(Scalar temp, Scalar pressure) + static Scalar liquidMolarDensity(Scalar temp, Scalar pressure) { // saturated molar volume according to Lide, CRC Handbook of // Thermophysical and Thermochemical Data, CRC Press, 1994 @@ -299,7 +298,7 @@ public: */ static Scalar liquidDensity(Scalar temperature, Scalar pressure) { - return molarLiquidDensity(temperature, pressure)*molarMass(); // [kg/m^3] + return liquidMolarDensity(temperature, pressure)*molarMass(); } /*!