Loading...
Searching...
No Matches
energymodule.hh
Go to the documentation of this file.
// -*- 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.
*/
#ifndef EWOMS_ENERGY_MODULE_HH
#define EWOMS_ENERGY_MODULE_HH
#include <dune/common/fvector.hh>
#include <opm/material/common/Valgrind.hpp>
#include <opm/models/common/multiphasebaseproperties.hh>
#include <opm/models/common/quantitycallbacks.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <cassert>
#include <cmath>
#include <stdexcept>
#include <string>
#include <type_traits>
namespace Opm {
template <class TypeTag, bool enableEnergy>
class EnergyModule;
template <class TypeTag>
class EnergyModule<TypeTag, /*enableEnergy=*/false>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
using ExtensiveQuantities = GetPropType<TypeTag, Properties::ExtensiveQuantities>;
using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>;
using Model = GetPropType<TypeTag, Properties::Model>;
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
public:
static void registerParameters()
{}
static std::string primaryVarName(unsigned)
{ return ""; }
static std::string eqName(unsigned)
{ return ""; }
static Scalar primaryVarWeight(const Model&,
unsigned,
unsigned)
{ return -1; }
static Scalar eqWeight(const Model&,
unsigned,
unsigned)
{ return -1; }
template <class FluidState>
static void setPriVarTemperatures(PrimaryVariables&,
const FluidState&)
{}
template <class RateVector, class FluidState>
static void setEnthalpyRate(RateVector&,
const FluidState&,
unsigned,
const Evaluation&)
{}
static void setEnthalpyRate(RateVector&,
const Evaluation&)
{}
static void addToEnthalpyRate(RateVector&,
const Evaluation&)
{}
static Scalar thermalConductionRate(const ExtensiveQuantities&)
{ return 0.0; }
template <class LhsEval>
static void addPhaseStorage(Dune::FieldVector<LhsEval, numEq>&,
const IntensiveQuantities&,
unsigned)
{}
template <class LhsEval, class Scv>
static void addFracturePhaseStorage(Dune::FieldVector<LhsEval, numEq>&,
const IntensiveQuantities&,
const Scv&,
unsigned)
{}
template <class LhsEval>
static void addSolidEnergyStorage(Dune::FieldVector<LhsEval, numEq>&,
const IntensiveQuantities&)
{}
template <class Context>
static void addAdvectiveFlux(RateVector&,
const Context&,
unsigned,
unsigned)
{}
template <class Context>
static void handleFractureFlux(RateVector&,
const Context&,
unsigned,
unsigned)
{}
template <class Context>
static void addDiffusiveFlux(RateVector&,
const Context&,
unsigned,
unsigned)
{}
};
template <class TypeTag>
class EnergyModule<TypeTag, /*enableEnergy=*/true>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>;
using ExtensiveQuantities = GetPropType<TypeTag, Properties::ExtensiveQuantities>;
using Indices = GetPropType<TypeTag, Properties::Indices>;
using Model = GetPropType<TypeTag, Properties::Model>;
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
enum { numPhases = FluidSystem::numPhases };
enum { energyEqIdx = Indices::energyEqIdx };
enum { temperatureIdx = Indices::temperatureIdx };
using Toolbox = Opm::MathToolbox<Evaluation>;
public:
static void registerParameters()
{}
static std::string primaryVarName(unsigned pvIdx)
{
if (pvIdx == temperatureIdx) {
return "temperature";
}
return "";
}
static std::string eqName(unsigned eqIdx)
{
if (eqIdx == energyEqIdx) {
return "energy";
}
return "";
}
static Scalar primaryVarWeight(const Model& model, unsigned globalDofIdx, unsigned pvIdx)
{
if (pvIdx != temperatureIdx) {
return -1;
}
// make the weight of the temperature primary variable inversly proportional to its value
return std::max(static_cast<Scalar>(1.0) / 1000,
1.0 / model.solution(/*timeIdx=*/0)[globalDofIdx][temperatureIdx]);
}
static Scalar eqWeight(const Model&,
unsigned,
unsigned eqIdx)
{
if (eqIdx != energyEqIdx) {
return -1;
}
// approximate change of internal energy of 1kg of liquid water for a temperature
// change of 30K
return static_cast<Scalar>(1.0) / (4.184e3 * 30.0);
}
static void setEnthalpyRate(RateVector& rateVec, const Evaluation& rate)
{ rateVec[energyEqIdx] = rate; }
static void addToEnthalpyRate(RateVector& rateVec, const Evaluation& rate)
{ rateVec[energyEqIdx] += rate; }
static Evaluation thermalConductionRate(const ExtensiveQuantities& extQuants)
{ return -extQuants.temperatureGradNormal() * extQuants.thermalConductivity(); }
template <class RateVector, class FluidState>
static void setEnthalpyRate(RateVector& rateVec,
const FluidState& fluidState,
unsigned phaseIdx,
const Evaluation& volume)
{
rateVec[energyEqIdx] =
volume *
fluidState.density(phaseIdx) *
fluidState.enthalpy(phaseIdx);
}
template <class FluidState>
static void setPriVarTemperatures(PrimaryVariables& priVars,
const FluidState& fs)
{
priVars[temperatureIdx] = Toolbox::value(fs.temperature(/*phaseIdx=*/0));
#ifndef NDEBUG
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
assert(std::abs(Toolbox::value(fs.temperature(/*phaseIdx=*/0))
- Toolbox::value(fs.temperature(phaseIdx))) < 1e-30);
}
#endif
}
template <class LhsEval>
static void addPhaseStorage(Dune::FieldVector<LhsEval, numEq>& storage,
const IntensiveQuantities& intQuants,
unsigned phaseIdx)
{
const auto& fs = intQuants.fluidState();
storage[energyEqIdx] +=
Toolbox::template decay<LhsEval>(fs.density(phaseIdx)) *
Toolbox::template decay<LhsEval>(fs.internalEnergy(phaseIdx)) *
Toolbox::template decay<LhsEval>(fs.saturation(phaseIdx)) *
Toolbox::template decay<LhsEval>(intQuants.porosity());
}
template <class Scv, class LhsEval>
static void addFracturePhaseStorage(Dune::FieldVector<LhsEval, numEq>& storage,
const IntensiveQuantities& intQuants,
const Scv& scv,
unsigned phaseIdx)
{
const auto& fs = intQuants.fractureFluidState();
storage[energyEqIdx] +=
Toolbox::template decay<LhsEval>(fs.density(phaseIdx)) *
Toolbox::template decay<LhsEval>(fs.internalEnergy(phaseIdx)) *
Toolbox::template decay<LhsEval>(fs.saturation(phaseIdx)) *
Toolbox::template decay<LhsEval>(intQuants.fracturePorosity()) *
Toolbox::template decay<LhsEval>(intQuants.fractureVolume()) / scv.volume();
}
template <class LhsEval>
static void addSolidEnergyStorage(Dune::FieldVector<LhsEval, numEq>& storage,
const IntensiveQuantities& intQuants)
{ storage[energyEqIdx] += Opm::decay<LhsEval>(intQuants.solidInternalEnergy()); }
template <class Context>
static void addAdvectiveFlux(RateVector& flux,
const Context& context,
unsigned spaceIdx,
unsigned timeIdx)
{
const auto& extQuants = context.extensiveQuantities(spaceIdx, timeIdx);
// advective energy flux in all phases
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
if (!context.model().phaseIsConsidered(phaseIdx)) {
continue;
}
// intensive quantities of the upstream and the downstream DOFs
const unsigned upIdx = static_cast<unsigned>(extQuants.upstreamIndex(phaseIdx));
const IntensiveQuantities& up = context.intensiveQuantities(upIdx, timeIdx);
flux[energyEqIdx] +=
extQuants.volumeFlux(phaseIdx) *
up.fluidState().enthalpy(phaseIdx) *
up.fluidState().density(phaseIdx);
}
}
template <class Context>
static void handleFractureFlux(RateVector& flux,
const Context& context,
unsigned spaceIdx,
unsigned timeIdx)
{
const auto& scvf = context.stencil(timeIdx).interiorFace(spaceIdx);
const auto& extQuants = context.extensiveQuantities(spaceIdx, timeIdx);
// reduce the energy flux in the matrix by the half the width occupied by the
// fracture
flux[energyEqIdx] *= 1 - extQuants.fractureWidth() / (2 * scvf.area());
// advective energy flux in all phases
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
if (!context.model().phaseIsConsidered(phaseIdx)) {
continue;
}
// intensive quantities of the upstream and the downstream DOFs
const unsigned upIdx = static_cast<unsigned>(extQuants.upstreamIndex(phaseIdx));
const IntensiveQuantities& up = context.intensiveQuantities(upIdx, timeIdx);
flux[energyEqIdx] +=
extQuants.fractureVolumeFlux(phaseIdx) *
up.fluidState().enthalpy(phaseIdx) *
up.fluidState().density(phaseIdx);
}
}
template <class Context>
static void addDiffusiveFlux(RateVector& flux,
const Context& context,
unsigned spaceIdx,
unsigned timeIdx)
{
const auto& extQuants = context.extensiveQuantities(spaceIdx, timeIdx);
// diffusive energy flux
flux[energyEqIdx] += -extQuants.temperatureGradNormal() * extQuants.thermalConductivity();
}
};
template <unsigned PVOffset, bool enableEnergy>
struct EnergyIndices;
template <unsigned PVOffset>
struct EnergyIndices<PVOffset, /*enableEnergy=*/false>
{
enum { temperatureIdx = -1000 };
enum { energyEqIdx = -1000 };
protected:
enum { numEq_ = 0 };
};
template <unsigned PVOffset>
struct EnergyIndices<PVOffset, /*enableEnergy=*/true>
{
enum { temperatureIdx = PVOffset };
enum { energyEqIdx = PVOffset };
protected:
enum { numEq_ = 1 };
};
template <class TypeTag, bool enableEnergy>
class EnergyIntensiveQuantities;
template <class TypeTag>
class EnergyIntensiveQuantities<TypeTag, /*enableEnergy=*/false>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
using Toolbox = Opm::MathToolbox<Evaluation>;
public:
Evaluation solidInternalEnergy() const
{
throw std::logic_error("solidInternalEnergy() does not make sense for isothermal models");
}
Evaluation thermalConductivity() const
{
throw std::logic_error("thermalConductivity() does not make sense for isothermal models");
}
protected:
template <class FluidState, class Context>
static void updateTemperatures_(FluidState& fluidState,
const Context& context,
unsigned spaceIdx,
unsigned timeIdx)
{
const Scalar T = context.problem().temperature(context, spaceIdx, timeIdx);
fluidState.setTemperature(Toolbox::createConstant(T));
}
template <class FluidState>
void update_(FluidState&,
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>&,
const ElementContext&,
unsigned,
unsigned)
{}
};
template <class TypeTag>
class EnergyIntensiveQuantities<TypeTag, /*enableEnergy=*/true>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
using ThermalConductionLaw = GetPropType<TypeTag, Properties::ThermalConductionLaw>;
using SolidEnergyLaw = GetPropType<TypeTag, Properties::SolidEnergyLaw>;
using Indices = GetPropType<TypeTag, Properties::Indices>;
enum { numPhases = FluidSystem::numPhases };
enum { temperatureIdx = Indices::temperatureIdx };
using Toolbox = Opm::MathToolbox<Evaluation>;
protected:
template <class FluidState, class Context>
static void updateTemperatures_(FluidState& fluidState,
const Context& context,
unsigned spaceIdx,
unsigned timeIdx)
{
const auto& priVars = context.primaryVars(spaceIdx, timeIdx);
if constexpr (std::is_same_v<Evaluation, Scalar>) { // finite differences
fluidState.setTemperature(Toolbox::createConstant(priVars[temperatureIdx]));
}
else {
// automatic differentiation
if (timeIdx == 0) {
fluidState.setTemperature(Toolbox::createVariable(priVars[temperatureIdx], temperatureIdx));
}
else {
fluidState.setTemperature(Toolbox::createConstant(priVars[temperatureIdx]));
}
}
}
template <class FluidState>
void update_(FluidState& fs,
typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache,
const ElementContext& elemCtx,
unsigned dofIdx,
unsigned timeIdx)
{
// set the specific enthalpies of the fluids
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
if (!elemCtx.model().phaseIsConsidered(phaseIdx)) {
continue;
}
fs.setEnthalpy(phaseIdx,
FluidSystem::enthalpy(fs, paramCache, phaseIdx));
}
// compute and set the volumetric internal energy of the solid phase
const auto& problem = elemCtx.problem();
const auto& solidEnergyParams = problem.solidEnergyLawParams(elemCtx, dofIdx, timeIdx);
const auto& thermalCondParams = problem.thermalConductionLawParams(elemCtx, dofIdx, timeIdx);
solidInternalEnergy_ = SolidEnergyLaw::solidInternalEnergy(solidEnergyParams, fs);
thermalConductivity_ = ThermalConductionLaw::thermalConductivity(thermalCondParams, fs);
Opm::Valgrind::CheckDefined(solidInternalEnergy_);
Opm::Valgrind::CheckDefined(thermalConductivity_);
}
public:
const Evaluation& solidInternalEnergy() const
{ return solidInternalEnergy_; }
const Evaluation& thermalConductivity() const
{ return thermalConductivity_; }
private:
Evaluation solidInternalEnergy_;
Evaluation thermalConductivity_;
};
template <class TypeTag, bool enableEnergy>
class EnergyExtensiveQuantities;
template <class TypeTag>
class EnergyExtensiveQuantities<TypeTag, /*enableEnergy=*/false>
{
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
protected:
void update_(const ElementContext&,
unsigned,
unsigned)
{}
template <class Context, class FluidState>
void updateBoundary_(const Context&,
unsigned,
unsigned,
const FluidState&)
{}
public:
Scalar temperatureGradNormal() const
{
throw std::logic_error("Calling temperatureGradNormal() does not make sense "
"for isothermal models");
}
Scalar thermalConductivity() const
{
throw std::logic_error("Calling thermalConductivity() does not make sense for "
"isothermal models");
}
};
template <class TypeTag>
class EnergyExtensiveQuantities<TypeTag, /*enableEnergy=*/true>
{
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
using GridView = GetPropType<TypeTag, Properties::GridView>;
enum { dimWorld = GridView::dimensionworld };
using EvalDimVector = Dune::FieldVector<Evaluation, dimWorld>;
using DimVector = Dune::FieldVector<Scalar, dimWorld>;
protected:
void update_(const ElementContext& elemCtx, unsigned faceIdx, unsigned timeIdx)
{
const auto& gradCalc = elemCtx.gradientCalculator();
TemperatureCallback<TypeTag> temperatureCallback(elemCtx);
EvalDimVector temperatureGrad;
gradCalc.calculateGradient(temperatureGrad,
elemCtx,
faceIdx,
temperatureCallback);
// scalar product of temperature gradient and scvf normal
const auto& face = elemCtx.stencil(/*timeIdx=*/0).interiorFace(faceIdx);
temperatureGradNormal_ = 0;
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx) {
temperatureGradNormal_ += (face.normal()[dimIdx]*temperatureGrad[dimIdx]);
}
const auto& extQuants = elemCtx.extensiveQuantities(faceIdx, timeIdx);
const auto& intQuantsInside = elemCtx.intensiveQuantities(extQuants.interiorIndex(), timeIdx);
const auto& intQuantsOutside = elemCtx.intensiveQuantities(extQuants.exteriorIndex(), timeIdx);
// arithmetic mean
thermalConductivity_ = 0.5 * (intQuantsInside.thermalConductivity() +
intQuantsOutside.thermalConductivity());
Opm::Valgrind::CheckDefined(thermalConductivity_);
}
template <class Context, class FluidState>
void updateBoundary_(const Context& context, unsigned bfIdx, unsigned timeIdx, const FluidState& fs)
{
const auto& stencil = context.stencil(timeIdx);
const auto& face = stencil.boundaryFace(bfIdx);
const auto& elemCtx = context.elementContext();
const unsigned insideScvIdx = face.interiorIndex();
const auto& insideScv = elemCtx.stencil(timeIdx).subControlVolume(insideScvIdx);
const auto& intQuantsInside = elemCtx.intensiveQuantities(insideScvIdx, timeIdx);
const auto& fsInside = intQuantsInside.fluidState();
// distance between the center of the SCV and center of the boundary face
DimVector distVec = face.integrationPos();
distVec -= insideScv.geometry().center();
Scalar dist = 0;
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx) {
dist += distVec[dimIdx] * face.normal()[dimIdx];
}
// if the following assertation triggers, the center of the
// center of the interior SCV was not inside the element!
assert(dist > 0);
// calculate the temperature gradient using two-point gradient
// appoximation
temperatureGradNormal_ =
(fs.temperature(/*phaseIdx=*/0) - fsInside.temperature(/*phaseIdx=*/0)) / dist;
// take the value for thermal conductivity from the interior finite volume
thermalConductivity_ = intQuantsInside.thermalConductivity();
}
public:
const Evaluation& temperatureGradNormal() const
{ return temperatureGradNormal_; }
const Evaluation& thermalConductivity() const
{ return thermalConductivity_; }
private:
Evaluation temperatureGradNormal_;
Evaluation thermalConductivity_;
};
} // namespace Opm
#endif
Opm::EnergyExtensiveQuantities< TypeTag, false >::temperatureGradNormal
Scalar temperatureGradNormal() const
The temperature gradient times the face normal [K m^2 / m].
Definition energymodule.hh:732
Opm::EnergyExtensiveQuantities< TypeTag, false >::thermalConductivity
Scalar thermalConductivity() const
The total thermal conductivity at the face .
Definition energymodule.hh:741
Opm::EnergyExtensiveQuantities< TypeTag, false >::update_
void update_(const ElementContext &, unsigned, unsigned)
Update the quantities required to calculate energy fluxes.
Definition energymodule.hh:716
Opm::EnergyExtensiveQuantities< TypeTag, true >::temperatureGradNormal
const Evaluation & temperatureGradNormal() const
The temperature gradient times the face normal [K m^2 / m].
Definition energymodule.hh:836
Opm::EnergyExtensiveQuantities< TypeTag, true >::update_
void update_(const ElementContext &elemCtx, unsigned faceIdx, unsigned timeIdx)
Update the quantities required to calculate energy fluxes.
Definition energymodule.hh:768
Opm::EnergyExtensiveQuantities< TypeTag, true >::thermalConductivity
const Evaluation & thermalConductivity() const
The total thermal conductivity at the face .
Definition energymodule.hh:843
Opm::EnergyExtensiveQuantities
Provides the quantities required to calculate energy fluxes.
Definition energymodule.hh:700
Opm::EnergyIntensiveQuantities< TypeTag, false >::thermalConductivity
Evaluation thermalConductivity() const
Returns the total thermal conductivity of the solid matrix in the sub-control volume.
Definition energymodule.hh:564
Opm::EnergyIntensiveQuantities< TypeTag, false >::updateTemperatures_
static void updateTemperatures_(FluidState &fluidState, const Context &context, unsigned spaceIdx, unsigned timeIdx)
Update the temperatures of the fluids of a fluid state.
Definition energymodule.hh:574
Opm::EnergyIntensiveQuantities< TypeTag, false >::update_
void update_(FluidState &, typename FluidSystem::template ParameterCache< typename FluidState::Scalar > &, const ElementContext &, unsigned, unsigned)
Update the quantities required to calculate energy fluxes.
Definition energymodule.hh:588
Opm::EnergyIntensiveQuantities< TypeTag, false >::solidInternalEnergy
Evaluation solidInternalEnergy() const
Returns the volumetric internal energy of the solid matrix in the sub-control volume.
Definition energymodule.hh:555
Opm::EnergyIntensiveQuantities< TypeTag, true >::solidInternalEnergy
const Evaluation & solidInternalEnergy() const
Returns the volumetric internal energy of the solid matrix in the sub-control volume.
Definition energymodule.hh:678
Opm::EnergyIntensiveQuantities< TypeTag, true >::thermalConductivity
const Evaluation & thermalConductivity() const
Returns the total conductivity capacity of the solid matrix in the sub-control volume.
Definition energymodule.hh:685
Opm::EnergyIntensiveQuantities< TypeTag, true >::update_
void update_(FluidState &fs, typename FluidSystem::template ParameterCache< typename FluidState::Scalar > &paramCache, const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx)
Update the quantities required to calculate energy fluxes.
Definition energymodule.hh:645
Opm::EnergyIntensiveQuantities< TypeTag, true >::updateTemperatures_
static void updateTemperatures_(FluidState &fluidState, const Context &context, unsigned spaceIdx, unsigned timeIdx)
Update the temperatures of the fluids of a fluid state.
Definition energymodule.hh:620
Opm::EnergyIntensiveQuantities
Provides the volumetric quantities required for the energy equation.
Definition energymodule.hh:535
Opm::EnergyModule< TypeTag, false >::eqWeight
static Scalar eqWeight(const Model &, unsigned, unsigned)
Returns the relative weight of a equation of the residual.
Definition energymodule.hh:107
Opm::EnergyModule< TypeTag, false >::setPriVarTemperatures
static void setPriVarTemperatures(PrimaryVariables &, const FluidState &)
Given a fluid state, set the temperature in the primary variables.
Definition energymodule.hh:116
Opm::EnergyModule< TypeTag, false >::handleFractureFlux
static void handleFractureFlux(RateVector &, const Context &, unsigned, unsigned)
Evaluates the advective energy fluxes over a fracture which should be attributed to a face of a subco...
Definition energymodule.hh:200
Opm::EnergyModule< TypeTag, false >::addPhaseStorage
static void addPhaseStorage(Dune::FieldVector< LhsEval, numEq > &, const IntensiveQuantities &, unsigned)
Add the energy storage term for a fluid phase to an equation vector.
Definition energymodule.hh:156
Opm::EnergyModule< TypeTag, false >::addToEnthalpyRate
static void addToEnthalpyRate(RateVector &, const Evaluation &)
Add the rate of the enthalpy flux to a rate vector.
Definition energymodule.hh:141
Opm::EnergyModule< TypeTag, false >::addDiffusiveFlux
static void addDiffusiveFlux(RateVector &, const Context &, unsigned, unsigned)
Adds the diffusive energy flux to the flux vector over the face of a sub-control volume.
Definition energymodule.hh:213
Opm::EnergyModule< TypeTag, false >::addSolidEnergyStorage
static void addSolidEnergyStorage(Dune::FieldVector< LhsEval, numEq > &, const IntensiveQuantities &)
Add the energy storage term for the fracture part a fluid phase to an equation vector.
Definition energymodule.hh:177
Opm::EnergyModule< TypeTag, false >::setEnthalpyRate
static void setEnthalpyRate(RateVector &, const Evaluation &)
Add the rate of the enthalpy flux to a rate vector.
Definition energymodule.hh:134
Opm::EnergyModule< TypeTag, false >::addAdvectiveFlux
static void addAdvectiveFlux(RateVector &, const Context &, unsigned, unsigned)
Evaluates the advective energy fluxes over a face of a subcontrol volume and adds the result in the f...
Definition energymodule.hh:188
Opm::EnergyModule< TypeTag, false >::addFracturePhaseStorage
static void addFracturePhaseStorage(Dune::FieldVector< LhsEval, numEq > &, const IntensiveQuantities &, const Scv &, unsigned)
Add the energy storage term for a fluid phase to an equation vector.
Definition energymodule.hh:166
Opm::EnergyModule< TypeTag, false >::primaryVarName
static std::string primaryVarName(unsigned)
Returns the name of a primary variable or an empty string if the specified primary variable index doe...
Definition energymodule.hh:84
Opm::EnergyModule< TypeTag, false >::eqName
static std::string eqName(unsigned)
Returns the name of an equation or an empty string if the specified equation index does not belong to...
Definition energymodule.hh:92
Opm::EnergyModule< TypeTag, false >::thermalConductionRate
static Scalar thermalConductionRate(const ExtensiveQuantities &)
Add the rate of the conductive energy flux to a rate vector.
Definition energymodule.hh:148
Opm::EnergyModule< TypeTag, false >::setEnthalpyRate
static void setEnthalpyRate(RateVector &, const FluidState &, unsigned, const Evaluation &)
Given a fluid state, set the enthalpy rate which emerges from a volumetric rate.
Definition energymodule.hh:125
Opm::EnergyModule< TypeTag, false >::primaryVarWeight
static Scalar primaryVarWeight(const Model &, unsigned, unsigned)
Returns the relative weight of a primary variable for calculating relative errors.
Definition energymodule.hh:99
Opm::EnergyModule< TypeTag, false >::registerParameters
static void registerParameters()
Register all run-time parameters for the energy module.
Definition energymodule.hh:76
Opm::EnergyModule< TypeTag, true >::handleFractureFlux
static void handleFractureFlux(RateVector &flux, const Context &context, unsigned spaceIdx, unsigned timeIdx)
Evaluates the advective energy fluxes over a fracture which should be attributed to a face of a subco...
Definition energymodule.hh:439
Opm::EnergyModule< TypeTag, true >::addToEnthalpyRate
static void addToEnthalpyRate(RateVector &rateVec, const Evaluation &rate)
Add the rate of the enthalpy flux to a rate vector.
Definition energymodule.hh:316
Opm::EnergyModule< TypeTag, true >::addFracturePhaseStorage
static void addFracturePhaseStorage(Dune::FieldVector< LhsEval, numEq > &storage, const IntensiveQuantities &intQuants, const Scv &scv, unsigned phaseIdx)
Add the energy storage term for a fluid phase to an equation vector.
Definition energymodule.hh:379
Opm::EnergyModule< TypeTag, true >::addPhaseStorage
static void addPhaseStorage(Dune::FieldVector< LhsEval, numEq > &storage, const IntensiveQuantities &intQuants, unsigned phaseIdx)
Add the energy storage term for a fluid phase to an equation vector.
Definition energymodule.hh:362
Opm::EnergyModule< TypeTag, true >::setEnthalpyRate
static void setEnthalpyRate(RateVector &rateVec, const Evaluation &rate)
Set the rate of energy flux of a rate vector.
Definition energymodule.hh:310
Opm::EnergyModule< TypeTag, true >::setPriVarTemperatures
static void setPriVarTemperatures(PrimaryVariables &priVars, const FluidState &fs)
Given a fluid state, set the temperature in the primary variables.
Definition energymodule.hh:345
Opm::EnergyModule< TypeTag, true >::addDiffusiveFlux
static void addDiffusiveFlux(RateVector &flux, const Context &context, unsigned spaceIdx, unsigned timeIdx)
Adds the diffusive energy flux to the flux vector over the face of a sub-control volume.
Definition energymodule.hh:475
Opm::EnergyModule< TypeTag, true >::setEnthalpyRate
static void setEnthalpyRate(RateVector &rateVec, const FluidState &fluidState, unsigned phaseIdx, const Evaluation &volume)
Given a fluid state, set the enthalpy rate which emerges from a volumetric rate.
Definition energymodule.hh:330
Opm::EnergyModule< TypeTag, true >::eqName
static std::string eqName(unsigned eqIdx)
Returns the name of an equation or an empty string if the specified equation index does not belong to...
Definition energymodule.hh:268
Opm::EnergyModule< TypeTag, true >::registerParameters
static void registerParameters()
Register all run-time parameters for the energy module.
Definition energymodule.hh:247
Opm::EnergyModule< TypeTag, true >::addSolidEnergyStorage
static void addSolidEnergyStorage(Dune::FieldVector< LhsEval, numEq > &storage, const IntensiveQuantities &intQuants)
Add the energy storage term for a fluid phase to an equation vector.
Definition energymodule.hh:398
Opm::EnergyModule< TypeTag, true >::addAdvectiveFlux
static void addAdvectiveFlux(RateVector &flux, const Context &context, unsigned spaceIdx, unsigned timeIdx)
Evaluates the advective energy fluxes for a flux integration point and adds the result in the flux ve...
Definition energymodule.hh:409
Opm::EnergyModule< TypeTag, true >::primaryVarName
static std::string primaryVarName(unsigned pvIdx)
Returns the name of a primary variable or an empty string if the specified primary variable index doe...
Definition energymodule.hh:255
Opm::EnergyModule< TypeTag, true >::primaryVarWeight
static Scalar primaryVarWeight(const Model &model, unsigned globalDofIdx, unsigned pvIdx)
Returns the relative weight of a primary variable for calculating relative errors.
Definition energymodule.hh:280
Opm::EnergyModule< TypeTag, true >::eqWeight
static Scalar eqWeight(const Model &, unsigned, unsigned eqIdx)
Returns the relative weight of a equation.
Definition energymodule.hh:294
Opm::EnergyModule< TypeTag, true >::thermalConductionRate
static Evaluation thermalConductionRate(const ExtensiveQuantities &extQuants)
Returns the conductive energy flux for a given flux integration point.
Definition energymodule.hh:322
Opm::EnergyModule
Provides the auxiliary methods required for consideration of the energy equation.
Definition energymodule.hh:54
Opm::TemperatureCallback
Callback class for temperature.
Definition quantitycallbacks.hh:49
fvbaseproperties.hh
Declare the properties used by the infrastructure code of the finite volume discretizations.
multiphasebaseproperties.hh
Defines the common properties required by the porous medium multi-phase models.
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
Opm::GetPropType
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition propertysystem.hh:233
Opm::getPropValue
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
quantitycallbacks.hh
This method contains all callback classes for quantities that are required by some extensive quantiti...
Opm::EnergyIndices
Provides the indices required for the energy equation.
Definition energymodule.hh:494