Commit cd8191fb authored by Bernd Flemisch's avatar Bernd Flemisch Committed by Kilian Weishaupt
Browse files

harmonize phase names

Implement decision made in !1137:
- 1p gas: `gas`
- 1p liquid: `liq`
- 2p gas/liquid: `gas` and `liq`
- 2p liquid/liquid: `aq` and `napl`
- 3p: `gas`, `aq` and `napl`
- solid: `s`

Add `IsAqueous` to components to detect if a component is aqueous or not.
Adapt reference solutions.
Adjust `primaryVariableName` only where necessary to make the tests pass.
Will be treated in general in !1212.
parent cc366999
......@@ -39,6 +39,9 @@
namespace Dumux {
namespace Components {
template <class Component>
struct IsAqueous : public std::false_type {};
template <class ScalarType, class Component>
class Base
{
......
......@@ -426,6 +426,9 @@ public:
{ return H2O::liquidThermalConductivity(temperature, pressure); }
};
template <class Scalar, class H2O>
struct IsAqueous<Brine<Scalar, H2O>> : public std::true_type {};
/*!
* \brief Default value for the salinity of the brine (dimensionless).
*/
......
......@@ -915,6 +915,9 @@ private:
}
}; // end class
template <class Scalar>
struct IsAqueous<H2O<Scalar>> : public std::true_type {};
} // end namespace Components
} // end namespace Dumux
......
......@@ -359,6 +359,9 @@ public:
};
template <class Scalar>
struct IsAqueous<SimpleH2O<Scalar>> : public std::true_type {};
template <class Scalar>
const Scalar Components::SimpleH2O<Scalar>::R = Constants<Scalar>::R / 18e-3;
......
......@@ -1061,6 +1061,9 @@ typename RawComponent::Scalar TabulatedComponent<RawComponent, useVaporPressure>
template <class RawComponent, bool useVaporPressure>
unsigned TabulatedComponent<RawComponent, useVaporPressure>::nDensity_;
template <class RawComponent, bool useVaporPressure>
struct IsAqueous<TabulatedComponent<RawComponent, useVaporPressure>> : public IsAqueous<RawComponent> {};
} // end namespace Components
} // end namespace Dumux
......
......@@ -73,7 +73,7 @@ public:
* \param phaseIdx The index of the fluid phase to consider
*/
static std::string phaseName(int phaseIdx = 0)
{ return Component::name(); }
{ return "gas"; }
/*!
* \brief A human readable name for the component.
......
......@@ -73,7 +73,7 @@ public:
* \param phaseIdx The index of the fluid phase to consider
*/
static std::string phaseName(int phaseIdx = 0)
{ return Component::name(); }
{ return "liq"; }
/*!
* \brief A human readable name for the component.
......
......@@ -68,8 +68,8 @@ public:
static std::string phaseName(int phaseIdx)
{
static std::string name[] = {
std::string("liquid"),
std::string("vapor"),
std::string("liq"),
std::string("gas"),
};
assert(0 <= phaseIdx && phaseIdx < numPhases);
......
......@@ -32,6 +32,7 @@
#include <dumux/material/fluidsystems/1pliquid.hh>
#include <dumux/material/fluidsystems/1pgas.hh>
#include <dumux/material/fluidstates/immiscible.hh>
#include <dumux/material/components/base.hh>
#include "base.hh"
......@@ -85,10 +86,20 @@ public:
{
assert(0 <= phaseIdx && phaseIdx < numPhases);
if (phaseIdx == phase0Idx)
return Fluid0::isGas() ? "gas"+Fluid0::phaseName() : "liq"+Fluid0::phaseName();
if (!Fluid0::isGas() && !Fluid1::isGas())
{
if (phaseIdx == phase0Idx)
return Components::IsAqueous<typename Fluid0::Component>::value ? "aq" : "napl";
else
return Components::IsAqueous<typename Fluid1::Component>::value ? "aq" : "napl";
}
else
return Fluid1::isGas() ? "gas"+Fluid1::phaseName() : "liq"+Fluid1::phaseName();
{
if (phaseIdx == phase0Idx)
return Fluid0::isGas() ? "gas" : "liq";
else
return Fluid1::isGas() ? "gas" : "liq";
}
}
/*!
......
......@@ -33,6 +33,7 @@
#include <dumux/material/fluidsystems/1pliquid.hh>
#include <dumux/material/fluidsystems/1pgas.hh>
#include <dumux/material/fluidstates/immiscible.hh>
#include <dumux/material/components/base.hh>
namespace Dumux {
namespace FluidSystems {
......@@ -91,9 +92,11 @@ public:
assert(0 <= phaseIdx && phaseIdx < numPhases);
switch (phaseIdx)
{
case wPhaseIdx: return WettingFluid::phaseName();
case nPhaseIdx: return NonwettingFluid::phaseName();
case gPhaseIdx: return Gas::phaseName();
case wPhaseIdx: return Components::IsAqueous<typename WettingFluid::Component>::value
? "aq" : "napl";
case nPhaseIdx: return Components::IsAqueous<typename NonwettingFluid::Component>::value
? "aq" : "napl";
case gPhaseIdx: return "gas";
}
DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
}
......
......@@ -69,7 +69,7 @@ public:
static const std::string phaseName(int phaseIdx = liquidPhaseIdx)
{
assert(phaseIdx == liquidPhaseIdx);
return "Brine";
return "liq";
}
/*!
......
......@@ -148,8 +148,8 @@ public:
assert(0 <= phaseIdx && phaseIdx < numPhases);
switch (phaseIdx)
{
case liquidPhaseIdx: return Brine::phaseName(Brine::liquidPhaseIdx);
case gasPhaseIdx: return Air::name();
case liquidPhaseIdx: return "liq";
case gasPhaseIdx: return "gas";
}
DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
}
......
......@@ -104,8 +104,8 @@ public:
assert(0 <= phaseIdx && phaseIdx < numPhases);
switch (phaseIdx)
{
case liquidPhaseIdx: return "Water";
case gasPhaseIdx: return Air::name();
case liquidPhaseIdx: return "liq";
case gasPhaseIdx: return "gas";
}
DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
}
......
......@@ -197,9 +197,9 @@ public:
assert(0 <= phaseIdx && phaseIdx < numPhases);
switch (phaseIdx)
{
case wPhaseIdx: return "Water";
case nPhaseIdx: return "NAPL";
case gPhaseIdx: return Air::name();
case wPhaseIdx: return "aq";
case nPhaseIdx: return "napl";
case gPhaseIdx: return "gas";
}
DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
}
......
......@@ -198,9 +198,9 @@ public:
assert(0 <= phaseIdx && phaseIdx < numPhases);
switch (phaseIdx)
{
case wPhaseIdx: return "Water";
case nPhaseIdx: return "NAPL";
case gPhaseIdx: return Air::name();
case wPhaseIdx: return "aq";
case nPhaseIdx: return "napl";
case gPhaseIdx: return "gas";
}
DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
}
......
......@@ -187,9 +187,9 @@ public:
assert(0 <= phaseIdx && phaseIdx < numPhases);
switch (phaseIdx)
{
case wPhaseIdx: return "Water";
case nPhaseIdx: return "NAPL";
case gPhaseIdx: return "Gas";
case wPhaseIdx: return "aq";
case nPhaseIdx: return "napl";
case gPhaseIdx: return "gas";
}
DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
}
......
......@@ -105,8 +105,8 @@ public:
assert(0 <= phaseIdx && phaseIdx < numPhases);
switch (phaseIdx)
{
case liquidPhaseIdx: return "Water";
case gasPhaseIdx: return "Nitrogen";
case liquidPhaseIdx: return "liq";
case gasPhaseIdx: return "gas";
}
DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
}
......
......@@ -124,8 +124,8 @@ public:
assert(0 <= phaseIdx && phaseIdx < numPhases);
switch (phaseIdx)
{
case liquidPhaseIdx: return "Water";
case gasPhaseIdx: return "Nitrogen";
case liquidPhaseIdx: return "liq";
case gasPhaseIdx: return "gas";
}
DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
}
......
......@@ -75,7 +75,7 @@ public:
* \param phaseIdx The index of the fluid phase to consider
*/
static std::string phaseName(int phaseIdx = 0)
{ return MainComponent::name(); }
{ return "liq"; }
/*!
* \brief Returns whether the fluids are miscible
......
......@@ -89,9 +89,9 @@ public:
assert(0 <= phaseIdx && phaseIdx < numPhases);
switch (phaseIdx)
{
case gPhaseIdx: return "Gas";
case wPhaseIdx: return "Water";
case oPhaseIdx: return "Oil";
case gPhaseIdx: return "gas";
case wPhaseIdx: return "aq";
case oPhaseIdx: return "napl";
}
DUNE_THROW(Dune::InvalidStateException, "Invalid phase index " << phaseIdx);
}
......
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