Skip to content
Snippets Groups Projects
Commit a2ebc7a0 authored by Simon Emmert's avatar Simon Emmert Committed by Timo Koch
Browse files

[components][ions] implement ion interface and carbonate and calcium ions

parent a0e7421e
No related branches found
No related tags found
1 merge request!1094Introduce ions and test ions and solid components
...@@ -5,8 +5,11 @@ air.hh ...@@ -5,8 +5,11 @@ air.hh
base.hh base.hh
benzene.hh benzene.hh
brine.hh brine.hh
calcite.hh
calciumion.hh
cao.hh cao.hh
cao2h2.hh cao2h2.hh
carbonateion.hh
ch4.hh ch4.hh
co2.hh co2.hh
co2tablereader.hh co2tablereader.hh
......
// -*- 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 A class for the CaCO3 mineral phase properties
*/
#ifndef DUMUX_CALCITE_HH
#define DUMUX_CALCITE_HH
#include <dumux/material/components/base.hh>
#include <dumux/material/components/solid.hh>
#include <dumux/material/components/calciumion.hh>
#include <dumux/material/components/carbonateion.hh>
namespace Dumux {
namespace Components {
/*!
* \ingroup Components
* \brief A class for the CaCO3 mineral phase properties
*/
template <class Scalar>
class Calcite
: public Components::Base<Scalar, Calcite<Scalar> >
, public Components::Solid<Scalar, Calcite<Scalar> >
{
public:
using CalciumIon = Components::CalciumIon<Scalar>;
using CarbonateIon = Components::CarbonateIon<Scalar>;
/*!
* \brief A human readable name for calcite.
*/
static std::string name()
{ return "Calcite"; }
/*!
* \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of calcite.
*/
static constexpr Scalar molarMass()
{ return CalciumIon::molarMass() + CarbonateIon::molarMass(); } // kg/mol
/*!
* \brief Returns true if the solid phase is assumed to be compressible
*/
static constexpr bool solidIsCompressible()
{ return false; }
/*!
* \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 constexpr Scalar solidDensity(Scalar temperature)
{ return 2.71e3; }
/*!
* \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)
{ return 3.849; }
/*!
* \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)
{ return 837; }
};
} // end namespace Components
} // end namespace Dumux
#endif
// -*- 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 A class for the Ca2+ (Calcium ion) component properties
*/
#ifndef DUMUX_CA_ION_HH
#define DUMUX_CA_ION_HH
#include <dumux/material/components/base.hh>
#include <dumux/material/components/ion.hh>
namespace Dumux {
namespace Components {
/*!
* \ingroup Components
* \brief A class for the Ca2+ (Calcium ion) component properties.
*/
template <class Scalar>
class CalciumIon
: public Components::Base<Scalar, CalciumIon<Scalar> >
, public Components::Ion<Scalar, CalciumIon<Scalar> >
{
public:
/*!
* \brief A human readable name for the Ca ion.
*/
static std::string name()
{ return "Ca2+"; }
/*!
* \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of the Ca ion.
*/
static constexpr Scalar molarMass()
{ return 40.078e-3; } // kg/mol
/*!
* \brief The charge balance of the Ca ion.
*/
static constexpr int charge()
{ return +2; }
};
} // end namespace Components
} // end namespace Dumux
#endif
// -*- 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 A class for the CO3 ion properties.
*/
#ifndef DUMUX_CO3_ION_HH
#define DUMUX_CO3_ION_HH
#include <dumux/material/components/base.hh>
#include <dumux/material/components/ion.hh>
namespace Dumux {
namespace Components {
/*!
* \ingroup Components
* \brief A class for the CO3 fluid properties.
*/
template <class Scalar>
class CarbonateIon
: public Components::Base<Scalar, CarbonateIon<Scalar> >
, public Components::Ion<Scalar, CarbonateIon<Scalar> >
{
public:
/*!
* \brief A human readable name for the CO3 ion.
*/
static std::string name()
{ return "CO3-"; }
/*!
* \brief The molar mass in \f$\mathrm{[kg/mol]}\f$ of the CO3 ion.
*/
static constexpr Scalar molarMass()
{ return 60.0092e-3; } // kg/mol
/*!
* \brief The charge balance of the CO3 ion.
*/
static constexpr int charge()
{ return -2; }
};
} // end namespace Components
} // end namespace Dumux
#endif
// -*- 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 are ions.
*/
#ifndef DUMUX_COMPONENT_ION_HH
#define DUMUX_COMPONENT_ION_HH
#include <dune/common/exceptions.hh>
#include <dumux/common/typetraits/typetraits.hh>
namespace Dumux {
namespace Components {
template<class Scalar, class Component>
class Ion
{
public:
/*!
* \brief Returns the charge of the ion.
*/
template<class C = Component>
static constexpr int charge()
{
static_assert(AlwaysFalse<C>::value, "Mandatory function not implemented: charge()");
return 0; // iso c++ requires a return statement for constexpr functions
}
};
} // end namespace Components
} // end namespace Dumux
#endif
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