From 6543a0177001e842a39d1a9c0e358799dfc3ea19 Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Thu, 24 Sep 2020 13:40:22 +0200 Subject: [PATCH 1/2] [material][2p] Move thermalconductivity laws to their own folder --- .../fluidmatrixinteractions/2p/CMakeLists.txt | 2 + .../2p/thermalconductivity/CMakeLists.txt | 5 + .../2p/thermalconductivity/johansen.hh | 129 ++++++++++++++++++ .../thermalconductivity/simplefluidlumping.hh | 84 ++++++++++++ .../2p/thermalconductivity/somerton.hh | 128 +++++++++++++++++ .../2p/thermalconductivityjohansen.hh | 126 +---------------- .../thermalconductivitysimplefluidlumping.hh | 81 +---------- .../2p/thermalconductivitysomerton.hh | 125 +---------------- 8 files changed, 354 insertions(+), 326 deletions(-) create mode 100644 dumux/material/fluidmatrixinteractions/2p/thermalconductivity/CMakeLists.txt create mode 100644 dumux/material/fluidmatrixinteractions/2p/thermalconductivity/johansen.hh create mode 100644 dumux/material/fluidmatrixinteractions/2p/thermalconductivity/simplefluidlumping.hh create mode 100644 dumux/material/fluidmatrixinteractions/2p/thermalconductivity/somerton.hh diff --git a/dumux/material/fluidmatrixinteractions/2p/CMakeLists.txt b/dumux/material/fluidmatrixinteractions/2p/CMakeLists.txt index 6f6255385f..d2a4aacc96 100644 --- a/dumux/material/fluidmatrixinteractions/2p/CMakeLists.txt +++ b/dumux/material/fluidmatrixinteractions/2p/CMakeLists.txt @@ -1,3 +1,5 @@ +add_subdirectory(thermalconductivity) + install(FILES brookscorey.hh brookscoreyparams.hh diff --git a/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/CMakeLists.txt b/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/CMakeLists.txt new file mode 100644 index 0000000000..34760f6ec3 --- /dev/null +++ b/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/CMakeLists.txt @@ -0,0 +1,5 @@ +install(FILES +johansen.hh +simplefluidlumping.hh +somerton.hh +DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/material/fluidmatrixinteractions/2p/thermalconductivity) diff --git a/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/johansen.hh b/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/johansen.hh new file mode 100644 index 0000000000..be4be1f51b --- /dev/null +++ b/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/johansen.hh @@ -0,0 +1,129 @@ + // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * \ingroup Fluidmatrixinteractions + * \brief Relation for the saturation-dependent effective thermal conductivity + */ +#ifndef DUMUX_MATERIAL_FLUIDMATRIX_THERMALCONDUCTIVITY_JOHANSEN_HH +#define DUMUX_MATERIAL_FLUIDMATRIX_THERMALCONDUCTIVITY_JOHANSEN_HH + +#include +#include + +namespace Dumux { + +/*! + * \ingroup Fluidmatrixinteractions + * \brief Relation for the saturation-dependent effective thermal conductivity + * + * The Johansen method (Johansen 1975 \cite johansen1977 ) computes the thermal conductivity of dry and the + * wet soil material and uses a root function of the wetting saturation to compute the + * effective thermal conductivity for a two-phase fluidsystem. The individual thermal + * conductivities are calculated as geometric mean of the thermal conductivity of the porous + * material and of the respective fluid phase. + * The material law is: + * \f$\mathrm{[ + \lambda_\text{eff} = \lambda_{\text{dry}} + \sqrt{(S_w)} \left(\lambda_\text{wet} - \lambda_\text{dry}\right) + }\f$ + * + * with + * \f$\mathrm{ + \lambda_\text{wet} = \lambda_{solid}^{\left(1-\phi\right)}*\lambda_w^\phi + }\f$ + * and the semi-empirical relation + * + * \f$\mathrm{ + \lambda_\text{dry} = \frac{0.135*\rho_s*\phi + 64.7}{\rho_s - 0.947 \rho_s*\phi}. + }\f$ + * + * Source: Phdthesis (Johansen1975) Johansen, O. Thermal conductivity of soils Norw. Univ. of Sci. Technol., Trondheim, Norway, 1975 \cite johansen1977 + */ +template +class ThermalConductivityJohansen +{ +public: + /*! + * \brief Returns the effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Johansen (1975) \cite johansen1977 . + * + * \param volVars volume variables + * \return Effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Johansen (1975) \cite johansen1977
+ * + * This formulation is semi-empirical and fitted to quartz sand. + * This gives an interpolation of the effective thermal conductivities of a porous medium + * filled with the non-wetting phase and a porous medium filled with the wetting phase. + * These two effective conductivities are computed as geometric mean of the solid and the + * fluid conductivities and interpolated with the Kersten number.
+ * Johansen, O. 1975. Thermal conductivity of soils. Ph.D. diss. Norwegian Univ. + * of Sci. and Technol., Trondheim. (Draft Transl. 637. 1977. U.S. Army + * Corps of Eng., Cold Regions Res. and Eng. Lab., Hanover, NH.) \cite johansen1977 + */ + template + static Scalar effectiveThermalConductivity(const VolumeVariables& volVars) + { + using FluidSystem = typename VolumeVariables::FluidSystem; + static_assert(FluidSystem::numPhases == 2, "ThermalConductivitySomerton only works for two-phase fluid systems!"); + // TODO: there should be an assertion that the indices are correct and 0 is actually the wetting phase! + + const Scalar sw = volVars.saturation(volVars.wettingPhase()); + const Scalar lambdaW = volVars.fluidThermalConductivity(volVars.wettingPhase()); + const Scalar lambdaN = volVars.fluidThermalConductivity(1-volVars.wettingPhase()); + const Scalar lambdaSolid = volVars.solidThermalConductivity(); + const Scalar porosity = volVars.porosity(); + const Scalar rhoSolid = volVars.solidDensity(); + + return effectiveThermalConductivity_(sw, lambdaW, lambdaN, lambdaSolid, porosity, rhoSolid); + } + +private: + /*! + * \brief Returns the effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Johansen (1975) \cite johansen1977 . + * + * \param Sw The saturation of the wetting phase + * \param lambdaW The thermal conductivity of the wetting phase in \f$\mathrm{[W/(m K)]}\f$ + * \param lambdaN The thermal conductivity of the non-wetting phase in \f$\mathrm{[W/(m K)]}\f$ + * \param lambdaSolid The thermal conductivity of the solid phase in \f$\mathrm{[W/(m K)]}\f$ + * \param porosity The porosity + * \param rhoSolid The density of solid phase in \f$\mathrm{[kg/m^3]}\f$ + * + * \return Effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Johansen (1975) \cite johansen1977 + */ + static Scalar effectiveThermalConductivity_(const Scalar Sw, + const Scalar lambdaW, + const Scalar lambdaN, + const Scalar lambdaSolid, + const Scalar porosity, + const Scalar rhoSolid) + { + using std::max; + const Scalar satW = max(0.0, Sw); + + const Scalar kappa = 15.6; // fitted to medium quartz sand + const Scalar rhoBulk = rhoSolid*porosity; + + using std::pow; + const Scalar lSat = lambdaSolid * pow(lambdaW / lambdaSolid, porosity); + const Scalar lDry = (0.135*rhoBulk + 64.7)/(rhoSolid - 0.947*rhoBulk); + const Scalar Ke = (kappa*satW)/(1+(kappa-1)*satW);// Kersten number, equation 13 + + return lDry + Ke * (lSat - lDry); // equation 14 + } +}; +} // end namespace Dumux +#endif diff --git a/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/simplefluidlumping.hh b/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/simplefluidlumping.hh new file mode 100644 index 0000000000..3580e2a5a3 --- /dev/null +++ b/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/simplefluidlumping.hh @@ -0,0 +1,84 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * \ingroup Fluidmatrixinteractions + * \brief Relation for the saturation-dependent effective thermal conductivity + */ +#ifndef DUMUX_MATERIAL_FLUIDMATRIX_THERMALCONDUCTIVITY_SIMPLE_FLUID_LUMPING_HH +#define DUMUX_MATERIAL_FLUIDMATRIX_THERMALCONDUCTIVITY_SIMPLE_FLUID_LUMPING_HH + +#include +#include + +namespace Dumux { + +/*! + * \ingroup Fluidmatrixinteractions + * \brief Relation for the saturation-dependent effective thermal conductivity + */ +template +class ThermalConductivitySimpleFluidLumping +{ +public: + /*! + * \brief Effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ + * + * \param volVars volume variables + * \return effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ + */ + template + static Scalar effectiveThermalConductivity(const VolumeVariables& volVars) + { + using FluidSystem = typename VolumeVariables::FluidSystem; + const Scalar sw = volVars.saturation(FluidSystem::phase0Idx); + const Scalar lambdaW = volVars.fluidThermalConductivity(FluidSystem::phase0Idx); + const Scalar lambdaN = volVars.fluidThermalConductivity(FluidSystem::phase1Idx); + const Scalar lambdaSolid = volVars.solidThermalConductivity(); + const Scalar porosity = volVars.porosity(); + + return effectiveThermalConductivity_(sw, lambdaW, lambdaN, lambdaSolid, porosity); + } + +private: + /*! + * \brief Returns the effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$. + * + * \param sw The saturation of the wetting phase + * \param lambdaW The thermal conductivity of the wetting phase in \f$\mathrm{[W/(m K)]}\f$ + * \param lambdaN The thermal conductivity of the non-wetting phase in \f$\mathrm{[W/(m K)]}\f$ + * \param lambdaSolid The thermal conductivity of the solid phase in \f$\mathrm{[W/(m K)]}\f$ + * \param porosity The porosity + * + * \return Effective thermal conductivity of the fluid phases + */ + static Scalar effectiveThermalConductivity_(const Scalar sw, + const Scalar lambdaW, + const Scalar lambdaN, + const Scalar lambdaSolid, + const Scalar porosity) + { + // Franz Lindner / Shi & Wang 2011 + using std::max; + const Scalar satW = max(0.0, sw); + return porosity * ( (1. - satW) * lambdaN + satW * lambdaW ) + (1.0 - porosity) * lambdaSolid ; ; // arithmetic + } +}; +} // end namespace Dumux +#endif diff --git a/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/somerton.hh b/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/somerton.hh new file mode 100644 index 0000000000..33e0d94a02 --- /dev/null +++ b/dumux/material/fluidmatrixinteractions/2p/thermalconductivity/somerton.hh @@ -0,0 +1,128 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/***************************************************************************** + * See the file COPYING for full copying permissions. * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation, either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see . * + *****************************************************************************/ +/*! + * \file + * \ingroup Fluidmatrixinteractions + * \brief Relation for the saturation-dependent effective thermal conductivity + */ +#ifndef DUMUX_MATERIAL_FLUIDMATRIX_THERMALCONDUCTIVITY_SOMERTON_HH +#define DUMUX_MATERIAL_FLUIDMATRIX_THERMALCONDUCTIVITY_SOMERTON_HH + +#include +#include + +namespace Dumux { + +/*! + * \ingroup Fluidmatrixinteractions + * \brief Relation for the saturation-dependent effective thermal conductivity + * + * The Somerton method computes the thermal conductivity of dry and the wet soil material + * and uses a root function of the wetting saturation to compute the + * effective thermal conductivity for a two-phase fluidsystem. The individual thermal + * conductivities are calculated as geometric mean of the thermal conductivity of the porous + * material and of the respective fluid phase. + * + * The material law is: + * \f$\mathrm{ + \lambda_\text{eff} = \lambda_{\text{dry}} + \sqrt{(S_w)} \left(\lambda_\text{wet} - \lambda_\text{dry}\right) + }\f$ + * + * with + * \f$\mathrm{ + \lambda_\text{wet} = \lambda_{solid}^{\left(1-\phi\right)}*\lambda_w^\phi + }\f$ + * and + * + * \f$\mathrm{ + \lambda_\text{dry} = \lambda_{solid}^{\left(1-\phi\right)}*\lambda_n^\phi. + }\f$ + * + */ +template +class ThermalConductivitySomerton +{ +public: + /*! + * \brief effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Somerton (1974) \cite somerton1974
+ * + * \param volVars volume variables + * \return effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Somerton (1974) \cite somerton1974
+ * + * This gives an interpolation of the effective thermal conductivities of a porous medium + * filled with the non-wetting phase and a porous medium filled with the wetting phase. + * These two effective conductivities are computed as geometric mean of the solid and the + * fluid conductivities and interpolated with the square root of the wetting saturation. + * See f.e. Ebigbo, A.: Thermal Effects of Carbon Dioxide Sequestration in the Subsurface, Diploma thesis \cite ebigbo2005 . + */ + template + static Scalar effectiveThermalConductivity(const VolumeVariables& volVars) + { + using FluidSystem = typename VolumeVariables::FluidSystem; + static_assert(FluidSystem::numPhases == 2, "ThermalConductivitySomerton only works for two-phase fluid systems!"); + static_assert((FluidSystem::isGas(0) && !FluidSystem::isGas(1)) || (!FluidSystem::isGas(0) && FluidSystem::isGas(1)), + "ThermalConductivitySomerton only works if one phase is gaseous and one is liquid!"); + + constexpr int liquidPhaseIdx = FluidSystem::isGas(0) ? 1 : 0; + constexpr int gasPhaseIdx = FluidSystem::isGas(0) ? 0 : 1; + + const Scalar satLiquid = volVars.saturation(liquidPhaseIdx); + const Scalar lambdaLiquid = volVars.fluidThermalConductivity(liquidPhaseIdx); + const Scalar lambdaGas = volVars.fluidThermalConductivity(gasPhaseIdx); + const Scalar lambdaSolid = volVars.solidThermalConductivity(); + const Scalar porosity = volVars.porosity(); + + return effectiveThermalConductivity_(satLiquid, lambdaLiquid, lambdaGas, lambdaSolid, porosity); + } + +private: + /*! + * \brief effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Somerton (1974) \cite somerton1974
+ * + * \param satLiquid The saturation of the liquid phase + * \param lambdaLiquid The thermal conductivity of the liquid phase in \f$\mathrm{[W/(m K)]}\f$ + * \param lambdaGas The thermal conductivity of the gas phase in \f$\mathrm{[W/(m K)]}\f$ + * \param lambdaSolid The thermal conductivity of the solid phase in \f$\mathrm{[W/(m K)]}\f$ + * \param porosity The porosity + * \param rhoSolid The density of solid phase in \f$\mathrm{[kg/m^3]}\f$ + * + * \return effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Somerton (1974) \cite somerton1974 + */ + static Scalar effectiveThermalConductivity_(const Scalar satLiquid, + const Scalar lambdaLiquid, + const Scalar lambdaGas, + const Scalar lambdaSolid, + const Scalar porosity, + const Scalar rhoSolid = 0.0 /*unused*/) + { + using std::max; + using std::pow; + using std::sqrt; + const Scalar satLiquidPhysical = max(0.0, satLiquid); + // geometric mean, using ls^(1-p)*l^p = ls*(l/ls)^p + const Scalar lSat = lambdaSolid * pow(lambdaLiquid / lambdaSolid, porosity); + const Scalar lDry = lambdaSolid * pow(lambdaGas / lambdaSolid, porosity); + + return lDry + sqrt(satLiquidPhysical) * (lSat - lDry); + } +}; + +} // end namespace Dumux + +#endif diff --git a/dumux/material/fluidmatrixinteractions/2p/thermalconductivityjohansen.hh b/dumux/material/fluidmatrixinteractions/2p/thermalconductivityjohansen.hh index aa52a5f322..763df214aa 100644 --- a/dumux/material/fluidmatrixinteractions/2p/thermalconductivityjohansen.hh +++ b/dumux/material/fluidmatrixinteractions/2p/thermalconductivityjohansen.hh @@ -1,129 +1,7 @@ - // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - *****************************************************************************/ -/*! - * \file - * \ingroup Fluidmatrixinteractions - * \brief Relation for the saturation-dependent effective thermal conductivity - */ #ifndef DUMUX_MATERIAL_THERMALCONDUCTIVITY_JOHANSEN_HH #define DUMUX_MATERIAL_THERMALCONDUCTIVITY_JOHANSEN_HH -#include -#include +#include +#warning "This header has been moved (will be removed after 3.3). Use thermalconductivity/johansen.hh" -namespace Dumux { - -/*! - * \ingroup Fluidmatrixinteractions - * \brief Relation for the saturation-dependent effective thermal conductivity - * - * The Johansen method (Johansen 1975 \cite johansen1977 ) computes the thermal conductivity of dry and the - * wet soil material and uses a root function of the wetting saturation to compute the - * effective thermal conductivity for a two-phase fluidsystem. The individual thermal - * conductivities are calculated as geometric mean of the thermal conductivity of the porous - * material and of the respective fluid phase. - * The material law is: - * \f$\mathrm{[ - \lambda_\text{eff} = \lambda_{\text{dry}} + \sqrt{(S_w)} \left(\lambda_\text{wet} - \lambda_\text{dry}\right) - }\f$ - * - * with - * \f$\mathrm{ - \lambda_\text{wet} = \lambda_{solid}^{\left(1-\phi\right)}*\lambda_w^\phi - }\f$ - * and the semi-empirical relation - * - * \f$\mathrm{ - \lambda_\text{dry} = \frac{0.135*\rho_s*\phi + 64.7}{\rho_s - 0.947 \rho_s*\phi}. - }\f$ - * - * Source: Phdthesis (Johansen1975) Johansen, O. Thermal conductivity of soils Norw. Univ. of Sci. Technol., Trondheim, Norway, 1975 \cite johansen1977 - */ -template -class ThermalConductivityJohansen -{ -public: - /*! - * \brief Returns the effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Johansen (1975) \cite johansen1977 . - * - * \param volVars volume variables - * \return Effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Johansen (1975) \cite johansen1977
- * - * This formulation is semi-empirical and fitted to quartz sand. - * This gives an interpolation of the effective thermal conductivities of a porous medium - * filled with the non-wetting phase and a porous medium filled with the wetting phase. - * These two effective conductivities are computed as geometric mean of the solid and the - * fluid conductivities and interpolated with the Kersten number.
- * Johansen, O. 1975. Thermal conductivity of soils. Ph.D. diss. Norwegian Univ. - * of Sci. and Technol., Trondheim. (Draft Transl. 637. 1977. U.S. Army - * Corps of Eng., Cold Regions Res. and Eng. Lab., Hanover, NH.) \cite johansen1977 - */ - template - static Scalar effectiveThermalConductivity(const VolumeVariables& volVars) - { - using FluidSystem = typename VolumeVariables::FluidSystem; - static_assert(FluidSystem::numPhases == 2, "ThermalConductivitySomerton only works for two-phase fluid systems!"); - // TODO: there should be an assertion that the indices are correct and 0 is actually the wetting phase! - - const Scalar sw = volVars.saturation(volVars.wettingPhase()); - const Scalar lambdaW = volVars.fluidThermalConductivity(volVars.wettingPhase()); - const Scalar lambdaN = volVars.fluidThermalConductivity(1-volVars.wettingPhase()); - const Scalar lambdaSolid = volVars.solidThermalConductivity(); - const Scalar porosity = volVars.porosity(); - const Scalar rhoSolid = volVars.solidDensity(); - - return effectiveThermalConductivity_(sw, lambdaW, lambdaN, lambdaSolid, porosity, rhoSolid); - } - -private: - /*! - * \brief Returns the effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Johansen (1975) \cite johansen1977 . - * - * \param Sw The saturation of the wetting phase - * \param lambdaW The thermal conductivity of the wetting phase in \f$\mathrm{[W/(m K)]}\f$ - * \param lambdaN The thermal conductivity of the non-wetting phase in \f$\mathrm{[W/(m K)]}\f$ - * \param lambdaSolid The thermal conductivity of the solid phase in \f$\mathrm{[W/(m K)]}\f$ - * \param porosity The porosity - * \param rhoSolid The density of solid phase in \f$\mathrm{[kg/m^3]}\f$ - * - * \return Effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Johansen (1975) \cite johansen1977 - */ - static Scalar effectiveThermalConductivity_(const Scalar Sw, - const Scalar lambdaW, - const Scalar lambdaN, - const Scalar lambdaSolid, - const Scalar porosity, - const Scalar rhoSolid) - { - using std::max; - const Scalar satW = max(0.0, Sw); - - const Scalar kappa = 15.6; // fitted to medium quartz sand - const Scalar rhoBulk = rhoSolid*porosity; - - using std::pow; - const Scalar lSat = lambdaSolid * pow(lambdaW / lambdaSolid, porosity); - const Scalar lDry = (0.135*rhoBulk + 64.7)/(rhoSolid - 0.947*rhoBulk); - const Scalar Ke = (kappa*satW)/(1+(kappa-1)*satW);// Kersten number, equation 13 - - return lDry + Ke * (lSat - lDry); // equation 14 - } -}; -} // end namespace Dumux #endif diff --git a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh index b24dbc2a9e..da2fd545e1 100644 --- a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh +++ b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysimplefluidlumping.hh @@ -1,84 +1,7 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - *****************************************************************************/ -/*! - * \file - * \ingroup Fluidmatrixinteractions - * \brief Relation for the saturation-dependent effective thermal conductivity - */ #ifndef DUMUX_MATERIAL_THERMALCONDUCTIVITY_SIMPLE_FLUID_LUMPING_HH #define DUMUX_MATERIAL_THERMALCONDUCTIVITY_SIMPLE_FLUID_LUMPING_HH -#include -#include +#include +#warning "This header has been moved (will be removed after 3.3). Use thermalconductivity/simplefluidlumping.hh" -namespace Dumux { - -/*! - * \ingroup Fluidmatrixinteractions - * \brief Relation for the saturation-dependent effective thermal conductivity - */ -template -class ThermalConductivitySimpleFluidLumping -{ -public: - /*! - * \brief Effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ - * - * \param volVars volume variables - * \return effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ - */ - template - static Scalar effectiveThermalConductivity(const VolumeVariables& volVars) - { - using FluidSystem = typename VolumeVariables::FluidSystem; - const Scalar sw = volVars.saturation(FluidSystem::phase0Idx); - const Scalar lambdaW = volVars.fluidThermalConductivity(FluidSystem::phase0Idx); - const Scalar lambdaN = volVars.fluidThermalConductivity(FluidSystem::phase1Idx); - const Scalar lambdaSolid = volVars.solidThermalConductivity(); - const Scalar porosity = volVars.porosity(); - - return effectiveThermalConductivity_(sw, lambdaW, lambdaN, lambdaSolid, porosity); - } - -private: - /*! - * \brief Returns the effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$. - * - * \param sw The saturation of the wetting phase - * \param lambdaW The thermal conductivity of the wetting phase in \f$\mathrm{[W/(m K)]}\f$ - * \param lambdaN The thermal conductivity of the non-wetting phase in \f$\mathrm{[W/(m K)]}\f$ - * \param lambdaSolid The thermal conductivity of the solid phase in \f$\mathrm{[W/(m K)]}\f$ - * \param porosity The porosity - * - * \return Effective thermal conductivity of the fluid phases - */ - static Scalar effectiveThermalConductivity_(const Scalar sw, - const Scalar lambdaW, - const Scalar lambdaN, - const Scalar lambdaSolid, - const Scalar porosity) - { - // Franz Lindner / Shi & Wang 2011 - using std::max; - const Scalar satW = max(0.0, sw); - return porosity * ( (1. - satW) * lambdaN + satW * lambdaW ) + (1.0 - porosity) * lambdaSolid ; ; // arithmetic - } -}; -} // end namespace Dumux #endif diff --git a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh index 438103c2b4..f6551f5747 100644 --- a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh +++ b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh @@ -1,128 +1,7 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - *****************************************************************************/ -/*! - * \file - * \ingroup Fluidmatrixinteractions - * \brief Relation for the saturation-dependent effective thermal conductivity - */ #ifndef DUMUX_MATERIAL_THERMALCONDUCTIVITY_SOMERTON_HH #define DUMUX_MATERIAL_THERMALCONDUCTIVITY_SOMERTON_HH -#include -#include - -namespace Dumux { - -/*! - * \ingroup Fluidmatrixinteractions - * \brief Relation for the saturation-dependent effective thermal conductivity - * - * The Somerton method computes the thermal conductivity of dry and the wet soil material - * and uses a root function of the wetting saturation to compute the - * effective thermal conductivity for a two-phase fluidsystem. The individual thermal - * conductivities are calculated as geometric mean of the thermal conductivity of the porous - * material and of the respective fluid phase. - * - * The material law is: - * \f$\mathrm{ - \lambda_\text{eff} = \lambda_{\text{dry}} + \sqrt{(S_w)} \left(\lambda_\text{wet} - \lambda_\text{dry}\right) - }\f$ - * - * with - * \f$\mathrm{ - \lambda_\text{wet} = \lambda_{solid}^{\left(1-\phi\right)}*\lambda_w^\phi - }\f$ - * and - * - * \f$\mathrm{ - \lambda_\text{dry} = \lambda_{solid}^{\left(1-\phi\right)}*\lambda_n^\phi. - }\f$ - * - */ -template -class ThermalConductivitySomerton -{ -public: - /*! - * \brief effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Somerton (1974) \cite somerton1974
- * - * \param volVars volume variables - * \return effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Somerton (1974) \cite somerton1974
- * - * This gives an interpolation of the effective thermal conductivities of a porous medium - * filled with the non-wetting phase and a porous medium filled with the wetting phase. - * These two effective conductivities are computed as geometric mean of the solid and the - * fluid conductivities and interpolated with the square root of the wetting saturation. - * See f.e. Ebigbo, A.: Thermal Effects of Carbon Dioxide Sequestration in the Subsurface, Diploma thesis \cite ebigbo2005 . - */ - template - static Scalar effectiveThermalConductivity(const VolumeVariables& volVars) - { - using FluidSystem = typename VolumeVariables::FluidSystem; - static_assert(FluidSystem::numPhases == 2, "ThermalConductivitySomerton only works for two-phase fluid systems!"); - static_assert((FluidSystem::isGas(0) && !FluidSystem::isGas(1)) || (!FluidSystem::isGas(0) && FluidSystem::isGas(1)), - "ThermalConductivitySomerton only works if one phase is gaseous and one is liquid!"); - - constexpr int liquidPhaseIdx = FluidSystem::isGas(0) ? 1 : 0; - constexpr int gasPhaseIdx = FluidSystem::isGas(0) ? 0 : 1; - - const Scalar satLiquid = volVars.saturation(liquidPhaseIdx); - const Scalar lambdaLiquid = volVars.fluidThermalConductivity(liquidPhaseIdx); - const Scalar lambdaGas = volVars.fluidThermalConductivity(gasPhaseIdx); - const Scalar lambdaSolid = volVars.solidThermalConductivity(); - const Scalar porosity = volVars.porosity(); - - return effectiveThermalConductivity_(satLiquid, lambdaLiquid, lambdaGas, lambdaSolid, porosity); - } - -private: - /*! - * \brief effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Somerton (1974) \cite somerton1974
- * - * \param satLiquid The saturation of the liquid phase - * \param lambdaLiquid The thermal conductivity of the liquid phase in \f$\mathrm{[W/(m K)]}\f$ - * \param lambdaGas The thermal conductivity of the gas phase in \f$\mathrm{[W/(m K)]}\f$ - * \param lambdaSolid The thermal conductivity of the solid phase in \f$\mathrm{[W/(m K)]}\f$ - * \param porosity The porosity - * \param rhoSolid The density of solid phase in \f$\mathrm{[kg/m^3]}\f$ - * - * \return effective thermal conductivity \f$\mathrm{[W/(m K)]}\f$ after Somerton (1974) \cite somerton1974 - */ - static Scalar effectiveThermalConductivity_(const Scalar satLiquid, - const Scalar lambdaLiquid, - const Scalar lambdaGas, - const Scalar lambdaSolid, - const Scalar porosity, - const Scalar rhoSolid = 0.0 /*unused*/) - { - using std::max; - using std::pow; - using std::sqrt; - const Scalar satLiquidPhysical = max(0.0, satLiquid); - // geometric mean, using ls^(1-p)*l^p = ls*(l/ls)^p - const Scalar lSat = lambdaSolid * pow(lambdaLiquid / lambdaSolid, porosity); - const Scalar lDry = lambdaSolid * pow(lambdaGas / lambdaSolid, porosity); - - return lDry + sqrt(satLiquidPhysical) * (lSat - lDry); - } -}; - -} // end namespace Dumux +#include +#warning "This header has been moved (will be removed after 3.3). Use thermalconductivity/somerton.hh" #endif -- GitLab From 63fb38b5db749ae51ca2653cc5855f553778942f Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Thu, 24 Sep 2020 23:28:35 +0200 Subject: [PATCH 2/2] [cleanup] Use new thermalconductivity header paths --- dumux/porousmediumflow/2p/model.hh | 2 +- dumux/porousmediumflow/2p1c/model.hh | 2 +- dumux/porousmediumflow/2p2c/model.hh | 4 ++-- dumux/porousmediumflow/2pnc/model.hh | 2 +- dumux/porousmediumflow/2pncmin/model.hh | 2 +- dumux/porousmediumflow/mpnc/model.hh | 4 ++-- dumux/porousmediumflow/richards/model.hh | 2 +- .../fluidmatrixinteractions/2p/test_thermalconductivity.cc | 4 ++-- .../boundary/stokesdarcy/1p2c_2p2c/spatialparams.hh | 2 +- test/multidomain/boundary/stokesdarcy/1p_2p/spatialparams.hh | 2 +- .../mpnc/implicit/thermalnonequilibrium/problem.hh | 2 +- .../richards/implicit/nonisothermal/conduction/problem.hh | 2 +- .../richards/implicit/nonisothermal/convection/problem.hh | 2 +- .../richards/implicit/nonisothermal/evaporation/problem.hh | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dumux/porousmediumflow/2p/model.hh b/dumux/porousmediumflow/2p/model.hh index 65483bf6d7..998a20ad33 100644 --- a/dumux/porousmediumflow/2p/model.hh +++ b/dumux/porousmediumflow/2p/model.hh @@ -59,7 +59,7 @@ #include -#include +#include #include #include diff --git a/dumux/porousmediumflow/2p1c/model.hh b/dumux/porousmediumflow/2p1c/model.hh index c8d71eb778..83055d4224 100644 --- a/dumux/porousmediumflow/2p1c/model.hh +++ b/dumux/porousmediumflow/2p1c/model.hh @@ -61,7 +61,7 @@ #include -#include +#include #include #include diff --git a/dumux/porousmediumflow/2p2c/model.hh b/dumux/porousmediumflow/2p2c/model.hh index 6df10bc75b..8fc4795243 100644 --- a/dumux/porousmediumflow/2p2c/model.hh +++ b/dumux/porousmediumflow/2p2c/model.hh @@ -89,8 +89,8 @@ #include #include #include -#include -#include +#include +#include #include "volumevariables.hh" diff --git a/dumux/porousmediumflow/2pnc/model.hh b/dumux/porousmediumflow/2pnc/model.hh index 76370c2118..8dad8844b5 100644 --- a/dumux/porousmediumflow/2pnc/model.hh +++ b/dumux/porousmediumflow/2pnc/model.hh @@ -91,7 +91,7 @@ #include #include -#include +#include #include #include diff --git a/dumux/porousmediumflow/2pncmin/model.hh b/dumux/porousmediumflow/2pncmin/model.hh index 164a5dc8cf..0d837f2aa1 100644 --- a/dumux/porousmediumflow/2pncmin/model.hh +++ b/dumux/porousmediumflow/2pncmin/model.hh @@ -103,7 +103,7 @@ #include #include -#include +#include namespace Dumux { namespace Properties { diff --git a/dumux/porousmediumflow/mpnc/model.hh b/dumux/porousmediumflow/mpnc/model.hh index 0f3e397778..2a8b52cbf8 100644 --- a/dumux/porousmediumflow/mpnc/model.hh +++ b/dumux/porousmediumflow/mpnc/model.hh @@ -102,8 +102,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/dumux/porousmediumflow/richards/model.hh b/dumux/porousmediumflow/richards/model.hh index 6449bdf0eb..884fc96322 100644 --- a/dumux/porousmediumflow/richards/model.hh +++ b/dumux/porousmediumflow/richards/model.hh @@ -97,7 +97,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/test/material/fluidmatrixinteractions/2p/test_thermalconductivity.cc b/test/material/fluidmatrixinteractions/2p/test_thermalconductivity.cc index 15abace050..59e677062d 100644 --- a/test/material/fluidmatrixinteractions/2p/test_thermalconductivity.cc +++ b/test/material/fluidmatrixinteractions/2p/test_thermalconductivity.cc @@ -27,8 +27,8 @@ #include #include -#include -#include +#include +#include #include diff --git a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/spatialparams.hh b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/spatialparams.hh index 670788f6dc..8e63965ff1 100644 --- a/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/spatialparams.hh +++ b/test/multidomain/boundary/stokesdarcy/1p2c_2p2c/spatialparams.hh @@ -28,7 +28,7 @@ #include #include #include -#include +#include namespace Dumux { diff --git a/test/multidomain/boundary/stokesdarcy/1p_2p/spatialparams.hh b/test/multidomain/boundary/stokesdarcy/1p_2p/spatialparams.hh index 46405bb904..e78d2f634a 100644 --- a/test/multidomain/boundary/stokesdarcy/1p_2p/spatialparams.hh +++ b/test/multidomain/boundary/stokesdarcy/1p_2p/spatialparams.hh @@ -28,7 +28,7 @@ #include #include #include -#include +#include namespace Dumux { diff --git a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/problem.hh b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/problem.hh index 34a04be27e..de62ede286 100644 --- a/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/problem.hh +++ b/test/porousmediumflow/mpnc/implicit/thermalnonequilibrium/problem.hh @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include "spatialparams.hh" diff --git a/test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh b/test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh index 5032c98908..206e394077 100644 --- a/test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh +++ b/test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include "../spatialparams.hh" diff --git a/test/porousmediumflow/richards/implicit/nonisothermal/convection/problem.hh b/test/porousmediumflow/richards/implicit/nonisothermal/convection/problem.hh index 276c9ad5af..639272dd09 100644 --- a/test/porousmediumflow/richards/implicit/nonisothermal/convection/problem.hh +++ b/test/porousmediumflow/richards/implicit/nonisothermal/convection/problem.hh @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include "../spatialparams.hh" diff --git a/test/porousmediumflow/richards/implicit/nonisothermal/evaporation/problem.hh b/test/porousmediumflow/richards/implicit/nonisothermal/evaporation/problem.hh index a0c30f8895..1a4f1f2343 100644 --- a/test/porousmediumflow/richards/implicit/nonisothermal/evaporation/problem.hh +++ b/test/porousmediumflow/richards/implicit/nonisothermal/evaporation/problem.hh @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include "../spatialparams.hh" -- GitLab