Commit 49f53fd4 authored by Katharina Heck's avatar Katharina Heck

[henry2p] cleanup and shorten test time as it is a steady state anyway

parent 8e0b17c0
......@@ -5,8 +5,8 @@ dune_add_test(NAME henry2p
COMMAND ${dumux_INCLUDE_DIRS}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/lecture/references/Henry2p-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/Henry2p-01001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/henry2p -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/henry2p.input -Grid.File ${CMAKE_CURRENT_SOURCE_DIR}/grids/henry.dgf")
${CMAKE_CURRENT_BINARY_DIR}/Henry2p-00087.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/henry2p -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/henry2p.input -Grid.File ${CMAKE_CURRENT_SOURCE_DIR}/grids/henry.dgf -TimeLoop.TEnd 1e9")
# headers for installation and headercheck
install(FILES
......
......@@ -147,8 +147,9 @@ int main(int argc, char** argv) try
vtkWriter.write(0.0);
// instantiate time loop
auto timeLoop = std::make_shared<TimeLoop<Scalar>>(restartTime, dt, tEnd);
auto timeLoop = std::make_shared<CheckPointTimeLoop<Scalar>>(0.0, dt, tEnd);
timeLoop->setMaxTimeStepSize(maxDt);
timeLoop->setPeriodicCheckPoint(getParam<Scalar>("TimeLoop.EpisodeLength", std::numeric_limits<Scalar>::max()));
// the assembler with time loop for instationary problem
using Assembler = FVAssembler<TypeTag, DiffMethod::numeric>;
......
......@@ -2,11 +2,14 @@
DtInitial = 2.5 # [s]
TEnd =1e12 # [s]
MaxTimeStepSize = 1e9
EpisodeLength = 1.e9 # [s]
EpisodeLength = 1e9 # [s]
[Grid]
File = ./grids/henry.dgf
[Problem]
freshWaterFluxRate = 6.6E-2 # [kg/sm^2] fresh water flux rate at the left boundary (6.6E-2)
freshWaterFluxRate = 6.6e-2 # [kg/sm^2] fresh water flux rate at the left boundary (6.6E-2)
Name = Henry2p
[Flux]
UpwindWeight = 1
......@@ -23,11 +23,6 @@
* water saturated medium.
*/
/*
* Note: In the new Dumux this problem uses much more time steps, it seems like the solver does not converge very good and therefor it makes the time steps smaller.
* The end results resp. the stationary state do look the same in both versions. In the new version one can see how the systems approaches the steady state so maybe in the new version a few errors are fixed.
*/
#ifndef DUMUX_HENRY2PPROBLEM_HH
#define DUMUX_HENRY2PPROBLEM_HH
......@@ -39,6 +34,7 @@
#include <dumux/porousmediumflow/problem.hh>
#include <dumux/material/fluidsystems/2pimmiscible.hh>
#include <dumux/material/fluidsystems/h2on2.hh>
#include "henry2pspatialparams.hh"
......@@ -67,7 +63,14 @@ struct Problem<TypeTag, TTag::Henry2pProblemTypeTag> { using type = Henry2pProbl
// Set the spatial parameters
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::Henry2pProblemTypeTag> { using type = Dumux::Henry2pSpatialParams<TypeTag>; };
struct SpatialParams<TypeTag, TTag::Henry2pProblemTypeTag>
{
private:
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
public:
using type = Henry2pSpatialParams<FVGridGeometry, Scalar>;
};
// Set the fluid system
template<class TypeTag>
......@@ -96,9 +99,6 @@ class Henry2pProblem : public PorousMediumFlowProblem<TypeTag>
static constexpr int saturationIdx = Indices::saturationIdx;
// equation indices
static constexpr int conti0EqIdx = Indices::conti0EqIdx;
// phase indices
static constexpr int wPhaseIdx = Indices::Phase0Idx;
static constexpr int nPhaseIdx = Indices::Phase1Idx;
// Grid and world dimension
static constexpr int dim = GridView::dimension;
static constexpr int dimWorld = GridView::dimensionworld;
......@@ -117,6 +117,7 @@ public:
Henry2pProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
{
FluidSystem::init();
eps_ = 3e-6;
temperature_ = 273.15 + 20; // -> 20°C
freshWaterFluxRate_= getParam<Scalar>("Problem.freshWaterFluxRate");
......@@ -127,22 +128,6 @@ public:
*/
// \{
/*!
* \brief Called directly after the time integration.
*/
void postTimeStep()
{
// Calculate storage terms
PrimaryVariables storage;
this->model().globalStorage(storage);
// Write mass balance information for rank 0
if (this->gridView().comm().rank() == 0)
{
std::cout<<"Storage: " << storage << std::endl;
}
}
/*!
* \brief Returns the temperature within the domain.
*
......@@ -177,15 +162,10 @@ public:
{
BoundaryTypes values;
if (globalPos[0]>2-eps_)
{
values.setAllDirichlet();
}
if(onRightBoundary_(globalPos))
values.setAllDirichlet();
else
{
values.setAllNeumann();
}
return values;
}
......@@ -203,23 +183,23 @@ public:
{
PrimaryVariables values;
if (globalPos[0]>2-eps_)// if(onRightBoundary_(globalPos))
if (globalPos[0]>2-eps_)// if(onRightBoundary_(globalPos))
{
if(globalPos[1]<0.8+eps_)
{
Scalar densityB = 1025;
values[pressureIdx] = 1.0133e5+(depthBOR_-globalPos[1]-0.2)*densityB*9.81+1000*9.81*0.2;
values[saturationIdx] = 1.0;
}
if(globalPos[1]<0.8+eps_)
{
Scalar densityB = 1025;
values[pressureIdx] = 1.0133e5+(depthBOR_-globalPos[1]-0.2)*densityB*9.81+1000*9.81*0.2;
values[saturationIdx] = 1.0;
}
else
{
Scalar densityB = 1025;
values[pressureIdx] = 1.0133e5+(depthBOR_-globalPos[1]-0.2)*densityB*9.81+1000*9.81*0.2;
values[saturationIdx] = 0.0;
}
else
{
Scalar densityB = 1025;
values[pressureIdx] = 1.0133e5+(depthBOR_-globalPos[1]-0.2)*densityB*9.81+1000*9.81*0.2;
values[saturationIdx] = 0.0;
}
}
return values;
}
......@@ -267,20 +247,20 @@ public:
PrimaryVariables values;
if(globalPos[1]<0.8+eps_)
{
Scalar densityB = 1025;
values[pressureIdx] = 1.0133e5+(depthBOR_-globalPos[1]-0.2)*densityB*9.81+1000*9.81*0.2;
values[saturationIdx] = 0.0;
}
{
Scalar densityB = 1025;
values[pressureIdx] = 1.0133e5+(depthBOR_-globalPos[1]-0.2)*densityB*9.81+1000*9.81*0.2;
values[saturationIdx] = 0.0;
}
else
{
Scalar densityW = 1000;
values[pressureIdx] = 1.0133e5+(depthBOR_-globalPos[1])*densityW*9.81;
values[saturationIdx] = 0.0;
}
else
{
Scalar densityW = 1000;
values[pressureIdx] = 1.0133e5+(depthBOR_-globalPos[1])*densityW*9.81;
values[saturationIdx] = 0.0;
}
return values;
return values;
}
// \}
......
......@@ -22,11 +22,10 @@
* \brief The spatial parameters for the HernyProblem which uses the
* twophase box model
*/
#ifndef DUMUX_LENS_SPATIAL_PARAMS_HH
#define DUMUX_LENS_SPATIAL_PARAMS_HH
#ifndef DUMUX_HENRY2P_SPATIAL_PARAMS_HH
#define DUMUX_HENRY2P_SPATIAL_PARAMS_HH
#include <dumux/material/spatialparams/fv.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedvangenuchten.hh>
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
......@@ -40,20 +39,18 @@ namespace Dumux {
* \brief The spatial parameters for the Henry2pProblem which uses the
* twophase box model
*/
template<class TypeTag>
class Henry2pSpatialParams : public FVSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>, GetPropType<TypeTag, Properties::Scalar>, Henry2pSpatialParams<TypeTag>>
template<class FVGridGeometry, class Scalar>
class Henry2pSpatialParams :
public FVSpatialParams<FVGridGeometry, Scalar, Henry2pSpatialParams<FVGridGeometry, Scalar>>
{
using ThisType = Henry2pSpatialParams<TypeTag>;
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using ParentType = FVSpatialParams<FVGridGeometry, Scalar, ThisType>;
using Grid = GetPropType<TypeTag, Properties::Grid>;
using GridView = GetPropType<TypeTag, Properties::GridView>;
using CoordScalar = typename Grid::ctype;
using ThisType = Henry2pSpatialParams<FVGridGeometry, Scalar>;
using GridView = typename FVGridGeometry::GridView;
using Element = typename GridView::template Codim<0>::Entity;
using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView;
static constexpr int dim=GridView::dimension;
static constexpr int dimWorld=GridView::dimensionworld;
using FVElementGeometry = typename FVGridGeometry::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using ParentType = FVSpatialParams<FVGridGeometry, Scalar, ThisType>;
static constexpr int dimWorld = GridView::dimensionworld;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
public:
......
Markdown is supported
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