Commit 6fa64ff5 authored by Andreas Lauser's avatar Andreas Lauser
Browse files

fluid systems/components: introduce isIncompressible(phaseIdx)

it returns -- guess what? -- whether a fluid phase is assumed to be
incompressible. this method is useful e.g. for flash calculations.

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7086 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent da409b0a
......@@ -249,6 +249,18 @@ public:
47*pMPa*salinity)));
}
/*!
* \brief Returns true iff the gas phase is assumed to be incompressible
*/
static bool gasIsIncompressible()
{ return H2O::gasIsIncompressible(); }
/*!
* \brief Returns true iff the liquid phase is assumed to be incompressible
*/
static bool liquidIsIncompressible()
{ return H2O::liquidIsIncompressible(); }
/*!
* \brief The pressure of steam in \f$\mathrm{[Pa]}\f$ at a given density and temperature.
*
......
......@@ -95,6 +95,11 @@ public:
static Scalar vaporPressure(Scalar T)
{ DUNE_THROW(Dune::NotImplemented, "vaporPressure for CH4"); }
/*!
* \brief Returns true iff the gas phase is assumed to be incompressible
*/
static bool gasIsIncompressible()
{ return false; }
/*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of \f$CH_4\f$ gas at a given pressure and temperature.
......@@ -120,25 +125,6 @@ public:
return IdealGas::pressure(temperature, density/molarMass());
}
/*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of \f$CH_4\f$ gas 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 liquidDensity(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidDensity for CH4"); }
/*!
* \brief The pressure of liquid methane in \f$\mathrm{[Pa]}\f$ at a given density and
* temperature.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param density density of component in \f$\mathrm{[kg/m^3]}\f$
*/
static Scalar liquidPressure(Scalar temperature, Scalar density)
{ DUNE_THROW(Dune::NotImplemented, "liquidPressure for CH4"); }
/*!
* \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure methane gas.
*
......@@ -170,15 +156,6 @@ public:
(cpVapD/4))));
}
/*!
* \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure liquid \f$CH_4\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
*/
static Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidEnthalpy for CH4"); }
/*!
* \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure methane gas.
*
......@@ -203,15 +180,6 @@ public:
IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
}
/*!
* \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure liquid \f$CH_4\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
*/
static Scalar liquidInternalEnergy(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidInternalEnergy of CH4"); }
/*!
* \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of \f$CH_4\f$ at a given pressure and temperature.
*
......@@ -248,15 +216,6 @@ public:
// convertion from micro poise to Pa s
return mu/1e6 / 10;
}
/*!
* \brief The dynamic liquid viscosity \f$\mathrm{[Pa*s]}\f$ of pure \f$CH_4\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
*/
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidViscosity for CH4"); }
};
} // end namepace
......
......@@ -61,6 +61,18 @@ public:
Scalar pressMin, Scalar pressMax, unsigned nPress)
{ Dune::dwarn << "No init routine defined - make sure that this is not necessary!" << std::endl; }
/*!
* \brief Returns true iff the gas phase is assumed to be incompressible
*/
static bool gasIsIncompressible()
{ DUNE_THROW(Dune::NotImplemented, "Component::gasIsIncompressible()"); }
/*!
* \brief Returns true iff the liquid phase is assumed to be incompressible
*/
static bool liquidIsIncompressible()
{ DUNE_THROW(Dune::NotImplemented, "Component::liquidIsIncompressible()"); }
/*!
* \brief A human readable name for the component.
*/
......
......@@ -80,12 +80,6 @@ public:
static Scalar tripleTemperature()
{ return 14.0; /* [K] */ }
/*!
* \brief Returns the pressure \f$\mathrm{[Pa]}\f$ at molecular hydrogen's triple point.
*/
static Scalar triplePressure()
{ DUNE_THROW(Dune::NotImplemented, "triplePressure for H2"); }
/*!
* \brief The vapor pressure in \f$\mathrm{[Pa]}\f$ of pure molecular hydrogen
* at a given temperature.
......@@ -127,6 +121,12 @@ public:
return IdealGas::density(molarMass(), temperature, pressure);
}
/*!
* \brief Returns true iff the gas phase is assumed to be incompressible
*/
static bool gasIsIncompressible()
{ return false; }
/*!
* \brief The pressure of gaseous \f$H_2\f$ in \f$\mathrm{[Pa]}\f$ at a given density and temperature.
*
......@@ -170,34 +170,6 @@ public:
(cpVapD/4))));
}
/*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of liquid hydrogen 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 liquidDensity(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidDensity for H2"); }
/*!
* \brief The pressure of liquid hydrogen in \f$\mathrm{[Pa]}\f$ at a given density and
* temperature.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param density density of component in \f$\mathrm{[kg/m^3]}\f$
*/
static Scalar liquidPressure(Scalar temperature, Scalar density)
{ DUNE_THROW(Dune::NotImplemented, "liquidPressure for H2"); }
/*!
* \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure liquid \f$H_2\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
*/
static Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidEnthalpy for H2"); }
/*!
* \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of \f$H_2\f$ at a given pressure and temperature.
*
......@@ -234,15 +206,6 @@ public:
// convertion from micro poise to Pa s
return mu/1e6 / 10;
}
/*!
* \brief The dynamic liquid viscosity \f$\mathrm{[Pa*s]}\f$ of pure \f$H_2\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
*/
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidViscosity for H2"); }
};
} // end namepace
......
......@@ -241,8 +241,8 @@ public:
* 1997 for the Thermodynamic Properties of Water and Steam",
* http://www.iapws.org/relguide/IF97-Rev.pdf
*/
static const Scalar gasHeatCap_p(Scalar temperature,
Scalar pressure)
static const Scalar gasHeatCapacity(Scalar temperature,
Scalar pressure)
{
if (!Region2::isValid(temperature, pressure))
{
......@@ -276,8 +276,8 @@ public:
* 1997 for the Thermodynamic Properties of Water and Steam",
* http://www.iapws.org/relguide/IF97-Rev.pdf
*/
static const Scalar liquidHeatCap_p(Scalar temperature,
Scalar pressure)
static const Scalar liquidHeatCapacity(Scalar temperature,
Scalar pressure)
{
if (!Region1::isValid(temperature, pressure))
{
......@@ -439,8 +439,8 @@ public:
* 1997 for the Thermodynamic Properties of Water and Steam",
* http://www.iapws.org/relguide/IF97-Rev.pdf
*/
static const Scalar liquidHeatCap_v(Scalar temperature,
Scalar pressure)
static const Scalar liquidHeatCapacityConstVolume(Scalar temperature,
Scalar pressure)
{
if (!Region1::isValid(temperature, pressure))
{
......@@ -473,7 +473,7 @@ public:
* 1997 for the Thermodynamic Properties of Water and Steam",
* http://www.iapws.org/relguide/IF97-Rev.pdf
*/
static Scalar gasHeatCap_v(Scalar temperature, Scalar pressure)
static Scalar gasHeatCapacityConstVolume(Scalar temperature, Scalar pressure)
{
if (!Region2::isValid(temperature, pressure))
{
......@@ -495,6 +495,18 @@ public:
return heatCap_v_Region2_(temperature, pressure);
}
/*!
* \brief Returns true iff the gas phase is assumed to be incompressible
*/
static bool gasIsIncompressible()
{ return false; }
/*!
* \brief Returns true iff the liquid phase is assumed to be incompressible
*/
static bool liquidIsIncompressible()
{ return false; }
/*!
* \brief The density of steam in \f$\mathrm{[kg/m^3]}\f$ at a given pressure and temperature.
*
......
......@@ -124,6 +124,12 @@ public:
sigma*sigma*sigma*N4))));
}
/*!
* \brief Returns true iff the gas phase is assumed to be incompressible
*/
static bool gasIsIncompressible()
{ return false; }
/*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of \f$N_2\f$ gas at a given pressure and temperature.
*
......@@ -148,25 +154,6 @@ public:
return IdealGas::pressure(temperature, density/molarMass());
}
/*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of \f$N_2\f$ gas 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 liquidDensity(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidDensity for N2"); }
/*!
* \brief The pressure of liquid nitrogen in \f$\mathrm{[Pa]}\f$ at a given density and
* temperature.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param density density of component in \f$\mathrm{[kg/m^3]}\f$
*/
static Scalar liquidPressure(Scalar temperature, Scalar density)
{ DUNE_THROW(Dune::NotImplemented, "liquidPressure for N2"); }
/*!
* \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure nitrogen gas.
*
......@@ -198,15 +185,6 @@ public:
(cpVapD/4))));
}
/*!
* \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure liquid \f$N_2\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
*/
static Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidEnthalpy for N2"); }
/*!
* \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure nitrogen gas.
*
......@@ -229,15 +207,6 @@ public:
IdealGas::R*temperature; // = pressure * spec. volume for an ideal gas
}
/*!
* \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure liquid \f$N_2\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
*/
static Scalar liquidInternalEnergy(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidInternalEnergy of N2"); }
/*!
* \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of \f$N_2\f$ at a given pressure and temperature.
*
......@@ -274,15 +243,6 @@ public:
// convertion from micro poise to Pa s
return mu/1e6 / 10;
}
/*!
* \brief The dynamic liquid viscosity \f$\mathrm{[Pa*s]}\f$ of pure \f$N_2\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
*/
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidViscosity for N2"); }
};
} // end namepace
......
......@@ -123,6 +123,12 @@ public:
epsilon)));
}
/*!
* \brief Returns true iff the gas phase is assumed to be incompressible
*/
static bool gasIsIncompressible()
{ return false; }
/*!
* \brief The density in \f$\mathrm{[kg/m^3]}\f$ of pure \f$O_2\f$ at a given pressure and temperature.
*
......@@ -180,34 +186,6 @@ public:
(cpVapD/4))));
}
/*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of gaseous \f$O_2\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 liquidDensity(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidDensity for O2"); }
/*!
* \brief The pressure of liquid oxygen in \f$\mathrm{[Pa]}\f$ at a given density and
* temperature.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param density density of component in \f$\mathrm{[kg/m^3]}\f$
*/
static Scalar liquidPressure(Scalar temperature, Scalar density)
{ DUNE_THROW(Dune::NotImplemented, "liquidPressure for O2"); }
/*!
* \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of pure liquid \f$O_2\f$.
*
* \param temperature temperature of component
* \param pressure pressure of component
*/
static Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidEnthalpy for O2"); }
/*!
* \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of \f$O_2\f$ at a given pressure and temperature.
*
......@@ -242,16 +220,6 @@ public:
// convertion from micro poise to Pa s
return mu/1e6 / 10;
}
/*!
* \brief The dynamic liquid viscosity \f$\mathrm{[Pa*s]}\f$ of pure \f$O_2\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
*/
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidViscosity for O2"); }
};
} // end namepace
......
......@@ -49,6 +49,12 @@ public:
static const char *name()
{ return "Oil"; }
/*!
* \brief Returns true iff the liquid phase is assumed to be incompressible
*/
static bool liquidIsIncompressible()
{ return true; }
/*!
* \brief Rough estimate of the density of oil \f$\mathrm{[kg/m^3]}\f$.
*
......
......@@ -85,15 +85,6 @@ public:
static Scalar triplePressure()
{ return 5.11e5; /* [N/m^2] */ }
/*!
* \brief The vapor pressure in \f$\mathrm{[Pa]}\f$ of pure \f$CO_2\f$
* at a given temperature.
*
* \param T temperature of component in \f$\mathrm{[K]}\f$
*/
static Scalar vaporPressure(Scalar T)
{ DUNE_THROW(Dune::NotImplemented, "vaporPressure of simple CO2"); }
/*!
* \brief Specific enthalpy of gaseous \f$CO_2\f$ \f$\mathrm{[J/kg]}\f$.
*
......@@ -137,14 +128,10 @@ public:
}
/*!
* \brief Specific internal energy of liquid \f$CO_2\f$ \f$\mathrm{[J/kg]}\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
* \brief Returns true iff the gas phase is assumed to be incompressible
*/
static const Scalar liquidInternalEnergy(Scalar temperature,
Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidInternalEnergy of simple CO2"); }
static bool gasIsIncompressible()
{ return false; }
/*!
* \brief The density of \f$CO_2\f$ at a given pressure and temperature [kg/m^3].
......@@ -170,25 +157,6 @@ public:
return IdealGas::pressure(temperature, density/molarMass());
}
/*!
* \brief The density of pure \f$CO_2\f$ at a given pressure and temperature \f$\mathrm{[kg/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 liquidDensity(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidDensity of simple CO2"); }
/*!
* \brief The pressure of liquid \f$CO_2\f$ in \f$\mathrm{[Pa]}\f$ at a given density and
* temperature.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param density density of component in \f$\mathrm{[kg/m^3]}\f$
*/
static Scalar liquidPressure(Scalar temperature, Scalar density)
{ DUNE_THROW(Dune::NotImplemented, "liquidPressure for simple CO2"); }
/*!
* \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of \f$CO_2\f$ at a given pressure and temperature.
*
......@@ -223,15 +191,6 @@ public:
// convertion from micro poise to Pa s
return mu/1e6 / 10;
}
/*!
* \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of pure \f$CO_2\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
*/
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
{ DUNE_THROW(Dune::NotImplemented, "liquidViscosity of simple CO2"); }
};
} // end namepace
......
......@@ -100,29 +100,18 @@ public:
{
return 3900; // [Pa] (at 20C)
};
/*!
* \brief Specific enthalpy of TCE steam \f$\mathrm{[J/kg]}\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
* \brief Returns true iff the gas phase is assumed to be incompressible
*/
static const Scalar gasEnthalpy(Scalar temperature,
Scalar pressure)
{
DUNE_THROW(Dune::NotImplemented, "gasEnthalpy for TCE");
};
static bool gasIsIncompressible()
{ return false; }
/*!
* \brief Specific enthalpy of liquid TCE \f$\mathrm{[J/kg]}\f$.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
* \brief Returns true iff the liquid phase is assumed to be incompressible
*/
static const Scalar liquidEnthalpy(Scalar temperature,
Scalar pressure)
{
DUNE_THROW(Dune::NotImplemented, "liquidEnthalpy for TCE");
};
static bool liquidIsIncompressible()
{ return true; }
/*!
* \brief The density of steam at a given pressure and temperature \f$\mathrm{[kg/m^3]}\f$.
......@@ -148,18 +137,6 @@ public:
return 1460.0; // [kg/m^3]
}
/*!
* \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of steam.
*
* \param temperature temperature of component in \f$\mathrm{[K]}\f$
* \param pressure pressure of component in \f$\mathrm{[Pa]}\f$
* \param regularize defines, if the functions is regularized or not, set to true by default
*/
static Scalar gasViscosity(Scalar temperature, Scalar pressure, bool regularize=true)
{
DUNE_THROW(Dune::NotImplemented, "gasViscosity for TCE");
};
/*!
* \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of pure TCE.
*
......
......@@ -182,6 +182,18 @@ public:
liquidEnthalpy(temperature, pressure) -
pressure/liquidDensity(temperature, pressure); }
/*!
* \brief Returns true iff the gas phase is assumed to be incompressible
*/
static bool gasIsIncompressible()
{ return false; }
/*!
* \brief Returns true iff the liquid phase is assumed to be incompressible
*/
static bool liquidIsIncompressible()
{ return true; }
/*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of steam at a given pressure and temperature.
*
......
......@@ -349,6 +349,18 @@ public:
return result;
};
/*!
* \brief Returns true iff the gas phase is assumed to be incompressible
*/
static bool gasIsIncompressible()
{ return RawComponent::gasIsIncompressible(); }
/*!
* \brief Returns true iff the liquid phase is assumed to be incompressible
*/
static bool liquidIsIncompressible()
{ return RawComponent::liquidIsIncompressible(); }
/*!
* \brief The density of gas at a given pressure and temperature
* \f$\mathrm{[kg/m^3]}\f$.
......
......@@ -49,6 +49,12 @@ public:
static const char *name()
{ return "Unit"; }
/*!
* \brief Returns true iff the liquid phase is assumed to be incompressible
*/
static bool liquidIsIncompressible()
{ return true; }
/*!
* \brief Rough estimate of the density of water \f$\mathrm{[kg/m^3]}\f$.
*
......
......@@ -81,6 +81,23 @@ public:
return Fluid::isLiquid();
}
/*!
* \brief Returns true if and only if a fluid phase is assumed to
* be incompressible.
*
* Incompressible means that the partial derivative of the density
* to the fluid pressure is equivalent to zero.
*
* \param phaseIdx The index of the fluid phase to consider