Commit d9807927 authored by Timo Koch's avatar Timo Koch
Browse files

[solidsystem] Implement one component solid system

parent 2242602f
// -*- 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 3 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 SolidSystems
* \brief The simplest solid phase consisting of a single solid component.
*/
#ifndef DUMUX_SOLIDSYSTEMS_SOLID_PHASE_HH
#define DUMUX_SOLIDSYSTEMS_SOLID_PHASE_HH
#include <string>
#include <dune/common/exceptions.hh>
namespace Dumux {
namespace SolidSystems {
/*!
* \ingroup SolidSystems
* \brief The simplest solid phase consisting of a single solid component.
* \note A solid is considered inert if it can't dissolve in a liquid and
* and can't increase its mass by precipitation from a fluid phase.
*/
template <class Scalar, class ComponentT, bool isInertComp = true>
class OneCSolid
{
public:
using Component = ComponentT;
/****************************************
* Solid phase related static parameters
****************************************/
static constexpr int numComponents = 1;
static constexpr int numInertComponents = isInertComp ? 1 : 0;
/*!
* \brief A human readable name for the component.
*
* \param compIdx The index of the component to consider
*/
static std::string componentName(int compIdx = 0)
{ return Component::name(); }
/*!
* \brief A human readable name for the solid system.
*/
static std::string name()
{ return "s"; }
/*!
* \brief Returns whether the phase is incompressible
*/
static constexpr bool isCompressible(int compIdx = 0)
{ return false; }
/*!
* \brief Returns whether the component is inert (doesn't react)
*/
static constexpr bool isInert()
{ return isInertComp; }
/*!
* \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of the component.
*/
static Scalar molarMass(int compIdx = 0)
{ return Component::molarMass(); }
/*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of the solid phase at a given pressure and temperature.
*/
static Scalar density(Scalar temperature, int compIdx = 0)
{ return Component::solidDensity(temperature); }
/*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of the solid phase at a given pressure and temperature.
*/
template <class SolidState>
static Scalar density(const SolidState& solidState, int compIdx = 0)
{ return density(solidState.temperature(), compIdx); }
/*!
* \brief The molar density of the solid phase at a given pressure and temperature.
*/
template <class SolidState>
static Scalar molarDensity(const SolidState& solidState, int compIdx = 0)
{ return density(solidState.temperature(), compIdx)/molarMass(compIdx); }
/*!
* \brief Thermal conductivity of the solid \f$\mathrm{[W/(m K)]}\f$.
*/
static Scalar thermalConductivity(Scalar temperature, int compIdx = 0)
{ return Component::solidThermalConductivity(temperature); }
/*!
* \brief Thermal conductivity of the solid \f$\mathrm{[W/(m K)]}\f$.
*/
template <class SolidState>
static Scalar thermalConductivity(const SolidState &solidState, int compIdx = 0)
{ return thermalConductivity(solidState.temperature(), compIdx); }
/*!
* \brief Specific isobaric heat capacity of the solid \f$\mathrm{[J/(kg K)]}\f$.
*/
static Scalar heatCapacity(Scalar temperature, int compIdx = 0)
{ return Component::solidHeatCapacity(temperature); }
/*!
* \brief Specific isobaric heat capacity of the solid \f$\mathrm{[J/(kg K)]}\f$.
*/
template <class SolidState>
static Scalar heatCapacity(const SolidState &solidState, int compIdx = 0)
{ return heatCapacity(solidState.temperature(), compIdx); }
};
} // end namespace SolidSystems
} // end namespace Dumux
#endif
install(FILES
1csolid.hh
compositionalsolidphase.hh
inertsolidphase.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/material/solidsystems)
......@@ -26,6 +26,8 @@
#include <string>
#include <dune/common/exceptions.hh>
#include <dumux/material/solidsystems/1csolid.hh>
#warning "This header is deprecated and will be removed after release 3.2. Use solidsystem.hh and SolidSystems::OneCSolid."
namespace Dumux {
namespace SolidSystems {
......@@ -37,95 +39,7 @@ namespace SolidSystems {
* and can't increase its mass by precipitation from a fluid phase.
*/
template <class Scalar, class ComponentT>
class InertSolidPhase
{
public:
using Component = ComponentT;
/****************************************
* Solid phase related static parameters
****************************************/
static constexpr int numComponents = 1;
static constexpr int numInertComponents = 1;
/*!
* \brief A human readable name for the component.
*
* \param compIdx The index of the component to consider
*/
static std::string componentName(int compIdx = 0)
{ return Component::name(); }
/*!
* \brief A human readable name for the solid system.
*/
static std::string name()
{ return "s"; }
/*!
* \brief Returns whether the phase is incompressible
*/
static constexpr bool isCompressible(int compIdx = 0)
{ return false; }
/*!
* \brief Returns whether the component is inert (doesn't react)
*/
static constexpr bool isInert()
{ return true; }
/*!
* \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of the component.
*/
static Scalar molarMass(int compIdx = 0)
{ return Component::molarMass(); }
/*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of the solid phase at a given pressure and temperature.
*/
static Scalar density(Scalar temperature)
{ return Component::solidDensity(temperature); }
/*!
* \brief The density \f$\mathrm{[kg/m^3]}\f$ of the solid phase at a given pressure and temperature.
*/
template <class SolidState>
static Scalar density(const SolidState& solidState)
{
return density(solidState.temperature());
}
/*!
* \brief Thermal conductivity of the solid \f$\mathrm{[W/(m K)]}\f$.
*/
static Scalar thermalConductivity(Scalar temperature)
{ return Component::solidThermalConductivity(temperature); }
/*!
* \brief Thermal conductivity of the solid \f$\mathrm{[W/(m K)]}\f$.
*/
template <class SolidState>
static Scalar thermalConductivity(const SolidState &solidState)
{
return thermalConductivity(solidState.temperature());
}
/*!
* \brief Specific isobaric heat capacity of the solid \f$\mathrm{[J/(kg K)]}\f$.
*/
static Scalar heatCapacity(Scalar temperature)
{ return Component::solidHeatCapacity(temperature); }
/*!
* \brief Specific isobaric heat capacity of the solid \f$\mathrm{[J/(kg K)]}\f$.
*/
template <class SolidState>
static Scalar heatCapacity(const SolidState &solidState)
{
return heatCapacity(solidState.temperature());
}
};
using InertSolidPhase = OneCSolid<Scalar, ComponentT, /*isInert=*/true>;
} // end namespace SolidSystems
} // end namespace Dumux
......
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