Commit c166d8cb authored by Dennis Gläser's avatar Dennis Gläser Committed by Timo Koch
Browse files

[2p] add test with oil-wet lens

parent b85b7c63
......@@ -31,7 +31,20 @@ dune_add_test(NAME test_2p_incompressible_box_ifsolver
${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")
-Problem.UseNonConformingOutput true")
# using tpfa with an oil-wet lens
dune_add_test(NAME test_2p_incompressible_tpfa_oilwet
SOURCES test_2p_fv.cc
COMPILE_DEFINITIONS TYPETAG=TwoPIncompressibleTpfa
COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/test/references/lenscc_oilwet-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/2p_tpfa_oilwet-00009.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_incompressible_tpfa_oilwet test_2p.input
-Problem.Name 2p_tpfa_oilwet
-Problem.EnableGravity false
-SpatialParams.LensIsOilWet true")
# using mpfa
dune_add_test(NAME test_2p_incompressible_mpfa
......
......@@ -175,6 +175,11 @@ public:
NumEqVector values(0.0);
if (onInlet_(globalPos))
values[contiDNAPLEqIdx] = -0.04; // kg / (m * s)
// in the test with the oil wet lens, use higher injection rate
if (this->spatialParams().lensIsOilWet())
values[contiDNAPLEqIdx] *= 10;
return values;
}
......
......@@ -82,6 +82,8 @@ public:
TwoPTestSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
{
lensIsOilWet_ = getParam<bool>("SpatialParams.LensIsOilWet", false);
lensLowerLeft_ = getParam<GlobalPosition>("SpatialParams.LensLowerLeft");
lensUpperRight_ = getParam<GlobalPosition>("SpatialParams.LensUpperRight");
......@@ -116,7 +118,9 @@ public:
const SubControlVolume& scv,
const ElementSolution& elemSol) const
{
if (isInLens_(element.geometry().center()))
// do not use a less permeable lens in the test with inverted wettability
if (isInLens_(element.geometry().center()) && !lensIsOilWet_)
return lensK_;
return outerK_;
}
......@@ -143,7 +147,8 @@ public:
const SubControlVolume& scv,
const ElementSolution& elemSol) const
{
if (isInLens_(element.geometry().center()))
// do not use different parameters in the test with inverted wettability
if (isInLens_(element.geometry().center()) && !lensIsOilWet_)
return lensMaterialParams_;
return outerMaterialParams_;
}
......@@ -156,7 +161,11 @@ public:
*/
template<class FluidSystem>
int wettingPhaseAtPos(const GlobalPosition& globalPos) const
{ return FluidSystem::phase0Idx; }
{
if (isInLens_(globalPos) && lensIsOilWet_)
return FluidSystem::phase1Idx;
return FluidSystem::phase0Idx;
}
//! Updates the map of which material parameters are associated with a nodal dof.
template<class SolutionVector>
......@@ -170,6 +179,9 @@ public:
const BoxMaterialInterfaceParams<ThisType>& materialInterfaceParams() const
{ return materialInterfaceParams_; }
//! Returns whether or not the lens is oil wet
bool lensIsOilWet() const { return lensIsOilWet_; }
private:
bool isInLens_(const GlobalPosition &globalPos) const
{
......@@ -180,6 +192,7 @@ private:
return true;
}
bool lensIsOilWet_;
GlobalPosition lensLowerLeft_;
GlobalPosition lensUpperRight_;
......
......@@ -150,11 +150,9 @@ int main(int argc, char** argv) try
using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields);
// use non-conforming output for the test with interface solver
#if ENABLEINTERFACESOLVER
VtkOutputModule<TypeTag> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name(), "", Dune::VTK::nonconforming);
#else
VtkOutputModule<TypeTag> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name());
#endif
const auto ncOutput = getParam<bool>("Problem.UseNonConformingOutput", false);
VtkOutputModule<TypeTag> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name(), "",
(ncOutput ? Dune::VTK::nonconforming : Dune::VTK::conforming));
VtkOutputFields::init(vtkWriter); //!< Add model specific output fields
vtkWriter.write(0.0);
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment