Commit 570e4422 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[test][md][embedded] New material law

parent 4514e277
......@@ -28,6 +28,9 @@ InitTopSaturation = 0.3
[Soil]
SpatialParams.Permeability = 2.57e-12 # [m^2]
SpatialParams.Porosity = 0.4 # [-]
SpatialParams.Swr = 0.05
SpatialParams.VanGenuchtenAlpha = 2.956e-4
SpatialParams.VanGenuchtenN = 1.5
Problem.Name = 3d
[Root]
......
......@@ -158,8 +158,7 @@ public:
// for initial conditions
const Scalar sw = getParam<Scalar>("Problem.InitTopSaturation", 0.3); // start with 30% saturation on top
using MaterialLaw = typename GetPropType<TypeTag, Properties::SpatialParams>::MaterialLaw;
pcTop_ = MaterialLaw::pc(this->spatialParams().materialLawParamsAtPos(gridGeometry->bBoxMax()), sw);
pcTop_ = this->spatialParams().fluidMatrixInteractionAtPos(gridGeometry->bBoxMax()).pc(sw);
}
/*!
......
......@@ -27,8 +27,7 @@
#include <dumux/common/parameters.hh>
#include <dumux/material/spatialparams/fv.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
#include <dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh>
namespace Dumux {
......@@ -47,26 +46,16 @@ class SoilSpatialParams
using SubControlVolume = typename GridGeometry::SubControlVolume;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
using PcKrSwCurve = FluidMatrix::VanGenuchtenDefault<Scalar>;
public:
// export permeability type
using PermeabilityType = Scalar;
// export material law type
using MaterialLaw = EffToAbsLaw<RegularizedVanGenuchten<Scalar>>;
// export material law params
using MaterialLawParams = typename MaterialLaw::Params;
SoilSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
: ParentType(gridGeometry)
, pcKrSwCurve_("Soil.SpatialParams")
{
// residual saturations
materialParams_.setSwr(0.05);
materialParams_.setSnr(0.0);
// parameters for the Van Genuchten law
// alpha and n
materialParams_.setVgAlpha(2.956e-4);
materialParams_.setVgn(1.5);
// perm and poro
permeability_ = getParam<Scalar>("Soil.SpatialParams.Permeability");
porosity_ = getParam<Scalar>("Soil.SpatialParams.Porosity");
......@@ -105,16 +94,15 @@ public:
/*!
* \brief Returns the parameters for the material law at a given location
*
* This method is not actually required by the Richards model, but provided
* for the convenience of the RichardsLensProblem
*
* \param globalPos A global coordinate vector
* \param globalPos The global coordinates for the given location
*/
const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition &globalPos) const
{ return materialParams_; }
auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
{
return makeFluidMatrixInteraction(pcKrSwCurve_);
}
private:
MaterialLawParams materialParams_;
const PcKrSwCurve pcKrSwCurve_;
Scalar permeability_;
Scalar porosity_;
};
......
......@@ -24,6 +24,9 @@ OutputName = test_md_embedded1d3d_1p_richards
[Soil]
SpatialParams.Permeability = 2.57e-12 # [m^2]
SpatialParams.Porosity = 0.3 # [-]
SpatialParams.Swr = 0.05
SpatialParams.VanGenuchtenAlpha = 2.956e-4
SpatialParams.VanGenuchtenN = 1.5
Problem.Name = 3d
[Root]
......
......@@ -27,8 +27,7 @@
#include <dumux/common/parameters.hh>
#include <dumux/material/spatialparams/fv.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
#include <dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh>
namespace Dumux {
......@@ -47,26 +46,16 @@ class SoilSpatialParams
using SubControlVolume = typename GridGeometry::SubControlVolume;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
using PcKrSwCurve = FluidMatrix::VanGenuchtenDefault<Scalar>;
public:
// export permeability type
using PermeabilityType = Scalar;
// export material law type
using MaterialLaw = EffToAbsLaw<RegularizedVanGenuchten<Scalar>>;
// export material law params
using MaterialLawParams = typename MaterialLaw::Params;
SoilSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
: ParentType(gridGeometry)
, pcKrSwCurve_("Soil.SpatialParams")
{
// residual saturations
materialParams_.setSwr(0.05);
materialParams_.setSnr(0.0);
// parameters for the Van Genuchten law
// alpha and n
materialParams_.setVgAlpha(2.956e-4);
materialParams_.setVgn(1.5);
// perm and poro
permeability_ = getParam<Scalar>("Soil.SpatialParams.Permeability");
porosity_ = getParam<Scalar>("Soil.SpatialParams.Porosity");
......@@ -105,16 +94,15 @@ public:
/*!
* \brief Returns the parameters for the material law at a given location
*
* This method is not actually required by the Richards model, but provided
* for the convenience of the RichardsLensProblem
*
* \param globalPos A global coordinate vector
* \param globalPos The global coordinates for the given location
*/
const MaterialLawParams& materialLawParamsAtPos(const GlobalPosition &globalPos) const
{ return materialParams_; }
auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
{
return makeFluidMatrixInteraction(pcKrSwCurve_);
}
private:
MaterialLawParams materialParams_;
const PcKrSwCurve pcKrSwCurve_;
Scalar permeability_;
Scalar porosity_;
};
......
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