version 3.8
localresidual_incompressible.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//
14#ifndef DUMUX_ENERGY_LOCAL_RESIDUAL_INCOMPRESSIBLE_HH
15#define DUMUX_ENERGY_LOCAL_RESIDUAL_INCOMPRESSIBLE_HH
16
19#include "localresidual.hh"
20
21namespace Dumux {
22
23// forward declaration
24template<class TypeTag, bool enableEneryBalance>
26
27template<class TypeTag>
29
34template<class TypeTag>
36{}; //energy balance not enabled
37
42template<class TypeTag>
44{
48 using FVElementGeometry = typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView;
49 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
52 using Element = typename GridView::template Codim<0>::Entity;
53 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
55 using Indices = typename ModelTraits::Indices;
56
57 static constexpr int numPhases = ModelTraits::numFluidPhases();
58 enum { energyEqIdx = Indices::energyEqIdx };
59
60public:
82 static void heatConvectionFlux(NumEqVector& flux,
83 FluxVariables& fluxVars,
84 int phaseIdx)
85 {
86 // internal energy used instead of enthalpy for incompressible flow
87 auto upwindTerm = [phaseIdx](const auto& volVars)
88 { return volVars.density(phaseIdx)*volVars.mobility(phaseIdx)*volVars.internalEnergy(phaseIdx); };
89
90 flux[energyEqIdx] += fluxVars.advectiveFlux(phaseIdx, upwindTerm);
91 }
92};
93
94} // end namespace Dumux
95
96#endif
Definition: porousmediumflow/nonisothermal/localresidual.hh:24
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes for incompressible flow.
Definition: localresidual_incompressible.hh:82
Definition: localresidual_incompressible.hh:25
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.
Element-wise calculation of the local residual for problems using fully implicit tracer model.