Commit 186c710f authored by Timo Koch's avatar Timo Koch
Browse files

[components] Make molar mass constexpr where possible

parent dc49fcaf
......@@ -58,7 +58,7 @@ public:
*
* Taken from constrelair.hh.
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{ return 0.02896; /* [kg/mol] */ }
/*!
......
......@@ -56,7 +56,7 @@ public:
/*!
* \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of benzene
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{ return 0.07811; }
/*!
......
......@@ -71,7 +71,7 @@ public:
*\param salinity The mass fraction of salt in brine
* This assumes that the salt is pure NaCl.
*/
static Scalar molarMass(Scalar salinity = constantSalinity)
static constexpr Scalar molarMass(Scalar salinity = constantSalinity)
{
const Scalar M1 = H2O::molarMass();
const Scalar M2 = Components::NaCl<Scalar>::molarMass(); // molar mass of NaCl [kg/mol]
......
......@@ -56,7 +56,7 @@ public:
/*!
* \brief The molar mass of CaOH2 in \f$\mathrm{[kg/mol]}\f$.
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{
return 56.0774e-3;
}
......
......@@ -57,7 +57,7 @@ public:
/*!
* \brief The molar mass of CaOH2 in \f$\mathrm{[kg/mol]}\f$.
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{
return 74.093e-3 ;
}
......
......@@ -56,7 +56,7 @@ public:
/*!
* \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of molecular methane.
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{ return 16.043e-3; /* [kg/mol] */}
/*!
......
......@@ -68,7 +68,7 @@ public:
/*!
* \brief The mass in \f$\mathrm{[kg/mol]}\f$ of one mole of CO2.
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{ return 44e-3; /* [kg/mol] */ }
/*!
......
......@@ -61,7 +61,7 @@ public:
/*!
* \brief The molar mass of Siliciumoxide which is 70 % of granite in \f$\mathrm{[kg/mol]}\f$.
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{
return 60.08e-3;
}
......
......@@ -57,7 +57,7 @@ public:
/*!
* \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of molecular hydrogen.
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{ return 2.01588e-3; }
/*!
......
......@@ -57,7 +57,7 @@ public:
/*!
* \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of molecular nitrogen.
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{ return 28.0134e-3;}
/*!
......
......@@ -57,7 +57,7 @@ public:
/*!
* \brief The molar mass of NaCl in \f$\mathrm{[kg/mol]}\f$.
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{
return 58.4428e-3 ;
}
......
......@@ -63,7 +63,7 @@ public:
/*!
* \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of water.
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{ return 18e-3; }
/*!
......
......@@ -158,7 +158,7 @@ public:
/*!
* \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of the component.
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{ return RawComponent::molarMass(); }
/*!
......
......@@ -57,7 +57,7 @@ public:
/*!
* \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of TCE.
*/
static Scalar molarMass()
static constexpr Scalar molarMass()
{
return 131.39e-3; // [kg/mol]
}
......
Supports Markdown
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