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
Commits
f5531035
Commit
f5531035
authored
Apr 13, 2018
by
Dennis Gläser
Browse files
[2p] add test using interface solver
parent
8c8fa38f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
test/porousmediumflow/2p/implicit/incompressible/CMakeLists.txt
View file @
f5531035
...
...
@@ -20,6 +20,19 @@ dune_add_test(NAME test_2p_incompressible_box
${
CMAKE_CURRENT_BINARY_DIR
}
/2p_box-00007.vtu
--command
"
${
CMAKE_CURRENT_BINARY_DIR
}
/test_2p_incompressible_box test_2p.input -Problem.Name 2p_box"
)
# using box with interface solver
dune_add_test
(
NAME test_2p_incompressible_box_ifsolver
SOURCES test_2p_fv.cc
COMPILE_DEFINITIONS TYPETAG=TwoPIncompressibleBox
COMPILE_DEFINITIONS ENABLEINTERFACESOLVER=true
COMMAND
${
CMAKE_SOURCE_DIR
}
/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files
${
CMAKE_SOURCE_DIR
}
/test/references/lensbox_ifsolver-reference.vtu
${
CMAKE_CURRENT_BINARY_DIR
}
/2p_box_ifsolver-00018.vtu
--command
"
${
CMAKE_CURRENT_BINARY_DIR
}
/test_2p_incompressible_box_ifsolver test_2p.input
-Problem.Name 2p_box_ifsolver
-Box.UseInterfaceSolver true"
)
# using mpfa
dune_add_test
(
NAME test_2p_incompressible_mpfa
SOURCES test_2p_fv.cc
...
...
test/porousmediumflow/2p/implicit/incompressible/problem.hh
View file @
f5531035
...
...
@@ -38,6 +38,10 @@
#include "spatialparams.hh"
#ifndef ENABLEINTERFACESOLVER
#define ENABLEINTERFACESOLVER 0
#endif
namespace
Dumux
{
// forward declarations
...
...
@@ -72,6 +76,9 @@ SET_PROP(TwoPIncompressible, FluidSystem)
SET_BOOL_PROP
(
TwoPIncompressible
,
EnableGridVolumeVariablesCache
,
false
);
SET_BOOL_PROP
(
TwoPIncompressible
,
EnableGridFluxVariablesCache
,
false
);
SET_BOOL_PROP
(
TwoPIncompressible
,
EnableFVGridGeometryCache
,
false
);
// Maybe enable the box-interface solver
SET_BOOL_PROP
(
TwoPIncompressible
,
EnableBoxInterfaceSolver
,
ENABLEINTERFACESOLVER
);
}
// end namespace Properties
/*!
...
...
test/porousmediumflow/2p/implicit/incompressible/spatialparams.hh
View file @
f5531035
...
...
@@ -23,11 +23,14 @@
#ifndef DUMUX_COMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
#define DUMUX_COMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH
#include <dumux/
material/spatialparams/fv
.hh>
#include <dumux/
discretization/methods
.hh>
#include <dumux/material/spatialparams/fv.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
#include <dumux/porousmediumflow/2p/boxmaterialinterfaceparams.hh>
namespace
Dumux
{
//forward declaration
...
...
@@ -63,12 +66,14 @@ public:
template
<
class
TypeTag
>
class
TwoPTestSpatialParams
:
public
FVSpatialParams
<
TypeTag
>
{
using
ThisType
=
TwoPTestSpatialParams
<
TypeTag
>
;
using
ParentType
=
FVSpatialParams
<
TypeTag
>
;
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
static
constexpr
int
dimWorld
=
GridView
::
dimensionworld
;
...
...
@@ -158,6 +163,18 @@ public:
int
wettingPhaseAtPos
(
const
GlobalPosition
&
globalPos
)
const
{
return
FluidSystem
::
phase0Idx
;
}
//! Updates the map of which material parameters are associated with a nodal dof.
template
<
class
SolutionVector
>
void
updateMaterialInterfaceParams
(
const
SolutionVector
&
x
)
{
if
(
FVGridGeometry
::
discMethod
==
DiscretizationMethod
::
box
)
materialInterfaceParams_
.
update
(
this
->
problem
().
fvGridGeometry
(),
*
this
,
x
);
}
//! Returns the material parameters associated with a nodal dof
const
BoxMaterialInterfaceParams
<
ThisType
>&
materialInterfaceParams
()
const
{
return
materialInterfaceParams_
;
}
private:
bool
isInLens_
(
const
GlobalPosition
&
globalPos
)
const
{
...
...
@@ -176,6 +193,9 @@ private:
MaterialLawParams
lensMaterialParams_
;
MaterialLawParams
outerMaterialParams_
;
// Determines the parameters associated with the dofs at material interfaces
BoxMaterialInterfaceParams
<
ThisType
>
materialInterfaceParams_
;
static
constexpr
Scalar
eps_
=
1.5e-7
;
};
...
...
test/porousmediumflow/2p/implicit/incompressible/test_2p_fv.cc
View file @
f5531035
...
...
@@ -126,6 +126,10 @@ int main(int argc, char** argv) try
problem
->
applyInitialSolution
(
x
);
auto
xOld
=
x
;
// maybe update the interface parameters
if
(
ENABLEINTERFACESOLVER
)
problem
->
spatialParams
().
updateMaterialInterfaceParams
(
x
);
// the grid variables
using
GridVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridVariables
);
auto
gridVariables
=
std
::
make_shared
<
GridVariables
>
(
problem
,
fvGridGeometry
);
...
...
test/references/lensbox_ifsolver-reference.vtu
0 → 100644
View file @
f5531035
This diff is collapsed.
Click to expand it.
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