Commit da419896 authored by Ned Coltman's avatar Ned Coltman
Browse files

Merge branch 'fix/new-matlaw-warnings' into 'master'

Fix/new matlaw warnings

Closes #21

See merge request !140
parents 86f57025 4c596700
[TimeLoop]
MaxTimeStepSize = 5.0e6 # maximal time step size [s]
TEnd = 5.0e7 # end time of the simulation [s]
DtInitial = 0.0625 # initial time step for the simulation [s]
MaxTimeStepSize = 5.0e6 # maximal time step size [s]
TEnd = 5.0e7 # end time of the simulation [s]
DtInitial = 0.0625 # initial time step for the simulation [s]
EpisodeLength = 5.0e6
[Grid]
UpperRight = 4 2 # upper right corner coordinates (x,y) [m]
Cells = 40 20 # grid resolution in (x,y) direction [-]
UpperRight = 4 2 # upper right corner coordinates (x,y) [m]
Cells = 40 20 # grid resolution in (x,y) direction [-]
[SpatialParams]
FinePermeability = 3.1e-11 # intrinsic permeability of the fine porous medium [m^2]
CoarsePermeability = 4.6e-9 # intrinsic permeability of the coarse porous medium [m^2]
FinePorosity = 0.2 # porosity of the fine porous medium [-]
CoarsePorosity = 0.6 # porosity of the coarse porous medium [-]
FineBrooksCoreyLambda = 3.5 # pore size distribution parameter for the Brooks-Corey capillary pressure-saturation relationship in the fine soil [-]
FineBrooksCoreyEntryPressure = 400 # entry pressure for the Brooks-Corey capillary pressure-saturation relationship in the fine soil [Pa]
CoarseBrooksCoreyLambda = 2.0 # pore size distribution parameter for the Brooks-Corey capillary pressure-saturation relationship in the coarse soil [-]
CoarseBrooksCoreyEntryPressure = 200 # entry pressure for the Brooks-Corey capillary pressure-saturation relationship in the coarse soil [Pa]
FineResidualSaturationWetting = 0.05 # residual saturation of the wetting phase in the fine soil [-]
FineResidualSaturationNonwetting = 0.3 # residual saturation of the nonwetting phase in the fine soil [-]
CoarseResidualSaturationWetting = 0.05 # residual saturation of the wetting phase in the coarse soil [-]
CoarseResidualSaturationNonwetting = 0.1 # residual saturation of the nonwetting phase in the coarse soil [-]
[SpatialParams.Fine]
Permeability = 3.1e-11 # intrinsic permeability of the fine porous medium [m^2]
Porosity = 0.2 # porosity of the fine porous medium [-]
BrooksCoreyLambda = 3.5 # pore size distribution parameter for the Brooks-Corey capillary pressure-saturation relationship in the fine soil [-]
BrooksCoreyPcEntry = 400 # entry pressure for the Brooks-Corey capillary pressure-saturation relationship in the fine soil [Pa]
Swr = 0.05 # residual saturation of the wetting phase in the fine soil [-]
Snr = 0.3 # residual saturation of the nonwetting phase in the fine soil [-]
[SpatialParams.Coarse]
Permeability = 4.6e-9 # intrinsic permeability of the coarse porous medium [m^2]
Porosity = 0.6 # porosity of the coarse porous medium [-]
BrooksCoreyLambda = 2.0 # pore size distribution parameter for the Brooks-Corey capillary pressure-saturation relationship in the coarse soil [-]
BrooksCoreyPcEntry = 200 # entry pressure for the Brooks-Corey capillary pressure-saturation relationship in the coarse soil [Pa]
Swr = 0.05 # residual saturation of the wetting phase in the coarse soil [-]
Snr = 0.1 # residual saturation of the nonwetting phase in the coarse soil [-]
[Boundary]
LowerPressure = 2.0e5 # Dirichlet pressure value for the boundary condition at the lower boundary [Pa]
UpperPressure = 4.0e5 # Dirichlet pressure value for the boundary condition at the upper boundary [Pa]
LowerPressure = 2.0e5 # Dirichlet pressure value for the boundary condition at the lower boundary [Pa]
UpperPressure = 4.0e5 # Dirichlet pressure value for the boundary condition at the upper boundary [Pa]
[Problem]
EnableGravity = false
......
......@@ -80,17 +80,16 @@ public:
Lens1p2cSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
{
lensLowerLeft_[0] = 0.0;
lensLowerLeft_[1] = 0.0;
lensUpperRight_[0]= 4.1;
lensUpperRight_[1]= 1.0;
lensPorosity_ = getParam<double>("SpatialParams.FinePorosity");
outerPorosity_ = getParam<double>("SpatialParams.CoarsePorosity");
lensPorosity_ = getParam<double>("SpatialParams.Fine.Porosity");
outerPorosity_ = getParam<double>("SpatialParams.Coarse.Porosity");
lensK_ = getParam<double>("SpatialParams.FinePermeability");
outerK_ = getParam<double>("SpatialParams.CoarsePermeability");
lensK_ = getParam<double>("SpatialParams.Fine.Permeability");
outerK_ = getParam<double>("SpatialParams.Coarse.Permeability");
}
/*!
......
......@@ -26,8 +26,7 @@
#ifndef DUMUX_LENS2P_SPATIALPARAMS_HH
#define DUMUX_LENS2P_SPATIALPARAMS_HH
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
#include <dumux/material/fluidmatrixinteractions/2p/brookscorey.hh>
#include <dumux/material/spatialparams/fv.hh>
namespace Dumux {
......@@ -49,11 +48,10 @@ class Lens2pSpatialParams
using ParentType = FVSpatialParams<FVGridGeometry, Scalar, ThisType>;
static constexpr int dimWorld = GridView::dimensionworld;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
using EffectiveLaw = RegularizedBrooksCorey<Scalar>;
using PcKrSw = FluidMatrix::BrooksCoreyDefault<Scalar>;
public:
using MaterialLaw = EffToAbsLaw<EffectiveLaw>;
using MaterialLawParams = typename MaterialLaw::Params;
using PermeabilityType = Scalar;
/*!
......@@ -61,27 +59,17 @@ public:
*/
Lens2pSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
, pcKrSwFine_("SpatialParams.Fine")
, pcKrSwCoarse_("SpatialParams.Coarse")
{
lensLowerLeft_ = {0.0, 0.0};
lensUpperRight_= {4.0, 1.0};
lensPorosity_ = getParam<Scalar> ("SpatialParams.FinePorosity");
outerPorosity_ = getParam<Scalar>("SpatialParams.CoarsePorosity");
lensK_ = getParam<Scalar>("SpatialParams.FinePermeability");
outerK_ = getParam<Scalar>("SpatialParams.CoarsePermeability");
// residual saturations
lensMaterialParams_.setSwr( getParam<Scalar>("SpatialParams.FineResidualSaturationWetting") );
lensMaterialParams_.setSnr( getParam<Scalar>("SpatialParams.FineResidualSaturationNonwetting") );
outerMaterialParams_.setSwr( getParam<Scalar>("SpatialParams.CoarseResidualSaturationWetting") );
outerMaterialParams_.setSnr( getParam<Scalar>("SpatialParams.CoarseResidualSaturationNonwetting") );
lensPorosity_ = getParam<Scalar> ("SpatialParams.Fine.Porosity");
outerPorosity_ = getParam<Scalar>("SpatialParams.Coarse.Porosity");
// parameters for the Brooks-Corey law
lensMaterialParams_.setPe( getParam<Scalar>("SpatialParams.FineBrooksCoreyEntryPressure") );
lensMaterialParams_.setLambda( getParam<Scalar>("SpatialParams.FineBrooksCoreyLambda") );
outerMaterialParams_.setPe( getParam<Scalar>("SpatialParams.CoarseBrooksCoreyEntryPressure") );
outerMaterialParams_.setLambda( getParam<Scalar>("SpatialParams.CoarseBrooksCoreyLambda") );
lensK_ = getParam<Scalar>("SpatialParams.Fine.Permeability");
outerK_ = getParam<Scalar>("SpatialParams.Coarse.Permeability");
}
/*!
......@@ -121,20 +109,20 @@ public:
}
/*!
* \brief return the brooks-corey context depending on the position
* \brief Returns the fluid-matrix interaction law
*
* \param element The current element
* \param scv The sub-control volume inside the element.
* \param elemSol The solution at the dofs connected to the element.
*/
template<class ElementSolution>
const MaterialLawParams& materialLawParams(const Element& element,
const SubControlVolume& scv,
const ElementSolution& elemSol) const
auto fluidMatrixInteraction(const Element& element,
const SubControlVolume& scv,
const ElementSolution& elemSol) const
{
if (isInLens_(scv.dofPosition()))
return lensMaterialParams_;
return outerMaterialParams_;
return makeFluidMatrixInteraction(pcKrSwFine_);
return makeFluidMatrixInteraction(pcKrSwCoarse_);
}
/*!
......@@ -178,9 +166,9 @@ private:
Scalar outerK_;
Scalar lensPorosity_;
Scalar outerPorosity_;
MaterialLawParams lensMaterialParams_;
MaterialLawParams outerMaterialParams_;
Scalar eps_ = 1e-6;
const PcKrSw pcKrSwFine_;
const PcKrSw pcKrSwCoarse_;
const Scalar eps_{1e-6};
};
} // end namespace Dumux
......
......@@ -12,21 +12,22 @@ UpperRight = 5 4 # upper right corner coordinates (x,
Cells = 40 64 # grid resolution in (x,y) direction [-]
[SpatialParams]
FinePermeability = 3.1e-11 # intrinsic permeability of the fine porous medium [m^2]
CoarsePermeability = 3.1e-10 # intrinsic permeability of the coarse porous medium [m^2]
FinePorosity = 0.1 # porosity of the fine porous medium [-]
CoarsePorosity = 0.2 # porosity of the coarse porous medium [-]
Fine.Permeability = 3.1e-11 # intrinsic permeability of the fine porous medium [m^2]
Coarse.Permeability = 3.1e-10 # intrinsic permeability of the coarse porous medium [m^2]
Fine.Porosity = 0.1 # porosity of the fine porous medium [-]
Coarse.Porosity = 0.2 # porosity of the coarse porous medium [-]
########
Parameters only relevant for two-phase simulations:
########
FineBrooksCoreyLambda = 3.5 # pore size distribution parameter for the Brooks-Corey capillary pressure - saturation relationship in the fine soil [-]
FineBrooksCoreyEntryPressure = 400 # entry pressure for the Brooks-Corey capillary pressure - saturation relationship in the fine soil [Pa]
CoarseBrooksCoreyLambda = 2.0 # pore size distribution parameter for the Brooks-Corey capillary pressure - saturation relationship in the coarse soil [-]
CoarseBrooksCoreyEntryPressure = 200 # entry pressure for the Brooks-Corey capillary pressure - saturation relationship in the coarse soil [Pa]
FineResidualSaturationWetting = 0.05 # residual saturation of the wetting phase in the fine soil [-]
FineResidualSaturationNonwetting = 0.3 # residual saturation of the nonwetting phase in the fine soil [-]
CoarseResidualSaturationWetting = 0.05 # residual saturation of the wetting phase in the coarse soil [-]
CoarseResidualSaturationNonwetting = 0.1 # residual saturation of the nonwetting phase in the coarse soil [-]
Fine.BrooksCoreyLambda = 3.5 # pore size distribution parameter for the Brooks-Corey capillary pressure-saturation relationship in the fine soil [-]
Fine.BrooksCoreyPcEntry = 400 # entry pressure for the Brooks-Corey capillary pressure-saturation relationship in the fine soil [Pa]
Fine.Swr = 0.05 # residual saturation of the wetting phase in the fine soil [-]
Fine.Snr = 0.3 # residual saturation of the nonwetting phase in the fine soil [-]
Coarse.BrooksCoreyLambda = 2.0 # pore size distribution parameter for the Brooks-Corey capillary pressure-saturation relationship in the coarse soil [-]
Coarse.BrooksCoreyPcEntry = 200 # entry pressure for the Brooks-Corey capillary pressure-saturation relationship in the coarse soil [Pa]
Coarse.Swr = 0.05 # residual saturation of the wetting phase in the coarse soil [-]
Coarse.Snr = 0.1 # residual saturation of the nonwetting phase in the coarse soil [-]
########
[Boundary]
......
......@@ -9,19 +9,21 @@ LowerLeft = 0 0 # lower left corner coordinates (x,y
UpperRight = 3 2 # upper right corner coordinates (x,y) [m]
Cells = 75 50 # grid resolution in (x,y) direction [-]
[SpatialParams]
FinePermeability = 9e-12 # intrinsic permeability of the fine porous medium [m^2]
CoarsePermeability = 4.6e-10 # intrinsic permeability of the coarse porous medium [m^2]
FinePorosity = 0.38 # porosity of the fine porous medium [-]
CoarsePorosity = 0.40 # porosity of the coarse porous medium [-]
FineBrooksCoreyLambda = 3.5 # pore size distribution parameter for the Brooks-Corey capillary pressure - saturation relationship in the fine soil [-]
FineBrooksCoreyEntryPressure = 500 # entry pressure for the Brooks-Corey capillary pressure - saturation relationship in the fine soil [Pa]
CoarseBrooksCoreyLambda = 2.0 # pore size distribution parameter for the Brooks-Corey capillary pressure - saturation relationship in the coarse soil [-]
CoarseBrooksCoreyEntryPressure = 200 # entry pressure for the Brooks-Corey capillary pressure - saturation relationship in the coarse soil [Pa]
FineResidualSaturationWetting = 0.18 # residual saturation of the wetting phase in the fine soil [-]
FineResidualSaturationNonwetting = 0.0 # residual saturation of the nonwetting phase in the fine soil [-]
CoarseResidualSaturationWetting = 0.05 # residual saturation of the wetting phase in the coarse soil [-]
CoarseResidualSaturationNonwetting = 0.0 # residual saturation of the nonwetting phase in the coarse soil [-]
[SpatialParams.Fine]
Permeability = 9e-12 # intrinsic permeability of the fine porous medium [m^2]
Porosity = 0.38 # porosity of the fine porous medium [-]
BrooksCoreyLambda = 3.5 # pore size distribution parameter for the Brooks-Corey capillary pressure - saturation relationship in the fine soil [-]
BrooksCoreyPcEntry = 500 # entry pressure for the Brooks-Corey capillary pressure - saturation relationship in the fine soil [Pa]
Swr = 0.18 # residual saturation of the wetting phase in the fine soil [-]
Snr = 0.0 # residual saturation of the nonwetting phase in the fine soil [-]
[SpatialParams.Coarse]
Permeability = 4.6e-10 # intrinsic permeability of the coarse porous medium [m^2]
Porosity = 0.40 # porosity of the coarse porous medium [-]
BrooksCoreyLambda = 2.0 # pore size distribution parameter for the Brooks-Corey capillary pressure - saturation relationship in the coarse soil [-]
BrooksCoreyPcEntry = 200 # entry pressure for the Brooks-Corey capillary pressure - saturation relationship in the coarse soil [Pa]
Swr = 0.05 # residual saturation of the wetting phase in the coarse soil [-]
Snr = 0.0 # residual saturation of the nonwetting phase in the coarse soil [-]
[Boundary]
LowerPressure = 1.19612e5 # Dirichlet pressure value for the boundary condition at the lower boundary [Pa]
......
......@@ -21,8 +21,7 @@
#include <dumux/common/properties.hh>
#include <dumux/porousmediumflow/2p/sequential/properties.hh>
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
#include <dumux/material/fluidmatrixinteractions/2p/materiallaw.hh>
/*!
* \file
......@@ -36,33 +35,6 @@ namespace Dumux {
* the Buckley-Leverett problem
*/
template<typename Scalar, typename Law>
struct CheckMaterialLaw
{
static bool isLinear()
{
return false;
}
};
template<typename Scalar>
struct CheckMaterialLaw<Scalar, LinearMaterial<Scalar> >
{
static bool isLinear()
{
return true;
}
};
template<typename Scalar>
struct CheckMaterialLaw<Scalar, EffToAbsLaw< LinearMaterial<Scalar> > >
{
static bool isLinear()
{
return true;
}
};
template<class TypeTag> class BuckleyLeverettAnalytic
{
using Problem = GetPropType<TypeTag, Properties::Problem>;
......@@ -70,8 +42,6 @@ template<class TypeTag> class BuckleyLeverettAnalytic
using GridView = typename GetPropType<TypeTag, Properties::GridGeometry>::GridView;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using SpatialParams = GetPropType<TypeTag, Properties::SpatialParams>;
using MaterialLaw = typename SpatialParams::MaterialLaw;
using MaterialLawParams = typename MaterialLaw::Params;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
using FluidState = GetPropType<TypeTag, Properties::FluidState>;
using Indices = GetPropType<TypeTag, Properties::Indices>;
......@@ -87,7 +57,6 @@ template<class TypeTag> class BuckleyLeverettAnalytic
using GlobalPosition = Dune::FieldVector<Scalar, dimworld>;
public:
// functions needed for analytical solution
void initializeAnalytic()
......@@ -106,11 +75,11 @@ public:
*/
void prepareAnalytic()
{
const MaterialLawParams& materialLawParams(problem_.spatialParams().materialLawParams(dummyElement_));
swr_ = materialLawParams.swr();
snr_ = materialLawParams.snr();
porosity_ = problem_.spatialParams().porosity(dummyElement_);
const auto& dummyElement = *problem_.gridView().template begin<0>();
const auto fluidMatrixInteraction = problem_.spatialParams().fluidMatrixInteractionAtPos(dummyElement.geometry().center());
swr_ = fluidMatrixInteraction.effToAbsParams().swr();
snr_ = fluidMatrixInteraction.effToAbsParams().snr();
porosity_ = problem_.spatialParams().porosity(dummyElement);
time_ = 0;
satVec_ = swr_;
......@@ -128,12 +97,11 @@ public:
for (int i = 0; i < pointNum_; i++)
{
fractionalW_[i] = MaterialLaw::krw(materialLawParams, satVec_[i])/viscosityW;
fractionalW_[i] /= (fractionalW_[i] + MaterialLaw::krn(materialLawParams, satVec_[i])/viscosityNW);
fractionalW_[i] = fluidMatrixInteraction.krw(satVec_[i])/viscosityW;
fractionalW_[i] /= (fractionalW_[i] + fluidMatrixInteraction.krn(satVec_[i])/viscosityNW);
}
dfwdsw_ = 0;
for (int i = 1; i < intervalNum_; i++)
{
dfwdsw_[i] = (fractionalW_[i + 1] - fractionalW_[i - 1]) / (satVec_[i + 1] - satVec_[i - 1]);
......@@ -177,12 +145,13 @@ public:
{
xf_[i] = vTot_ * time_ / porosity_ * dfwdsw_[i];
}
// position of maximum xf_
int xfmax = 0;
int xhelp = pointNum_ / 3;
int xhelpold = 0;
int xhelpoldold = 0;
int xfmax = 0;
// position of maximum xf_
int xhelp2 = 0;
for (int i = 0; i < pointNum_; i++)
{
if (xf_[i] > xf_[i + 1])
......@@ -197,13 +166,9 @@ public:
Scalar A1;
Scalar A2;
Scalar b;
int xhelp2 = 0;
while (a)
{
if (CheckMaterialLaw<Scalar, MaterialLaw>::isLinear())
break;
A1 = 0;
for (int i = 0; i <= xhelp - 1; i++)
......@@ -262,7 +227,7 @@ public:
int index = problem_.variables().index(*eIt);
// account for linear material law
if (CheckMaterialLaw<Scalar, MaterialLaw>::isLinear())
if constexpr (SpatialParams::pcSwCurveIsLinear())
{
if (globalPos[0] <= xf_[1])
{
......@@ -313,9 +278,7 @@ public:
}
BlockVector AnalyticSolution() const
{
return analyticSolution_;
}
{ return analyticSolution_; }
//Write saturation and pressure into file
template<class MultiWriter>
......@@ -332,9 +295,13 @@ public:
}
//! Construct an IMPES object.
BuckleyLeverettAnalytic(Problem& problem, Scalar totalVelocity = 3e-7) :
problem_(problem), analyticSolution_(0), error_(0), elementVolume_(0), size_(problem.gridView().size(0)), vTot_(totalVelocity), dummyElement_(
*(problem_.gridView().template begin<0> ()))
BuckleyLeverettAnalytic(Problem& problem, Scalar totalVelocity = 3e-7)
: problem_(problem)
, analyticSolution_(0)
, error_(0)
, elementVolume_(0)
, size_(problem.gridView().size(0))
, vTot_(totalVelocity)
{
dummyGlobal_ = 0.0;
dummyGlobal_[0] = 1.0;
......@@ -365,7 +332,6 @@ private:
Dune::FieldVector<Scalar, pointNum_> dfwdsw_;
Dune::FieldVector<Scalar, pointNum_> xf_;
int dfwdswmax_;
const Element& dummyElement_;
GlobalPosition dummyGlobal_;
};
......
......@@ -48,10 +48,10 @@ void usage(const char *progName, const std::string &errorMsg)
"\t-SpatialParams.Porosity The porosity of the porous medium [-]\n"
"\t-SpatialParams.BrooksCoreyLambda The pore size distribution parameter for the \n"
"\t \t Brooks-Corey capillary pressure - saturation relationship [-]\n"
"\t-SpatialParams.BrooksCoreyEntryPressure The entry pressure for the \n"
"\t-SpatialParams.BrooksCoreyPcEntry The entry pressure for the \n"
"\t \t Brooks-Corey capillary pressure - saturation relationship [Pa]\n"
"\t-SpatialParams.ResidualSaturationWetting The residual saturation of the wetting phase [-]\n"
"\t-SpatialParams.ResidualSaturationNonwetting The residual saturation of the nonwetting phase [-]\n"
"\t-SpatialParams.Swr The residual saturation of the wetting phase [-]\n"
"\t-SpatialParams.Snr The residual saturation of the nonwetting phase [-]\n"
"\t-Fluid.DensityW The density of the wetting phase [kg/m^3]\n"
"\t-Fluid.DensityNW The density of the nonwetting phase [kg/m^3]\n"
"\t-Fluid.ViscosityW The dynamic viscosity of the wetting phase [kg/(ms)]\n"
......
......@@ -6,15 +6,12 @@ DtInitial = 1e3 # initial time step for the simulati
EnableGravity = false
[SpatialParams]
Permeability = 1.01936799e-14 # intrinsic permeability of the porous medium [m^2]
Porosity = 0.2 # porosity of the porous medium [-]
BrooksCoreyLambda = 4.0 # pore size distribution parameter for the Brooks-Corey capillary pressure - saturation relationship [-]
BrooksCoreyEntryPressure = 0 # entry pressure for the Brooks-Corey capillary pressure - saturation relationship [Pa]
ResidualSaturationWetting = 0.2 # residual saturation of the wetting phase [-]
ResidualSaturationNonwetting = 0.2 # residual saturation of the nonwetting phase [-]
BrooksCoreyPcEntry = 0 # entry pressure for the Brooks-Corey capillary pressure - saturation relationship [Pa]
Swr = 0.2 # residual saturation of the wetting phase [-]
Snr = 0.2 # residual saturation of the nonwetting phase [-]
[Fluid]
DensityW = 1e3 # density of the wetting phase [kg/m^3]
......
......@@ -90,8 +90,8 @@ public:
densityNonwetting_ = getParam<Scalar>("Fluid.DensityNW");
swr_ = getParam<Scalar>("SpatialParams.ResidualSaturationWetting");
snr_ = getParam<Scalar>("SpatialParams.ResidualSaturationNonwetting");
swr_ = getParam<Scalar>("SpatialParams.Swr");
snr_ = getParam<Scalar>("SpatialParams.Snr");
paraviewOutput_ = getParam<bool>("Output.paraviewOutput", true);
}
......
......@@ -23,9 +23,7 @@
#include <dumux/common/parameters.hh>
#include <dumux/material/spatialparams/sequentialfv.hh>
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
#include <dumux/material/fluidmatrixinteractions/2p/brookscorey.hh>
namespace Dumux {
......@@ -44,19 +42,12 @@ struct BuckleyLeverettSpatialParamsTypeTag {};
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::BuckleyLeverettSpatialParamsTypeTag> { using type = BuckleyLeverettSpatialParams<TypeTag>; };
// Set the material law
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::BuckleyLeverettSpatialParamsTypeTag>
{
private:
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using RawMaterialLaw = RegularizedBrooksCorey<Scalar>;
public:
using type = EffToAbsLaw<RawMaterialLaw>;
};
} // end namespace Properties
// forward declaration
class LinearMaterialDefault;
class LinearMaterial;
template<class TypeTag>
class BuckleyLeverettSpatialParams: public SequentialFVSpatialParams<TypeTag>
{
......@@ -71,50 +62,44 @@ class BuckleyLeverettSpatialParams: public SequentialFVSpatialParams<TypeTag>
using Element = typename Grid::Traits::template Codim<0>::Entity;
using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
using FieldMatrix = Dune::FieldMatrix<Scalar,dim,dim>;
using PcKrSwCurve = FluidMatrix::BrooksCoreyDefault<Scalar>;
public:
using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>;
using MaterialLawParams = typename MaterialLaw::Params;
Scalar intrinsicPermeability (const Element& element) const
BuckleyLeverettSpatialParams(const Problem& problem)
: ParentType(problem)
, pcKrSwCurve_("SpatialParams")
{
return constPermeability_;
Scalar permFactor = 1.0; //0.001/(1000*9.81);
constPermeability_ = getParam<Scalar>("SpatialParams.Permeability")*permFactor;
porosity_ = getParam<Scalar>("SpatialParams.Porosity");
}
static constexpr bool pcSwCurveIsLinear()
{ return (std::is_same_v<PcKrSwCurve, LinearMaterial> || std::is_same_v<PcKrSwCurve, LinearMaterialDefault>); }
Scalar intrinsicPermeability (const Element& element) const
{ return constPermeability_; }
Scalar porosity(const Element &element) const
{
return porosity_;
}
{ return porosity_; }
/*!
* \brief DOC ME!
* \param element DOC ME!
* \brief Returns the parameters for the material law at a given location
*
* \param globalPos The global coordinates for the given location
*/
// return the parameter object for the Brooks-Corey material law which depends on the position
const MaterialLawParams& materialLawParams(const Element &element) const
{
return materialLawParams_;
}
BuckleyLeverettSpatialParams(const Problem& problem)
:ParentType(problem)
{
Scalar permFactor = 1.0; //0.001/(1000*9.81);
constPermeability_ = getParam<double>("SpatialParams.Permeability")*permFactor;
materialLawParams_.setSwr( getParam<double>("SpatialParams.ResidualSaturationWetting") );
materialLawParams_.setSnr( getParam<double>("SpatialParams.ResidualSaturationNonwetting") );
//set Brooks-Corey parameters
materialLawParams_.setPe( getParam<double>("SpatialParams.BrooksCoreyEntryPressure") );
materialLawParams_.setLambda( getParam<double>("SpatialParams.BrooksCoreyLambda") );
porosity_ = getParam<double>("SpatialParams.Porosity");
}
auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
{ return pcKrSwCurve_; }
private:
MaterialLawParams materialLawParams_;
const PcKrSwCurve pcKrSwCurve_;
Scalar constPermeability_;
Scalar porosity_;
Scalar swr_;
Scalar snr_;
Scalar pcEntry_;
Scalar lambda_;
};
......
......@@ -21,12 +21,10 @@ Salinity = 0.1
Permeability = 1e-13 # [m^2] intrinsic permeability
DipAngle = 0.0 # [deg] dip angle for the domain
Porosity = 0.3 # porosity
[MaterialLaw]
Swr = 0.2 # [-] residual wetting phase sat.
Snr = 0.2 # [-] residual nonwetting phase sat.
Pe = 5e3 # [Pa] capillary entry pressure
Lambda = 2 # [-] Brooks Corey parameter
BrooksCoreyPcEntry = 5e3 # [Pa] capillary entry pressure
BrooksCoreyLambda = 2 # [-] Brooks Corey parameter
[Problem]
Name = co2plumeshape # the name of the output files
......
......@@ -28,8 +28,7 @@
#include <dumux/io/grid/griddata.hh>
#include <dumux/material/spatialparams/fv.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
#include <dumux/material/fluidmatrixinteractions/2p/brookscorey.hh>
#include <dumux/porousmediumflow/co2/model.hh>