From 8309a6e2d863c8961fab9af12e032f765fc3b21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20Gl=C3=A4ser?= <dennis.glaeser@iws.uni-stuttgart.de> Date: Tue, 14 Dec 2021 12:14:07 +0100 Subject: [PATCH] [examples] update markdown docu --- examples/1protationsymmetry/doc/problem.md | 16 +++-------- examples/1ptracer/doc/1p.md | 16 +++++------ examples/1ptracer/doc/tracer.md | 8 +++--- examples/2pinfiltration/doc/2p.md | 20 ++++---------- .../biomineralization/doc/fluidmaterial.md | 1 + examples/biomineralization/doc/setup.md | 27 +++++++++++-------- 6 files changed, 36 insertions(+), 52 deletions(-) diff --git a/examples/1protationsymmetry/doc/problem.md b/examples/1protationsymmetry/doc/problem.md index 8efafedb87..496d2ea766 100644 --- a/examples/1protationsymmetry/doc/problem.md +++ b/examples/1protationsymmetry/doc/problem.md @@ -224,14 +224,6 @@ properties and boundary conditions, from the input file. } ``` -We need to specify a constant temperature for our isothermal problem. -Fluid properties that depend on temperature will be calculated with this value. - -```cpp - Scalar temperature() const - { return 283.15; } -``` - #### Specify the types of boundary conditions This function is used to define the type of boundary conditions used depending on the location. Two types of boundary conditions can be specified: Dirichlet or Neumann boundary condition. @@ -306,14 +298,14 @@ by finite volume schemes, from which the spatial parameters defined for this example inherit. ```cpp -#include <dumux/material/spatialparams/fv1p.hh> +#include <dumux/porousmediumflow/fvspatialparams1p.hh> ``` ### The spatial parameters class In the `RotSymExampleSpatialParams` class, we define the functions needed to describe the porous medium, that is, porosity and permeability. -We inherit from the `FVSpatialParamsOneP` class here, which is the base class +We inherit from the `FVPorousMediumFlowSpatialParamsOneP` class here, which is the base class for spatial parameters in the context of single-phase porous medium flow applications using finite volume discretization schemes. @@ -322,10 +314,10 @@ namespace Dumux { template<class GridGeometry, class Scalar> class RotSymExampleSpatialParams -: public FVSpatialParamsOneP<GridGeometry, Scalar, RotSymExampleSpatialParams<GridGeometry, Scalar>> +: public FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, RotSymExampleSpatialParams<GridGeometry, Scalar>> { using ThisType = RotSymExampleSpatialParams<GridGeometry, Scalar>; - using ParentType = FVSpatialParamsOneP<GridGeometry, Scalar, ThisType>; + using ParentType = FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, ThisType>; using Element = typename GridGeometry::GridView::template Codim<0>::Entity; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; public: diff --git a/examples/1ptracer/doc/1p.md b/examples/1ptracer/doc/1p.md index b1e294cbb8..02704ced7b 100644 --- a/examples/1ptracer/doc/1p.md +++ b/examples/1ptracer/doc/1p.md @@ -282,18 +282,14 @@ set a pressure of 1.1 bar and 1 bar at the bottom and top boundaries, respective } ``` -#### Temperature distribution -We need to specify a constant temperature for our isothermal problem. -Fluid properties that depend on temperature will be calculated with this value. ```cpp - Scalar temperature() const - { return 283.15; /*10°C*/ } }; // end class definition of OnePTestProblem } // end namespace Dumux ``` +[[/codeblock]] </details> @@ -330,7 +326,7 @@ by finite volume schemes, from which the spatial parameters defined for this example will inherit. ```cpp -#include <dumux/material/spatialparams/fv1p.hh> +#include <dumux/porousmediumflow/fvspatialparams1p.hh> ``` @@ -338,7 +334,7 @@ example will inherit. In the `OnePTestSpatialParams` class, we define all functions needed to describe the porous medium, e.g. porosity and permeability, for the single-phase problem. -We inherit from the `FVSpatialParamsOneP` class here, which is the base class +We inherit from the `FVPorousMediumFlowSpatialParamsOneP` class here, which is the base class for spatial parameters in the context of single-phase porous medium flow applications using finite volume discretization schemes. @@ -347,7 +343,7 @@ namespace Dumux { template<class GridGeometry, class Scalar> class OnePTestSpatialParams -: public FVSpatialParamsOneP<GridGeometry, Scalar, +: public FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, OnePTestSpatialParams<GridGeometry, Scalar>> { // The following convenience aliases will be used throughout this class @@ -355,7 +351,7 @@ class OnePTestSpatialParams using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using Element = typename GridView::template Codim<0>::Entity; - using ParentType = FVSpatialParamsOneP<GridGeometry, Scalar, + using ParentType = FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, OnePTestSpatialParams<GridGeometry, Scalar>>; static constexpr int dimWorld = GridView::dimensionworld; @@ -430,7 +426,7 @@ We set the porosity $`[-]`$ for the whole domain to a value of $`20 \%`$. Note that in case you want to use solution-dependent porosities, you can use the overload `porosity(const Element&, const SubControlVolume&, const ElementSolution&)` -that is defined in the base class `FVSpatialParamsOneP`. Per default, this +that is defined in the base class `FVPorousMediumFlowSpatialParamsOneP`. Per default, this fowards to the `porosityAtPos` function per default, which we overload here. ```cpp diff --git a/examples/1ptracer/doc/tracer.md b/examples/1ptracer/doc/tracer.md index c548f5c126..48e4c60791 100644 --- a/examples/1ptracer/doc/tracer.md +++ b/examples/1ptracer/doc/tracer.md @@ -410,14 +410,14 @@ We include the spatial parameters class for single-phase models discretized by finite volume schemes, from which the spatial parameters defined for this example will inherit. ```cpp -#include <dumux/material/spatialparams/fv1p.hh> +#include <dumux/porousmediumflow/fvspatialparams1p.hh> ``` ### The spatial parameters class In the OnePTestSpatialParams class, we define all functions needed to define the spatially-dependent parameters for the tracer problem. -We inherit from the FVSpatialParamsOneP class here, which is the base class for +We inherit from the FVPorousMediumFlowSpatialParamsOneP class here, which is the base class for spatial parameters in the context of single-phase porous medium flow applications using finite volume discretization schemes. @@ -426,7 +426,7 @@ namespace Dumux { template<class GridGeometry, class Scalar> class TracerTestSpatialParams -: public FVSpatialParamsOneP<GridGeometry, Scalar, +: public FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, TracerTestSpatialParams<GridGeometry, Scalar>> { using GridView = typename GridGeometry::GridView; @@ -434,7 +434,7 @@ class TracerTestSpatialParams using SubControlVolume = typename FVElementGeometry::SubControlVolume; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using Element = typename GridView::template Codim<0>::Entity; - using ParentType = FVSpatialParamsOneP<GridGeometry, Scalar, + using ParentType = FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, TracerTestSpatialParams<GridGeometry, Scalar>>; static const int dimWorld = GridView::dimensionworld; diff --git a/examples/2pinfiltration/doc/2p.md b/examples/2pinfiltration/doc/2p.md index a3b73ab1de..f5f5869145 100644 --- a/examples/2pinfiltration/doc/2p.md +++ b/examples/2pinfiltration/doc/2p.md @@ -216,16 +216,6 @@ public: } ``` -For isothermal problems, Dumux requires problem classes to implement a `temperature()` -member function. Fluid properties that depend on temperature will be calculated with the specified temperature. - -```cpp - Scalar temperature() const - { - return 293.15; // 10°C - } -``` - #### Boundary types We define the type of boundary conditions depending on location. Two types of boundary conditions can be specified: Dirichlet or Neumann boundary condition. On a Dirichlet boundary, the values of the @@ -257,7 +247,7 @@ and the DNAPL saturation. // To determine the density of water for a given state, we build a fluid state with the given conditions: PrimaryVariables values; GetPropType<TypeTag, Properties::FluidState> fluidState; - fluidState.setTemperature(temperature()); + fluidState.setTemperature(this->spatialParams().temperatureAtPos({})); fluidState.setPressure(waterPhaseIdx, /*pressure=*/1e5); fluidState.setPressure(dnaplPhaseIdx, /*pressure=*/1e5); @@ -377,7 +367,7 @@ private: We include the basic spatial parameters for finite volumes file from which we will inherit ```cpp -#include <dumux/material/spatialparams/fv.hh> +#include <dumux/porousmediumflow/fvspatialparamsmp.hh> ``` We include all laws which are needed to define the interaction between the solid matrix and the fluids, e.g. laws for capillary pressure saturation relationships. @@ -387,14 +377,14 @@ We include all laws which are needed to define the interaction between the solid ``` ### The spatial parameters class -In the TwoPTestSpatialParams class we define all functions needed to describe the porous matrix, e.g. porosity and permeability. We inherit from the `FVSpatialParams` class, which is the base class for multiphase porous medium flow applications. +In the TwoPTestSpatialParams class we define all functions needed to describe the porous matrix, e.g. porosity and permeability. We inherit from the `FVPorousMediumFlowSpatialParamsMP` class, which is the base class for multiphase porous medium flow applications. ```cpp namespace Dumux { template<class GridGeometry, class Scalar> class TwoPTestSpatialParams -: public FVSpatialParams<GridGeometry, Scalar, TwoPTestSpatialParams<GridGeometry, Scalar>> +: public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, TwoPTestSpatialParams<GridGeometry, Scalar>> { //we introduce using declarations that are derived from the property system which we need in this class using GridView = typename GridGeometry::GridView; @@ -402,7 +392,7 @@ class TwoPTestSpatialParams using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolume = typename FVElementGeometry::SubControlVolume; using ThisType = TwoPTestSpatialParams<GridGeometry, Scalar>; - using ParentType = FVSpatialParams<GridGeometry, Scalar, ThisType>; + using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, ThisType>; static constexpr int dimWorld = GridView::dimensionworld; using GlobalPosition = typename Element::Geometry::GlobalCoordinate; diff --git a/examples/biomineralization/doc/fluidmaterial.md b/examples/biomineralization/doc/fluidmaterial.md index 808c31b9c5..a494709af8 100644 --- a/examples/biomineralization/doc/fluidmaterial.md +++ b/examples/biomineralization/doc/fluidmaterial.md @@ -62,6 +62,7 @@ The real work (creating the tables) is done by some external program by Span and ```cpp #include <assert.h> +#include <dumux/material/components/co2tablereader.hh> namespace Dumux::ICP { #include "co2valueslaboratory.inc" }// end namespace Dumux::ICP diff --git a/examples/biomineralization/doc/setup.md b/examples/biomineralization/doc/setup.md index 4763727756..76d61cd9f4 100644 --- a/examples/biomineralization/doc/setup.md +++ b/examples/biomineralization/doc/setup.md @@ -246,8 +246,7 @@ are declared which are used the time loop in main.cc { episodeIdx_ = epIdx; } ``` -Here, functions to return the injectionType, the name of the problem and the temperature -are defined +Here, functions to return the injectionType and the name of the problem are defined ```cpp int injectionType(int episodeIdx) const @@ -256,10 +255,6 @@ are defined // Get the problem name. It is used as a prefix for files generated by the simulation. const std::string& name() const { return name_; } - - // Return the temperature - Scalar temperature() const - { return temperature_; } ``` #### Boundary conditions @@ -658,7 +653,7 @@ over the computational grid We include the basic spatial parameters for finite volumes file from which we will inherit ```cpp -#include <dumux/material/spatialparams/fv.hh> +#include <dumux/porousmediumflow/fvspatialparamsmp.hh> ``` We include the files for the two-phase laws: the Brooks-Corey pc-Sw and relative permeability laws @@ -684,7 +679,7 @@ We include the laws for changing permeability based on porosity change according ### The spatial parameters class In the `ICPSpatialParams` class, we define all functions needed to describe the porous medium, e.g. porosity and permeability. -We inherit from the `FVSpatialParams` class which is the base class for spatial paramters using finite volume discretization schemes. +We inherit from the `FVPorousMediumFlowSpatialParamsMP` class which is the base class for spatial paramters using finite volume discretization schemes. ```cpp namespace Dumux { @@ -692,11 +687,11 @@ namespace Dumux { // In the ICPSpatialParams class we define all functions needed to describe the spatial distributed parameters. template<class GridGeometry, class Scalar> class ICPSpatialParams -: public FVSpatialParams<GridGeometry, Scalar, ICPSpatialParams<GridGeometry, Scalar>> +: public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, ICPSpatialParams<GridGeometry, Scalar>> { // We introduce using declarations that are derived from the property system which we need in this class using ThisType = ICPSpatialParams<GridGeometry, Scalar>; - using ParentType = FVSpatialParams<GridGeometry, Scalar, ThisType>; + using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, ThisType>; using GridView = typename GridGeometry::GridView; using SubControlVolume = typename GridGeometry::SubControlVolume; using Element = typename GridView::template Codim<0>::Entity; @@ -717,8 +712,9 @@ Due due calcium carbonate precipitation the porosity and the permeability change , pcKrSw_("SpatialParams") // initialize from input file { // We read reference values for porosity and permeability from the input - referencePorosity_ = getParam<Scalar>("SpatialParams.ReferencePorosity", 0.4); + referencePorosity_ = getParam<Scalar>("SpatialParams.ReferencePorosity", 0.4); referencePermeability_ = getParam<Scalar>("SpatialParams.ReferencePermeability", 2.e-10); + temperature_ = getParam<Scalar>("Problem.Temperature"); } // We return the reference or initial porosity. @@ -765,6 +761,13 @@ Define the wetting phase { return FluidSystem::H2OIdx; } ``` +Define the temperature field (constant here) + +```cpp + Scalar temperatureAtPos(const GlobalPosition& globalPos) const + { return temperature_; } +``` + The remainder of this class contains the data members and defines the porosity law which describes the change of porosity due to calcium carbonate precipitation. Additionally the change of porosity results in a change of permeability. This relation is described in the permeability law, in this case the Kozeny-Carman porosity-permeability relation @@ -780,6 +783,8 @@ private: Scalar referencePorosity_; //The reference permeability is the known (measured) permeability, of the porous medium in the initial condition, before the solid phases change during the simulation PermeabilityType referencePermeability_ = 0.0; + // the reference temperature field (for fluid properties) + Scalar temperature_; };// end class definition of ICPSpatialParams } //end namespace Dumux ``` -- GitLab