Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux-course
Commits
dfd7fb1c
Commit
dfd7fb1c
authored
Oct 28, 2020
by
Roman Winter
Browse files
[feature] materiallaw-2p for course
parent
9eeca366
Changes
40
Hide whitespace changes
Inline
Side-by-side
exercises/exercise-basic/params.input
View file @
dfd7fb1c
...
...
@@ -15,9 +15,15 @@ InjectionDuration = 2.628e6 # in seconds, i.e. one month
[SpatialParams]
PermeabilityAquitard = 1e-15 # m^2
EntryPressureAquitard = 4.5e4 # Pa
Aquitard.BrooksCoreyPcEntry = 4.5e4 # Pa
Aquitard.BrooksCoreyLambda = 2.0
Aquitard.Swr = 0.2
Aquitard.Snr = 0.0
PermeabilityAquifer = 1e-12 # m^2
EntryPressureAquifer = 1e4 # Pa
Aquifer.BrooksCoreyPcEntry = 1e4 # Pa
Aquifer.BrooksCoreyLambda = 2.0
Aquifer.Swr = 0.2
Aquifer.Snr = 0.0
# these parameters are only used in the nonisothermal model. Uncomment them for that
#[Component]
...
...
exercises/exercise-basic/spatialparams.hh
View file @
dfd7fb1c
...
...
@@ -28,11 +28,10 @@
#define DUMUX_EX_BASIC_SPATIAL_PARAMS_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/io/gnuplotinterface.hh>
#include <dumux/io/plot
materialla
w.hh>
#include <dumux/io/plot
pckrs
w.hh>
namespace
Dumux
{
...
...
@@ -55,13 +54,12 @@ class InjectionSpatialParams
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
using
PcKrSwCurve
=
FluidMatrix
::
BrooksCoreyDefault
<
Scalar
>
;
public:
// export permeability type
using
PermeabilityType
=
Scalar
;
using
MaterialLaw
=
EffToAbsLaw
<
RegularizedBrooksCorey
<
Scalar
>>
;
using
MaterialLawParams
=
typename
MaterialLaw
::
Params
;
/*!
* \brief The constructor
*
...
...
@@ -69,6 +67,8 @@ public:
*/
InjectionSpatialParams
(
std
::
shared_ptr
<
const
FVGridGeometry
>&
fvGridGeometry
)
:
ParentType
(
fvGridGeometry
)
,
aquitardPcKrSwCurve_
(
"SpatialParams.Aquitard"
)
,
aquiferPcKrSwCurve_
(
"SpatialParams.Aquifer"
)
{
aquiferHeightFromBottom_
=
30.0
;
...
...
@@ -79,18 +79,6 @@ public:
// porosities
aquitardPorosity_
=
0.2
;
aquiferPorosity_
=
0.4
;
// residual saturations
aquitardMaterialParams_
.
setSwr
(
0.2
);
aquitardMaterialParams_
.
setSnr
(
0.0
);
aquiferMaterialParams_
.
setSwr
(
0.2
);
aquiferMaterialParams_
.
setSnr
(
0.0
);
// parameters for the Brooks-Corey law
aquitardMaterialParams_
.
setPe
(
getParam
<
Scalar
>
(
"SpatialParams.EntryPressureAquitard"
));
aquiferMaterialParams_
.
setPe
(
getParam
<
Scalar
>
(
"SpatialParams.EntryPressureAquifer"
));
aquitardMaterialParams_
.
setLambda
(
2.0
);
aquiferMaterialParams_
.
setLambda
(
2.0
);
}
/*!
...
...
@@ -120,17 +108,18 @@ public:
}
/*!
* \brief
Function for defining the parameters needed by constitutive relationships (kr-sw, pc-sw, etc.).
* \brief
Returns the parameters for the material law at a given location
*
* \param globalPos The global position
* This method is not actually required by the Richards model, but provided
* for the convenience of the RichardsLensProblem
*
* \
return the material parame
te
r
s
object
* \
param globalPos The global coordina
tes
for the given location
*/
const
Mat
e
ri
alLawParams
&
materialLawParams
AtPos
(
const
GlobalPosition
&
globalPos
)
const
{
auto
fluid
Matri
xInteraction
AtPos
(
const
GlobalPosition
&
globalPos
)
const
{
if
(
isInAquitard_
(
globalPos
))
return
aquitardMaterialParams_
;
return
aquiferMaterialParams_
;
return
makeFluidMatrixInteraction
(
aquitardPcKrSwCurve_
);
return
makeFluidMatrixInteraction
(
aquiferPcKrSwCurve_
);
}
/*!
...
...
@@ -158,12 +147,11 @@ private:
Scalar
aquiferK_
;
Scalar
aquiferHeightFromBottom_
;
Scalar
aquitardPorosity_
;
Scalar
aquiferPorosity_
;
MaterialLawParams
aquitardMaterialParams
_
;
MaterialLawParams
aquiferMaterialParams
_
;
const
PcKrSwCurve
aquitardPcKrSwCurve
_
;
const
PcKrSwCurve
aquiferPcKrSwCurve
_
;
};
}
// end namespace Dumux
...
...
exercises/exercise-biomineralization/biominspatialparams.hh
View file @
dfd7fb1c
...
...
@@ -26,8 +26,7 @@
#include <dumux/material/spatialparams/fv.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>
#include <dumux/material/fluidmatrixinteractions/porosityprecipitation.hh>
#include <dumux/material/fluidmatrixinteractions/permeabilitykozenycarman.hh>
...
...
@@ -46,7 +45,6 @@ class BioMinSpatialparams
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
ParentType
=
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
BioMinSpatialparams
<
FVGridGeometry
,
Scalar
,
numFluidComps
,
numActiveSolidComps
>>
;
using
EffectiveLaw
=
RegularizedBrooksCorey
<
Scalar
>
;
using
GridView
=
typename
FVGridGeometry
::
GridView
;
using
CoordScalar
=
typename
GridView
::
ctype
;
...
...
@@ -58,10 +56,10 @@ class BioMinSpatialparams
using
PoroLaw
=
PorosityPrecipitation
<
Scalar
,
numFluidComps
,
numActiveSolidComps
>
;
using
PcKrSwCurve
=
FluidMatrix
::
BrooksCoreyDefault
<
Scalar
>
;
public:
using
PermeabilityType
=
Tensor
;
using
MaterialLaw
=
EffToAbsLaw
<
EffectiveLaw
>
;
using
MaterialLawParams
=
typename
MaterialLaw
::
Params
;
/*!
* \brief The constructor
...
...
@@ -70,6 +68,8 @@ public:
*/
BioMinSpatialparams
(
std
::
shared_ptr
<
const
FVGridGeometry
>
fvGridGeometry
)
:
ParentType
(
fvGridGeometry
)
,
pcKrSwCurve_
(
"SpatialParams"
)
,
aquitardPcKrSwCurve_
(
"SpatialParams.Aquitard"
)
{
//! set initial aquifer params
initialPorosity_
=
getParam
<
Scalar
>
(
"SpatialParams.InitialPorosity"
);
...
...
@@ -78,25 +78,9 @@ public:
// set main diagonal entries of the permeability tensor to a value
// setting to one value means: isotropic, homogeneous
// residual saturations
materialParams_
.
setSwr
(
0.2
);
materialParams_
.
setSnr
(
0.05
);
// parameters for the Brooks-Corey law
materialParams_
.
setPe
(
1e4
);
materialParams_
.
setLambda
(
2.0
);
//! hard code specific params for aquitard layer
aquitardPorosity_
=
0.1
;
aquitardPermeability_
=
1e-15
;
// residual saturations
aquitardMaterialParams_
.
setSwr
(
0.0
);
aquitardMaterialParams_
.
setSnr
(
0.0
);
// parameters for the Brooks-Corey law
aquitardMaterialParams_
.
setPe
(
1e7
);
aquitardMaterialParams_
.
setLambda
(
2.0
);
}
template
<
class
SolidSystem
,
class
ElementSolution
>
...
...
@@ -261,16 +245,18 @@ public:
}
/*!
* \brief
r
eturn the parameter
object
for the
Brooks-Corey material law which depends on the posi
tion
* \brief
R
eturn
s
the parameter
s
for the
material law at a given loca
tion
*
* \param globalPos The global position
* This method is not actually required by the Richards model, but provided
* for the convenience of the RichardsLensProblem
*
* \param globalPos The global coordinates for the given location
*/
const
MaterialLawParams
&
materialLawParamsAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
if
(
isInAquitard_
(
globalPos
)
&&
!
isFaultZone_
(
globalPos
))
return
aquitardMaterialParams_
;
else
return
materialParams_
;
auto
fluidMatrixInteractionAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
if
(
isInAquitard_
(
globalPos
))
return
makeFluidMatrixInteraction
(
aquitardPcKrSwCurve_
);
return
makeFluidMatrixInteraction
(
pcKrSwCurve_
);
}
// define which phase is to be considered as the wetting phase
...
...
@@ -298,11 +284,11 @@ private:
Scalar
initialPermeability_
;
std
::
vector
<
std
::
vector
<
PermeabilityType
>
>
referencePermeability_
;
MaterialLawParams
materialParams_
;
Scalar
aquitardPorosity_
;
Scalar
aquitardPermeability_
;
MaterialLawParams
aquitardMaterialParams_
;
const
PcKrSwCurve
pcKrSwCurve_
;
const
PcKrSwCurve
aquitardPcKrSwCurve_
;
};
}
// end namespace Dumux
...
...
exercises/exercise-biomineralization/params.input
View file @
dfd7fb1c
...
...
@@ -26,6 +26,15 @@ ConcUrea = 60 # [kg/m³] injected urea concentration (max: 80)
[SpatialParams]
InitialPorosity = 0.35 # [-]
InitialPermeability = 1e-13 # [m^2]
BrooksCoreyPcEntry = 1e4 # Pa
BrooksCoreyLambda = 2.0
Swr = 0.2
Snr = 0.05
Aquitard.BrooksCoreyPcEntry = 1e7 # Pa
Aquitard.BrooksCoreyLambda = 2.0
Aquitard.Swr = 0.0
Aquitard.Snr = 0.0
[BioCoefficients]
RhoBiofilm = 6.9 # [kg/m³] density of biofilm
...
...
exercises/exercise-coupling-ff-pm/2pspatialparams.hh
View file @
dfd7fb1c
...
...
@@ -25,8 +25,7 @@
#define DUMUX_TWOPHASE_SPATIAL_PARAMS_HH
#include <dumux/material/spatialparams/fv.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh>
#include <dumux/material/fluidmatrixinteractions/2p/vangenuchten.hh>
#include <dumux/material/fluidmatrixinteractions/2p/thermalconductivity/somerton.hh>
namespace
Dumux
{
...
...
@@ -47,28 +46,19 @@ class TwoPSpatialParams
using
ParentType
=
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
TwoPSpatialParams
<
FVGridGeometry
,
Scalar
>>
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
using
EffectiveLaw
=
RegularizedVanGenuchten
<
Scalar
>
;
using
PcKrSwCurve
=
FluidMatrix
::
VanGenuchtenDefault
<
Scalar
>
;
public:
using
MaterialLaw
=
EffToAbsLaw
<
EffectiveLaw
>
;
using
MaterialLawParams
=
typename
MaterialLaw
::
Params
;
using
PermeabilityType
=
Scalar
;
TwoPSpatialParams
(
std
::
shared_ptr
<
const
FVGridGeometry
>
fvGridGeometry
)
:
ParentType
(
fvGridGeometry
)
,
pcKrSwCurve_
(
"Darcy.SpatialParams"
)
{
permeability_
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Permeability"
);
porosity_
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Porosity"
);
alphaBJ_
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.AlphaBeaversJoseph"
);
// residual saturations
params_
.
setSwr
(
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Swr"
));
params_
.
setSnr
(
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Snr"
));
// parameters for the vanGenuchten law
params_
.
setVgAlpha
(
getParam
<
Scalar
>
(
"Darcy.SpatialParams.VgAlpha"
));
params_
.
setVgn
(
getParam
<
Scalar
>
(
"Darcy.SpatialParams.VgN"
));
params_
.
setPcLowSw
(
params_
.
swr
()
*
5.0
);
params_
.
setPcHighSw
(
1.0
-
params_
.
snr
()
*
5.0
);
}
/*!
...
...
@@ -95,19 +85,17 @@ public:
{
return
alphaBJ_
;
}
/*!
* \brief Returns the parameter object for the Brooks-Corey material law.
* In this test, we use element-wise distributed material parameters.
* \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 element The current element
* \param scv The sub-control volume inside the element.
* \param elemSol The solution at the dofs connected to the element.
* \return the material parameters object
* \param globalPos The global coordinates for the given location
*/
template
<
class
ElementSolutionVector
>
const
MaterialLawParams
&
materialLawParams
(
const
Element
&
element
,
const
SubControlVolume
&
scv
,
const
ElementSolutionVector
&
elemSol
)
const
{
return
params_
;
}
auto
fluidMatrixInteractionAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
return
makeFluidMatrixInteraction
(
pcKrSwCurve_
);
}
/*!
* \brief Function for defining which phase is to be considered as the wetting phase.
...
...
@@ -123,7 +111,7 @@ private:
Scalar
permeability_
;
Scalar
porosity_
;
Scalar
alphaBJ_
;
MaterialLawParams
params
_
;
const
PcKrSwCurve
pcKrSwCurve
_
;
static
constexpr
Scalar
eps_
=
1.0e-7
;
};
...
...
exercises/exercise-coupling-ff-pm/models/params.input
View file @
dfd7fb1c
...
...
@@ -32,10 +32,12 @@ Permeability = 2.65e-10 # m^2
Porosity = 0.4 # -
AlphaBeaversJoseph = 1.0 # -
# EXNUMBER >= 1
VanGenuchtenN = 8.0
VanGenuchtenAlpha = 6.5e-4
Swr = 0.005
Snr = 0.01
VgAlpha = 6.5e-4
VgN = 8
.0
PcLowSw = Swr * 5.0
PcHighSw = 1.0 - Snr * 5
.0
[Problem]
Name = models_coupling
...
...
exercises/exercise-coupling-ff-pm/turbulence/params.input
View file @
dfd7fb1c
...
...
@@ -40,10 +40,12 @@ InitPhasePresence = 3 # bothPhases
Porosity = 0.41
Permeability = 2.65e-10
AlphaBeaversJoseph = 1.0
VanGenuchtenN = 6.9
VanGenuchtenAlpha = 6.371e-4
Swr = 0.005
Snr = 0.01
VgAlpha = 6.371e-4
VgN = 6.9
PcLowSw = Swr * 5.0
PcHighSw = 1.0 - Snr * 5.0
[Problem]
Name = ex_coupling_turbulence_ff-pm
...
...
exercises/exercise-fluidsystem/aparams.input
View file @
dfd7fb1c
...
...
@@ -5,6 +5,16 @@ DtInitial = 10 # initial time step size [s]
[Problem]
Name = exercise-fluidsystem_a # name will be given to e.g. to the vtk result files
[SpatialParams]
BrooksCoreyPcEntry = 5.0e2 # Pa
BrooksCoreyLambda = 2.0
Swr = 0.1
Snr = 0.0
Lens.BrooksCoreyPcEntry = 1e3 # Pa
Lens.BrooksCoreyLambda = 2.0
Lens.Swr = 0.1
Lens.Snr = 0.0
[Grid]
UpperRight = 60 60 # x-/y-coordinates of the upper-right corner of the grid [m]
Cells = 60 60 # x-/y-resolution of the grid
...
...
exercises/exercise-fluidsystem/bparams.input
View file @
dfd7fb1c
...
...
@@ -5,6 +5,16 @@ DtInitial = 10 # initial time step size [s]
[Problem]
Name = exercise-fluidsystem_b # name will be given to e.g. to the vtk result files
[SpatialParams]
BrooksCoreyPcEntry = 5.0e2 # Pa
BrooksCoreyLambda = 2.0
Swr = 0.1
Snr = 0.0
Lens.BrooksCoreyPcEntry = 1e3 # Pa
Lens.BrooksCoreyLambda = 2.0
Lens.Swr = 0.1
Lens.Snr = 0.0
[Grid]
UpperRight = 60 60 # x-/y-coordinates of the upper-right corner of the grid [m]
Cells = 60 60 # x-/y-resolution of the grid
exercises/exercise-fluidsystem/spatialparams.hh
View file @
dfd7fb1c
...
...
@@ -29,8 +29,7 @@
#include <dumux/material/spatialparams/fv.hh>
// include material laws
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
#include <dumux/material/fluidmatrixinteractions/2p/brookscorey.hh>
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
namespace
Dumux
{
...
...
@@ -52,15 +51,14 @@ class ExerciseFluidsystemSpatialParams
static
constexpr
int
dim
=
GridView
::
dimension
;
static
constexpr
int
dimWorld
=
GridView
::
dimensionworld
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
using
PcKrSwCurve
=
FluidMatrix
::
BrooksCoreyDefault
<
Scalar
>
;
public:
// export permeability type
using
PermeabilityType
=
Dune
::
FieldMatrix
<
Scalar
,
dim
,
dim
>
;
using
MaterialLaw
=
EffToAbsLaw
<
RegularizedBrooksCorey
<
Scalar
>>
;
using
MaterialLawParams
=
typename
MaterialLaw
::
Params
;
/*!
* \brief The constructor
*
...
...
@@ -70,6 +68,8 @@ public:
:
ParentType
(
fvGridGeometry
)
,
K_
(
0
)
,
KLens_
(
0
)
,
pcKrSwCurve_
(
"SpatialParams"
)
,
lensPcKrSwCurve_
(
"Lens.SpatialParams"
)
{
//set main diagonal entries of the permeability tensor to a value
//setting to one value means: isotropic, homogeneous
...
...
@@ -78,18 +78,6 @@ public:
K_
[
i
][
i
]
=
1e-7
;
KLens_
[
i
][
i
]
=
1e-10
;
}
//set residual saturations
materialParams_
.
setSwr
(
0.0
);
materialParamsLens_
.
setSwr
(
0.1
);
materialParams_
.
setSnr
(
0.0
);
materialParamsLens_
.
setSnr
(
0.1
);
//parameters of Brooks & Corey Law
materialParams_
.
setPe
(
500.0
);
materialParamsLens_
.
setPe
(
1000.0
);
materialParams_
.
setLambda
(
2
);
materialParamsLens_
.
setLambda
(
2
);
}
...
...
@@ -119,17 +107,18 @@ public:
}
/*!
* \brief
Function for defining the parameters needed by constitutive relationships (kr-sw, pc-sw, etc.).
* \brief
Returns the parameters for the material law at a given location
*
* \param globalPos The global position
* This method is not actually required by the Richards model, but provided
* for the convenience of the RichardsLensProblem
*
* \
return the material parame
te
r
s
object
* \
param globalPos The global coordina
tes
for the given location
*/
const
Mat
e
ri
alLawParams
&
materialLawParams
AtPos
(
const
GlobalPosition
&
globalPos
)
const
{
auto
fluid
Matri
xInteraction
AtPos
(
const
GlobalPosition
&
globalPos
)
const
{
if
(
isInLens
(
globalPos
))
return
ma
terialParamsLens_
;
return
ma
terialParams_
;
return
ma
keFluidMatrixInteraction
(
pcKrSwCurve_
);
return
ma
keFluidMatrixInteraction
(
lensPcKrSwCurve_
);
}
/*!
...
...
@@ -165,9 +154,9 @@ private:
Dune
::
FieldMatrix
<
Scalar
,
dim
,
dim
>
K_
;
Dune
::
FieldMatrix
<
Scalar
,
dim
,
dim
>
KLens_
;
// Object that holds the values/parameters of the selected material law.
MaterialLawParams
materialParams
_
;
MaterialLawParams
materialParamsLens
_
;
const
PcKrSwCurve
pcKrSwCurve
_
;
const
PcKrSwCurve
lensPcKrSwCurve
_
;
};
}
// end namespace Dumux
#endif
exercises/exercise-fractures/fracturespatialparams.hh
View file @
dfd7fb1c
...
...
@@ -30,8 +30,7 @@
#include <dumux/io/grid/griddata.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
{
...
...
@@ -54,8 +53,7 @@ class FractureSpatialParams
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
// use a regularized van-genuchten material law
using
EffectiveLaw
=
RegularizedVanGenuchten
<
Scalar
>
;
using
PcKrSwCurve
=
FluidMatrix
::
VanGenuchtenDefault
<
Scalar
>
;
// we identify those fractures as barriers, that have a domain marker
// of 2. This is what is set in the grid file (see grids/complex.geo)
...
...
@@ -65,31 +63,19 @@ public:
//! export the type used for permeabilities
using
PermeabilityType
=
Scalar
;
//! export the material law and parameters used
using
MaterialLaw
=
EffToAbsLaw
<
EffectiveLaw
>
;
using
MaterialLawParams
=
typename
MaterialLaw
::
Params
;
//! the constructor
FractureSpatialParams
(
std
::
shared_ptr
<
const
FVGridGeometry
>
fvGridGeometry
,
std
::
shared_ptr
<
const
Dumux
::
GridData
<
Grid
>>
gridData
,
const
std
::
string
&
paramGroup
)
:
ParentType
(
fvGridGeometry
)
,
gridDataPtr_
(
gridData
)
,
pcKrSwCurve_
(
"Fracture.SpatialParams"
)
,
barrierPcKrSwCurve_
(
"Fracture.SpatialParams.Barrier"
)
{
porosity_
=
getParamFromGroup
<
Scalar
>
(
paramGroup
,
"SpatialParams.Porosity"
);
porosityBarrier_
=
getParamFromGroup
<
Scalar
>
(
paramGroup
,
"SpatialParams.PorosityBarrier"
);
permeability_
=
getParamFromGroup
<
Scalar
>
(
paramGroup
,
"SpatialParams.Permeability"
);
permeabilityBarrier_
=
getParamFromGroup
<
Scalar
>
(
paramGroup
,
"SpatialParams.PermeabilityBarrier"
);
// set the material law parameters
materialLawParams_
.
setSnr
(
getParamFromGroup
<
Scalar
>
(
paramGroup
,
"SpatialParams.Snr"
));
materialLawParams_
.
setSnr
(
getParamFromGroup
<
Scalar
>
(
paramGroup
,
"SpatialParams.Swr"
));
materialLawParams_
.
setVgAlpha
(
getParamFromGroup
<
Scalar
>
(
paramGroup
,
"SpatialParams.VGAlpha"
));
materialLawParams_
.
setVgn
(
getParamFromGroup
<
Scalar
>
(
paramGroup
,
"SpatialParams.VGN"
));
materialLawParamsBarrier_
.
setSnr
(
getParamFromGroup
<
Scalar
>
(
paramGroup
,
"SpatialParams.SnrBarrier"
));
materialLawParamsBarrier_
.
setSnr
(
getParamFromGroup
<
Scalar
>
(
paramGroup
,
"SpatialParams.SwrBarrier"
));
materialLawParamsBarrier_
.
setVgAlpha
(
getParamFromGroup
<
Scalar
>
(
paramGroup
,
"SpatialParams.VGAlphaBarrier"
));
materialLawParamsBarrier_
.
setVgn
(
getParamFromGroup
<
Scalar
>
(
paramGroup
,
"SpatialParams.VGNBarrier"
));
}
//! Function for defining the (intrinsic) permeability \f$[m^2]\f$.
...
...
@@ -114,15 +100,24 @@ public:
return
porosity_
;
}
//! Return the material law parameters
template
<
class
ElementSolution
>
const
MaterialLawParams
&
materialLawParams
(
const
Element
&
element
,
const
SubControlVolume
&
scv
,
const
ElementSolution
&
elemSol
)
const
{
/*!
* \brief Returns the parameters for the material law for the sub-control volume
*
* This method is not actually required by the Richards model, but provided
* for the convenience of the RichardsLensProblem
*
* \param element The current finite element
* \param scv The sub-control volume
* \param elemSol The current element solution
*/
template
<
class
ElementSolution
>
auto
fluidMatrixInteraction
(
const
Element
&
element
,
const
SubControlVolume
&
scv
,
const
ElementSolution
&
elemSol
)
const
{
// TODO dumux-course-task B
// Change fracture properties
return
ma
terialLawParams_
;
return
ma
keFluidMatrixInteraction
(
pcKrSwCurve_
);
}
//! Water is the wetting phase
...
...
@@ -146,8 +141,8 @@ private:
Scalar
porosityBarrier_
;
PermeabilityType
permeability_
;
PermeabilityType
permeabilityBarrier_
;
MaterialLawParams
materialLawParams
_
;
MaterialLawParams
materialLawParamsBarrier
_
;
const
PcKrSwCurve
pcKrSwCurve
_
;
const
PcKrSwCurve
barrierPcKrSwCurve
_
;
};
}
// end namespace Dumux
...
...
exercises/exercise-fractures/matrixspatialparams.hh
View file @
dfd7fb1c
...
...
@@ -30,8 +30,7 @@
#include <dumux/io/grid/griddata.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
{
...
...
@@ -53,32 +52,22 @@ class MatrixSpatialParams
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
// use a regularized van-genuchten material law
using
EffectiveLaw
=
RegularizedVanGenuchten
<
Scalar
>
;
using
PcKrSwCurve
=
FluidMatrix
::
VanGenuchtenDefault
<
Scalar
>
;
public:
//! export the type used for permeabilities
using
PermeabilityType
=
Scalar
;
//! export the material law and parameters used
using
MaterialLaw
=
EffToAbsLaw
<
EffectiveLaw
>
;
using
MaterialLawParams
=
typename
MaterialLaw
::
Params
;
//! the constructor
MatrixSpatialParams
(
std
::
shared_ptr
<
const
FVGridGeometry
>
fvGridGeometry
,
std
::
shared_ptr
<
const
Dumux
::
GridData
<
Grid
>>
gridData
,
const
std
::
string
&
paramGroup
)
:
ParentType
(
fvGridGeometry
)
,
gridDataPtr_
(
gridData
)