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
c91156ca
Commit
c91156ca
authored
Dec 21, 2018
by
Timo Koch
Browse files
Merge branch 'cleanup/free-spatialparams-from-typetag' into 'master'
Cleanup/free spatialparams from typetag See merge request
!63
parents
681e6b88
d6764c21
Pipeline
#750
passed with stage
in 25 seconds
Changes
20
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
exercises/exercise-biomineralization/biominproblem.hh
View file @
c91156ca
...
...
@@ -53,7 +53,7 @@ namespace Properties
//! Create new type tag for the problem
// Create new type tags
namespace
TTag
{
struct
ExerciseFourBioMin
{
using
InheritsFrom
=
std
::
tuple
<
BioMinSpatialparams
,
TwoPNCMin
>
;
};
struct
ExerciseFourBioMin
{
using
InheritsFrom
=
std
::
tuple
<
TwoPNCMin
>
;
};
struct
ExerciseFourBioMinCCTpfa
{
using
InheritsFrom
=
std
::
tuple
<
ExerciseFourBioMin
,
CCTpfaModel
>
;
};
}
// end namespace TTag
...
...
@@ -92,6 +92,14 @@ struct SolidSystem<TypeTag, TTag::ExerciseFourBioMin>
using
type
=
SolidSystems
::
BiominSolidPhase
<
Scalar
>
;
};
// Set the spatial parameters
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
ExerciseFourBioMin
>
{
using
MT
=
GetPropType
<
TypeTag
,
ModelTraits
>
;
static
constexpr
int
numFluidComps
=
MT
::
numFluidComponents
();
static
constexpr
int
numActiveSolidComps
=
MT
::
numSolidComps
()
-
MT
::
numInertSolidComps
();
using
type
=
BioMinSpatialparams
<
GetPropType
<
TypeTag
,
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>
,
numFluidComps
,
numActiveSolidComps
>
;
};
template
<
class
TypeTag
>
struct
EnableFVGridGeometryCache
<
TypeTag
,
TTag
::
ExerciseFourBioMin
>
{
static
constexpr
bool
value
=
false
;
};
...
...
exercises/exercise-biomineralization/biominspatialparams.hh
View file @
c91156ca
...
...
@@ -33,39 +33,20 @@
#include <dumux/discretization/method.hh>
namespace
Dumux
{
//forward declaration
template
<
class
TypeTag
>
class
BioMinSpatialparams
;
namespace
Properties
{
// The spatial parameters TypeTag
NEW_TYPE_TAG
(
BioMinSpatialparams
);
// Set the spatial parameters
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
BioMinSpatialparams
>
{
using
type
=
BioMinSpatialparams
<
TypeTag
>
;
};
}
// end namespace Properties
namespace
Dumux
{
/*!
* \brief Definition of the spatial parameters for the biomineralisation problem
* with geostatistically distributed initial permeability.
*/
template
<
class
TypeTag
>
template
<
class
FVGridGeometry
,
class
Scalar
,
int
numFluidComps
,
int
numActiveSolidComps
>
class
BioMinSpatialparams
:
public
FVSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
BioMinSpatialparams
<
TypeTag
>>
:
public
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
BioMinSpatialparams
<
FVGridGeometry
,
Scalar
,
numFluidComps
,
numActiveSolidComps
>>
{
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
ParentType
=
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
BioMinSpatialparams
<
TypeTag
>>
;
using
ParentType
=
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
BioMinSpatialparams
<
FVGridGeometry
,
Scalar
,
numFluidComps
,
numActiveSolidComps
>>
;
using
EffectiveLaw
=
RegularizedBrooksCorey
<
Scalar
>
;
using
SolutionVector
=
GetPropType
<
TypeTag
,
Properties
::
SolutionVector
>
;
using
GridView
=
typename
FVGridGeometry
::
GridView
;
using
CoordScalar
=
typename
GridView
::
ctype
;
...
...
@@ -75,8 +56,9 @@ class BioMinSpatialparams
using
GlobalPosition
=
Dune
::
FieldVector
<
CoordScalar
,
dimWorld
>
;
using
Tensor
=
Dune
::
FieldMatrix
<
CoordScalar
,
dimWorld
,
dimWorld
>
;
using
PoroLaw
=
PorosityPrecipitation
<
Scalar
,
numFluidComps
,
numActiveSolidComps
>
;
public:
using
SolidSystem
=
GetPropType
<
TypeTag
,
Properties
::
SolidSystem
>
;
using
PermeabilityType
=
Tensor
;
using
MaterialLaw
=
EffToAbsLaw
<
EffectiveLaw
>
;
using
MaterialLawParams
=
typename
MaterialLaw
::
Params
;
...
...
@@ -156,6 +138,7 @@ public:
* \param fvGridGeometry The fvGridGeometry
* \param sol The (initial) solution vector
*/
template
<
class
SolutionVector
>
void
computeReferencePorosity
(
const
FVGridGeometry
&
fvGridGeometry
,
const
SolutionVector
&
sol
)
{
...
...
@@ -174,6 +157,7 @@ public:
const
auto
&
dofPosition
=
scv
.
dofPosition
();
const
bool
isInAquitardNotFaultZone
=
isInAquitard_
(
dofPosition
)
&&
!
isFaultZone_
(
dofPosition
);
auto
phi
=
isInAquitardNotFaultZone
?
aquitardPorosity_
:
initialPorosity_
;
auto
phiEvaluated
=
poroLaw_
.
evaluatePorosity
(
element
,
scv
,
elemSol
,
phi
);
referencePorosity_
[
eIdx
][
scv
.
indexInElement
()]
=
calculatephiRef
(
phi
,
phiEvaluated
);
}
...
...
@@ -226,6 +210,7 @@ public:
* \param fvGridGeometry The fvGridGeometry
* \param sol The (initial) solution vector
*/
template
<
class
SolutionVector
>
void
computeReferencePermeability
(
const
FVGridGeometry
&
fvGridGeometry
,
const
SolutionVector
&
sol
)
{
...
...
@@ -332,10 +317,8 @@ private:
bool
isFaultZone_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
dimWorld
-
2
]
>
2
-
eps_
&&
globalPos
[
dimWorld
-
2
]
<
3
+
eps_
;}
using
ModelTraits
=
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>
;
PorosityPrecipitation
<
Scalar
,
ModelTraits
::
numFluidComponents
(),
ModelTraits
::
numSolidComps
()
>
poroLaw_
;
PermeabilityKozenyCarman
<
PermeabilityType
>
permLaw_
;
PoroLaw
poroLaw_
;
Scalar
initialPorosity_
;
std
::
vector
<
std
::
vector
<
Scalar
>
>
referencePorosity_
;
...
...
exercises/exercise-coupling-ff-pm/1pspatialparams.hh
View file @
c91156ca
...
...
@@ -26,27 +26,20 @@
#include <dumux/material/spatialparams/fv1p.hh>
namespace
Dumux
{
namespace
Dumux
{
/*!
* \ingroup OnePModel
* \ingroup ImplicitTestProblems
*
* \brief The spatial parameters class for the test problem using the
* 1p cc model
*/
template
<
class
TypeTag
>
template
<
class
FVGridGeometry
,
class
Scalar
>
class
OnePSpatialParams
:
public
FVSpatialParamsOneP
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
OnePSpatialParams
<
TypeTag
>>
:
public
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePSpatialParams
<
FVGridGeometry
,
Scalar
>>
{
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
Problem
=
GetPropType
<
TypeTag
,
Properties
::
Problem
>
;
using
GridView
=
GetPropType
<
TypeTag
,
Properties
::
GridView
>
;
using
ParentType
=
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePSpatialParams
<
TypeTag
>>
;
using
GridView
=
typename
FVGridGeometry
::
GridView
;
using
ParentType
=
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePSpatialParams
<
FVGridGeometry
,
Scalar
>>
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
...
...
@@ -56,7 +49,7 @@ public:
using
PermeabilityType
=
Scalar
;
OnePSpatialParams
(
std
::
shared_ptr
<
const
FVGridGeometry
>
fvGridGeometry
)
:
ParentType
(
fvGridGeometry
)
:
ParentType
(
fvGridGeometry
)
{
permeability_
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Permeability"
);
porosity_
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Porosity"
);
...
...
exercises/exercise-coupling-ff-pm/2pspatialparams.hh
View file @
c91156ca
...
...
@@ -29,29 +29,22 @@
#include <dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh>
#include <dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh>
namespace
Dumux
{
namespace
Dumux
{
/*!
* \ingroup TwoPModel
* \ingroup ImplicitTestProblems
*
* \brief The spatial parameters class for the test problem using the 2p cc model
*/
template
<
class
TypeTag
>
template
<
class
FVGridGeometry
,
class
Scalar
>
class
TwoPSpatialParams
:
public
FVSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
TwoPSpatialParams
<
TypeTag
>>
:
public
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
TwoPSpatialParams
<
FVGridGeometry
,
Scalar
>>
{
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
Problem
=
GetPropType
<
TypeTag
,
Properties
::
Problem
>
;
using
GridView
=
GetPropType
<
TypeTag
,
Properties
::
GridView
>
;
using
GridView
=
typename
FVGridGeometry
::
GridView
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
ParentType
=
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
TwoPSpatialParams
<
TypeTag
>>
;
using
ParentType
=
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
TwoPSpatialParams
<
FVGridGeometry
,
Scalar
>>
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
using
EffectiveLaw
=
RegularizedVanGenuchten
<
Scalar
>
;
...
...
@@ -62,7 +55,7 @@ public:
using
PermeabilityType
=
Scalar
;
TwoPSpatialParams
(
std
::
shared_ptr
<
const
FVGridGeometry
>
fvGridGeometry
)
:
ParentType
(
fvGridGeometry
)
:
ParentType
(
fvGridGeometry
)
{
permeability_
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Permeability"
);
porosity_
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Porosity"
);
...
...
@@ -134,6 +127,6 @@ private:
static
constexpr
Scalar
eps_
=
1.0e-7
;
};
}
// end namespace
}
// end namespace
Dumux
#endif
exercises/exercise-coupling-ff-pm/interface/ex_interface_pmproblem.hh
View file @
c91156ca
...
...
@@ -17,10 +17,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
*
* \brief The porous medium flow sub problem
*/
* \file
*
* \brief The porous medium flow sub problem
*/
#ifndef DUMUX_DARCY_SUBPROBLEM_HH
#define DUMUX_DARCY_SUBPROBLEM_HH
...
...
@@ -80,8 +80,11 @@ struct Grid<TypeTag, TTag::DarcyOneP>
};
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyOneP
>
{
using
type
=
OnePSpatialParams
<
TypeTag
>
;
};
}
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyOneP
>
{
using
type
=
OnePSpatialParams
<
GetPropType
<
TypeTag
,
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>>
;
};
}
// end namespace Properties
/*!
* \brief The porous medium flow sub problem
...
...
exercises/exercise-coupling-ff-pm/models/ex_models_pmproblem.hh
View file @
c91156ca
...
...
@@ -79,8 +79,11 @@ struct Grid<TypeTag, TTag::DarcyOnePNC> { using type = Dune::YaspGrid<2>; };
// Set the spatial paramaters type
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
type
=
OnePSpatialParams
<
TypeTag
>
;
};
}
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyOnePNC
>
{
using
type
=
OnePSpatialParams
<
GetPropType
<
TypeTag
,
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>>
;
};
}
// end namespace Properties
template
<
class
TypeTag
>
class
DarcySubProblem
:
public
PorousMediumFlowProblem
<
TypeTag
>
...
...
@@ -396,6 +399,6 @@ private:
Dumux
::
GnuplotInterface
<
Scalar
>
gnuplotInterfaceFluxes_
;
Dumux
::
GnuplotInterface
<
Scalar
>
gnuplotStorage_
;
};
}
//end namespace
}
//end namespace
Dumux
#endif //DUMUX_DARCY_SUBPROBLEM_HH
exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_ffproblem.hh
View file @
c91156ca
...
...
@@ -32,13 +32,13 @@
#include <dumux/freeflow/compositional/navierstokesncmodel.hh>
#include <dumux/freeflow/navierstokes/problem.hh>
namespace
Dumux
{
namespace
Dumux
{
template
<
class
TypeTag
>
class
FreeFlowSubProblem
;
namespace
Properties
{
namespace
Properties
{
// Create new type tags
namespace
TTag
{
struct
StokesZeroEq
{
using
InheritsFrom
=
std
::
tuple
<
NavierStokesNCNI
,
StaggeredFreeFlowModel
>
;
};
...
...
exercises/exercise-coupling-ff-pm/turbulence/ex_turbulence_pmproblem.hh
View file @
c91156ca
...
...
@@ -16,11 +16,11 @@
* 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 The porous medium sub problem
*/
/*!
* \file
*
* \brief The porous medium sub problem
*/
#ifndef DUMUX_DARCY2P2C_SUBPROBLEM_HH
#define DUMUX_DARCY2P2C_SUBPROBLEM_HH
...
...
@@ -72,8 +72,11 @@ template<class TypeTag>
struct
UseMoles
<
TypeTag
,
TTag
::
DarcyTwoPTwoCNI
>
{
static
constexpr
bool
value
=
true
;
};
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyTwoPTwoCNI
>
{
using
type
=
TwoPSpatialParams
<
TypeTag
>
;
};
}
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyTwoPTwoCNI
>
{
using
type
=
TwoPSpatialParams
<
GetPropType
<
TypeTag
,
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>>
;
};
}
// end namespace Properties
/*!
* \brief The porous medium sub problem
...
...
exercises/exercise-mainfile/1pproblem.hh
View file @
c91156ca
...
...
@@ -70,7 +70,9 @@ struct Problem<TypeTag, TTag::OnePBase> { using type = OnePTestProblem<TypeTag>;
// set the spatial params
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
OnePBase
>
{
using
type
=
OnePTestSpatialParams
<
TypeTag
>
;
};
struct
SpatialParams
<
TypeTag
,
TTag
::
OnePBase
>
{
using
type
=
OnePTestSpatialParams
<
GetPropType
<
TypeTag
,
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>>
;
};
// the fluid system for incompressible tests
template
<
class
TypeTag
>
...
...
exercises/exercise-mainfile/1pspatialparams.hh
View file @
c91156ca
...
...
@@ -24,7 +24,6 @@
#ifndef DUMUX_EX_MAINFILE_ONEP_TEST_SPATIAL_PARAMS_HH
#define DUMUX_EX_MAINFILE_ONEP_TEST_SPATIAL_PARAMS_HH
#include <dumux/porousmediumflow/properties.hh>
#include <dumux/material/spatialparams/fv1p.hh>
namespace
Dumux
{
...
...
@@ -34,19 +33,15 @@ namespace Dumux {
* \brief The spatial parameters class for the test problem using the
* compressible 1p model
*/
template
<
class
TypeTag
>
template
<
class
FVGridGeometry
,
class
Scalar
>
class
OnePTestSpatialParams
:
public
FVSpatialParamsOneP
<
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
),
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
),
OnePTestSpatialParams
<
TypeTag
>>
:
public
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePTestSpatialParams
<
FVGridGeometry
,
Scalar
>>
{
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
GridView
=
typename
FVGridGeometry
::
GridView
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
ParentType
=
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePTestSpatialParams
<
TypeTag
>>
;
using
ParentType
=
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePTestSpatialParams
<
FVGridGeometry
,
Scalar
>>
;
static
constexpr
int
dimWorld
=
GridView
::
dimensionworld
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
...
...
exercises/solution/exercise-biomineralization/biominproblem.hh
View file @
c91156ca
...
...
@@ -54,7 +54,7 @@ namespace Properties
//! Create new type tag for the problem
// Create new type tags
namespace
TTag
{
struct
ExerciseFourBioMin
{
using
InheritsFrom
=
std
::
tuple
<
BioMinSpatialparams
,
TwoPNCMin
>
;
};
struct
ExerciseFourBioMin
{
using
InheritsFrom
=
std
::
tuple
<
TwoPNCMin
>
;
};
struct
ExerciseFourBioMinCCTpfa
{
using
InheritsFrom
=
std
::
tuple
<
ExerciseFourBioMin
,
CCTpfaModel
>
;
};
}
// end namespace TTag
...
...
@@ -93,6 +93,14 @@ struct SolidSystem<TypeTag, TTag::ExerciseFourBioMin>
using
type
=
SolidSystems
::
BiominSolidPhase
<
Scalar
>
;
};
// Set the spatial parameters
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
ExerciseFourBioMin
>
{
using
MT
=
GetPropType
<
TypeTag
,
ModelTraits
>
;
static
constexpr
int
numFluidComps
=
MT
::
numFluidComponents
();
static
constexpr
int
numActiveSolidComps
=
MT
::
numSolidComps
()
-
MT
::
numInertSolidComps
();
using
type
=
BioMinSpatialparams
<
GetPropType
<
TypeTag
,
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>
,
numFluidComps
,
numActiveSolidComps
>
;
};
template
<
class
TypeTag
>
struct
EnableFVGridGeometryCache
<
TypeTag
,
TTag
::
ExerciseFourBioMin
>
{
static
constexpr
bool
value
=
false
;
};
...
...
exercises/solution/exercise-biomineralization/biominspatialparams.hh
View file @
c91156ca
...
...
@@ -33,39 +33,20 @@
#include <dumux/discretization/method.hh>
namespace
Dumux
{
//forward declaration
template
<
class
TypeTag
>
class
BioMinSpatialparams
;
namespace
Properties
{
// The spatial parameters TypeTag
NEW_TYPE_TAG
(
BioMinSpatialparams
);
// Set the spatial parameters
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
BioMinSpatialparams
>
{
using
type
=
BioMinSpatialparams
<
TypeTag
>
;
};
}
// end namespace Properties
namespace
Dumux
{
/*!
* \brief Definition of the spatial parameters for the biomineralisation problem
* with geostatistically distributed initial permeability.
*/
template
<
class
TypeTag
>
template
<
class
FVGridGeometry
,
class
Scalar
,
int
numFluidComps
,
int
numActiveSolidComps
>
class
BioMinSpatialparams
:
public
FVSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
BioMinSpatialparams
<
TypeTag
>>
:
public
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
BioMinSpatialparams
<
FVGridGeometry
,
Scalar
,
numFluidComps
,
numActiveSolidComps
>>
{
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
ParentType
=
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
BioMinSpatialparams
<
TypeTag
>>
;
using
ParentType
=
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
BioMinSpatialparams
<
FVGridGeometry
,
Scalar
,
numFluidComps
,
numActiveSolidComps
>>
;
using
EffectiveLaw
=
RegularizedBrooksCorey
<
Scalar
>
;
using
SolutionVector
=
GetPropType
<
TypeTag
,
Properties
::
SolutionVector
>
;
using
GridView
=
typename
FVGridGeometry
::
GridView
;
using
CoordScalar
=
typename
GridView
::
ctype
;
...
...
@@ -75,8 +56,9 @@ class BioMinSpatialparams
using
GlobalPosition
=
Dune
::
FieldVector
<
CoordScalar
,
dimWorld
>
;
using
Tensor
=
Dune
::
FieldMatrix
<
CoordScalar
,
dimWorld
,
dimWorld
>
;
using
PoroLaw
=
PorosityPrecipitation
<
Scalar
,
numFluidComps
,
numActiveSolidComps
>
;
public:
using
SolidSystem
=
GetPropType
<
TypeTag
,
Properties
::
SolidSystem
>
;
using
PermeabilityType
=
Tensor
;
using
MaterialLaw
=
EffToAbsLaw
<
EffectiveLaw
>
;
using
MaterialLawParams
=
typename
MaterialLaw
::
Params
;
...
...
@@ -156,6 +138,7 @@ public:
* \param fvGridGeometry The fvGridGeometry
* \param sol The (initial) solution vector
*/
template
<
class
SolutionVector
>
void
computeReferencePorosity
(
const
FVGridGeometry
&
fvGridGeometry
,
const
SolutionVector
&
sol
)
{
...
...
@@ -174,6 +157,7 @@ public:
const
auto
&
dofPosition
=
scv
.
dofPosition
();
const
bool
isInAquitardNotFaultZone
=
isInAquitard_
(
dofPosition
)
&&
!
isFaultZone_
(
dofPosition
);
auto
phi
=
isInAquitardNotFaultZone
?
aquitardPorosity_
:
initialPorosity_
;
auto
phiEvaluated
=
poroLaw_
.
evaluatePorosity
(
element
,
scv
,
elemSol
,
phi
);
referencePorosity_
[
eIdx
][
scv
.
indexInElement
()]
=
calculatephiRef
(
phi
,
phiEvaluated
);
}
...
...
@@ -226,6 +210,7 @@ public:
* \param fvGridGeometry The fvGridGeometry
* \param sol The (initial) solution vector
*/
template
<
class
SolutionVector
>
void
computeReferencePermeability
(
const
FVGridGeometry
&
fvGridGeometry
,
const
SolutionVector
&
sol
)
{
...
...
@@ -332,10 +317,8 @@ private:
bool
isFaultZone_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
dimWorld
-
2
]
>
2
-
eps_
&&
globalPos
[
dimWorld
-
2
]
<
3
+
eps_
;}
using
ModelTraits
=
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>
;
PorosityPrecipitation
<
Scalar
,
ModelTraits
::
numFluidComponents
(),
ModelTraits
::
numSolidComps
()
>
poroLaw_
;
PermeabilityKozenyCarman
<
PermeabilityType
>
permLaw_
;
PoroLaw
poroLaw_
;
Scalar
initialPorosity_
;
std
::
vector
<
std
::
vector
<
Scalar
>
>
referencePorosity_
;
...
...
exercises/solution/exercise-coupling-ff-pm/1pspatialparams.hh
View file @
c91156ca
...
...
@@ -26,27 +26,20 @@
#include <dumux/material/spatialparams/fv1p.hh>
namespace
Dumux
{
namespace
Dumux
{
/*!
* \ingroup OnePModel
* \ingroup ImplicitTestProblems
*
* \brief The spatial parameters class for the test problem using the
* 1p cc model
*/
template
<
class
TypeTag
>
template
<
class
FVGridGeometry
,
class
Scalar
>
class
OnePSpatialParams
:
public
FVSpatialParamsOneP
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
OnePSpatialParams
<
TypeTag
>>
:
public
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePSpatialParams
<
FVGridGeometry
,
Scalar
>>
{
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
Problem
=
GetPropType
<
TypeTag
,
Properties
::
Problem
>
;
using
GridView
=
GetPropType
<
TypeTag
,
Properties
::
GridView
>
;
using
ParentType
=
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePSpatialParams
<
TypeTag
>>
;
using
GridView
=
typename
FVGridGeometry
::
GridView
;
using
ParentType
=
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePSpatialParams
<
FVGridGeometry
,
Scalar
>>
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
...
...
@@ -56,7 +49,7 @@ public:
using
PermeabilityType
=
Scalar
;
OnePSpatialParams
(
std
::
shared_ptr
<
const
FVGridGeometry
>
fvGridGeometry
)
:
ParentType
(
fvGridGeometry
)
:
ParentType
(
fvGridGeometry
)
{
permeability_
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Permeability"
);
porosity_
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Porosity"
);
...
...
exercises/solution/exercise-coupling-ff-pm/2pspatialparams.hh
View file @
c91156ca
...
...
@@ -29,29 +29,22 @@
#include <dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh>
#include <dumux/material/fluidmatrixinteractions/2p/thermalconductivitysomerton.hh>
namespace
Dumux
{
namespace
Dumux
{
/*!
* \ingroup TwoPModel
* \ingroup ImplicitTestProblems
*
* \brief The spatial parameters class for the test problem using the 2p cc model
*/
template
<
class
TypeTag
>
template
<
class
FVGridGeometry
,
class
Scalar
>
class
TwoPSpatialParams
:
public
FVSpatialParams
<
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
,
TwoPSpatialParams
<
TypeTag
>>
:
public
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
TwoPSpatialParams
<
FVGridGeometry
,
Scalar
>>
{
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
using
Problem
=
GetPropType
<
TypeTag
,
Properties
::
Problem
>
;
using
GridView
=
GetPropType
<
TypeTag
,
Properties
::
GridView
>
;
using
GridView
=
typename
FVGridGeometry
::
GridView
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
ParentType
=
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
TwoPSpatialParams
<
TypeTag
>>
;
using
ParentType
=
FVSpatialParams
<
FVGridGeometry
,
Scalar
,
TwoPSpatialParams
<
FVGridGeometry
,
Scalar
>>
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
using
EffectiveLaw
=
RegularizedVanGenuchten
<
Scalar
>
;
...
...
@@ -62,7 +55,7 @@ public:
using
PermeabilityType
=
Scalar
;
TwoPSpatialParams
(
std
::
shared_ptr
<
const
FVGridGeometry
>
fvGridGeometry
)
:
ParentType
(
fvGridGeometry
)
:
ParentType
(
fvGridGeometry
)
{
permeability_
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Permeability"
);
porosity_
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Porosity"
);
...
...
@@ -134,6 +127,6 @@ private:
static
constexpr
Scalar
eps_
=
1.0e-7
;
};
}
// end namespace
}
// end namespace
Dumux
#endif
exercises/solution/exercise-coupling-ff-pm/interface/ex_interface_pmproblem.hh
View file @
c91156ca
...
...
@@ -47,23 +47,29 @@ class DarcySubProblem;
namespace
Properties
{
NEW_TYPE_TAG
(
DarcyOneP
,
INHERITS_FROM
(
CCTpfaModel
,
OneP
));
// Create new type tags
namespace
TTag
{
struct
DarcyOneP
{
using
InheritsFrom
=
std
::
tuple
<
OneP
,
CCTpfaModel
>
;
};
}
// end namespace TTag
// Set the problem property
SET_TYPE_PROP
(
DarcyOneP
,
Problem
,
Dumux
::
DarcySubProblem
<
TypeTag
>
);
template
<
class
TypeTag
>
struct
Problem
<
TypeTag
,
TTag
::
DarcyOneP
>
{
using
type
=
Dumux
::
DarcySubProblem
<
TypeTag
>
;
};