From 1cda86e176e2747eca8cd8212854ad6d592ba526 Mon Sep 17 00:00:00 2001 From: Klaus Mosthaf <klmos@env.dtu.dk> Date: Thu, 24 Jan 2013 12:16:49 +0000 Subject: [PATCH] Renamed somerton.hh to thermalconductivitysomerton.hh, removed TypeTage from thermalconductivitysomerton.hh, because material laws should remain property-free. Thus, the arguments of the effectiveThermalConductivity method have been changed to Scalar quantities only. Deprecated boundaryMatrixHeatFlux method, which is not used anymore. Reviewed by Markus git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@10083 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- dumux/implicit/2p2cni/2p2cnifluxvariables.hh | 29 ++++--- .../implicit/2p2cni/2p2cnipropertydefaults.hh | 9 ++- dumux/implicit/2pni/2pnifluxvariables.hh | 29 ++++--- dumux/implicit/2pni/2pnipropertydefaults.hh | 9 ++- .../2p/thermalconductivitysomerton.hh | 77 +++++++++++++++++++ .../spatialparams/implicitspatialparams.hh | 2 +- 6 files changed, 130 insertions(+), 25 deletions(-) create mode 100644 dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh diff --git a/dumux/implicit/2p2cni/2p2cnifluxvariables.hh b/dumux/implicit/2p2cni/2p2cnifluxvariables.hh index e80056e1ef..8ffa108a7d 100644 --- a/dumux/implicit/2p2cni/2p2cnifluxvariables.hh +++ b/dumux/implicit/2p2cni/2p2cnifluxvariables.hh @@ -62,6 +62,12 @@ class TwoPTwoCNIFluxVariables : public TwoPTwoCFluxVariables<TypeTag> enum { dimWorld = GridView::dimensionworld }; typedef Dune::FieldVector<Scalar, dimWorld> DimVector; + typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; + enum { + wPhaseIdx = Indices::wPhaseIdx, + nPhaseIdx = Indices::nPhaseIdx + }; + public: /*! * \brief The constructor @@ -138,18 +144,21 @@ protected: const Element &element, const ElementVolumeVariables &elemVolVars) { + const unsigned i = this->face().i; + const unsigned j = this->face().j; + const Scalar lambdaI = - ThermalConductivityModel::effectiveThermalConductivity(element, - elemVolVars, - this->fvGeometry_, - problem.spatialParams(), - this->face().i); + ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[i].saturation(wPhaseIdx), + elemVolVars[i].thermalConductivity(wPhaseIdx), + elemVolVars[i].thermalConductivity(nPhaseIdx), + problem.spatialParams().thermalConductivitySolid(element, this->fvGeometry_, i), + problem.spatialParams().porosity(element, this->fvGeometry_, i)); const Scalar lambdaJ = - ThermalConductivityModel::effectiveThermalConductivity(element, - elemVolVars, - this->fvGeometry_, - problem.spatialParams(), - this->face().j); + ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[j].saturation(wPhaseIdx), + elemVolVars[j].thermalConductivity(wPhaseIdx), + elemVolVars[j].thermalConductivity(nPhaseIdx), + problem.spatialParams().thermalConductivitySolid(element, this->fvGeometry_, j), + problem.spatialParams().porosity(element, this->fvGeometry_, j)); // -> harmonic mean lambdaEff_ = harmonicMean(lambdaI, lambdaJ); } diff --git a/dumux/implicit/2p2cni/2p2cnipropertydefaults.hh b/dumux/implicit/2p2cni/2p2cnipropertydefaults.hh index dca073ed54..e69f601221 100644 --- a/dumux/implicit/2p2cni/2p2cnipropertydefaults.hh +++ b/dumux/implicit/2p2cni/2p2cnipropertydefaults.hh @@ -36,7 +36,7 @@ #include "2p2cnivolumevariables.hh" #include "2p2cnifluxvariables.hh" -#include <dumux/material/fluidmatrixinteractions/2p/somerton.hh> +#include <dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh> namespace Dumux { @@ -73,7 +73,12 @@ SET_PROP(TwoPTwoCNI, Indices) }; //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_TYPE_PROP(TwoPTwoCNI, ThermalConductivityModel, Somerton<TypeTag>); +SET_PROP(TwoPTwoCNI, ThermalConductivityModel) +{ private : + typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + public: + typedef ThermalConductivitySomerton<Scalar> type; +}; } diff --git a/dumux/implicit/2pni/2pnifluxvariables.hh b/dumux/implicit/2pni/2pnifluxvariables.hh index bec6a02946..8c5688ace6 100644 --- a/dumux/implicit/2pni/2pnifluxvariables.hh +++ b/dumux/implicit/2pni/2pnifluxvariables.hh @@ -64,6 +64,12 @@ class TwoPNIFluxVariables : public ImplicitDarcyFluxVariables<TypeTag> typedef typename GridView::ctype CoordScalar; typedef Dune::FieldVector<CoordScalar, dimWorld> DimVector; + typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices; + enum { + wPhaseIdx = Indices::wPhaseIdx, + nPhaseIdx = Indices::nPhaseIdx + }; + public: /* @@ -144,18 +150,21 @@ protected: const Element &element, const ElementVolumeVariables &elemVolVars) { + const unsigned i = this->face().i; + const unsigned j = this->face().j; + const Scalar lambdaI = - ThermalConductivityModel::effectiveThermalConductivity(element, - elemVolVars, - this->fvGeometry_, - problem.spatialParams(), - this->face().i); + ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[i].saturation(wPhaseIdx), + elemVolVars[i].thermalConductivity(wPhaseIdx), + elemVolVars[i].thermalConductivity(nPhaseIdx), + problem.spatialParams().thermalConductivitySolid(element, this->fvGeometry_, i), + problem.spatialParams().porosity(element, this->fvGeometry_, i)); const Scalar lambdaJ = - ThermalConductivityModel::effectiveThermalConductivity(element, - elemVolVars, - this->fvGeometry_, - problem.spatialParams(), - this->face().j); + ThermalConductivityModel::effectiveThermalConductivity(elemVolVars[j].saturation(wPhaseIdx), + elemVolVars[j].thermalConductivity(wPhaseIdx), + elemVolVars[j].thermalConductivity(nPhaseIdx), + problem.spatialParams().thermalConductivitySolid(element, this->fvGeometry_, j), + problem.spatialParams().porosity(element, this->fvGeometry_, j)); // -> harmonic mean lambdaEff_ = harmonicMean(lambdaI, lambdaJ); } diff --git a/dumux/implicit/2pni/2pnipropertydefaults.hh b/dumux/implicit/2pni/2pnipropertydefaults.hh index b0566265c0..325a4d9ebe 100644 --- a/dumux/implicit/2pni/2pnipropertydefaults.hh +++ b/dumux/implicit/2pni/2pnipropertydefaults.hh @@ -36,7 +36,7 @@ #include "2pnifluxvariables.hh" #include "2pniindices.hh" -#include <dumux/material/fluidmatrixinteractions/2p/somerton.hh> +#include <dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh> namespace Dumux { @@ -68,7 +68,12 @@ SET_TYPE_PROP(TwoPNI, FluxVariables, TwoPNIFluxVariables<TypeTag>); SET_TYPE_PROP(TwoPNI, Indices, TwoPNIIndices<TypeTag, 0>); //! Somerton is used as default model to compute the effective thermal heat conductivity -SET_TYPE_PROP(TwoPNI, ThermalConductivityModel, Somerton<TypeTag>); +SET_PROP(TwoPNI, ThermalConductivityModel) +{ private : + typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; + public: + typedef ThermalConductivitySomerton<Scalar> type; +}; } diff --git a/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh new file mode 100644 index 0000000000..54339363d0 --- /dev/null +++ b/dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh @@ -0,0 +1,77 @@ +// -*- 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 2 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 <http://www.gnu.org/licenses/>. * + *****************************************************************************/ +/*! + * \file + * + * \brief Relation for the saturation-dependent effective thermal conductivity + */ +#ifndef THERMALCONDUCTIVITY_SOMERTON_HH +#define THERMALCONDUCTIVITY_SOMERTON_HH + +#include <algorithm> + +namespace Dumux +{ +/*! + * \ingroup fluidmatrixinteractionslaws + * + * \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. It is assumed, that the + * non-wetting phase does not contribute to the conduction due to a large contrast + * in the fluid conductivities. + */ +template<class Scalar> +class ThermalConductivitySomerton +{ +public: + /*! + * \brief Returns the effective thermal conductivity \f$[W/m^2]\f$ after Somerton (1974). + * + * The material law is: + * \f[ + l_eff = l_solid + (l_wet - l_solid) + \f] + * + * \param Sw The saturation of the wetting phase + * \param lambdaW the thermal conductivity of the wetting phase + * \param lambdaN the thermal conductivity of the non-wetting phase + * \param lambdaSolid the thermal conductivity of the solid phase + * \param porosity The porosity + * + * \return Effective thermal conductivity \f$[W/m^2]\f$ after Somerton (1974) + */ + static Scalar effectiveThermalConductivity(const Scalar Sw, + const Scalar lambdaW, + const Scalar lamdaN, + const Scalar lambdaSolid, + const Scalar porosity) + { + const Scalar satW = std::max<Scalar>(0.0, Sw); + const Scalar lSat = std::pow(lambdaSolid, (1.0 - porosity)) * std::pow(lambdaW, porosity); + const Scalar lDry = std::pow(lambdaSolid, (1.0 - porosity)); + + return lDry + std::sqrt(satW) * (lDry - lSat); + } + +}; +} +#endif diff --git a/dumux/material/spatialparams/implicitspatialparams.hh b/dumux/material/spatialparams/implicitspatialparams.hh index b57c894a1e..9cbbbe4509 100644 --- a/dumux/material/spatialparams/implicitspatialparams.hh +++ b/dumux/material/spatialparams/implicitspatialparams.hh @@ -115,7 +115,7 @@ public: * \param fvGeometry The finite volume geometry of the current element * \tparam FaceType The type of the face (boundary face / SCV face) */ - template <class FaceType> + template <class FaceType> DUNE_DEPRECATED_MSG("Method not used anymore!") void boundaryMatrixHeatFlux(Vector &heatFlux, const FluxVariables &fluxVars, const ElementVolumeVariables &elemVolVars, -- GitLab