Skip to content
GitLab
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
d71a12db
Commit
d71a12db
authored
Oct 09, 2019
by
Katharina Heck
Browse files
Merge branch 'cleanup/use-gridgeometry' into 'master'
use new names G(g)ridGeometry See merge request
!78
parents
2fc6395c
9fc779c1
Pipeline
#1423
passed with stage
in 1 minute and 1 second
Changes
63
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
exercises/exercise-basic/2p2cmain.cc
View file @
d71a12db
...
...
@@ -81,7 +81,7 @@ int main(int argc, char** argv) try
const
auto
&
leafGridView
=
gridManager
.
grid
().
leafGridView
();
// create the finite volume grid geometry
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
auto
fvGridGeometry
=
std
::
make_shared
<
FVGridGeometry
>
(
leafGridView
);
fvGridGeometry
->
update
();
...
...
exercises/exercise-basic/2pmain.cc
View file @
d71a12db
...
...
@@ -81,7 +81,7 @@ int main(int argc, char** argv) try
const
auto
&
leafGridView
=
gridManager
.
grid
().
leafGridView
();
// create the finite volume grid geometry
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
auto
fvGridGeometry
=
std
::
make_shared
<
FVGridGeometry
>
(
leafGridView
);
fvGridGeometry
->
update
();
...
...
exercises/exercise-basic/injection2p2cproblem.hh
View file @
d71a12db
...
...
@@ -59,7 +59,7 @@ template<class TypeTag>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2p2c
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
InjectionSpatialParams
<
FVGridGeometry
,
Scalar
>
;
...
...
@@ -104,8 +104,8 @@ class Injection2p2cProblem : public PorousMediumFlowProblem<TypeTag>
using
Indices
=
typename
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>::
Indices
;
using
PrimaryVariables
=
GetPropType
<
TypeTag
,
Properties
::
PrimaryVariables
>
;
using
BoundaryTypes
=
GetPropType
<
TypeTag
,
Properties
::
BoundaryTypes
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>::
LocalView
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>::
LocalView
;
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
...
...
@@ -204,7 +204,7 @@ public:
// if we are inside the injection zone set inflow Neumann boundary conditions
if
(
time_
<
injectionDuration_
&&
globalPos
[
1
]
<
15
+
eps_
&&
globalPos
[
1
]
>
7
-
eps_
&&
globalPos
[
0
]
>
0.9
*
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
])
&&
globalPos
[
1
]
<
15
+
eps_
&&
globalPos
[
1
]
>
7
-
eps_
&&
globalPos
[
0
]
>
0.9
*
this
->
g
ridGeometry
().
bBoxMax
()[
0
])
{
// TODO: dumux-course-task
//instead of setting -1e-4 here directly use totalAreaSpecificInflow_ in the computation
...
...
exercises/exercise-basic/injection2pniproblem.hh
View file @
d71a12db
...
...
@@ -65,7 +65,7 @@ template<class TypeTag>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2pNITypeTag
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
InjectionSpatialParams
<
FVGridGeometry
,
Scalar
>
;
...
...
@@ -110,8 +110,8 @@ class Injection2PNIProblem : public PorousMediumFlowProblem<TypeTag>
using
Indices
=
typename
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>::
Indices
;
using
PrimaryVariables
=
GetPropType
<
TypeTag
,
Properties
::
PrimaryVariables
>
;
using
BoundaryTypes
=
GetPropType
<
TypeTag
,
Properties
::
BoundaryTypes
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>::
LocalView
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>::
LocalView
;
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
...
...
@@ -202,7 +202,7 @@ public:
// if we are inside the injection zone set inflow Neumann boundary conditions
if
(
time_
<
injectionDuration_
&&
globalPos
[
1
]
<
15
+
eps_
&&
globalPos
[
1
]
>
7
-
eps_
&&
globalPos
[
0
]
>
0.9
*
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
])
&&
globalPos
[
1
]
<
15
+
eps_
&&
globalPos
[
1
]
>
7
-
eps_
&&
globalPos
[
0
]
>
0.9
*
this
->
g
ridGeometry
().
bBoxMax
()[
0
])
{
// inject nitrogen. negative values mean injection
// units kg/(s*m^2)
...
...
exercises/exercise-basic/injection2pproblem.hh
View file @
d71a12db
...
...
@@ -61,7 +61,7 @@ template<class TypeTag>
struct
SpatialParams
<
TypeTag
,
TTag
::
Injection2p
>
{
private:
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
Scalar
=
GetPropType
<
TypeTag
,
Properties
::
Scalar
>
;
public:
using
type
=
InjectionSpatialParams
<
FVGridGeometry
,
Scalar
>
;
...
...
@@ -102,8 +102,8 @@ class Injection2PProblem : public PorousMediumFlowProblem<TypeTag>
using
Indices
=
typename
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>::
Indices
;
using
PrimaryVariables
=
GetPropType
<
TypeTag
,
Properties
::
PrimaryVariables
>
;
using
BoundaryTypes
=
GetPropType
<
TypeTag
,
Properties
::
BoundaryTypes
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>::
LocalView
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>::
LocalView
;
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
...
...
@@ -206,7 +206,7 @@ public:
// using < boundary + eps_ or > boundary - eps_ is safer for floating point comparisons
// than using <= or >= as it is robust with regard to imprecision introduced by rounding errors.
if
(
time_
<
injectionDuration_
&&
globalPos
[
1
]
<
15
+
eps_
&&
globalPos
[
1
]
>
7
-
eps_
&&
globalPos
[
0
]
>
0.9
*
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
])
&&
globalPos
[
1
]
<
15
+
eps_
&&
globalPos
[
1
]
>
7
-
eps_
&&
globalPos
[
0
]
>
0.9
*
this
->
g
ridGeometry
().
bBoxMax
()[
0
])
{
// inject nitrogen. negative values mean injection
// units kg/(s*m^2)
...
...
exercises/exercise-biomineralization/biominproblem.hh
View file @
d71a12db
...
...
@@ -91,7 +91,7 @@ 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
,
FV
GridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>
,
numFluidComps
,
numActiveSolidComps
>
;
using
type
=
BioMinSpatialparams
<
GetPropType
<
TypeTag
,
GridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>
,
numFluidComps
,
numActiveSolidComps
>
;
};
template
<
class
TypeTag
>
...
...
@@ -118,8 +118,8 @@ class BioMinProblem : public PorousMediumFlowProblem<TypeTag>
using
PrimaryVariables
=
GetPropType
<
TypeTag
,
Properties
::
PrimaryVariables
>
;
using
BoundaryTypes
=
GetPropType
<
TypeTag
,
Properties
::
BoundaryTypes
>
;
using
VolumeVariables
=
GetPropType
<
TypeTag
,
Properties
::
VolumeVariables
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>::
LocalView
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>::
LocalView
;
// Grid dimension
enum
...
...
@@ -182,7 +182,7 @@ public:
concCa_
=
getParam
<
Scalar
>
(
"Injection.ConcCa"
);
concUrea_
=
getParam
<
Scalar
>
(
"Injection.ConcUrea"
);
unsigned
int
codim
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>::
discMethod
==
DiscretizationMethod
::
box
?
dim
:
0
;
unsigned
int
codim
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>::
discMethod
==
DiscretizationMethod
::
box
?
dim
:
0
;
Kxx_
.
resize
(
fvGridGeometry
->
gridView
().
size
(
codim
));
Kyy_
.
resize
(
fvGridGeometry
->
gridView
().
size
(
codim
));
...
...
@@ -238,7 +238,7 @@ public:
BoundaryTypes
bcTypes
;
// we don't set any BCs for the solid phases
Scalar
xmax
=
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
];
Scalar
xmax
=
this
->
g
ridGeometry
().
bBoxMax
()[
0
];
// set all Neumann
bcTypes
.
setAllNeumann
();
...
...
@@ -313,7 +313,7 @@ public:
PrimaryVariables
priVars
(
0.0
);
priVars
.
setState
(
liquidPhaseOnly
);
Scalar
hmax
=
this
->
fvG
ridGeometry
().
bBoxMax
()[
1
];
Scalar
hmax
=
this
->
g
ridGeometry
().
bBoxMax
()[
1
];
priVars
[
pressureIdx
]
=
initPressure_
-
(
globalPos
[
1
]
-
hmax
)
*
densityW_
*
9.81
;
priVars
[
switchIdx
]
=
0.0
;
priVars
[
CaIdx
]
=
0.0
;
...
...
@@ -381,11 +381,11 @@ public:
*/
void
updateVtkOutput
(
const
SolutionVector
&
curSol
)
{
for
(
const
auto
&
element
:
elements
(
this
->
fvG
ridGeometry
().
gridView
()))
for
(
const
auto
&
element
:
elements
(
this
->
g
ridGeometry
().
gridView
()))
{
const
auto
elemSol
=
elementSolution
(
element
,
curSol
,
this
->
fvG
ridGeometry
());
const
auto
elemSol
=
elementSolution
(
element
,
curSol
,
this
->
g
ridGeometry
());
auto
fvGeometry
=
localView
(
this
->
fvG
ridGeometry
());
auto
fvGeometry
=
localView
(
this
->
g
ridGeometry
());
fvGeometry
.
bindElement
(
element
);
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
...
...
exercises/exercise-biomineralization/biominspatialparams.hh
View file @
d71a12db
...
...
@@ -119,7 +119,7 @@ public:
Scalar
referencePorosity
(
const
Element
&
element
,
const
SubControlVolume
&
scv
)
const
{
const
auto
eIdx
=
this
->
fvG
ridGeometry
().
elementMapper
().
index
(
element
);
const
auto
eIdx
=
this
->
g
ridGeometry
().
elementMapper
().
index
(
element
);
return
referencePorosity_
[
eIdx
][
scv
.
indexInElement
()];
}
...
...
@@ -148,7 +148,7 @@ public:
auto
fvGeometry
=
localView
(
fvGridGeometry
);
fvGeometry
.
bindElement
(
element
);
const
auto
eIdx
=
this
->
fvG
ridGeometry
().
elementMapper
().
index
(
element
);
const
auto
eIdx
=
this
->
g
ridGeometry
().
elementMapper
().
index
(
element
);
auto
elemSol
=
elementSolution
(
element
,
sol
,
fvGridGeometry
);
referencePorosity_
[
eIdx
].
resize
(
fvGeometry
.
numScv
());
...
...
@@ -189,7 +189,7 @@ public:
PermeabilityType
referencePermeability
(
const
Element
&
element
,
const
SubControlVolume
&
scv
)
const
{
const
auto
eIdx
=
this
->
fvG
ridGeometry
().
elementMapper
().
index
(
element
);
const
auto
eIdx
=
this
->
g
ridGeometry
().
elementMapper
().
index
(
element
);
return
referencePermeability_
[
eIdx
][
scv
.
indexInElement
()];
}
...
...
@@ -220,7 +220,7 @@ public:
auto
fvGeometry
=
localView
(
fvGridGeometry
);
fvGeometry
.
bindElement
(
element
);
const
auto
eIdx
=
this
->
fvG
ridGeometry
().
elementMapper
().
index
(
element
);
const
auto
eIdx
=
this
->
g
ridGeometry
().
elementMapper
().
index
(
element
);
auto
elemSol
=
elementSolution
(
element
,
sol
,
fvGridGeometry
);
referencePermeability_
[
eIdx
].
resize
(
fvGeometry
.
numScv
());
...
...
exercises/exercise-biomineralization/main.cc
View file @
d71a12db
...
...
@@ -83,7 +83,7 @@ int main(int argc, char** argv) try
const
auto
&
leafGridView
=
gridManager
.
grid
().
leafGridView
();
// create the finite volume grid geometry
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
auto
fvGridGeometry
=
std
::
make_shared
<
FVGridGeometry
>
(
leafGridView
);
fvGridGeometry
->
update
();
...
...
exercises/exercise-coupling-ff-pm/interface/freeflowsubproblem.hh
View file @
d71a12db
...
...
@@ -100,7 +100,7 @@ class FreeFlowSubProblem : public NavierStokesProblem<TypeTag>
using
BoundaryTypes
=
GetPropType
<
TypeTag
,
Properties
::
BoundaryTypes
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolumeFace
=
typename
FVElementGeometry
::
SubControlVolumeFace
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
...
...
@@ -250,7 +250,7 @@ public:
PrimaryVariables
initialAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
PrimaryVariables
values
(
0.0
);
values
[
Indices
::
velocityYIdx
]
=
-
1e-6
*
globalPos
[
0
]
*
(
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
]
-
globalPos
[
0
]);
values
[
Indices
::
velocityYIdx
]
=
-
1e-6
*
globalPos
[
0
]
*
(
this
->
g
ridGeometry
().
bBoxMax
()[
0
]
-
globalPos
[
0
]);
return
values
;
}
...
...
@@ -276,22 +276,22 @@ public:
*/
void
calculateAnalyticalVelocityX
()
const
{
analyticalVelocityX_
.
resize
(
this
->
fvG
ridGeometry
().
gridView
().
size
(
0
));
analyticalVelocityX_
.
resize
(
this
->
g
ridGeometry
().
gridView
().
size
(
0
));
using
std
::
sqrt
;
const
Scalar
dPdX
=
-
deltaP_
/
(
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
]
-
this
->
fvG
ridGeometry
().
bBoxMin
()[
0
]);
const
Scalar
dPdX
=
-
deltaP_
/
(
this
->
g
ridGeometry
().
bBoxMax
()[
0
]
-
this
->
g
ridGeometry
().
bBoxMin
()[
0
]);
static
const
Scalar
mu
=
FluidSystem
::
viscosity
(
temperature
(),
1e5
);
static
const
Scalar
alpha
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.AlphaBeaversJoseph"
);
static
const
Scalar
K
=
getParam
<
Scalar
>
(
"Darcy.SpatialParams.Permeability"
);
static
const
Scalar
sqrtK
=
sqrt
(
K
);
const
Scalar
sigma
=
(
this
->
fvG
ridGeometry
().
bBoxMax
()[
1
]
-
this
->
fvG
ridGeometry
().
bBoxMin
()[
1
])
/
sqrtK
;
const
Scalar
sigma
=
(
this
->
g
ridGeometry
().
bBoxMax
()[
1
]
-
this
->
g
ridGeometry
().
bBoxMin
()[
1
])
/
sqrtK
;
const
Scalar
uB
=
-
K
/
(
2.0
*
mu
)
*
((
sigma
*
sigma
+
2.0
*
alpha
*
sigma
)
/
(
1.0
+
alpha
*
sigma
))
*
dPdX
;
for
(
const
auto
&
element
:
elements
(
this
->
fvG
ridGeometry
().
gridView
()))
for
(
const
auto
&
element
:
elements
(
this
->
g
ridGeometry
().
gridView
()))
{
const
auto
eIdx
=
this
->
fvG
ridGeometry
().
gridView
().
indexSet
().
index
(
element
);
const
Scalar
y
=
element
.
geometry
().
center
()[
1
]
-
this
->
fvG
ridGeometry
().
bBoxMin
()[
1
];
const
auto
eIdx
=
this
->
g
ridGeometry
().
gridView
().
indexSet
().
index
(
element
);
const
Scalar
y
=
element
.
geometry
().
center
()[
1
]
-
this
->
g
ridGeometry
().
bBoxMin
()[
1
];
const
Scalar
u
=
uB
*
(
1.0
+
alpha
/
sqrtK
*
y
)
+
1.0
/
(
2.0
*
mu
)
*
(
y
*
y
+
2
*
alpha
*
y
*
sqrtK
)
*
dPdX
;
analyticalVelocityX_
[
eIdx
]
=
u
;
...
...
@@ -312,16 +312,16 @@ public:
private:
bool
onLeftBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
0
]
<
this
->
fvG
ridGeometry
().
bBoxMin
()[
0
]
+
eps_
;
}
{
return
globalPos
[
0
]
<
this
->
g
ridGeometry
().
bBoxMin
()[
0
]
+
eps_
;
}
bool
onRightBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
0
]
>
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
]
-
eps_
;
}
{
return
globalPos
[
0
]
>
this
->
g
ridGeometry
().
bBoxMax
()[
0
]
-
eps_
;
}
bool
onLowerBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
1
]
<
this
->
fvG
ridGeometry
().
bBoxMin
()[
1
]
+
eps_
;
}
{
return
globalPos
[
1
]
<
this
->
g
ridGeometry
().
bBoxMin
()[
1
]
+
eps_
;
}
bool
onUpperBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
1
]
>
this
->
fvG
ridGeometry
().
bBoxMax
()[
1
]
-
eps_
;
}
{
return
globalPos
[
1
]
>
this
->
g
ridGeometry
().
bBoxMax
()[
1
]
-
eps_
;
}
Scalar
eps_
;
Scalar
deltaP_
;
...
...
exercises/exercise-coupling-ff-pm/interface/main.cc
View file @
d71a12db
...
...
@@ -157,10 +157,10 @@ int main(int argc, char** argv) try
// create the finite volume grid geometry
using
StokesFVGridGeometry
=
GetPropType
<
StokesTypeTag
,
Properties
::
FV
GridGeometry
>
;
using
StokesFVGridGeometry
=
GetPropType
<
StokesTypeTag
,
Properties
::
GridGeometry
>
;
auto
stokesFvGridGeometry
=
std
::
make_shared
<
StokesFVGridGeometry
>
(
stokesGridView
);
stokesFvGridGeometry
->
update
();
using
DarcyFVGridGeometry
=
GetPropType
<
DarcyTypeTag
,
Properties
::
FV
GridGeometry
>
;
using
DarcyFVGridGeometry
=
GetPropType
<
DarcyTypeTag
,
Properties
::
GridGeometry
>
;
auto
darcyFvGridGeometry
=
std
::
make_shared
<
DarcyFVGridGeometry
>
(
darcyGridView
);
darcyFvGridGeometry
->
update
();
...
...
exercises/exercise-coupling-ff-pm/interface/porousmediumsubproblem.hh
View file @
d71a12db
...
...
@@ -82,7 +82,7 @@ struct Grid<TypeTag, TTag::DarcyOneP>
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
DarcyOneP
>
{
using
type
=
OnePSpatialParams
<
GetPropType
<
TypeTag
,
FV
GridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>>
;
using
type
=
OnePSpatialParams
<
GetPropType
<
TypeTag
,
GridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>>
;
};
}
// end namespace Properties
...
...
@@ -100,10 +100,10 @@ class PorousMediumSubProblem : public PorousMediumFlowProblem<TypeTag>
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
using
BoundaryTypes
=
GetPropType
<
TypeTag
,
Properties
::
BoundaryTypes
>
;
using
VolumeVariables
=
GetPropType
<
TypeTag
,
Properties
::
VolumeVariables
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>::
LocalView
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
SubControlVolumeFace
=
typename
FVElementGeometry
::
SubControlVolumeFace
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
GridVariables
=
GetPropType
<
TypeTag
,
Properties
::
GridVariables
>
;
using
ElementFluxVariablesCache
=
typename
GridVariables
::
GridFluxVariablesCache
::
LocalView
;
...
...
@@ -256,16 +256,16 @@ public:
private:
bool
onLeftBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
0
]
<
this
->
fvG
ridGeometry
().
bBoxMin
()[
0
]
+
eps_
;
}
{
return
globalPos
[
0
]
<
this
->
g
ridGeometry
().
bBoxMin
()[
0
]
+
eps_
;
}
bool
onRightBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
0
]
>
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
]
-
eps_
;
}
{
return
globalPos
[
0
]
>
this
->
g
ridGeometry
().
bBoxMax
()[
0
]
-
eps_
;
}
bool
onLowerBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
1
]
<
this
->
fvG
ridGeometry
().
bBoxMin
()[
1
]
+
eps_
;
}
{
return
globalPos
[
1
]
<
this
->
g
ridGeometry
().
bBoxMin
()[
1
]
+
eps_
;
}
bool
onUpperBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
1
]
>
this
->
fvG
ridGeometry
().
bBoxMax
()[
1
]
-
eps_
;
}
{
return
globalPos
[
1
]
>
this
->
g
ridGeometry
().
bBoxMax
()[
1
]
-
eps_
;
}
Scalar
eps_
;
std
::
shared_ptr
<
CouplingManager
>
couplingManager_
;
...
...
exercises/exercise-coupling-ff-pm/models/freeflowsubproblem.hh
View file @
d71a12db
...
...
@@ -94,7 +94,7 @@ class FreeFlowSubProblem : public NavierStokesProblem<TypeTag>
using
Indices
=
typename
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>::
Indices
;
using
BoundaryTypes
=
GetPropType
<
TypeTag
,
Properties
::
BoundaryTypes
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolumeFace
=
typename
FVElementGeometry
::
SubControlVolumeFace
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
...
...
@@ -268,13 +268,13 @@ public:
FluidState
fluidState
;
updateFluidStateForBC_
(
fluidState
,
pressure_
);
const
Scalar
density
=
FluidSystem
::
density
(
fluidState
,
0
);
values
[
Indices
::
pressureIdx
]
=
pressure_
-
density
*
this
->
gravity
()[
1
]
*
(
this
->
fvG
ridGeometry
().
bBoxMax
()[
1
]
-
globalPos
[
1
]);
values
[
Indices
::
pressureIdx
]
=
pressure_
-
density
*
this
->
gravity
()[
1
]
*
(
this
->
g
ridGeometry
().
bBoxMax
()[
1
]
-
globalPos
[
1
]);
// gravity has negative sign
values
[
Indices
::
conti0EqIdx
+
1
]
=
moleFraction_
;
values
[
Indices
::
velocityXIdx
]
=
4.0
*
velocity_
*
(
globalPos
[
1
]
-
this
->
fvG
ridGeometry
().
bBoxMin
()[
1
])
*
(
this
->
fvG
ridGeometry
().
bBoxMax
()[
1
]
-
globalPos
[
1
])
values
[
Indices
::
velocityXIdx
]
=
4.0
*
velocity_
*
(
globalPos
[
1
]
-
this
->
g
ridGeometry
().
bBoxMin
()[
1
])
*
(
this
->
g
ridGeometry
().
bBoxMax
()[
1
]
-
globalPos
[
1
])
/
(
height_
()
*
height_
());
return
values
;
...
...
@@ -303,16 +303,16 @@ public:
private:
bool
onLeftBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
0
]
<
this
->
fvG
ridGeometry
().
bBoxMin
()[
0
]
+
eps_
;
}
{
return
globalPos
[
0
]
<
this
->
g
ridGeometry
().
bBoxMin
()[
0
]
+
eps_
;
}
bool
onRightBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
0
]
>
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
]
-
eps_
;
}
{
return
globalPos
[
0
]
>
this
->
g
ridGeometry
().
bBoxMax
()[
0
]
-
eps_
;
}
bool
onLowerBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
1
]
<
this
->
fvG
ridGeometry
().
bBoxMin
()[
1
]
+
eps_
;
}
{
return
globalPos
[
1
]
<
this
->
g
ridGeometry
().
bBoxMin
()[
1
]
+
eps_
;
}
bool
onUpperBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
1
]
>
this
->
fvG
ridGeometry
().
bBoxMax
()[
1
]
-
eps_
;
}
{
return
globalPos
[
1
]
>
this
->
g
ridGeometry
().
bBoxMax
()[
1
]
-
eps_
;
}
//! \brief updates the fluid state to obtain required quantities for IC/BC
void
updateFluidStateForBC_
(
FluidState
&
fluidState
,
const
Scalar
pressure
)
const
...
...
@@ -337,7 +337,7 @@ private:
}
// the height of the free-flow domain
const
Scalar
height_
()
const
{
return
this
->
fvG
ridGeometry
().
bBoxMax
()[
1
]
-
this
->
fvG
ridGeometry
().
bBoxMin
()[
1
];
}
{
return
this
->
g
ridGeometry
().
bBoxMax
()[
1
]
-
this
->
g
ridGeometry
().
bBoxMin
()[
1
];
}
Scalar
eps_
;
...
...
exercises/exercise-coupling-ff-pm/models/main.cc
View file @
d71a12db
...
...
@@ -105,10 +105,10 @@ int main(int argc, char** argv) try
const
auto
&
stokesGridView
=
stokesGridManager
.
grid
().
leafGridView
();
// create the finite volume grid geometry
using
StokesFVGridGeometry
=
GetPropType
<
StokesTypeTag
,
Properties
::
FV
GridGeometry
>
;
using
StokesFVGridGeometry
=
GetPropType
<
StokesTypeTag
,
Properties
::
GridGeometry
>
;
auto
stokesFvGridGeometry
=
std
::
make_shared
<
StokesFVGridGeometry
>
(
stokesGridView
);
stokesFvGridGeometry
->
update
();
using
DarcyFVGridGeometry
=
GetPropType
<
DarcyTypeTag
,
Properties
::
FV
GridGeometry
>
;
using
DarcyFVGridGeometry
=
GetPropType
<
DarcyTypeTag
,
Properties
::
GridGeometry
>
;
auto
darcyFvGridGeometry
=
std
::
make_shared
<
DarcyFVGridGeometry
>
(
darcyGridView
);
darcyFvGridGeometry
->
update
();
...
...
exercises/exercise-coupling-ff-pm/models/porousmediumsubproblem.hh
View file @
d71a12db
...
...
@@ -80,7 +80,7 @@ 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
<
GetPropType
<
TypeTag
,
FV
GridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>>
;
using
type
=
OnePSpatialParams
<
GetPropType
<
TypeTag
,
GridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>>
;
};
}
// end namespace Properties
...
...
@@ -95,10 +95,10 @@ class PorousMediumSubProblem : public PorousMediumFlowProblem<TypeTag>
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
using
BoundaryTypes
=
GetPropType
<
TypeTag
,
Properties
::
BoundaryTypes
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>::
LocalView
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
SubControlVolumeFace
=
typename
FVElementGeometry
::
SubControlVolumeFace
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
GridVariables
=
GetPropType
<
TypeTag
,
Properties
::
GridVariables
>
;
using
ElementFluxVariablesCache
=
typename
GridVariables
::
GridFluxVariablesCache
::
LocalView
;
...
...
@@ -185,9 +185,9 @@ public:
// compute the mass in the entire domain
Scalar
waterMass
=
0.0
;
for
(
const
auto
&
element
:
elements
(
this
->
fvG
ridGeometry
().
gridView
()))
for
(
const
auto
&
element
:
elements
(
this
->
g
ridGeometry
().
gridView
()))
{
auto
fvGeometry
=
localView
(
this
->
fvG
ridGeometry
());
auto
fvGeometry
=
localView
(
this
->
g
ridGeometry
());
fvGeometry
.
bindElement
(
element
);
auto
elemVolVars
=
localView
(
gridVariables
.
curGridVolVars
());
...
...
@@ -203,7 +203,7 @@ public:
Scalar
cumMassLoss
=
initialWaterContent_
-
waterMass
;
Scalar
evaporationRate
=
(
lastWaterMass_
-
waterMass
)
*
86400
/
(
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
]
-
this
->
fvG
ridGeometry
().
bBoxMin
()[
0
])
/
(
this
->
g
ridGeometry
().
bBoxMax
()[
0
]
-
this
->
g
ridGeometry
().
bBoxMin
()[
0
])
/
timeLoop_
->
timeStepSize
();
lastWaterMass_
=
waterMass
;
...
...
@@ -224,9 +224,9 @@ public:
std
::
vector
<
Scalar
>
x
;
std
::
vector
<
Scalar
>
y
;
for
(
const
auto
&
element
:
elements
(
this
->
fvG
ridGeometry
().
gridView
()))
for
(
const
auto
&
element
:
elements
(
this
->
g
ridGeometry
().
gridView
()))
{
auto
fvGeometry
=
localView
(
this
->
fvG
ridGeometry
());
auto
fvGeometry
=
localView
(
this
->
g
ridGeometry
());
fvGeometry
.
bindElement
(
element
);
auto
elemVolVars
=
localView
(
gridVariables
.
curGridVolVars
());
...
...
@@ -246,7 +246,7 @@ public:
gnuplotInterfaceFluxes_
.
resetPlot
();
gnuplotInterfaceFluxes_
.
setXlabel
(
"x-position [m]"
);
gnuplotInterfaceFluxes_
.
setXRange
(
this
->
fvG
ridGeometry
().
bBoxMin
()[
0
],
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
]);
gnuplotInterfaceFluxes_
.
setXRange
(
this
->
g
ridGeometry
().
bBoxMin
()[
0
],
this
->
g
ridGeometry
().
bBoxMax
()[
0
]);
gnuplotInterfaceFluxes_
.
setYlabel
(
"flux [kg/(m^2 s)]"
);
gnuplotInterfaceFluxes_
.
setYRange
(
-
5e-4
,
0.0
);
gnuplotInterfaceFluxes_
.
setOption
(
"set label 'time: "
+
std
::
to_string
(
timeLoop_
->
time
()
/
86400.
)
+
"d' at graph 0.8,0.8 "
);
...
...
@@ -375,16 +375,16 @@ public:
private:
bool
onLeftBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
0
]
<
this
->
fvG
ridGeometry
().
bBoxMin
()[
0
]
+
eps_
;
}
{
return
globalPos
[
0
]
<
this
->
g
ridGeometry
().
bBoxMin
()[
0
]
+
eps_
;
}
bool
onRightBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
0
]
>
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
]
-
eps_
;
}
{
return
globalPos
[
0
]
>
this
->
g
ridGeometry
().
bBoxMax
()[
0
]
-
eps_
;
}
bool
onLowerBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
1
]
<
this
->
fvG
ridGeometry
().
bBoxMin
()[
1
]
+
eps_
;
}
{
return
globalPos
[
1
]
<
this
->
g
ridGeometry
().
bBoxMin
()[
1
]
+
eps_
;
}
bool
onUpperBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
1
]
>
this
->
fvG
ridGeometry
().
bBoxMax
()[
1
]
-
eps_
;
}
{
return
globalPos
[
1
]
>
this
->
g
ridGeometry
().
bBoxMax
()[
1
]
-
eps_
;
}
Scalar
eps_
;
Scalar
moleFraction_
;
...
...
exercises/exercise-coupling-ff-pm/turbulence/freeflowsubproblem.hh
View file @
d71a12db
...
...
@@ -90,7 +90,7 @@ class FreeFlowSubProblem : public NavierStokesProblem<TypeTag>
using
Indices
=
typename
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>::
Indices
;
using
BoundaryTypes
=
GetPropType
<
TypeTag
,
Properties
::
BoundaryTypes
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FV
GridGeometry
>
;
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolumeFace
=
typename
FVElementGeometry
::
SubControlVolumeFace
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
...
...
@@ -280,7 +280,7 @@ public:
const
Scalar
density
=
FluidSystem
::
density
(
fluidState
,
0
);
PrimaryVariables
values
(
0.0
);
values
[
Indices
::
pressureIdx
]
=
refPressure
()
+
density
*
this
->
gravity
()[
1
]
*
(
globalPos
[
1
]
-
this
->
fvG
ridGeometry
().
bBoxMin
()[
1
]);
values
[
Indices
::
pressureIdx
]
=
refPressure
()
+
density
*
this
->
gravity
()[
1
]
*
(
globalPos
[
1
]
-
this
->
g
ridGeometry
().
bBoxMin
()[
1
]);
values
[
Indices
::
conti0EqIdx
+
1
]
=
refMoleFrac
();
values
[
Indices
::
velocityXIdx
]
=
refVelocity
();
values
[
Indices
::
temperatureIdx
]
=
refTemperature
();
...
...
@@ -331,16 +331,16 @@ public:
private:
bool
onLeftBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
0
]
<
this
->
fvG
ridGeometry
().
bBoxMin
()[
0
]
+
eps_
;
}
{
return
globalPos
[
0
]
<
this
->
g
ridGeometry
().
bBoxMin
()[
0
]
+
eps_
;
}
bool
onRightBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
0
]
>
this
->
fvG
ridGeometry
().
bBoxMax
()[
0
]
-
eps_
;
}
{
return
globalPos
[
0
]
>
this
->
g
ridGeometry
().
bBoxMax
()[
0
]
-
eps_
;
}
bool
onLowerBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
1
]
<
this
->
fvG
ridGeometry
().
bBoxMin
()[
1
]
+
eps_
;
}
{
return
globalPos
[
1
]
<
this
->
g
ridGeometry
().
bBoxMin
()[
1
]
+
eps_
;
}
bool
onUpperBoundary_
(
const
GlobalPosition
&
globalPos
)
const
{
return
globalPos
[
1
]
>
this
->
fvG
ridGeometry
().
bBoxMax
()[
1
]
-
eps_
;
}
{
return
globalPos
[
1
]
>
this
->
g
ridGeometry
().
bBoxMax
()[
1
]
-
eps_
;
}
//! \brief updates the fluid state to obtain required quantities for IC/BC
void
updateFluidStateForBC_
(
FluidState
&
fluidState
,
const
Scalar
temperature
,
...
...
@@ -367,7 +367,7 @@ private:
// the height of the free-flow domain
const
Scalar
height_
()
const
{
return
this
->
fvG
ridGeometry
().
bBoxMax
()[
1
]
-
this
->
fvG
ridGeometry
().
bBoxMin
()[
1
];
}
{
return
this
->
g
ridGeometry
().
bBoxMax
()[
1
]
-
this
->
g
ridGeometry
().
bBoxMin
()[
1
];
}
Scalar
eps_
;
...
...
exercises/exercise-coupling-ff-pm/turbulence/main.cc
View file @
d71a12db
...
...
@@ -105,10 +105,10 @@ int main(int argc, char** argv) try
const
auto
&
stokesGridView
=
stokesGridManager
.
grid
().
leafGridView
();
// create the finite volume grid geometry
using
StokesFVGridGeometry
=
GetPropType
<
StokesTypeTag
,
Properties
::
FV
GridGeometry
>
;
using
StokesFVGridGeometry
=
GetPropType
<
StokesTypeTag
,
Properties
::
GridGeometry
>
;
auto
stokesFvGridGeometry
=
std
::
make_shared
<
StokesFVGridGeometry
>
(
stokesGridView
);
stokesFvGridGeometry
->
update
();
using
DarcyFVGridGeometry
=
GetPropType
<
DarcyTypeTag
,
Properties
::
FV
GridGeometry
>
;
using
DarcyFVGridGeometry
=
GetPropType
<
DarcyTypeTag
,
Properties
::
GridGeometry
>
;
auto
darcyFvGridGeometry
=
std
::
make_shared
<
DarcyFVGridGeometry
>
(
darcyGridView
);
darcyFvGridGeometry
->
update
();
...
...