3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/nonisothermal/localresidual.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
26#ifndef DUMUX_ENERGY_LOCAL_RESIDUAL_HH
27#define DUMUX_ENERGY_LOCAL_RESIDUAL_HH
28
30
31namespace Dumux {
32
33// forward declaration
34template<class TypeTag, bool enableEneryBalance>
36
37template<class TypeTag>
39
44template<class TypeTag>
46{
50 using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
51 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
53
54public:
63 static void fluidPhaseStorage(NumEqVector& storage,
64 const SubControlVolume& scv,
65 const VolumeVariables& volVars,
66 int phaseIdx)
67 {}
68
76 static void solidPhaseStorage(NumEqVector& storage,
77 const SubControlVolume& scv,
78 const VolumeVariables& volVars)
79 {}
80
88 static void heatConvectionFlux(NumEqVector& flux,
89 FluxVariables& fluxVars,
90 int phaseIdx)
91 {}
92
99 static void heatConductionFlux(NumEqVector& flux,
100 FluxVariables& fluxVars)
101 {}
102};
103
108template<class TypeTag>
110{
114 using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
115 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
118 using Element = typename GridView::template Codim<0>::Entity;
119 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
121
122 enum { energyEqIdx = Indices::energyEqIdx };
123
124public:
125
134 static void fluidPhaseStorage(NumEqVector& storage,
135 const SubControlVolume& scv,
136 const VolumeVariables& volVars,
137 int phaseIdx)
138 {
139 storage[energyEqIdx] += volVars.porosity()
140 * volVars.density(phaseIdx)
141 * volVars.internalEnergy(phaseIdx)
142 * volVars.saturation(phaseIdx);
143 }
144
152 static void solidPhaseStorage(NumEqVector& storage,
153 const SubControlVolume& scv,
154 const VolumeVariables& volVars)
155 {
156 storage[energyEqIdx] += volVars.temperature()
157 * volVars.solidHeatCapacity()
158 * volVars.solidDensity()
159 * (1.0 - volVars.porosity());
160 }
161
169 static void heatConvectionFlux(NumEqVector& flux,
170 FluxVariables& fluxVars,
171 int phaseIdx)
172 {
173 auto upwindTerm = [phaseIdx](const auto& volVars)
174 { return volVars.density(phaseIdx)*volVars.mobility(phaseIdx)*volVars.enthalpy(phaseIdx); };
175
176 flux[energyEqIdx] += fluxVars.advectiveFlux(phaseIdx, upwindTerm);
177 }
178
185 static void heatConductionFlux(NumEqVector& flux,
186 FluxVariables& fluxVars)
187 {
188 flux[energyEqIdx] += fluxVars.heatConductionFlux();
189 }
190
200 static void computeSourceEnergy(NumEqVector& source,
201 const Element& element,
202 const FVElementGeometry& fvGeometry,
203 const ElementVolumeVariables& elemVolVars,
204 const SubControlVolume &scv)
205 {}
206};
207
208} // end namespace Dumux
209
210#endif
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
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:149
Definition: porousmediumflow/nonisothermal/localresidual.hh:35
static void heatConductionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The diffusive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:99
static void fluidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars, int phaseIdx)
The energy storage in the fluid phase with index phaseIdx.
Definition: porousmediumflow/nonisothermal/localresidual.hh:63
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:88
static void solidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars)
The energy storage in the solid matrix.
Definition: porousmediumflow/nonisothermal/localresidual.hh:76
static void solidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars)
The energy storage in the solid matrix.
Definition: porousmediumflow/nonisothermal/localresidual.hh:152
static void fluidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars, int phaseIdx)
The energy storage in the fluid phase with index phaseIdx.
Definition: porousmediumflow/nonisothermal/localresidual.hh:134
static void heatConductionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The diffusive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:185
static void computeSourceEnergy(NumEqVector &source, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv)
heat transfer between the phases for nonequilibrium models
Definition: porousmediumflow/nonisothermal/localresidual.hh:200
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:169
Declares all properties used in Dumux.