version 3.10-dev
somerton.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//
7#ifndef DUMUX_MATERIAL_FLUIDMATRIX_THERMALCONDUCTIVITY_SOMERTON_TWO_P_HH
8#define DUMUX_MATERIAL_FLUIDMATRIX_THERMALCONDUCTIVITY_SOMERTON_TWO_P_HH
9
10#include <algorithm>
11#include <cmath>
12
13namespace Dumux {
14
44template<class Scalar>
46{
47public:
53 template<class VolumeVariables>
54 static Scalar effectiveThermalConductivity(const VolumeVariables& volVars)
55 {
56 using FluidSystem = typename VolumeVariables::FluidSystem;
57 static_assert(FluidSystem::numPhases == 2, "ThermalConductivitySomertonTwoP only works for two-phase fluid systems!");
58 static_assert((FluidSystem::isGas(0) && !FluidSystem::isGas(1)) || (!FluidSystem::isGas(0) && FluidSystem::isGas(1)),
59 "ThermalConductivitySomertonTwoP only works if one phase is gaseous and one is liquid!");
60
61 constexpr int liquidPhaseIdx = FluidSystem::isGas(0) ? 1 : 0;
62 constexpr int gasPhaseIdx = FluidSystem::isGas(0) ? 0 : 1;
63
64 const Scalar satLiquid = volVars.saturation(liquidPhaseIdx);
65 const Scalar lambdaLiquid = volVars.fluidThermalConductivity(liquidPhaseIdx);
66 const Scalar lambdaGas = volVars.fluidThermalConductivity(gasPhaseIdx);
67 const Scalar lambdaSolid = volVars.solidThermalConductivity();
68 const Scalar porosity = volVars.porosity();
69
70 return effectiveThermalConductivity_(satLiquid, lambdaLiquid, lambdaGas, lambdaSolid, porosity);
71 }
72
73private:
85 static Scalar effectiveThermalConductivity_(const Scalar satLiquid,
86 const Scalar lambdaLiquid,
87 const Scalar lambdaGas,
88 const Scalar lambdaSolid,
89 const Scalar porosity)
90 {
91 using std::max;
92 using std::pow;
93 using std::sqrt;
94 const Scalar satLiquidPhysical = max<Scalar>(0.0, satLiquid);
95 // geometric mean, using ls^(1-p)*l^p = ls*(l/ls)^p
96 const Scalar lambdaSaturated = lambdaSolid * pow(lambdaLiquid / lambdaSolid, porosity);
97 const Scalar lambdaDry = lambdaSolid * pow(lambdaGas / lambdaSolid, porosity);
98
99 return lambdaDry + sqrt(satLiquidPhysical) * (lambdaSaturated - lambdaDry);
100 }
101};
102
103#ifndef DOXYGEN
104template<class Scalar>
105using ThermalConductivitySomerton [[deprecated("Use ThermalConductivitySomertonTwoP. Will be removed after 3.9.")]] = ThermalConductivitySomertonTwoP<Scalar>;
106#endif
107
108} // end namespace Dumux
109
110#endif
Effective thermal conductivity after Somerton.
Definition: somerton.hh:46
static Scalar effectiveThermalConductivity(const VolumeVariables &volVars)
Effective thermal conductivity in for two phases.
Definition: somerton.hh:54
std::string porosity() noexcept
I/O name of porosity.
Definition: name.hh:127
Definition: adapt.hh:17