Loading [MathJax]/extensions/tex2jax.js
3.4
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
31
32namespace Dumux {
33
34// forward declaration
35template<class TypeTag, bool enableEneryBalance>
37
38template<class TypeTag>
40
45template<class TypeTag>
47{
51 using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
52 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
54
55public:
64 static void fluidPhaseStorage(NumEqVector& storage,
65 const SubControlVolume& scv,
66 const VolumeVariables& volVars,
67 int phaseIdx)
68 {}
69
77 static void solidPhaseStorage(NumEqVector& storage,
78 const SubControlVolume& scv,
79 const VolumeVariables& volVars)
80 {}
81
89 static void heatConvectionFlux(NumEqVector& flux,
90 FluxVariables& fluxVars,
91 int phaseIdx)
92 {}
93
100 static void heatConductionFlux(NumEqVector& flux,
101 FluxVariables& fluxVars)
102 {}
103};
104
109template<class TypeTag>
111{
115 using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
116 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
119 using Element = typename GridView::template Codim<0>::Entity;
120 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
122
123 enum { energyEqIdx = Indices::energyEqIdx };
124
125public:
126
135 static void fluidPhaseStorage(NumEqVector& storage,
136 const SubControlVolume& scv,
137 const VolumeVariables& volVars,
138 int phaseIdx)
139 {
140 storage[energyEqIdx] += volVars.porosity()
141 * volVars.density(phaseIdx)
142 * volVars.internalEnergy(phaseIdx)
143 * volVars.saturation(phaseIdx);
144 }
145
153 static void solidPhaseStorage(NumEqVector& storage,
154 const SubControlVolume& scv,
155 const VolumeVariables& volVars)
156 {
157 storage[energyEqIdx] += volVars.temperature()
158 * volVars.solidHeatCapacity()
159 * volVars.solidDensity()
160 * (1.0 - volVars.porosity());
161 }
162
170 static void heatConvectionFlux(NumEqVector& flux,
171 FluxVariables& fluxVars,
172 int phaseIdx)
173 {
174 auto upwindTerm = [phaseIdx](const auto& volVars)
175 { return volVars.density(phaseIdx)*volVars.mobility(phaseIdx)*volVars.enthalpy(phaseIdx); };
176
177 flux[energyEqIdx] += fluxVars.advectiveFlux(phaseIdx, upwindTerm);
178 }
179
186 static void heatConductionFlux(NumEqVector& flux,
187 FluxVariables& fluxVars)
188 {
189 flux[energyEqIdx] += fluxVars.heatConductionFlux();
190 }
191
201 static void computeSourceEnergy(NumEqVector& source,
202 const Element& element,
203 const FVElementGeometry& fvGeometry,
204 const ElementVolumeVariables& elemVolVars,
205 const SubControlVolume &scv)
206 {}
207};
208
209} // end namespace Dumux
210
211#endif
A helper to deduce a vector with the same size as numbers of equations.
typename NumEqVectorTraits< PrimaryVariables >::type NumEqVector
A vector with the same size as numbers of equations This is the default implementation and has to be ...
Definition: numeqvector.hh:46
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:150
Definition: porousmediumflow/nonisothermal/localresidual.hh:36
static void heatConductionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The diffusive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:100
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:64
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:89
static void solidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars)
The energy storage in the solid matrix.
Definition: porousmediumflow/nonisothermal/localresidual.hh:77
static void solidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars)
The energy storage in the solid matrix.
Definition: porousmediumflow/nonisothermal/localresidual.hh:153
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:135
static void heatConductionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The diffusive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:186
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:201
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:170
Declares all properties used in Dumux.