From 947cacb5c1791c050c094953942181e5fd97eaec Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Tue, 27 Feb 2018 14:49:54 +0100 Subject: [PATCH] [component] Split interface into base, solid, liquid, gas Deprecate old Component base class --- dumux/material/components/base.hh | 108 ++++++++++++ dumux/material/components/component.hh | 223 ++----------------------- dumux/material/components/gas.hh | 117 +++++++++++++ dumux/material/components/liquid.hh | 110 ++++++++++++ dumux/material/components/solid.hh | 95 +++++++++++ 5 files changed, 445 insertions(+), 208 deletions(-) create mode 100644 dumux/material/components/base.hh create mode 100644 dumux/material/components/gas.hh create mode 100644 dumux/material/components/liquid.hh create mode 100644 dumux/material/components/solid.hh diff --git a/dumux/material/components/base.hh b/dumux/material/components/base.hh new file mode 100644 index 0000000000..9b48e4feaa --- /dev/null +++ b/dumux/material/components/base.hh @@ -0,0 +1,108 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ + +/*! + * \file + * \ingroup Components + * \brief Base class for all components + * Components provide the thermodynamic relations for the liquid, + * gaseous and/or solid state of a single + * chemical species or a _fixed_ mixture of species. + * Fluid systems use components to compute thermodynamic quantities of phases. + */ +#ifndef DUMUX_COMPONENT_BASE_HH +#define DUMUX_COMPONENT_BASE_HH + +namespace Dumux { +namespace Components { + +template <class Scalar, class Implementation> +class Base +{ +public: + static const bool isTabulated = false; + + /*! + * \brief A default routine for initialization, not needed for components and must not be called. + * + * \param tempMin The minimum of the temperature range in \f$\mathrm{[K]}\f$ + * \param tempMax The maximum of the temperature range in \f$\mathrm{[K]}\f$ + * \param nTemp The number of entries/steps within the temperature range + * \param pressMin The minimum of the pressure range in \f$\mathrm{[Pa]}\f$ + * \param pressMax The maximum of the pressure range in \f$\mathrm{[Pa]}\f$ + * \param nPress The number of entries/steps within the pressure range + * + * This function throws a warning when called: "No init routine defined - make sure that this is not necessary!" + */ + static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, + Scalar pressMin, Scalar pressMax, unsigned nPress) + { Dune::dwarn << "No init routine defined - make sure that this is not necessary!" << std::endl; } + + /*! + * \brief A human readable name for the component. + * \note Mandatory for all components + */ + static std::string name() + { return Implementation::name(); } + + /*! + * \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of the component. + */ + static Scalar molarMass() + { DUNE_THROW(Dune::NotImplemented, "Component::molarMass()"); } + + /*! + * \brief Returns the critical temperature in \f$\mathrm{[K]}\f$ of the component. + */ + static Scalar criticalTemperature() + { DUNE_THROW(Dune::NotImplemented, "Component::criticalTemperature()"); } + + /*! + * \brief Returns the critical pressure in \f$\mathrm{[Pa]}\f$ of the component. + */ + static Scalar criticalPressure() + { DUNE_THROW(Dune::NotImplemented, "Component::criticalPressure()"); } + + /*! + * \brief Returns the temperature in \f$\mathrm{[K]}\f$ at the component's triple point. + */ + static Scalar tripleTemperature() + { DUNE_THROW(Dune::NotImplemented, "Component::tripleTemperature()"); } + + /*! + * \brief Returns the pressure in \f$\mathrm{[Pa]}\f$ at the component's triple point. + */ + static Scalar triplePressure() + { DUNE_THROW(Dune::NotImplemented, "Component::triplePressure()"); } + + /*! + * \brief The vapor pressure in \f$\mathrm{[Pa]}\f$ of the component at a given + * temperature in \f$\mathrm{[K]}\f$. + * + * \param T temperature of the component in \f$\mathrm{[K]}\f$ + */ + static Scalar vaporPressure(Scalar T) + { DUNE_THROW(Dune::NotImplemented, "Component::vaporPressure()"); } + +}; + +} // end namespace Components +} // end namespace Dumux + +#endif diff --git a/dumux/material/components/component.hh b/dumux/material/components/component.hh index a8e9a82bb4..8a4437eb57 100644 --- a/dumux/material/components/component.hh +++ b/dumux/material/components/component.hh @@ -25,10 +25,14 @@ #ifndef DUMUX_COMPONENT_HH #define DUMUX_COMPONENT_HH +#warning "This header is deprecated. Use base.hh/solid.hh/liquid.hh/gas.hh" #include <dune/common/stdstreams.hh> +#include <dumux/material/components/base.hh> +#include <dumux/material/components/liquid.hh> +#include <dumux/material/components/gas.hh> +#include <dumux/material/components/solid.hh> -namespace Dumux -{ +namespace Dumux { /*! * \ingroup Components @@ -37,211 +41,14 @@ namespace Dumux * \tparam Scalar The type used for scalar values * \tparam Implementation Necessary for static polymorphism */ -template <class Scalar, class Implementation> -class Component -{ -public: - static const bool isTabulated = false; - - /*! - * \brief A default routine for initialization, not needed for components and must not be called. - * - * \param tempMin The minimum of the temperature range in \f$\mathrm{[K]}\f$ - * \param tempMax The maximum of the temperature range in \f$\mathrm{[K]}\f$ - * \param nTemp The number of entries/steps within the temperature range - * \param pressMin The minimum of the pressure range in \f$\mathrm{[Pa]}\f$ - * \param pressMax The maximum of the pressure range in \f$\mathrm{[Pa]}\f$ - * \param nPress The number of entries/steps within the pressure range - * - * This function throws a warning when called: "No init routine defined - make sure that this is not necessary!" - */ - static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, - Scalar pressMin, Scalar pressMax, unsigned nPress) - { Dune::dwarn << "No init routine defined - make sure that this is not necessary!" << std::endl; } - - /*! - * \brief Returns true if the gas phase is assumed to be compressible - */ - static constexpr bool gasIsCompressible() - { return Implementation::gasIsCompressible(); } - - /*! - * \brief Returns true if the gas phase viscostiy is constant - */ - static constexpr bool gasViscosityIsConstant() - { return Implementation::gasViscosityIsConstant(); } - - /*! - * \brief Returns true if the gas phase is assumed to be ideal - */ - static constexpr bool gasIsIdeal() - { return Implementation::gasIsCompressible(); } - - /*! - * \brief Returns true if the liquid phase is assumed to be compressible - */ - static constexpr bool liquidIsCompressible() - { return Implementation::liquidIsCompressible(); } - - /*! - * \brief Returns true if the liquid phase viscostiy is constant - */ - static constexpr bool liquidViscosityIsConstant() - { return Implementation::liquidViscosityIsConstant(); } - - /*! - * \brief A human readable name for the component. - */ - static std::string name() - { DUNE_THROW(Dune::NotImplemented, "Component::name()"); } - - /*! - * \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of the component. - */ - static Scalar molarMass() - { DUNE_THROW(Dune::NotImplemented, "Component::molarMass()"); } - - /*! - * \brief Returns the critical temperature in \f$\mathrm{[K]}\f$ of the component. - */ - static Scalar criticalTemperature() - { DUNE_THROW(Dune::NotImplemented, "Component::criticalTemperature()"); } - - /*! - * \brief Returns the critical pressure in \f$\mathrm{[Pa]}\f$ of the component. - */ - static Scalar criticalPressure() - { DUNE_THROW(Dune::NotImplemented, "Component::criticalPressure()"); } - - /*! - * \brief Returns the temperature in \f$\mathrm{[K]}\f$ at the component's triple point. - */ - static Scalar tripleTemperature() - { DUNE_THROW(Dune::NotImplemented, "Component::tripleTemperature()"); } - - /*! - * \brief Returns the pressure in \f$\mathrm{[Pa]}\f$ at the component's triple point. - */ - static Scalar triplePressure() - { DUNE_THROW(Dune::NotImplemented, "Component::triplePressure()"); } - - /*! - * \brief The vapor pressure in \f$\mathrm{[Pa]}\f$ of the component at a given - * temperature in \f$\mathrm{[K]}\f$. - * - * \param T temperature of the component in \f$\mathrm{[K]}\f$ - */ - static Scalar vaporPressure(Scalar T) - { DUNE_THROW(Dune::NotImplemented, "Component::vaporPressure()"); } - - /*! - * \brief The density in \f$\mathrm{[kg/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$ - */ - static Scalar gasDensity(Scalar temperature, Scalar pressure) - { DUNE_THROW(Dune::NotImplemented, "Component::gasDensity()"); } - - /*! - * \brief The density \f$\mathrm{[kg/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$ - */ - static Scalar liquidDensity(Scalar temperature, Scalar pressure) - { DUNE_THROW(Dune::NotImplemented, "Component::liquidDensity()"); } - - /*! - * \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of the pure component in gas. - * - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ - */ - static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure) - { DUNE_THROW(Dune::NotImplemented, "Component::gasEnthalpy()"); } - - /*! - * \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of the pure component in liquid. - * - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ - */ - static const Scalar liquidEnthalpy(Scalar temperature, Scalar pressure) - { DUNE_THROW(Dune::NotImplemented, "Component::liquidEnthalpy()"); } - - /*! - * \brief Specific internal energy \f$\mathrm{[J/kg]}\f$ of the pure component in gas. - * - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ - */ - static const Scalar gasInternalEnergy(Scalar temperature, Scalar pressure) - { DUNE_THROW(Dune::NotImplemented, "Component::gasInternalEnergy()"); } - - /*! - * \brief Specific internal energy \f$\mathrm{[J/kg]}\f$ of pure the pure component in liquid. - * - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ - */ - static const Scalar liquidInternalEnergy(Scalar temperature, Scalar pressure) - { DUNE_THROW(Dune::NotImplemented, "Component::liquidInternalEnergy()"); } - - /*! - * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of the pure 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$ - */ - static Scalar gasViscosity(Scalar temperature, Scalar pressure) - { DUNE_THROW(Dune::NotImplemented, "Component::gasViscosity()"); } - - /*! - * \brief The dynamic liquid viscosity \f$\mathrm{[Pa*s]}\f$ of the pure component. - * - * \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, "Component::liquidViscosity()"); } - - /*! - * \brief Thermal conductivity of the component \f$\mathrm{[W/(m*K)]}\f$ as a gas. - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ - */ - static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure) - { DUNE_THROW(Dune::NotImplemented, "Component::gasThermalConductivity()"); } - - /*! - * \brief Thermal conductivity of the component \f$\mathrm{[W/(m*K)]}\f$ as a liquid. - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ - */ - static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure) - { DUNE_THROW(Dune::NotImplemented, "Component::liquidThermalConductivity()"); } - - /*! - * \brief Specific isobaric heat capacity of the component \f$\mathrm{[J/(kg*K)]}\f$ as a gas. - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ - */ - static Scalar gasHeatCapacity(Scalar temperature, Scalar pressure) - { DUNE_THROW(Dune::NotImplemented, "Component::gasHeatCapacity()"); } - - /*! - * \brief Specific isobaric heat capacity of the component \f$\mathrm{[J/(kg*K)]}\f$ as a liquid. - * \param temperature temperature of component in \f$\mathrm{[K]}\f$ - * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ - */ - static Scalar liquidHeatCapacity(Scalar temperature, Scalar pressure) - { DUNE_THROW(Dune::NotImplemented, "Component::liquidHeatCapacity()"); } -}; - -} // end namespace +template <class Scalar, class C> +class DUNE_DEPRECATED_MSG("Derive from Base and Liquid and/or Gas and/or Solid directly") Component +: public Components::Base<Scalar, C> +, public Components::Liquid<Scalar, C> +, public Components::Gas<Scalar, C> +, public Components::Solid<Scalar, C> +{ }; + +} // end namespace Dumux #endif diff --git a/dumux/material/components/gas.hh b/dumux/material/components/gas.hh new file mode 100644 index 0000000000..40d562247b --- /dev/null +++ b/dumux/material/components/gas.hh @@ -0,0 +1,117 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ + +/*! + * \file + * \ingroup Components + * \brief Interface for components that have a gas state + */ +#ifndef DUMUX_COMPONENT_GAS_HH +#define DUMUX_COMPONENT_GAS_HH + +namespace Dumux { +namespace Components { + +template<class Scalar, class Component> +class Gas +{ + /*! + * \brief the component has a gas state if it derives from Gas + */ + static constexpr bool hasGasState() + { return true; } + + /*! + * \brief Returns true if the gas phase is assumed to be compressible + */ + static constexpr bool gasIsCompressible() + { return Component::gasIsCompressible(); } + + /*! + * \brief Returns true if the gas phase viscostiy is constant + */ + static constexpr bool gasViscosityIsConstant() + { return Component::gasViscosityIsConstant(); } + + /*! + * \brief Returns true if the gas phase is assumed to be ideal + */ + static constexpr bool gasIsIdeal() + { return Component::gasIsCompressible(); } + + /*! + * \brief The density in \f$\mathrm{[kg/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$ + */ + static Scalar gasDensity(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::gasDensity()"); } + + /*! + * \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of the pure component in gas. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::gasEnthalpy()"); } + + /*! + * \brief Specific internal energy \f$\mathrm{[J/kg]}\f$ of the pure component in gas. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static const Scalar gasInternalEnergy(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::gasInternalEnergy()"); } + + /*! + * \brief The dynamic viscosity \f$\mathrm{[Pa*s]}\f$ of the pure 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$ + */ + static Scalar gasViscosity(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::gasViscosity()"); } + + /*! + * \brief Thermal conductivity of the component \f$\mathrm{[W/(m*K)]}\f$ as a gas. + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::gasThermalConductivity()"); } + + /*! + * \brief Specific isobaric heat capacity of the component \f$\mathrm{[J/(kg*K)]}\f$ as a gas. + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static Scalar gasHeatCapacity(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::gasHeatCapacity()"); } + +}; + +} // end namespace Components +} // end namespace Dumux + +#endif diff --git a/dumux/material/components/liquid.hh b/dumux/material/components/liquid.hh new file mode 100644 index 0000000000..47c756d2fb --- /dev/null +++ b/dumux/material/components/liquid.hh @@ -0,0 +1,110 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ + +/*! + * \file + * \ingroup Components + * \brief Interface for components that have a liquid state + */ +#ifndef DUMUX_COMPONENT_LIQUID_HH +#define DUMUX_COMPONENT_LIQUID_HH + +namespace Dumux { +namespace Components { + +template<class Scalar, class Component> +class Liquid +{ +public: + /*! + * \brief the component has a liquid state if it derives from Liquid + */ + static constexpr bool hasLiquidState() + { return true; } + + /*! + * \brief Returns true if the liquid phase is assumed to be compressible + */ + static constexpr bool liquidIsCompressible() + { return Component::liquidIsCompressible(); } + + /*! + * \brief Returns true if the liquid phase viscostiy is constant + */ + static constexpr bool liquidViscosityIsConstant() + { return Component::liquidViscosityIsConstant(); } + + /*! + * \brief The density \f$\mathrm{[kg/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$ + */ + static Scalar liquidDensity(Scalar temperature, Scalar pressure) + { return Component::liquidDensity(temperature, pressure); } + + /*! + * \brief The dynamic liquid viscosity \f$\mathrm{[Pa*s]}\f$ of the pure component. + * + * \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) + { return Component::liquidViscosity(temperature, pressure); } + + /*! + * \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of the pure component in liquid. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static const Scalar liquidEnthalpy(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::liquidEnthalpy()"); } + + /*! + * \brief Specific internal energy \f$\mathrm{[J/kg]}\f$ of pure the pure component in liquid. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static const Scalar liquidInternalEnergy(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::liquidInternalEnergy()"); } + + /*! + * \brief Thermal conductivity of the component \f$\mathrm{[W/(m*K)]}\f$ as a liquid. + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::liquidThermalConductivity()"); } + + /*! + * \brief Specific isobaric heat capacity of the component \f$\mathrm{[J/(kg*K)]}\f$ as a liquid. + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static Scalar liquidHeatCapacity(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::liquidHeatCapacity()"); } +}; + +} // end namespace Components +} // end namespace Dumux + +#endif diff --git a/dumux/material/components/solid.hh b/dumux/material/components/solid.hh new file mode 100644 index 0000000000..e981ab55d4 --- /dev/null +++ b/dumux/material/components/solid.hh @@ -0,0 +1,95 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ + +/*! + * \file + * \ingroup Components + * \brief Interface for components that have a solid state + */ +#ifndef DUMUX_COMPONENT_SOLID_HH +#define DUMUX_COMPONENT_SOLID_HH + +namespace Dumux { +namespace Components { + +template<class Scalar, class Component> +class Solid +{ + /*! + * \brief the component has a solid state if it derives from Solid + */ + static constexpr bool hasSolidState() + { return true; } + + /*! + * \brief Returns true if the solid phase is assumed to be compressible + */ + static constexpr bool solidIsCompressible() + { return Component::solidIsCompressible(); } + + /*! + * \brief The density in \f$\mathrm{[kg/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$ + */ + static Scalar solidDensity(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::solidDensity()"); } + + /*! + * \brief Specific enthalpy \f$\mathrm{[J/kg]}\f$ of the pure component in solid. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static const Scalar solidEnthalpy(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::solidEnthalpy()"); } + + /*! + * \brief Specific internal energy \f$\mathrm{[J/kg]}\f$ of the pure component in solid. + * + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static const Scalar solidInternalEnergy(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::solidInternalEnergy()"); } + + /*! + * \brief Thermal conductivity of the component \f$\mathrm{[W/(m*K)]}\f$ as a solid. + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static Scalar solidThermalConductivity(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::solidThermalConductivity()"); } + + /*! + * \brief Specific isobaric heat capacity of the component \f$\mathrm{[J/(kg*K)]}\f$ as a solid. + * \param temperature temperature of component in \f$\mathrm{[K]}\f$ + * \param pressure pressure of component in \f$\mathrm{[Pa]}\f$ + */ + static Scalar solidHeatCapacity(Scalar temperature, Scalar pressure) + { DUNE_THROW(Dune::NotImplemented, "Component::solidHeatCapacity()"); } + +}; + +} // end namespace Components +} // end namespace Dumux + +#endif -- GitLab