Skip to content
Snippets Groups Projects
Commit 5d1dbf06 authored by Timo Koch's avatar Timo Koch
Browse files

[liquid2c] Add molar density. Remove compIdx default.

parent 32093b15
No related branches found
No related tags found
2 merge requests!617[WIP] Next,!360Improve Richards model - Add RichardsNC model
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
* *
* \param compIdx The index of the component to consider * \param compIdx The index of the component to consider
*/ */
static std::string componentName(int compIdx = 0) static std::string componentName(int compIdx)
{ return compIdx ? SecondComponent::name() : MainComponent::name(); } { return compIdx ? SecondComponent::name() : MainComponent::name(); }
/*! /*!
...@@ -129,7 +129,7 @@ public: ...@@ -129,7 +129,7 @@ public:
/*! /*!
* \brief The mass in \f$\mathrm{[kg]}\f$ of one mole of the component. * \brief The mass in \f$\mathrm{[kg]}\f$ of one mole of the component.
*/ */
static Scalar molarMass(int compIdx = 0) static Scalar molarMass(int compIdx)
{ return compIdx ? SecondComponent::molarMass() : MainComponent::molarMass(); } { return compIdx ? SecondComponent::molarMass() : MainComponent::molarMass(); }
/*! /*!
...@@ -164,18 +164,18 @@ public: ...@@ -164,18 +164,18 @@ public:
{ return MainComponent::vaporPressure(T); } { return MainComponent::vaporPressure(T); }
/*! /*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of the component at a given pressure and temperature. * \brief The density \f$\mathrm{[kg/m^3]}\f$ of the phase at a given pressure and temperature.
*/ */
static Scalar density(Scalar temperature, Scalar pressure) static Scalar density(Scalar temperature, Scalar pressure)
{ return MainComponent::liquidDensity(temperature, pressure); } { return MainComponent::liquidDensity(temperature, pressure); }
using Base::density; using Base::density;
/*! /*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of the component at a given pressure and temperature. * \brief The density \f$\mathrm{[kg/m^3]}\f$ of the phase at a given pressure and temperature.
*/ */
template <class FluidState> template <class FluidState>
static Scalar density(const FluidState &fluidState, static Scalar density(const FluidState &fluidState,
const int phaseIdx) const int phaseIdx = 0)
{ {
const Scalar T = fluidState.temperature(phaseIdx); const Scalar T = fluidState.temperature(phaseIdx);
const Scalar p = fluidState.pressure(phaseIdx); const Scalar p = fluidState.pressure(phaseIdx);
...@@ -191,6 +191,14 @@ public: ...@@ -191,6 +191,14 @@ public:
+ SecondComponent::molarMass()*fluidState.moleFraction(wPhaseIdx, secondCompIdx)); + SecondComponent::molarMass()*fluidState.moleFraction(wPhaseIdx, secondCompIdx));
} }
/*!
* \brief The molar density \f$\mathrm{[mol/m^3]}\f$ of the phase at a given pressure and temperature.
*/
template <class FluidState>
static Scalar molarDensity(const FluidState &fluidState,
const int phaseIdx = 0)
{ return fluidState.molarDensity(phaseIdx); }
/*! /*!
* \brief The pressure \f$\mathrm{[Pa]}\f$ of the component at a given density and temperature. * \brief The pressure \f$\mathrm{[Pa]}\f$ of the component at a given density and temperature.
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment