Commit 0826839b authored by Philipp Nuske's avatar Philipp Nuske
Browse files

Introducing an interface for interfacial area surfaces which translates...

Introducing an interface for interfacial area surfaces which translates absolute to effective saturations (just like the one for the material laws).

changing the templates for the surfaces a little. 

reviewed by Bernd


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@11505 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent e052e433
......@@ -42,7 +42,7 @@ namespace Dumux
* \brief Implementation of a exponential function relating
* specific interfacial area to wetting phase saturation and capillary pressure.
*/
template <class ParamsT>
template <class ScalarT, class ParamsT =AwnSurfaceExpSwPcTo3Params<ScalarT> >
class AwnSurfaceExpSwPcTo3
{
public:
......
......@@ -32,7 +32,8 @@ namespace Dumux
* because Sw=0 cannnot be reached on different ways. We only need to define pcmax ...
*
*/
template <class ParamsT>
template <class ScalarT, class ParamsT =AwnSurfacePcMaxFctParams<ScalarT> >
class AwnSurfacePcMaxFct
{
public:
......
......@@ -41,7 +41,7 @@ namespace Dumux
* \brief Implementation of the polynomial of second order relating
* specific interfacial area to wetting phase saturation and capillary pressure as suggested by Joakar-Niasar(2007).
*/
template <class ParamsT>
template <class ScalarT, class ParamsT = AwnSurfacePolynomial2ndOrderParams<ScalarT> >
class AwnSurfacePolynomial2ndOrder
{
public:
......@@ -59,7 +59,7 @@ public:
* \param Sw Effective saturation of the wetting phase
* \param pc Capillary pressure
*/
static Scalar interfacialArea(const Params &params, const Scalar Sw, const Scalar pc)
static Scalar interfacialArea(const Params & params, const Scalar Sw, const Scalar pc)
{
const Scalar a00 = params.a00();
const Scalar a10 = params.a10();
......
// -*- 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 This material law takes a material law (interfacial area surface)
* defined for effective saturations and converts it to a material law defined on
* absolute saturations.
*/
#ifndef DUMUX_EFF_TO_ABS_LAW_IA_HH
#define DUMUX_EFF_TO_ABS_LAW_IA_HH
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
#include "efftoabslawiaparams.hh"
namespace Dumux
{
/*!
* \ingroup fluidmatrixinteractionslaws
*
* \brief This material law takes a material law (interfacial area surface) defined for effective
* saturations and converts it to a material (interfacial area surface) law defined on absolute
* saturations.
*
* The idea: "material laws" (like VanGenuchten or BrooksCorey) are defined for effective saturations.
* The numeric calculations however are performed with absolute saturations. The EffToAbsLaw class gets
* the "material laws" actually used as well as the corresponding parameter container as template arguments.
*
* Subsequently, the desired function (pc, sw... ) of the actually used "material laws" are called but with the
* saturations already converted from absolute to effective.
*
* This approach makes sure that in the "material laws" only effective saturations are considered, which makes sense,
* as these laws only deal with effective saturations. This also allows for changing the calculation of the effective
* saturations easily, as this is subject of discussion / may be problem specific.
*
* Additionally, handing over effective saturations to the "material laws" in stead of them calculating effective
* saturations prevents accidently "converting twice".
*
* This boils down to:
* - the actual material laws (linear, VanGenuchten...) do not need to deal with any kind of conversion
* - the definition of the material law in the spatial parameters is not really intuitive, but using it is:
* Hand in values, get back values, do not deal with conversion.
*/
template <class EffLawIAT,
class MaterialAbsParamsT ,
class InterfacialAreaAbsParamsT = typename EffLawIAT::Params>
class EffToAbsLawIA
{
typedef EffLawIAT EffLawIA;
typedef MaterialAbsParamsT MaterialParams;
public:
typedef InterfacialAreaAbsParamsT Params;
typedef typename MaterialParams::Scalar Scalar;
/*!
* \brief The interfacial area relation
*/
static Scalar interfacialArea(const Params & iaParams,
const MaterialParams & params,
const Scalar sw,
const Scalar pc)
{
return EffLawIA::interfacialArea(iaParams,
swToSwe(params, sw),
pc);
}
protected:
/*!
* \brief Convert an absolute wetting saturation to an effective one.
*
* \param sw Absolute saturation of the wetting phase \f${S}_w\f$.
* \param params A container object that is populated with the appropriate coefficients for the respective law.
* Therefore, in the (problem specific) spatialParameters first, the material law is chosen, and then the params container
* is constructed accordingly. Afterwards the values are set there, too.
* \return Effective saturation of the wetting phase.
*/
static Scalar swToSwe(const MaterialParams & params, Scalar sw)
{
return (sw - params.swr())/(1. - params.swr() - params.snr());
}
};
}
#endif
// -*- 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 A default implementation of the parameters for the adapter
* class to convert material laws -- in this case the interfacial area surfaces --
* from effective to absolute saturations.
*/
#ifndef DUMUX_EFF_TO_ABS_LAW_IA_PARAMS_HH
#define DUMUX_EFF_TO_ABS_LAW_IA_PARAMS_HH
namespace Dumux
{
/*!
* \ingroup fluidmatrixinteractionsparams
*
* \brief A default implementation of the parameters for the adapter
* class to convert material laws -- in this case the interfacial area surfaces --
* from effective to absolute saturations.
*/
template <class EffIALawParamsT>
class EffToAbsLawIAParams : public EffIALawParamsT
{
typedef EffIALawParamsT EffIALawParams;
public:
typedef typename EffIALawParams::Scalar Scalar;
EffToAbsLawIAParams()
: EffIALawParams()
{}
};
}
#endif
......@@ -30,6 +30,7 @@
#include <dumux/material/fluidmatrixinteractions/mp/2poftadapter.hh>
// material laws for interfacial area
#include <dumux/material/fluidmatrixinteractions/2pia/efftoabslawia.hh>
#include <dumux/material/fluidmatrixinteractions/2pia/awnsurfacepolynomial2ndorder.hh>
#include <dumux/material/fluidmatrixinteractions/2pia/awnsurfacepolynomialedgezero2ndorder.hh>
#include <dumux/material/fluidmatrixinteractions/2pia/awnsurfaceexpfct.hh>
......@@ -99,7 +100,42 @@ private:
// typedef TwoPOfTAdapter<wPhaseIdx, TwoPMaterialLaw> type; // adapter for incorporating temperature effects on pc-S
typedef TwoPAdapter<wPhaseIdx, TwoPMaterialLaw> type;
};
}
// Set the interfacial area relation: wetting -- non-wetting
SET_PROP(EvaporationAtmosphereSpatialParams, AwnSurface)
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef AwnSurfacePcMaxFct<Scalar> EffectiveIALaw;
// typedef AwnSurfacePolynomial2ndOrder<Scalar> EffectiveIALaw;
public:
typedef EffToAbsLawIA<EffectiveIALaw, MaterialLawParams> type;
};
// Set the interfacial area relation: wetting -- solid
SET_PROP(EvaporationAtmosphereSpatialParams, AwsSurface)
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef AwnSurfacePolynomial2ndOrder<Scalar> EffectiveIALaw;
public:
typedef EffToAbsLawIA<EffectiveIALaw, MaterialLawParams> type;
};
// Set the interfacial area relation: non-wetting -- solid
SET_PROP(EvaporationAtmosphereSpatialParams, AnsSurface)
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef AwnSurfaceExpSwPcTo3<Scalar> EffectiveIALaw;
public:
typedef EffToAbsLawIA<EffectiveIALaw, MaterialLawParams> type;
};
} // end namespace properties
/* \brief Definition of the soil properties for the poor man's coupling / evaporation atmosphere with kinetic model
*/
......@@ -114,29 +150,36 @@ class EvaporationAtmosphereSpatialParams : public ImplicitSpatialParams<TypeTag>
enum {dim=GridView::dimension };
enum {dimWorld=GridView::dimensionworld};
enum {wPhaseIdx = FluidSystem::wPhaseIdx};
enum {nPhaseIdx = FluidSystem::nPhaseIdx};
enum {sPhaseIdx = FluidSystem::sPhaseIdx};
enum { enableKineticEnergy = GET_PROP_VALUE(TypeTag, EnableKineticEnergy)};
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases)};
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy)};
typedef typename GET_PROP_TYPE(TypeTag, VolumeVariables) VolumeVariables;
typedef typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables) ElementVolumeVariables;
typedef typename GET_PROP_TYPE(TypeTag, FluxVariables) FluxVariables;
typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector;
typedef typename GET_PROP_TYPE(TypeTag, FVElementGeometry) FVElementGeometry;
typedef typename GridView::template Codim<0>::Entity Element;
typedef Dune::FieldVector<Scalar,dimWorld> GlobalPosition;
typedef Dune::FieldVector<Scalar,dim> LocalPosition;
typedef Dune::FieldVector<Scalar,dimWorld> DimVector;
typedef typename GET_PROP_TYPE(TypeTag, FluidState) FluidState;
public:
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename MaterialLaw::Params MaterialLawParams;
typedef AwnSurfacePolynomial2ndOrderParams<Scalar> AwsSurfaceParams;
typedef AwnSurfacePolynomial2ndOrder<AwsSurfaceParams> AwsSurface;
typedef typename GET_PROP_TYPE(TypeTag, AwnSurface) AwnSurface;
typedef typename AwnSurface::Params AwnSurfaceParams;
typedef AwnSurfacePcMaxFctParams<Scalar> AwnSurfaceParams;
typedef AwnSurfacePcMaxFct<AwnSurfaceParams> AwnSurface;
typedef typename GET_PROP_TYPE(TypeTag, AwsSurface) AwsSurface;
typedef typename AwsSurface::Params AwsSurfaceParams;
typedef AwnSurfaceExpSwPcTo3Params<Scalar> AnsSurfaceParams;
typedef AwnSurfaceExpSwPcTo3<AnsSurfaceParams> AnsSurface;
typedef typename GET_PROP_TYPE(TypeTag, AnsSurface) AnsSurface;
typedef typename AnsSurface::Params AnsSurfaceParams;
EvaporationAtmosphereSpatialParams(const GridView &gv)
......@@ -250,7 +293,6 @@ public:
aNonWettingSolidSurfaceParams_.setA2(aNonWettingSolidA2_);
aNonWettingSolidSurfaceParams_.setA3(aNonWettingSolidA3_);
// dummys for free flow: no interface where there is only one phase
aWettingNonWettingSurfaceParamsFreeFlow_.setA1(0.);
aWettingNonWettingSurfaceParamsFreeFlow_.setA2(0.);
......@@ -303,6 +345,9 @@ public:
const unsigned int scvIdx) const
{
const GlobalPosition & globalPos = fvGeometry.subContVol[scvIdx].global ;
// const LocalPosition & localPos = fvGeometry.subContVol[scvIdx].localCenter ;
// const GlobalPosition & globalPos = element.geometry().global(localPos) ;
if (inFF_(globalPos) )
return porosityFF_ ;
else if (inPM_(globalPos))
......@@ -397,7 +442,7 @@ public:
const Scalar pcMax(const Element & element,
const FVElementGeometry & fvGeometry,
const unsigned int scvIdx) const
{ return pcMax_ ; }
{ return aWettingNonWettingSurfaceParams_.pcMax() ; }
/*!\brief Return the characteristic length for the mass transfer.
*
......@@ -552,7 +597,7 @@ private:
AwnSurfaceParams aWettingNonWettingSurfaceParamsFreeFlow_;
AnsSurfaceParams aNonWettingSolidSurfaceParamsFreeFlow_ ;
Scalar pcMax_ ;
Scalar pcMax_ ;
// Porous Medium Domain
Scalar intrinsicPermeabilityPM_ ;
......
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