version 3.8
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_SOLID_ENERGY_LOCAL_RESIDUAL_HH
13#define DUMUX_SOLID_ENERGY_LOCAL_RESIDUAL_HH
14
17
18namespace Dumux {
19
24template<class TypeTag>
25class SolidEnergyLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidual>
26{
32 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
34 using ElementFluxVariablesCache = typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView;
35 using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
36 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
37 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
39 using Element = typename GridView::template Codim<0>::Entity;
40
41public:
42 using ParentType::ParentType;
43
53 NumEqVector computeStorage(const Problem& problem,
54 const SubControlVolume& scv,
55 const VolumeVariables& volVars) const
56 {
57 NumEqVector storage;
58 storage[0] = volVars.temperatureSolid()
59 * volVars.solidHeatCapacity()
60 * volVars.solidDensity()
61 * (1.0 - volVars.porosity());
62
63 return storage;
64 }
65
66
77 NumEqVector computeFlux(const Problem& problem,
78 const Element& element,
79 const FVElementGeometry& fvGeometry,
80 const ElementVolumeVariables& elemVolVars,
81 const SubControlVolumeFace& scvf,
82 const ElementFluxVariablesCache& elemFluxVarsCache) const
83 {
84 FluxVariables fluxVars;
85 fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
86 return fluxVars.heatConductionFlux();
87 }
88};
89
90} // end namespace Dumux
91
92#endif
Element-wise calculation of the residual.
Definition: porousmediumflow/solidenergy/localresidual.hh:26
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:53
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:77
Defines all properties used in Dumux.
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:34
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
Definition: adapt.hh:17
A helper to deduce a vector with the same size as numbers of equations.