GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/johansen.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 7 15 46.7%
Functions: 0 1 0.0%
Branches: 0 2 0.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 #ifndef DUMUX_MATERIAL_FLUIDMATRIX_THERMALCONDUCTIVITY_JOHANSEN_HH
8 #define DUMUX_MATERIAL_FLUIDMATRIX_THERMALCONDUCTIVITY_JOHANSEN_HH
9
10 #include <cmath>
11 #include <algorithm>
12
13 namespace Dumux {
14
15 /*!
16 * \addtogroup EffectiveHeatConductivity
17 * \copydetails Dumux::ThermalConductivityJohansen
18 */
19
20 /*!
21 * \ingroup EffectiveHeatConductivity
22 * \brief Relation for the saturation-dependent effective thermal conductivity
23 *
24 * ### Johansen (two fluid phases)
25 *
26 * `ThermalConductivityJohansen` \cite johansen1977 computes the thermal conductivity of dry and the
27 * wet soil material and interpolates using the Kersten number. The effective wet conductivity
28 * is based on a geometric average and the effective dry conductivity is based on a semi-emprical
29 * relation and fitted to medium quartz sand.
30 *
31 * The effective thermal conductivity is given by
32 * \f[
33 * \lambda_\text{eff} = \lambda_{\text{dry}} + \text{Ke} \left(\lambda_\text{wet} - \lambda_\text{dry}\right), \quad
34 * \lambda_\text{wet} = \lambda_\text{s}^{\left(1-\phi\right)} \lambda_\text{w}^\phi, \quad
35 * \lambda_\text{dry} = \frac{0.135 \rho_\text{s} \phi + 64.7}{\rho_\text{s} - 0.947 \rho_\text{s} \phi},
36 * \f]
37 * where \f$ \phi \f$ is the porosity, \f$ \lambda_\alpha \f$ is the thermal conductivity
38 * of phase \f$ \alpha \f$, \f$ \rho_\text{s} \f$ denotes the density of the solid phase, and the
39 * Kersten number is given by \f$ \text{Ke} = (\kappa S_\text{w})/(1 + (1-\kappa) S_\text{w}) \f$,
40 * with the wetting phase saturation \f$ S_w \f$ and a fitting parameter \f$ \kappa = 15.6 \f$
41 * for medium quartz sand.
42 */
43 template<class Scalar>
44 class ThermalConductivityJohansen
45 {
46 public:
47 /*!
48 * \brief Effective thermal conductivity in \f$\mathrm{W/(m K)}\f$ for two phases
49 * \param volVars volume variables
50 * \return Effective thermal conductivity in \f$\mathrm{W/(m K)}\f$ for two phases
51 */
52 template<class VolumeVariables>
53 static Scalar effectiveThermalConductivity(const VolumeVariables& volVars)
54 {
55 using FluidSystem = typename VolumeVariables::FluidSystem;
56 static_assert(FluidSystem::numPhases == 2, "ThermalConductivitySomerton only works for two-phase fluid systems!");
57 // TODO: there should be an assertion that the indices are correct and 0 is actually the wetting phase!
58
59 1001 const Scalar sw = volVars.saturation(volVars.wettingPhase());
60 1001 const Scalar lambdaW = volVars.fluidThermalConductivity(volVars.wettingPhase());
61 1001 const Scalar lambdaN = volVars.fluidThermalConductivity(1-volVars.wettingPhase());
62 1001 const Scalar lambdaSolid = volVars.solidThermalConductivity();
63 1001 const Scalar porosity = volVars.porosity();
64 1001 const Scalar rhoSolid = volVars.solidDensity();
65
66 1001 return effectiveThermalConductivity_(sw, lambdaW, lambdaN, lambdaSolid, porosity, rhoSolid);
67 }
68
69 private:
70 /*!
71 * \brief Effective thermal conductivity in \f$\mathrm{W/(m K)}\f$ for two phases
72 *
73 * \param Sw The saturation of the wetting phase
74 * \param lambdaW The thermal conductivity of the wetting phase in \f$\mathrm{W/(m K)}\f$
75 * \param lambdaN The thermal conductivity of the nonwetting phase in \f$\mathrm{W/(m K)}\f$
76 * \param lambdaSolid The thermal conductivity of the solid phase in \f$\mathrm{W/(m K)}\f$
77 * \param porosity The porosity
78 * \param rhoSolid The density of solid phase in \f$\mathrm{kg/m^3}\f$
79 *
80 * \return Effective thermal conductivity in \f$\mathrm{W/(m K)}\f$ for two phases
81 */
82 static Scalar effectiveThermalConductivity_(const Scalar Sw,
83 const Scalar lambdaW,
84 const Scalar lambdaN,
85 const Scalar lambdaSolid,
86 const Scalar porosity,
87 const Scalar rhoSolid)
88 {
89 using std::max;
90 const Scalar satW = max<Scalar>(0.0, Sw);
91
92 const Scalar kappa = 15.6; // fitted to medium quartz sand
93 const Scalar rhoBulk = rhoSolid*porosity;
94
95 using std::pow;
96
97 const Scalar lambdaSaturated = lambdaSolid * pow(lambdaW / lambdaSolid, porosity);
98 const Scalar lambdaDry = (0.135*rhoBulk + 64.7)/(rhoSolid - 0.947*rhoBulk);
99 const Scalar Ke = (kappa*satW)/(1+(kappa-1)*satW);// Kersten number, equation 13
100
101 return lambdaDry + Ke * (lambdaSaturated - lambdaDry); // equation 14
102 }
103 };
104
105 } // end namespace Dumux
106
107 #endif
108