Commit 0dcf1916 authored by Katharina Heck's avatar Katharina Heck

Merge branch 'cleanup/mm-again' into 'master'

Cleanup mm

See merge request !66
parents fa9f85c2 9d6a87a0
......@@ -24,6 +24,8 @@
#ifndef DUMUX_VIPLAB_OUTPUT_HH
#define DUMUX_VIPLAB_OUTPUT_HH
#include <dumux/porousmediumflow/sequential/properties.hh>
namespace Dumux {
/**
* \brief Writes output to use with ViPLab.
......
......@@ -20,6 +20,8 @@
#ifndef DUMUX_1P2C_SPATIALPARAMS_HH
#define DUMUX_1P2C_SPATIALPARAMS_HH
#include <dumux/common/properties.hh>
#include <dumux/material/spatialparams/fv1p.hh>
/**
......
......@@ -24,6 +24,8 @@
#include <cmath>
#include <dune/grid/yaspgrid.hh>
#include <dumux/porousmediumflow/1p/sequential/diffusion/cellcentered/pressureproperties.hh>
#include <dumux/porousmediumflow/1p/sequential/diffusion/problem.hh>
#include <dumux/porousmediumflow/sequential/cellcentered/velocity.hh>
......
......@@ -22,6 +22,8 @@
#ifndef DUMUX_LECTURE_MHS_GROUNDWATER_SPATIALPARAMS_HH
#define DUMUX_LECTURE_MHS_GROUNDWATER_SPATIALPARAMS_HH
#include <dumux/common/parameters.hh>
#include <dumux/material/spatialparams/sequentialfv1p.hh>
namespace Dumux {
......
......@@ -19,6 +19,8 @@
#ifndef BUCKLEYLEVERETT_SPATIALPARAMS_HH
#define BUCKLEYLEVERETT_SPATIALPARAMS_HH
#include <dumux/common/parameters.hh>
#include <dumux/material/spatialparams/sequentialfv.hh>
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
......
......@@ -26,6 +26,7 @@
#include <dumux/material/components/base.hh>
#include <dumux/material/components/liquid.hh>
namespace Dumux {
/*!
......
......@@ -25,6 +25,7 @@
#define DUMUX_PSEUDOOIL_HH
#include <dumux/material/components/base.hh>
#include <dumux/material/components/liquid.hh>
namespace Dumux {
......
......@@ -7,7 +7,7 @@ dune_add_test(NAME co2plumeshapeexercise
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/lecture/references/co2plumeshape-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/co2plumeshape-00002.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/co2plumeshapeexercise -TimeLoop.TEnd 1e7 -TimeLoop.EpisodeLength 1e7 -BoundaryConditions.InjectionRate 0.01")
--command "${CMAKE_CURRENT_BINARY_DIR}/co2plumeshapeexercise -TimeLoop.TEnd 1e7 -TimeLoop.EpisodeLength 1e7 -BoundaryConditions.InjectionRate 0.01")
#install sources
install(FILES
......
......@@ -39,6 +39,7 @@ Pressure = 1.5e7 # [Pa] initial pressure
InjectionRate = 0.001 # [kg/s] mass injection of CO2
InjectionTemperature = 313.15 # [K] temperature of injected CO2
[Newton]
MaxRelativeShift = 1e-8
SatisfyResidualAndShiftCriterion = true
[Component]
SolidDensity = 2700
SolidThermalConductivity = 2.8
SolidHeatCapacity = 790
......@@ -18,7 +18,6 @@
*****************************************************************************/
/*!
* \file
* \ingroup CO2Tests
* \brief Definition of a problem, where CO2 is injected in a reservoir.
*/
#ifndef DUMUX_PLUMESHAPE_PROBLEM_HH
......@@ -42,12 +41,11 @@
// per default use isothermal model
#ifndef ISOTHERMAL
#define ISOTHERMAL 1
#define ISOTHERMAL 0
#endif
namespace Dumux {
/*!
* \ingroup CO2Tests
* \brief Definition of a problem, where CO2 is injected in a reservoir.
*/
template <class TypeTag>
......@@ -56,7 +54,7 @@ class PlumeShapeProblem;
namespace Properties {
// Create new type tags
namespace TTag {
struct PlumeShapeTypeTag { using InheritsFrom = std::tuple<TwoPTwoCCO2>; };
struct PlumeShapeTypeTag { using InheritsFrom = std::tuple<TwoPTwoCCO2NI>; };
struct PlumeShapeBoxTypeTag { using InheritsFrom = std::tuple<BoxModel, PlumeShapeTypeTag>; };
} // end namespace TTag
......@@ -97,8 +95,6 @@ struct UseMoles<TypeTag, TTag::PlumeShapeTypeTag> { static constexpr bool value
} // end namespace Properties
/*!
* \ingroup CO2Model
* \ingroup ImplicitTestProblems
* \brief Definition of a problem, where CO2 is injected in a reservoir.
*
* The domain is sized 200m times 100m and consists of four layers, a
......@@ -140,9 +136,6 @@ class PlumeShapeProblem : public PorousMediumFlowProblem<TypeTag>
pressureIdx = Indices::pressureIdx,
switchIdx = Indices::switchIdx,
wPhaseIdx = Indices::pressureIdx,
nPhaseIdx = Indices::switchIdx,
// phase presence index
firstPhaseOnly = Indices::firstPhaseOnly,
......@@ -211,11 +204,6 @@ public:
gravity_[1] = -9.81 * cos(dipAngleRadians_);
gravity_[0] = -9.81 * sin(dipAngleRadians_);
#if !ISOTHERMAL
injectionPressure_ = getParam<Scalar>("Problem.InjectionPressure");
injectionTemperature_ = getParam<Scalar>("Problem.InjectionTemperature");
#endif
// initialize the tables of the fluid system
FluidSystem::init(/*Tmin=*/temperatureLow_,
......@@ -267,8 +255,6 @@ public:
* \brief Specifies which kind of boundary condition should be
* used for which equation on a given boundary segment.
*
* \param element The finite element
* \param scv The sub control volume
*/
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
......@@ -317,19 +303,19 @@ public:
* E.g. for the mass balance that would the mass flux in \f$ [ kg / (m^2 \cdot s)] \f$.
*/
NumEqVector neumann(const Element& element,
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolvars,
const SubControlVolumeFace& scvf) const
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolvars,
const SubControlVolumeFace& scvf) const
{
NumEqVector fluxes(0.0);
// kg/(m^2*s) or mole/(m^2*s) depending on useMoles
auto globalPos = scvf.ipGlobal();
const auto globalPos = scvf.ipGlobal();
if ( globalPos[1] < 30.0 + eps_ && globalPos[0] < eps_ )
{
Scalar massFlux = injectionRate_ /30.0; // [kg/(s*m^2)]
fluxes[contiCO2EqIdx] = -massFlux; // kg/(s*m^2)
#if !ISOTHERMAL
const Scalar pressure = elemVolvars[scvf.insideScvIdx()].pressure(nPhaseIdx);
const Scalar pressure = elemVolvars[scvf.insideScvIdx()].pressure(FluidSystem::phase1Idx);
fluxes[energyEqIdx] = -massFlux*CO2::gasEnthalpy(injectionTemperature_, pressure);
#endif
}
......@@ -393,20 +379,24 @@ private:
values[Indices::switchIdx] = massFracLiquidCO2;
#if !ISOTHERMAL
values[temperatureIdx] = temperature_;//290.0 + (depthBOR_ - globalPos[1])*0.03;
#endif
return values;
}
Scalar injectionRate_;
#if !ISOTHERMAL
Scalar injectionPressure_, injectionTemperature_;
Scalar injectionTemperature_;
#endif
int nTemperature_;
int nPressure_;
Scalar temperature_;
Scalar injectionTemperature_;
Scalar pressure_;
Scalar dipAngleRadians_, dipAngle_;
......
......@@ -18,7 +18,6 @@
*****************************************************************************/
/*!
* \file
* \ingroup CO2Tests
* \brief Definition of the spatial parameters for the heterogeneous
* problem which uses the non-isothermal or isothermal CO2
* fully implicit model.
......@@ -37,7 +36,6 @@
namespace Dumux {
/*!
* \ingroup CO2Model
* \brief Definition of the spatial parameters for the CO2 plumeshape
* problem which uses the non-isothermal or isothermal CO2
* fully implicit model.
......@@ -66,8 +64,6 @@ public:
/*!
* \brief The constructor
*
* \param gridView The grid view
*/
PlumeShapeSpatialParams(std::shared_ptr<const FVGridGeometry> fvGridGeometry)
: ParentType(fvGridGeometry)
......
[TimeLoop]
DtInitial = 1 # [s]
TEnd = 1800 # [s]
OutputInterval = 1
MaxTimeStepSize = 1
[Grid]
......@@ -28,3 +27,6 @@ SolidHeatCapacity = 850
SolidDensity = 2650
SolidThermalConductivity = 2.8
SolidHeatCapacity = 84000
[Newton]
MaxRelativeShift = 1e-4
......@@ -103,6 +103,7 @@ struct SpatialParams<TypeTag, TTag::ColumnTypeTag>
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = ColumnSpatialParams<FVGridGeometry, Scalar>;
};
} // end namespace Properties
/*!
......@@ -258,7 +259,7 @@ public:
NumEqVector values(0.0);
// negative values for injection
if (globalPos[1] > 1.2 - eps_)
if (globalPos[1] > this->fvGridGeometry().bBoxMax()[1] - eps_)
{
values[FluidSystem::wCompIdx] = getParam<Scalar>("Problem.steamFlux");
values[FluidSystem::gCompIdx] = -0.000001;
......@@ -324,45 +325,45 @@ private:
if (y > yMax - eps_)
values[switch2Idx] = 0.112;
else if (y > yMax - 0.0148 + eps_)
else if (y > yMax - 0.0148 - eps_)
values[switch2Idx] = 0 + ((yMax - y)/0.0148)*0.112;
else if (y > yMax - 0.0296 + eps_)
else if (y > yMax - 0.0296 - eps_)
values[switch2Idx] = 0.112 + (((yMax - y) - 0.0148)/0.0148)*(0.120 - 0.112);
else if (y > yMax - 0.0444 + eps_)
else if (y > yMax - 0.0444 - eps_)
values[switch2Idx] = 0.120 + (((yMax - y) - 0.0296)/0.0148)*(0.125 - 0.120);
else if (y > yMax - 0.0592 + eps_)
else if (y > yMax - 0.0592 - eps_)
values[switch2Idx] = 0.125 + (((yMax - y) - 0.0444)/0.0148)*(0.137 - 0.125);
else if (y > yMax - 0.0740 + eps_)
else if (y > yMax - 0.0740 - eps_)
values[switch2Idx] = 0.137 + (((yMax - y) - 0.0592)/0.0148)*(0.150 - 0.137);
else if (y > yMax - 0.0888 + eps_)
else if (y > yMax - 0.0888 - eps_)
values[switch2Idx] = 0.150 + (((yMax - y) - 0.0740)/0.0148)*(0.165 - 0.150);
else if (y > yMax - 0.1036 + eps_)
else if (y > yMax - 0.1036 - eps_)
values[switch2Idx] = 0.165 + (((yMax - y) - 0.0888)/0.0148)*(0.182 - 0.165);
else if (y > yMax - 0.1184 + eps_)
else if (y > yMax - 0.1184 - eps_)
values[switch2Idx] = 0.182 + (((yMax - y) - 0.1036)/0.0148)*(0.202 - 0.182);
else if (y > yMax - 0.1332 + eps_)
else if (y > yMax - 0.1332 - eps_)
values[switch2Idx] = 0.202 + (((yMax - y) - 0.1184)/0.0148)*(0.226 - 0.202);
else if (y > yMax - 0.1480 + eps_)
else if (y > yMax - 0.1480 - eps_)
values[switch2Idx] = 0.226 + (((yMax - y) - 0.1332)/0.0148)*(0.257 - 0.226);
else if (y > yMax - 0.1628 + eps_)
else if (y > yMax - 0.1628 - eps_)
values[switch2Idx] = 0.257 + (((yMax - y) - 0.1480)/0.0148)*(0.297 - 0.257);
else if (y > yMax - 0.1776 + eps_)
else if (y > yMax - 0.1776 - eps_)
values[switch2Idx] = 0.297 + (((yMax - y) - 0.1628)/0.0148)*(0.352 - 0.297);
else if (y > yMax - 0.1924 + eps_)
else if (y > yMax - 0.1924 - eps_)
values[switch2Idx] = 0.352 + (((yMax - y) - 0.1776)/0.0148)*(0.426 - 0.352);
else if (y > yMax - 0.2072 + eps_)
else if (y > yMax - 0.2072 - eps_)
values[switch2Idx] = 0.426 + (((yMax - y) - 0.1924)/0.0148)*(0.522 - 0.426);
else if (y > yMax - 0.2220 + eps_)
else if (y > yMax - 0.2220 - eps_)
values[switch2Idx] = 0.522 + (((yMax - y) - 0.2072)/0.0148)*(0.640 - 0.522);
else if (y > yMax - 0.2368 + eps_)
else if (y > yMax - 0.2368 - eps_)
values[switch2Idx] = 0.640 + (((yMax - y) - 0.2220)/0.0148)*(0.767 - 0.640);
else if (y > yMax - 0.2516 + eps_)
else if (y > yMax - 0.2516 - eps_)
values[switch2Idx] = 0.767 + (((yMax - y) - 0.2368)/0.0148)*(0.878 - 0.767);
else if (y > yMax - 0.2664 + eps_)
else if (y > yMax - 0.2664 - eps_)
values[switch2Idx] = 0.878 + (((yMax - y) - 0.2516)/0.0148)*(0.953 - 0.878);
else if (y > yMax - 0.2812 + eps_)
else if (y > yMax - 0.2812 - eps_)
values[switch2Idx] = 0.953 + (((yMax - y) - 0.2664)/0.0148)*(0.988 - 0.953);
else if (y > yMax - 0.3000 + eps_)
else if (y > yMax - 0.3000 - eps_)
values[switch2Idx] = 0.988;
else
values[switch2Idx] = 1.e-4;
......
......@@ -204,8 +204,6 @@ private:
MaterialLawParams fineMaterialParams_;
MaterialLawParams coarseMaterialParams_;
Scalar lambdaSolid_;
static constexpr Scalar eps_ = 1.5e-7;
};
......
......@@ -5,8 +5,8 @@ dune_add_test(NAME fuelcell
COMMAND ${dumux_INCLUDE_DIRS}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/lecture/references/fuelcell-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/fuelcell-00017.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/fuelcell -TimeManager.TEnd 10")
${CMAKE_CURRENT_BINARY_DIR}/fuelcell-00010.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/fuelcell -TimeLoop.TEnd 1")
# headers for installation and headercheck
install(FILES
......
......@@ -25,6 +25,8 @@
#ifndef DUMUX_FUELCELL_LECTURE_SPATIAL_PARAMS_HH
#define DUMUX_FUELCELL_LECTURE_SPATIAL_PARAMS_HH
#include <dumux/common/properties.hh>
#include <dumux/material/spatialparams/fv.hh>
#include <dumux/material/fluidmatrixinteractions/2p/linearmaterial.hh>
#include <dumux/material/fluidmatrixinteractions/2p/regularizedbrookscorey.hh>
......
......@@ -30,6 +30,9 @@
#include <algorithm>
#include <cmath>
#include <cassert>
#include <vector>
#include <dumux/common/exceptions.hh>
namespace Dumux
{
......
......@@ -5,8 +5,8 @@ dune_add_test(NAME heatpipe
COMMAND ${dumux_INCLUDE_DIRS}/bin/testing/runtest.py
CMD_ARGS --script fuzzy
--files ${CMAKE_SOURCE_DIR}/lecture/references/heatpipe-reference.vtu
${CMAKE_CURRENT_BINARY_DIR}/heatpipe-00022.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/heatpipe ")
${CMAKE_CURRENT_BINARY_DIR}/heatpipe-00001.vtu
--command "${CMAKE_CURRENT_BINARY_DIR}/heatpipe -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/heatpipe.input -Grid.File ${CMAKE_CURRENT_SOURCE_DIR}/grids/heatpipe.dgf -TimeLoop.TEnd 1e5 -TimeLoop.EpisodeLength 1e5")
# headers for installation and headercheck
install(FILES
......
add_input_file_links()
dune_add_test(NAME sagd
SOURCES sagd.cc
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/sagd
......
add_input_file_links()
dune_add_test(NAME sagd_cyclic
SOURCES sagd_cyclic.cc
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/sagd_cyclic
......
add_input_file_links()
dune_add_test(NAME sagd_cyclic_hyst
SOURCES sagd_cyclic_hyst.cc
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/sagd_cyclic_hyst
......
......@@ -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
......
......@@ -24,8 +24,10 @@
#ifndef DUMUX_DISCRETIZATION_BOX_FICKS_LAW_DISPERSION_HH
#define DUMUX_DISCRETIZATION_BOX_FICKS_LAW_DISPERSION_HH
#include <dumux/common/parameters.hh>
#include <dumux/common/math.hh>
#include <dumux/common/properties.hh>
#include <dumux/discretization/method.hh>
namespace Dumux
......
......@@ -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;
......
......@@ -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-00002.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
......
......@@ -135,11 +135,6 @@ int main(int argc, char** argv) try
const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize");
auto dt = getParam<Scalar>("TimeLoop.DtInitial");
// check if we are about to restart a previously interrupted simulation
Scalar restartTime = 0;
if (Parameters::getTree().hasKey("Restart") || Parameters::getTree().hasKey("TimeLoop.Restart")) // Fehlt ebenso
restartTime = getParam<Scalar>("TimeLoop.Restart");
// intialize the vtk output module
using IOFields = GetPropType<TypeTag, Properties::IOFields>;
VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name());
......@@ -147,8 +142,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>;
......@@ -179,7 +175,8 @@ int main(int argc, char** argv) try
timeLoop->advanceTimeStep();
// write vtk output
vtkWriter.write(timeLoop->time());
if (timeLoop->isCheckPoint())
vtkWriter.write(timeLoop->time());
// report statistics of this time step
timeLoop->reportTimeStep();
......
......@@ -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.