refactor the "heat conduction" laws into "thermal laws"
thermal laws are the heat conduction laws plus "solid energy laws" which can be used to specify the relations which govern the volumetric internal energy of the solid matrix of the porous medium.
This commit is contained in:
parent
f195effcdd
commit
7b8951ed83
64
opm/material/thermal/ConstantSolidHeatCapLaw.hpp
Normal file
64
opm/material/thermal/ConstantSolidHeatCapLaw.hpp
Normal file
@ -0,0 +1,64 @@
|
||||
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
// vi: set et ts=4 sw=4 sts=4:
|
||||
/*
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM 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.
|
||||
|
||||
OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Consult the COPYING file in the top-level source directory of this
|
||||
module for the precise wording of the license and the list of
|
||||
copyright holders.
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
* \copydoc Opm::ConstantSolidHeatCapLaw
|
||||
*/
|
||||
#ifndef OPM_CONSTANT_SOLID_HEAT_CAP_LAW_HPP
|
||||
#define OPM_CONSTANT_SOLID_HEAT_CAP_LAW_HPP
|
||||
|
||||
#include "ConstantSolidHeatCapLawParams.hpp"
|
||||
|
||||
#include <opm/material/densead/Math.hpp>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
/*!
|
||||
* \ingroup material
|
||||
*
|
||||
* \brief Implements a solid energy storage law which assumes constant heat capacity.
|
||||
*/
|
||||
template <class ScalarT,
|
||||
class ParamsT = ConstantSolidHeatCapLawParams<ScalarT> >
|
||||
class ConstantSolidHeatCapLaw
|
||||
{
|
||||
public:
|
||||
typedef ParamsT Params;
|
||||
typedef typename Params::Scalar Scalar;
|
||||
|
||||
/*!
|
||||
* \brief Given a fluid state, compute the volumetric internal energy of the solid matrix [W/m^3].
|
||||
*/
|
||||
template <class FluidState, class Evaluation = typename FluidState::Scalar>
|
||||
static Evaluation solidInternalEnergy(const Params& params, const FluidState& fluidState)
|
||||
{
|
||||
const Evaluation& T = fluidState.temperature(/*phaseIdx=*/0);
|
||||
|
||||
Scalar cp = params.solidHeatCapacity();
|
||||
|
||||
return T*cp;
|
||||
}
|
||||
};
|
||||
} // namespace Opm
|
||||
|
||||
#endif
|
67
opm/material/thermal/ConstantSolidHeatCapLawParams.hpp
Normal file
67
opm/material/thermal/ConstantSolidHeatCapLawParams.hpp
Normal file
@ -0,0 +1,67 @@
|
||||
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
// vi: set et ts=4 sw=4 sts=4:
|
||||
/*
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM 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.
|
||||
|
||||
OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Consult the COPYING file in the top-level source directory of this
|
||||
module for the precise wording of the license and the list of
|
||||
copyright holders.
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
* \copydoc Opm::ConstantSolidHeatCapLawParams
|
||||
*/
|
||||
#ifndef OPM_CONSTANT_SOLID_HEAT_CAP_LAW_PARAMS_HPP
|
||||
#define OPM_CONSTANT_SOLID_HEAT_CAP_LAW_PARAMS_HPP
|
||||
|
||||
#include <opm/material/common/EnsureFinalized.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
/*!
|
||||
* \brief The default implementation of a parameter object for the
|
||||
* solid energy storage law which assumes constant heat capacity.
|
||||
*/
|
||||
template <class ScalarT>
|
||||
class ConstantSolidHeatCapLawParams : public EnsureFinalized
|
||||
{
|
||||
public:
|
||||
typedef ScalarT Scalar;
|
||||
|
||||
ConstantSolidHeatCapLawParams(const ConstantSolidHeatCapLawParams&) = default;
|
||||
|
||||
ConstantSolidHeatCapLawParams()
|
||||
{ }
|
||||
|
||||
/*!
|
||||
* \brief Set the specific heat capacity of the solid matrix [J/(m^3 K)].
|
||||
*/
|
||||
void setSolidHeatCapacity(Scalar value)
|
||||
{ solidHeatCapacity_ = value; }
|
||||
|
||||
/*!
|
||||
* \brief Return the specific heat capacity of the solid matrix [J/(m^3 K)].
|
||||
*/
|
||||
Scalar solidHeatCapacity() const
|
||||
{ EnsureFinalized::check(); return solidHeatCapacity_; }
|
||||
|
||||
private:
|
||||
Scalar solidHeatCapacity_;
|
||||
};
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
#endif
|
@ -24,10 +24,10 @@
|
||||
* \file
|
||||
* \copydoc Opm::FluidHeatConduction
|
||||
*/
|
||||
#ifndef OPM_FLUID_HEAT_CONDUCTION_HPP
|
||||
#define OPM_FLUID_HEAT_CONDUCTION_HPP
|
||||
#ifndef OPM_FLUID_HEAT_CONDUCTION_LAW_HPP
|
||||
#define OPM_FLUID_HEAT_CONDUCTION_LAW_HPP
|
||||
|
||||
#include "FluidConductionParams.hpp"
|
||||
#include "FluidHeatConductionLawParams.hpp"
|
||||
|
||||
#include <opm/material/common/Spline.hpp>
|
||||
|
||||
@ -42,8 +42,8 @@ namespace Opm {
|
||||
template <class FluidSystem,
|
||||
class ScalarT,
|
||||
int phaseIdx,
|
||||
class ParamsT = FluidHeatConductionParams<ScalarT> >
|
||||
class FluidHeatConduction
|
||||
class ParamsT = FluidHeatConductionLawParams<ScalarT> >
|
||||
class FluidHeatConductionLaw
|
||||
{
|
||||
public:
|
||||
typedef ParamsT Params;
|
@ -24,24 +24,24 @@
|
||||
* \file
|
||||
* \copydoc Opm::FluidHeatConductionParams
|
||||
*/
|
||||
#ifndef OPM_FLUID_HEAT_CONDUCTION_PARAMS_HPP
|
||||
#define OPM_FLUID_HEAT_CONDUCTION_PARAMS_HPP
|
||||
#ifndef OPM_FLUID_HEAT_CONDUCTION_LAW_PARAMS_HPP
|
||||
#define OPM_FLUID_HEAT_CONDUCTION_LAW_PARAMS_HPP
|
||||
|
||||
namespace Opm {
|
||||
/*!
|
||||
* \brief Parameters for the heat conduction law which just takes the conductivity of a given fluid phase.
|
||||
*/
|
||||
template <class ScalarT>
|
||||
class FluidHeatConductionParams
|
||||
class FluidHeatConductionLawParams
|
||||
{
|
||||
// do not copy!
|
||||
FluidHeatConductionParams(const FluidHeatConductionParams&)
|
||||
FluidHeatConductionLawParams(const FluidHeatConductionLawParams&)
|
||||
{}
|
||||
|
||||
public:
|
||||
typedef ScalarT Scalar;
|
||||
|
||||
FluidHeatConductionParams()
|
||||
FluidHeatConductionLawParams()
|
||||
{ }
|
||||
|
||||
};
|
@ -22,10 +22,10 @@
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
* \copydoc Opm::DummyHeatConductionLaw
|
||||
* \copydoc Opm::NullHeatConductionLaw
|
||||
*/
|
||||
#ifndef OPM_DUMMY_HEATCONDUCTION_LAW_HPP
|
||||
#define OPM_DUMMY_HEATCONDUCTION_LAW_HPP
|
||||
#ifndef OPM_NULL_HEATCONDUCTION_LAW_HPP
|
||||
#define OPM_NULL_HEATCONDUCTION_LAW_HPP
|
||||
|
||||
#include <opm/common/Unused.hpp>
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
@ -39,10 +39,10 @@ namespace Opm
|
||||
* \brief Implements a dummy law for heat conduction to which isothermal models
|
||||
* can fall back to.
|
||||
*
|
||||
* If any method of this law is called, it throws std::logic_error.
|
||||
* This law just returns 0 unconditionally.
|
||||
*/
|
||||
template <class ScalarT>
|
||||
class DummyHeatConductionLaw
|
||||
class NullHeatConductionLaw
|
||||
{
|
||||
public:
|
||||
typedef int Params;
|
||||
@ -54,13 +54,10 @@ public:
|
||||
*
|
||||
* If this method is called an exception is thrown at run time.
|
||||
*/
|
||||
template <class FluidState, class Evaluation = Scalar>
|
||||
static Scalar heatConductivity(const Params& params OPM_UNUSED,
|
||||
const FluidState& fluidState OPM_UNUSED)
|
||||
{
|
||||
OPM_THROW(std::logic_error,
|
||||
"No heat conduction law specified!");
|
||||
}
|
||||
template <class FluidState, class Evaluation = typename FluidState::Scalar>
|
||||
static Evaluation heatConductivity(const Params& params OPM_UNUSED,
|
||||
const FluidState& fluidState OPM_UNUSED)
|
||||
{ return 0.0; }
|
||||
};
|
||||
} // namespace Opm
|
||||
|
58
opm/material/thermal/NullSolidEnergyLaw.hpp
Normal file
58
opm/material/thermal/NullSolidEnergyLaw.hpp
Normal file
@ -0,0 +1,58 @@
|
||||
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
// vi: set et ts=4 sw=4 sts=4:
|
||||
/*
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM 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.
|
||||
|
||||
OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Consult the COPYING file in the top-level source directory of this
|
||||
module for the precise wording of the license and the list of
|
||||
copyright holders.
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
* \copydoc Opm::NullSolidEnergyLaw
|
||||
*/
|
||||
#ifndef OPM_NULL_SOLID_ENERGY_LAW_HPP
|
||||
#define OPM_NULL_SOLID_ENERGY_LAW_HPP
|
||||
|
||||
#include <opm/material/densead/Math.hpp>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
/*!
|
||||
* \ingroup material
|
||||
*
|
||||
* \brief Implements a solid energy storage law which just returns 0.
|
||||
*/
|
||||
template <class ScalarT>
|
||||
class NullSolidEnergyLaw
|
||||
{
|
||||
public:
|
||||
typedef int Params;
|
||||
typedef ScalarT Scalar;
|
||||
|
||||
/*!
|
||||
* \brief Given a fluid state, compute the volumetric internal energy of the solid
|
||||
* matrix [W/m^3].
|
||||
*
|
||||
* This solid energy law simply returns 0.
|
||||
*/
|
||||
template <class FluidState, class Evaluation = typename FluidState::Scalar>
|
||||
static Evaluation solidInternalEnergy(const Params& params, const FluidState& fluidState)
|
||||
{ return 0.0; }
|
||||
};
|
||||
} // namespace Opm
|
||||
|
||||
#endif
|
@ -22,12 +22,12 @@
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
* \copydoc Opm::Somerton
|
||||
* \copydoc Opm::SomertonHeatConductionLaw
|
||||
*/
|
||||
#ifndef OPM_SOMERTON_HPP
|
||||
#define OPM_SOMERTON_HPP
|
||||
#ifndef OPM_SOMERTON_HEAT_CONDUCTION_LAW_HPP
|
||||
#define OPM_SOMERTON_HEAT_CONDUCTION_LAW_HPP
|
||||
|
||||
#include "SomertonParams.hpp"
|
||||
#include "SomertonHeatConductionLawParams.hpp"
|
||||
|
||||
#include <opm/material/common/Spline.hpp>
|
||||
|
||||
@ -59,8 +59,8 @@ namespace Opm
|
||||
*/
|
||||
template <class FluidSystem,
|
||||
class ScalarT,
|
||||
class ParamsT = SomertonParams<FluidSystem::numPhases, ScalarT> >
|
||||
class Somerton
|
||||
class ParamsT = SomertonHeatConductionLawParams<FluidSystem::numPhases, ScalarT> >
|
||||
class SomertonHeatConductionLaw
|
||||
{
|
||||
enum { numPhases = FluidSystem::numPhases };
|
||||
|
||||
@ -86,7 +86,7 @@ public:
|
||||
* phase \f$\alpha\f$ and \f$S_\alpha\f$ is the saturation of
|
||||
* phase \f$\alpha\f$.
|
||||
*/
|
||||
template <class FluidState, class Evaluation = Scalar>
|
||||
template <class FluidState, class Evaluation = typename FluidState::Scalar>
|
||||
static Evaluation heatConductivity(const Params& params,
|
||||
const FluidState& fluidState)
|
||||
{
|
@ -22,10 +22,10 @@
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
* \copydoc Opm::SomertonParams
|
||||
* \copydoc Opm::SomertonHeatConductionLawParams
|
||||
*/
|
||||
#ifndef OPM_SOMERTON_PARAMS_HPP
|
||||
#define OPM_SOMERTON_PARAMS_HPP
|
||||
#ifndef OPM_SOMERTON_HEAT_CONDUCTION_LAW_PARAMS_HPP
|
||||
#define OPM_SOMERTON_HEAT_CONDUCTION_LAW_PARAMS_HPP
|
||||
|
||||
#include <cassert>
|
||||
|
||||
@ -33,19 +33,19 @@ namespace Opm {
|
||||
|
||||
/*!
|
||||
* \brief The default implementation of a parameter object for the
|
||||
* Somerton heatconduction law.
|
||||
* Somerton heat conduction law.
|
||||
*/
|
||||
template <unsigned numPhases, class ScalarT>
|
||||
class SomertonParams
|
||||
class SomertonHeatConductionLawParams
|
||||
{
|
||||
// do not copy!
|
||||
SomertonParams(const SomertonParams&)
|
||||
SomertonHeatConductionLawParams(const SomertonHeatConductionLawParams&)
|
||||
{}
|
||||
|
||||
public:
|
||||
typedef ScalarT Scalar;
|
||||
|
||||
SomertonParams()
|
||||
SomertonHeatConductionLawParams()
|
||||
{ }
|
||||
|
||||
/*!
|
@ -43,6 +43,8 @@
|
||||
#include <opm/material/fluidsystems/H2OAirMesityleneFluidSystem.hpp>
|
||||
#include <opm/material/fluidsystems/H2OAirXyleneFluidSystem.hpp>
|
||||
|
||||
#include <opm/material/thermal/FluidHeatConductionLaw.hpp>
|
||||
|
||||
// include all fluid states
|
||||
#include <opm/material/fluidstates/PressureOverlayFluidState.hpp>
|
||||
#include <opm/material/fluidstates/SaturationOverlayFluidState.hpp>
|
||||
|
Loading…
Reference in New Issue
Block a user