3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
porousmediumflow/solidenergy/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 2 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 *****************************************************************************/
24#ifndef DUMUX_SOLID_ENERGY_LOCAL_RESIDUAL_HH
25#define DUMUX_SOLID_ENERGY_LOCAL_RESIDUAL_HH
26
29
30namespace Dumux {
31
36template<class TypeTag>
37class SolidEnergyLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidual>
38{
44 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
46 using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView;
47 using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
48 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
49 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
51 using Element = typename GridView::template Codim<0>::Entity;
52
53public:
54 using ParentType::ParentType;
55
65 NumEqVector computeStorage(const Problem& problem,
66 const SubControlVolume& scv,
67 const VolumeVariables& volVars) const
68 {
69 NumEqVector storage;
70 storage[0] = volVars.temperatureSolid()
71 * volVars.solidHeatCapacity()
72 * volVars.solidDensity()
73 * (1.0 - volVars.porosity());
74
75 return storage;
76 }
77
78
89 NumEqVector computeFlux(const Problem& problem,
90 const Element& element,
91 const FVElementGeometry& fvGeometry,
92 const ElementVolumeVariables& elemVolVars,
93 const SubControlVolumeFace& scvf,
94 const ElementFluxVariablesCache& elemFluxVarsCache) const
95 {
96 FluxVariables fluxVars;
97 fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
98 return fluxVars.heatConductionFlux();
99 }
100};
101
102} // end namespace Dumux
103
104#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
Element-wise calculation of the residual.
Definition: porousmediumflow/solidenergy/localresidual.hh:38
NumEqVector computeStorage(const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars) const
Evaluate the rate of change of all conservation quantites.
Definition: porousmediumflow/solidenergy/localresidual.hh:65
NumEqVector computeFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const ElementFluxVariablesCache &elemFluxVarsCache) const
Evaluate the energy flux over a face of a sub control volume.
Definition: porousmediumflow/solidenergy/localresidual.hh:89
Declares all properties used in Dumux.