GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/porousmediumflow/solidenergy/localresidual.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 9 12 75.0%
Functions: 0 6 0.0%
Branches: 2 10 20.0%

Line Branch Exec Source
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 //
7 /*!
8 * \file
9 * \ingroup SolidEnergyModel
10 * \brief Element-wise calculation of the residual
11 */
12 #ifndef DUMUX_SOLID_ENERGY_LOCAL_RESIDUAL_HH
13 #define DUMUX_SOLID_ENERGY_LOCAL_RESIDUAL_HH
14
15 #include <dumux/common/properties.hh>
16 #include <dumux/common/numeqvector.hh>
17
18 namespace Dumux {
19
20 /*!
21 * \ingroup SolidEnergyModel
22 * \brief Element-wise calculation of the residual
23 */
24 template<class TypeTag>
25 class SolidEnergyLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidual>
26 {
27 using ParentType = GetPropType<TypeTag, Properties::BaseLocalResidual>;
28 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
29 using Problem = GetPropType<TypeTag, Properties::Problem>;
30 using NumEqVector = Dumux::NumEqVector<GetPropType<TypeTag, Properties::PrimaryVariables>>;
31 using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>;
32 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
33 using FluxVariables = GetPropType<TypeTag, Properties::FluxVariables>;
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;
38 using GridView = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView;
39 using Element = typename GridView::template Codim<0>::Entity;
40
41 public:
42
2/4
✓ Branch 1 taken 200001 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 200001 times.
✗ Branch 5 not taken.
492354 using ParentType::ParentType;
43
44 /*!
45 * \brief Evaluate the rate of change of all conservation quantites
46 * \param problem The problem
47 * \param scv The sub control volume
48 * \param volVars The current or previous volVars
49 * \note This function should not include the source and sink terms.
50 * \note The volVars can be different to allow computing
51 * the implicit/explicit euler time derivative here
52 */
53 NumEqVector computeStorage(const Problem& problem,
54 const SubControlVolume& scv,
55 const VolumeVariables& volVars) const
56 {
57 1238048 NumEqVector storage;
58 1238048 storage[0] = volVars.temperatureSolid()
59 2476096 * volVars.solidHeatCapacity()
60 1238048 * volVars.solidDensity()
61 2476096 * (1.0 - volVars.porosity());
62
63 return storage;
64 }
65
66
67 /*!
68 * \brief Evaluate the energy flux over a face of a sub control volume
69 *
70 * \param problem The problem
71 * \param element The element
72 * \param fvGeometry The finite volume geometry context
73 * \param elemVolVars The volume variables for all flux stencil elements
74 * \param scvf The sub control volume face to compute the flux on
75 * \param elemFluxVarsCache The cache related to flux computation
76 */
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
0/2
✗ Branch 1 not taken.
✗ Branch 2 not taken.
3313080 FluxVariables fluxVars;
85
0/2
✗ Branch 1 not taken.
✗ Branch 2 not taken.
3313080 fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
86
0/2
✗ Branch 1 not taken.
✗ Branch 2 not taken.
3313080 return fluxVars.heatConductionFlux();
87 }
88 };
89
90 } // end namespace Dumux
91
92 #endif
93