Commit cf1430df authored by Katharina Heck's avatar Katharina Heck

[henry1p2c][cleanup] shorten test time and some cleanup

parent 514cbe51
......@@ -5,8 +5,8 @@ dune_add_test(NAME henry1p2c
COMMAND ${dumux_INCLUDE_DIRS}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/lecture/references/Henry1p2c-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/Henry1p2c-00056.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/henry1p2c -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/henry1p2c.input -Grid.File ${CMAKE_CURRENT_SOURCE_DIR}/grids/henry.dgf")
${CMAKE_CURRENT_BINARY_DIR}/Henry1p2c-00048.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/henry1p2c -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/henry1p2c.input -Grid.File ${CMAKE_CURRENT_SOURCE_DIR}/grids/henry.dgf -TimeLoop.TEnd 1e10")
# headers for installation and headercheck
install(FILES
......
......@@ -190,7 +190,10 @@ int main(int argc, char** argv) try
// print dumux end message
if (mpiHelper.rank() == 0)
{
Parameters::print();
DumuxMessage::print(/*firstCall=*/false);
}
return 0;
}
......
......@@ -6,8 +6,8 @@ TEnd = 1e12# [s]
File = ./grids/henry.dgf
[Problem]
freshWaterFluxRate = 6.6e-2 # [mol/sm^2] fresh water flux rate at the left boundary
freshWaterFluxRate = 6.6E-2 # [kg/sm^2] fresh water flux rate at the left boundary
diffusionCoefficient = 6.6e-6 # 1.2e-9 #[m2/s] Diffusion coefficient
Name = Henry1p2c
AlphaL = 0.1 #longitual dispersivity
AlphaL = 0.1 # longitual dispersivity
AlphaT = 0.01 # transversal dispersivity
......@@ -24,6 +24,8 @@
#ifndef DUMUX_HENRY1P2C_PROBLEM_HH
#define DUMUX_HENRY1P2C_PROBLEM_HH
#include <dumux/discretization/box.hh>
#include <dumux/porousmediumflow/1pnc/model.hh>
#include <dumux/porousmediumflow/problem.hh>
......@@ -65,7 +67,7 @@ struct SpatialParams<TypeTag, TTag::Henry1p2cProblemTypeTag>
//Define whether mole(true) or mass (false) fractions are used
template<class TypeTag>
struct UseMoles<TypeTag, TTag::Henry1p2cProblemTypeTag> { static constexpr bool value = true; };
struct UseMoles<TypeTag, TTag::Henry1p2cProblemTypeTag> { static constexpr bool value = false; };
template<class TypeTag>
struct MolecularDiffusionType<TypeTag, TTag::Henry1p2cProblemTypeTag> { using type = FicksLawDispersionImplementation<TypeTag, DiscretizationMethod::box>; };
......@@ -85,32 +87,29 @@ class Henry1p2cProblem : public PorousMediumFlowProblem<TypeTag>
using Element = typename GridView::template Codim<0>::Entity;
using ElementIterator = typename GridView::template Codim<0>::Iterator;
using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>;
// copy some indices for convenience
using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices;
using ParentType = PorousMediumFlowProblem<TypeTag>;
using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
// copy some indices for convenience
using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices;
// indices of the equations
static constexpr int conti0EqIdx = Indices::conti0EqIdx;
// Grid and world dimension
static constexpr int dim = GridView::dimension;
static constexpr int dimWorld = GridView::dimensionworld;
// indices of the equations
static constexpr int conti0EqIdx = Indices::conti0EqIdx;
static constexpr int transportEqIdx = Indices::transportEqIdx;
using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
using Vertex = typename GridView::template Codim<dim>::Entity;
using Intersection = typename GridView::Intersection;
public:
Henry1p2cProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
{
FluidSystem::init();
freshWaterFluxRate_= getParam<Scalar>("Problem.freshWaterFluxRate");
}
bool shouldWriteRestartFile() const
{
return false;
}
/*!
* \name Problem parameters
*/
......@@ -164,7 +163,7 @@ public:
initial_(values, globalPos);
if (globalPos[0]>2-eps_ && globalPos[1]<0.8+eps_)
{
values[FluidSystem::SaltIdx] = 0.0124171;
values[FluidSystem::SaltIdx] = 0.03922;
}
return values;
......@@ -178,15 +177,18 @@ public:
* in normal direction of each component. Negative values mean
* influx.
*/
PrimaryVariables neumannAtPos(const GlobalPosition &globalPos) const
NumEqVector neumann(const Element& element,
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars,
const SubControlVolumeFace& scvf) const
{
PrimaryVariables values(0.0);
const auto globalPos = element.geometry().corner(scvf.insideScvIdx());
NumEqVector values(0.0);
if (globalPos[0]<eps_)
{
values[conti0EqIdx] = -freshWaterFluxRate_/FluidSystem::molarMass(FluidSystem::WaterIdx); //-6.6E-2; //6.6e-5*m2/s*1000kg/m^3
values[conti0EqIdx] = -freshWaterFluxRate_; //-6.6E-2; //6.6e-5*m2/s*1000kg/m^3
}
return values;
}
// \}
......@@ -236,7 +238,6 @@ private:
}
Scalar freshWaterFluxRate_;
Scalar totalInjectionVolume_;
static constexpr Scalar eps_ = 1e-6;
static constexpr Scalar depthBOR_ = 1.0; // [m]
};
......
......@@ -27,7 +27,6 @@
#include <dumux/material/spatialparams/fv.hh>
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
#include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
namespace Dumux {
......@@ -65,9 +64,6 @@ public:
porosity_ = 0.35;
}
~Henry1p2cSpatialParams()
{}
/*!
* \brief Define the intrinsic permeability \f$\mathrm{[m^2]}\f$.
*
......
......@@ -28,9 +28,8 @@
#include <dune/common/exceptions.hh>
#include <dumux/discretization/box.hh>
#include <dumux/material/fluidsystems/base.hh>
#include <dumux/material/components/tabulatedcomponent.hh>
#include <dumux/material/components/h2o.hh>
#include <assert.h>
......@@ -55,7 +54,7 @@ class WaterSalt : public Base<Scalar, WaterSalt<Scalar> >
{
using ThisType = WaterSalt<Scalar>;
using BaseT = Base<Scalar, ThisType>;
using H2O = Dumux::Components::H2O<Scalar>;
using H2O = Components::TabulatedComponent<Components::H2O<Scalar>>;
public:
/****************************************
......@@ -185,7 +184,36 @@ public:
* tables that always work.
*/
static void init()
{}
{
init(/*tempMin=*/273.15,
/*tempMax=*/623.15,
/*numTemp=*/100,
/*pMin=*/-10.,
/*pMax=*/20e6,
/*numP=*/200);
}
/*!
* \brief Initialize the fluid system's static parameters using
* problem specific temperature and pressure ranges
*
* \param tempMin The minimum temperature used for tabulation of water \f$\mathrm{[K]}\f$
* \param tempMax The maximum temperature used for tabulation of water\f$\mathrm{[K]}\f$
* \param nTemp The number of ticks on the temperature axis of the table of water
* \param pressMin The minimum pressure used for tabulation of water \f$\mathrm{[Pa]}\f$
* \param pressMax The maximum pressure used for tabulation of water \f$\mathrm{[Pa]}\f$
* \param nPress The number of ticks on the pressure axis of the table of water
*/
static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp,
Scalar pressMin, Scalar pressMax, unsigned nPress)
{
if (H2O::isTabulated)
{
H2O::init(tempMin, tempMax, nTemp,
pressMin, pressMax, nPress);
}
}
using BaseT::molarDensity;
/*!
......@@ -439,9 +467,7 @@ private:
{
// regularisation
if (temperature <= 275.)
{
temperature = 275;
}
Scalar T_C = temperature - 273.15;
Scalar salinity=Xsalt;
......
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