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
a7ac83bd
Commit
a7ac83bd
authored
Jul 29, 2019
by
Martin Schneider
Browse files
[course][exercises] Correct return type for Neumann and Source functions
parent
9b6857a8
Changes
12
Hide whitespace changes
Inline
Side-by-side
exercises/exercise-basic/injection2p2cproblem.hh
View file @
a7ac83bd
...
...
@@ -197,10 +197,10 @@ public:
*
* \param globalPos The position of the integration point of the boundary segment.
*/
PrimaryVariables
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
// if we are inside the injection zone set inflow Neumann boundary conditions
if
(
time_
<
injectionDuration_
...
...
exercises/exercise-basic/injection2pniproblem.hh
View file @
a7ac83bd
...
...
@@ -195,10 +195,10 @@ public:
*
* \param globalPos The position of the integration point of the boundary segment.
*/
PrimaryVariables
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
// if we are inside the injection zone set inflow Neumann boundary conditions
if
(
time_
<
injectionDuration_
...
...
exercises/exercise-basic/injection2pproblem.hh
View file @
a7ac83bd
...
...
@@ -197,10 +197,10 @@ public:
*
* \param globalPos The position of the integration point of the boundary segment.
*/
PrimaryVariables
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
// if we are inside the injection zone set inflow Neumann boundary conditions
// using < boundary + eps_ or > boundary - eps_ is safer for floating point comparisons
...
...
exercises/exercise-fluidsystem/2p2cproblem.hh
View file @
a7ac83bd
...
...
@@ -110,6 +110,7 @@ class ExerciseFluidsystemProblemTwoPTwoC : public PorousMediumFlowProblem<TypeTa
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>::
LocalView
;
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
public:
ExerciseFluidsystemProblemTwoPTwoC
(
std
::
shared_ptr
<
const
FVGridGeometry
>
fvGridGeometry
)
...
...
@@ -176,10 +177,10 @@ public:
*
* \param globalPos The position of the integration point of the boundary segment.
*/
PrimaryVariables
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
Scalar
up
=
this
->
fvGridGeometry
().
bBoxMax
()[
dimWorld
-
1
];
// extraction of oil (30 g/m/s) on a segment of the upper boundary
...
...
@@ -236,10 +237,10 @@ public:
* \brief Returns the source term
* \param globalPos The global position
*/
PrimaryVariables
sourceAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
sourceAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// we do not define any sources
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
return
values
;
}
...
...
exercises/exercise-fluidsystem/2pproblem.hh
View file @
a7ac83bd
...
...
@@ -133,6 +133,7 @@ class ExerciseFluidsystemProblemTwoP : public PorousMediumFlowProblem<TypeTag>
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>::
LocalView
;
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
FluidState
=
GetPropType
<
TypeTag
,
Properties
::
FluidState
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
enum
{
waterPressureIdx
=
Indices
::
pressureIdx
,
...
...
@@ -218,10 +219,10 @@ public:
* For this method, the \a values parameter stores the mass flux
* in normal direction of each phase. Negative values mean influx.
*/
PrimaryVariables
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
Scalar
up
=
this
->
fvGridGeometry
().
bBoxMax
()[
dimWorld
-
1
];
...
...
@@ -274,10 +275,10 @@ public:
*
* \param globalPos The global position
*/
PrimaryVariables
sourceAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
sourceAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// we define no source term here
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
return
values
;
}
...
...
exercises/exercise-grids/injection2pproblem.hh
View file @
a7ac83bd
...
...
@@ -108,6 +108,7 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag>
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>::
LocalView
;
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
enum
{
dimWorld
=
GridView
::
dimensionworld
};
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
...
...
@@ -199,10 +200,10 @@ public:
*
* \param globalPos The position of the integration point of the boundary segment.
*/
PrimaryVariables
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
// if we are inside the injection zone set inflow Neumann boundary conditions
// using < boundary + eps_ or > boundary - eps_ is safer for floating point comparisons
...
...
exercises/exercise-runtimeparams/injection2pproblem.hh
View file @
a7ac83bd
...
...
@@ -105,6 +105,7 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag>
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>::
LocalView
;
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
enum
{
dimWorld
=
GridView
::
dimensionworld
};
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
...
...
@@ -199,10 +200,10 @@ public:
*
* \param globalPos The position of the integration point of the boundary segment.
*/
PrimaryVariables
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
// if we are inside the injection zone set inflow Neumann boundary conditions
// using < boundary + eps_ or > boundary - eps_ is safer for floating point comparisons
...
...
exercises/solution/exercise-basic/injection2pniproblem.hh
View file @
a7ac83bd
...
...
@@ -190,10 +190,10 @@ public:
*
* \param globalPos The position of the integration point of the boundary segment.
*/
PrimaryVariables
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
// if we are inside the injection zone set inflow Neumann boundary conditions
if
(
time_
<
injectionDuration_
...
...
exercises/solution/exercise-fluidsystem/2p2cproblem.hh
View file @
a7ac83bd
...
...
@@ -110,6 +110,7 @@ class ExerciseFluidsystemProblemTwoPTwoC : public PorousMediumFlowProblem<TypeTa
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>::
LocalView
;
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
public:
ExerciseFluidsystemProblemTwoPTwoC
(
std
::
shared_ptr
<
const
FVGridGeometry
>
fvGridGeometry
)
...
...
@@ -181,10 +182,10 @@ public:
* For this method, the \a values parameter stores the mass flux
* in normal direction of each phase. Negative values mean influx.
*/
PrimaryVariables
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
Scalar
up
=
this
->
fvGridGeometry
().
bBoxMax
()[
dimWorld
-
1
];
// extraction of oil (30 g/m/s) on a segment of the upper boundary
...
...
@@ -245,10 +246,10 @@ public:
* \f$ [ \textnormal{unit of primary variable} / (m^\textrm{dim} \cdot s )] \f$
* \param globalPos The global position
*/
PrimaryVariables
sourceAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
sourceAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// we do not define any sources
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
return
values
;
}
...
...
exercises/solution/exercise-fluidsystem/2pproblem.hh
View file @
a7ac83bd
...
...
@@ -133,6 +133,7 @@ class ExerciseFluidsystemProblemTwoP : public PorousMediumFlowProblem<TypeTag>
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>::
LocalView
;
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
FluidState
=
GetPropType
<
TypeTag
,
Properties
::
FluidState
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
enum
{
waterPressureIdx
=
Indices
::
pressureIdx
,
...
...
@@ -221,10 +222,10 @@ public:
* For this method, the \a values parameter stores the mass flux
* in normal direction of each phase. Negative values mean influx.
*/
PrimaryVariables
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
Scalar
up
=
this
->
fvGridGeometry
().
bBoxMax
()[
dimWorld
-
1
];
...
...
@@ -279,10 +280,10 @@ public:
* \f$ [ \textnormal{unit of primary variable} / (m^\textrm{dim} \cdot s )] \f$
* \param globalPos The global position
*/
PrimaryVariables
sourceAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
sourceAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// we define no source term here
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
return
values
;
}
...
...
exercises/solution/exercise-grids/injection2pproblem.hh
View file @
a7ac83bd
...
...
@@ -116,6 +116,7 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag>
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>::
LocalView
;
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
enum
{
dimWorld
=
GridView
::
dimensionworld
};
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
...
...
@@ -207,10 +208,10 @@ public:
*
* \param globalPos The position of the integration point of the boundary segment.
*/
PrimaryVariables
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
// if we are inside the injection zone set inflow Neumann boundary conditions
// using < boundary + eps_ or > boundary - eps_ is safer for floating point comparisons
...
...
exercises/solution/exercise-runtimeparams/injection2pproblem.hh
View file @
a7ac83bd
...
...
@@ -105,6 +105,7 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag>
using
FVGridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>
;
using
FVElementGeometry
=
typename
GetPropType
<
TypeTag
,
Properties
::
FVGridGeometry
>::
LocalView
;
using
FluidSystem
=
GetPropType
<
TypeTag
,
Properties
::
FluidSystem
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
enum
{
dimWorld
=
GridView
::
dimensionworld
};
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
...
...
@@ -205,10 +206,10 @@ public:
*
* \param globalPos The position of the integration point of the boundary segment.
*/
PrimaryVariables
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
NumEqVector
neumannAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
PrimaryVariables
values
(
0.0
);
NumEqVector
values
(
0.0
);
// if we are inside the injection zone set inflow Neumann boundary conditions
// using < boundary + eps_ or > boundary - eps_ is safer for floating point comparisons
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment