Commit 1cda86e1 authored by Klaus Mosthaf's avatar Klaus Mosthaf
Browse files

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
parent 05078427
......@@ -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);
}
......
......@@ -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;
};
}
......
......@@ -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);
}
......
......@@ -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;
};
}
......
// -*- 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
......@@ -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,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment