Commit 92b54e43 authored by Felix Weinhardt's avatar Felix Weinhardt
Browse files

[update exercise-biomineralization]

-updated to dumux 3.0
-added a build-directory for the solution
parent 2e3a23c6
......@@ -124,7 +124,7 @@ Run two simulations and compare them side by side by creating two input files, o
```bash
./exercisebiomin -Problem.Name biominNoUrea -Injection.ConcUrea 0
```
The result for the biomineralization process after the CO2 injection should look like this:
The result for the biomineralization process during the CO2 injection should look like this:
![](../extradoc/exercisebiomin_injectionFinal.png)
......@@ -133,13 +133,13 @@ The result for the biomineralization process after the CO2 injection should look
In the last step, the manual comparison of the results can be quite difficult. Paraview offers the option to use programmable python filters. To use them, make sure two result files with __different names__ are loaded. Mark both of them and click on `Filters --> Alphabetical --> Programmable Filter`. Now a new field opens on the left side. Copy the following lines there:
```python
Sn_0 = inputs[0].CellData['S_n'];
Sn_1 = inputs[1].CellData['S_n'];
output.CellData.append(abs(Sn_0-Sn_1),'diffSn');
S_gas_0 = inputs[0].CellData['S_gas'];
S_gas_1 = inputs[1].CellData['S_gas'];
output.CellData.append(abs(S_gas_0-S_gas_1),'diffS_gas');
```
Click `Apply` and select `diffSn` as new output. You should now see the difference between the two result files. You can also change the output to a not absolute value by changing the last line to:
Click `Apply` and select `diffS_gas` as new output. You should now see the difference between the two result files. You can also change the output to a not absolute value by changing the last line to:
```python
output.CellData.append((Sn_0-Sn_1),'diffSn');
output.CellData.append((S_gas_0-S_gas_1),'diffS_gas');
```
......@@ -51,42 +51,54 @@ class ExerciseFourBioMinProblem;
namespace Properties
{
//! Create new type tag for the problem
NEW_TYPE_TAG(ExerciseFourBioMinTypeTag, INHERITS_FROM(TwoPNCMin, BioMinSpatialparams));
NEW_TYPE_TAG(ExerciseFourBioMinCCTpfaTypeTag, INHERITS_FROM(CCTpfaModel, ExerciseFourBioMinTypeTag));
// Create new type tags
namespace TTag {
struct ExerciseFourBioMinTypeTag { using InheritsFrom = std::tuple<BioMinSpatialparams, TwoPNCMin>; };
struct ExerciseFourBioMinCCTpfaTypeTag { using InheritsFrom = std::tuple<ExerciseFourBioMinTypeTag, CCTpfaModel>; };
} // end namespace TTag
//! Set the problem property
SET_TYPE_PROP(ExerciseFourBioMinTypeTag, Problem, ExerciseFourBioMinProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::ExerciseFourBioMinTypeTag> { using type = ExerciseFourBioMinProblem<TypeTag>; };
//! Set grid and the grid creator to be used
#if HAVE_DUNE_ALUGRID
SET_TYPE_PROP(ExerciseFourBioMinTypeTag, Grid, Dune::ALUGrid</*dim=*/2, 2, Dune::cube, Dune::nonconforming>);
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFourBioMinTypeTag> { using type = Dune::ALUGrid</*dim=*/2, 2, Dune::cube, Dune::nonconforming>; };
#elif HAVE_UG
SET_TYPE_PROP(ExerciseFourBioMinTypeTag, Grid, Dune::UGGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFourBioMinTypeTag> { using type = Dune::UGGrid<2>; };
#else
SET_TYPE_PROP(ExerciseFourBioMinTypeTag, Grid, Dune::YaspGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFourBioMinTypeTag> { using type = Dune::YaspGrid<2>; };
#endif // HAVE_DUNE_ALUGRID
//! Set the fluid system type
SET_PROP(ExerciseFourBioMinTypeTag, FluidSystem)
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFourBioMinTypeTag>
{
private:
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using CO2Tables = Dumux::CO2Tables;
using H2OType = Components::TabulatedComponent<Components::H2O<Scalar>>;
public:
using type = FluidSystems::BioMin<Scalar, CO2Tables, H2OType>;
};
SET_PROP(ExerciseFourBioMinTypeTag, SolidSystem)
template<class TypeTag>
struct SolidSystem<TypeTag, TTag::ExerciseFourBioMinTypeTag>
{
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = SolidSystems::BiominSolidPhase<Scalar>;
};
SET_BOOL_PROP(ExerciseFourBioMinTypeTag, EnableFVGridGeometryCache, false);
SET_BOOL_PROP(ExerciseFourBioMinTypeTag, EnableGridVolumeVariablesCache, false);
SET_BOOL_PROP(ExerciseFourBioMinTypeTag, EnableGridFluxVariablesCache, false);
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::ExerciseFourBioMinTypeTag> { static constexpr bool value = false; };
template<class TypeTag>
struct EnableGridVolumeVariablesCache<TypeTag, TTag::ExerciseFourBioMinTypeTag> { static constexpr bool value = false; };
template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::ExerciseFourBioMinTypeTag> { static constexpr bool value = false; };
} // end namespace properties
/*!
......@@ -98,16 +110,16 @@ class ExerciseFourBioMinProblem : public PorousMediumFlowProblem<TypeTag>
{
using ParentType = PorousMediumFlowProblem<TypeTag>;
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem);
using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
using GridView = GetPropType<TypeTag, Properties::GridView>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>;
using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices;
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>;
using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>;
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView;
// Grid dimension
enum
......@@ -117,10 +129,10 @@ class ExerciseFourBioMinProblem : public PorousMediumFlowProblem<TypeTag>
};
using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimension>;
using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>;
using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
using Element = typename GridView::template Codim<0>::Entity;
using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
// TODO: dumux-course-task
// set the chemistry TypeTag
......@@ -173,7 +185,7 @@ public:
concCa_ = getParam<Scalar>("Injection.ConcCa");
concUrea_ = getParam<Scalar>("Injection.ConcUrea");
unsigned int codim = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box ? dim : 0;
unsigned int codim = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box ? dim : 0;
Kxx_.resize(fvGridGeometry->gridView().size(codim));
Kyy_.resize(fvGridGeometry->gridView().size(codim));
......
......@@ -31,7 +31,7 @@
#include <dumux/material/fluidmatrixinteractions/porosityprecipitation.hh>
#include <dumux/material/fluidmatrixinteractions/permeabilitykozenycarman.hh>
#include <dumux/discretization/methods.hh>
#include <dumux/discretization/method.hh>
namespace Dumux
{
......@@ -45,7 +45,8 @@ namespace Properties
NEW_TYPE_TAG(BioMinSpatialparams);
// Set the spatial parameters
SET_TYPE_PROP(BioMinSpatialparams, SpatialParams, BioMinSpatialparams<TypeTag>);
template<class TypeTag>
struct SpatialParams<TypeTag, TTag::BioMinSpatialparams> { using type = BioMinSpatialparams<TypeTag>; };
} // end namespace Properties
/*!
......@@ -54,17 +55,17 @@ SET_TYPE_PROP(BioMinSpatialparams, SpatialParams, BioMinSpatialparams<TypeTag>);
*/
template<class TypeTag>
class BioMinSpatialparams
: public FVSpatialParams<typename GET_PROP_TYPE(TypeTag, FVGridGeometry),
typename GET_PROP_TYPE(TypeTag, Scalar),
: public FVSpatialParams<GetPropType<TypeTag, Properties::FVGridGeometry>,
GetPropType<TypeTag, Properties::Scalar>,
BioMinSpatialparams<TypeTag>>
{
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
using FVElementGeometry = typename FVGridGeometry::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using ParentType = FVSpatialParams<FVGridGeometry, Scalar, BioMinSpatialparams<TypeTag>>;
using EffectiveLaw = RegularizedBrooksCorey<Scalar>;
using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
using GridView = typename FVGridGeometry::GridView;
using CoordScalar = typename GridView::ctype;
......@@ -75,7 +76,7 @@ class BioMinSpatialparams
using Tensor = Dune::FieldMatrix<CoordScalar, dimWorld, dimWorld>;
public:
using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem);
using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>;
using PermeabilityType = Tensor;
using MaterialLaw = EffToAbsLaw<EffectiveLaw>;
using MaterialLawParams = typename MaterialLaw::Params;
......@@ -331,8 +332,8 @@ private:
bool isFaultZone_(const GlobalPosition &globalPos) const
{ return globalPos[dimWorld-2] > 2 - eps_ && globalPos[dimWorld-2] < 3 + eps_;}
using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits);
PorosityPrecipitation<Scalar, ModelTraits::numComponents(), ModelTraits::numSolidComps()> poroLaw_;
using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>;
PorosityPrecipitation<Scalar, ModelTraits::numFluidComponents(), ModelTraits::numSolidComps()> poroLaw_;
PermeabilityKozenyCarman<PermeabilityType> permLaw_;
......
......@@ -33,12 +33,12 @@ namespace Dumux {
template <class TypeTag>
class SimpleBiominReactions
{
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem);
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>;
using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>;
using ThisType = SimpleBiominReactions<TypeTag>;
using Sources = typename GET_PROP_TYPE(TypeTag, NumEqVector);
using Sources = GetPropType<TypeTag, Properties::NumEqVector>;
public:
......@@ -100,7 +100,6 @@ public:
if (molalityUrea < 0)
molalityUrea = 0;
// compute rate of ureolysis:
// TODO: dumux-course-task
// compute rate of ureolysis by implementing Z_urease,biofilm and r_urea
......@@ -121,7 +120,7 @@ public:
q[BiofilmIdx] += 0;
q[CalciteIdx] += 0;
}
private:
// urease parameters
Scalar kub_;
......
......@@ -39,12 +39,12 @@
#include <dumux/common/defaultusagemessage.hh>
#include <dumux/linear/amgbackend.hh>
#include <dumux/nonlinear/privarswitchnewtonsolver.hh>
#include <dumux/nonlinear/newtonsolver.hh>
#include <dumux/assembly/fvassembler.hh>
#include <dumux/assembly/diffmethod.hh>
#include <dumux/discretization/methods.hh>
#include <dumux/discretization/method.hh>
#include <dumux/io/vtkoutputmodule.hh>
#include <dumux/io/grid/gridmanager.hh>
......@@ -59,7 +59,7 @@ int main(int argc, char** argv) try
using namespace Dumux;
// define the type tag for this problem
using TypeTag = TTAG(ExerciseFourBioMinCCTpfaTypeTag);
using TypeTag = Properties::TTag::ExerciseFourBioMinCCTpfaTypeTag;
// initialize MPI, finalize is done automatically on exit
const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv);
......@@ -72,7 +72,7 @@ int main(int argc, char** argv) try
Parameters::init(argc, argv);
// try to create a grid (from the given grid file or the input file)
GridManager<typename GET_PROP_TYPE(TypeTag, Grid)> gridManager;
GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager;
gridManager.init();
////////////////////////////////////////////////////////////
......@@ -83,16 +83,16 @@ int main(int argc, char** argv) try
const auto& leafGridView = gridManager.grid().leafGridView();
// create the finite volume grid geometry
using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
auto fvGridGeometry = std::make_shared<FVGridGeometry>(leafGridView);
fvGridGeometry->update();
// the problem (initial and boundary conditions)
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using Problem = GetPropType<TypeTag, Properties::Problem>;
auto problem = std::make_shared<Problem>(fvGridGeometry);
// the solution vector
using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
SolutionVector x(fvGridGeometry->numDofs());
problem->applyInitialSolution(x);
auto xOld = x;
......@@ -102,19 +102,19 @@ int main(int argc, char** argv) try
problem->spatialParams().computeReferencePermeability(*fvGridGeometry, x);
// the grid variables
using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
auto gridVariables = std::make_shared<GridVariables>(problem, fvGridGeometry);
gridVariables->init(x, xOld);
// get some time loop parameters
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
const auto tEnd = getParam<Scalar>("TimeLoop.TEnd");
const auto maxDt = getParam<Scalar>("TimeLoop.MaxTimeStepSize");
auto dt = getParam<Scalar>("TimeLoop.DtInitial");
// initialize the vtk output module
using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields);
VtkOutputModule<TypeTag> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name());
using VtkOutputFields = GetPropType<TypeTag, Properties::VtkOutputFields>;
VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables, x, problem->name());
VtkOutputFields::init(vtkWriter); //!< Add model specific output fields
//add specific output
vtkWriter.addField(problem->getKxx(), "Kxx");
......@@ -137,8 +137,7 @@ int main(int argc, char** argv) try
auto linearSolver = std::make_shared<LinearSolver>(leafGridView, fvGridGeometry->dofMapper());
// the non-linear solver
using NewtonSolver = PriVarSwitchNewtonSolver<Assembler, LinearSolver,
typename GET_PROP_TYPE(TypeTag, PrimaryVariableSwitch)>;
using NewtonSolver = NewtonSolver<Assembler, LinearSolver>;
NewtonSolver nonLinearSolver(assembler, linearSolver);
// time loop
......
......@@ -37,3 +37,6 @@ RhoBiofilm = 6.9 # [kg/m³] density of biofilm
Kub = 8.81e-3 # [kg_urease/kg_bio] (max: 0.01)
Kurease = 1000 # [mol_urea/(kg_urease s)]
Ku = 0.355 # [mol/kgH2O] Lauchnor et al. 2014
[Brine]
Salinity = 0.1
......@@ -61,13 +61,13 @@ namespace FluidSystems {
*/
template <class Scalar,
class CO2Table,
class H2OType = Components::TabulatedComponent<Components::H2O<Scalar>> >
class H2OType = Dumux::Components::TabulatedComponent<Dumux::Components::H2O<Scalar>> >
class BioMin
: public BaseFluidSystem<Scalar, BioMin<Scalar, CO2Table, H2OType> >
: public Base<Scalar, BioMin<Scalar, CO2Table, H2OType> >
{
using ThisType = BioMin<Scalar, H2OType>;
using Base = BaseFluidSystem <Scalar, ThisType>;
using Base = Dumux::FluidSystems::Base<Scalar, ThisType>;
using Brine_CO2 = BinaryCoeff::Brine_CO2<Scalar, CO2Table>;
using IdealGas = Dumux::IdealGas<Scalar>;
......@@ -333,8 +333,8 @@ public:
if (phaseIdx == liquidPhaseIdx)
{
// assume brine with viscosity effect of Ca for the liquid phase.
Scalar salinity = fluidState.massFraction(liquidPhaseIdx, CaIdx);
Scalar result = Brine::liquidViscosity(temperature, pressure, salinity);
//F Scalar salinity = fluidState.massFraction(liquidPhaseIdx, CaIdx);
Scalar result = Brine::liquidViscosity(temperature, pressure);
Valgrind::CheckDefined(result);
return result;
......@@ -388,7 +388,7 @@ public:
Scalar temperature = fluidState.temperature(phaseIdx);
Scalar pressure = fluidState.pressure(phaseIdx);
Scalar salinity = 0.1; //TODO major assumption in favor of runtime!
Scalar salinity = Brine::salinity(); // 0.1; //TODO major assumption in favor of runtime!
//function is actually designed for use with NaCl not Ca.
//Theoretically it should be: fluidState.massFraction(liquidPhaseIdx, CaIdx);
......@@ -546,7 +546,7 @@ private:
"defined below 250MPa (is" << pl << ")");
}
Scalar rho_brine = Brine::liquidDensity(T, pl, XlSal);
Scalar rho_brine = Brine::liquidDensity(T, pl);
Scalar rho_pure = H2O::liquidDensity(T, pl);
Scalar rho_lCO2 = liquidDensityWaterCO2_(T, pl, xwH2O, xwCO2);
Scalar contribCO2 = rho_lCO2 - rho_pure;
......
......@@ -6,3 +6,4 @@ add_subdirectory(exercise-grids)
add_subdirectory(exercise-mainfile)
add_subdirectory(exercise-properties)
add_subdirectory(exercise-runtimeparams)
add_subdirectory(exercise-biomineralization)
# executables for exercisebiomin
dune_add_test(NAME exercisebiomin_solution
SOURCES exercisebiomin.cc
CMD_ARGS exercisebiomin.input)
# add tutorial to the common target
add_dependencies(test_exercises exercisebiomin_solution)
# add symlinks for the input files
add_input_file_links(FILES "exercisebiomin.input")
......@@ -32,7 +32,9 @@
#include <dumux/material/components/co2tablereader.hh>
#include "fluidsystems/biomin.hh" // The biomineralization fluid system
#include "chemistry/simplebiominreactions.hh" // chemical reactions
// TODO: dumux-course-task
// include chemistry file here
#include "chemistry/simplebiominreactions.hh" // chemical reactions
#include "biominspatialparams.hh" // Spatially dependent parameters
namespace Dumux {
......@@ -50,42 +52,54 @@ class ExerciseFourBioMinProblem;
namespace Properties
{
//! Create new type tag for the problem
NEW_TYPE_TAG(ExerciseFourBioMinTypeTag, INHERITS_FROM(TwoPNCMin, BioMinSpatialparams));
NEW_TYPE_TAG(ExerciseFourBioMinCCTpfaTypeTag, INHERITS_FROM(CCTpfaModel, ExerciseFourBioMinTypeTag));
// Create new type tags
namespace TTag {
struct ExerciseFourBioMinTypeTag { using InheritsFrom = std::tuple<BioMinSpatialparams, TwoPNCMin>; };
struct ExerciseFourBioMinCCTpfaTypeTag { using InheritsFrom = std::tuple<ExerciseFourBioMinTypeTag, CCTpfaModel>; };
} // end namespace TTag
//! Set the problem property
SET_TYPE_PROP(ExerciseFourBioMinTypeTag, Problem, ExerciseFourBioMinProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::ExerciseFourBioMinTypeTag> { using type = ExerciseFourBioMinProblem<TypeTag>; };
//! Set grid and the grid creator to be used
#if HAVE_DUNE_ALUGRID
SET_TYPE_PROP(ExerciseFourBioMinTypeTag, Grid, Dune::ALUGrid</*dim=*/2, 2, Dune::cube, Dune::nonconforming>);
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFourBioMinTypeTag> { using type = Dune::ALUGrid</*dim=*/2, 2, Dune::cube, Dune::nonconforming>; };
#elif HAVE_UG
SET_TYPE_PROP(ExerciseFourBioMinTypeTag, Grid, Dune::UGGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFourBioMinTypeTag> { using type = Dune::UGGrid<2>; };
#else
SET_TYPE_PROP(ExerciseFourBioMinTypeTag, Grid, Dune::YaspGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::ExerciseFourBioMinTypeTag> { using type = Dune::YaspGrid<2>; };
#endif // HAVE_DUNE_ALUGRID
//! Set the fluid system type
SET_PROP(ExerciseFourBioMinTypeTag, FluidSystem)
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::ExerciseFourBioMinTypeTag>
{
private:
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using CO2Tables = Dumux::CO2Tables;
using H2OType = Components::TabulatedComponent<Components::H2O<Scalar>>;
public:
using type = FluidSystems::BioMin<Scalar, CO2Tables, H2OType>;
};
SET_PROP(ExerciseFourBioMinTypeTag, SolidSystem)
template<class TypeTag>
struct SolidSystem<TypeTag, TTag::ExerciseFourBioMinTypeTag>
{
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = SolidSystems::BiominSolidPhase<Scalar>;
};
SET_BOOL_PROP(ExerciseFourBioMinTypeTag, EnableFVGridGeometryCache, false);
SET_BOOL_PROP(ExerciseFourBioMinTypeTag, EnableGridVolumeVariablesCache, false);
SET_BOOL_PROP(ExerciseFourBioMinTypeTag, EnableGridFluxVariablesCache, false);
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::ExerciseFourBioMinTypeTag> { static constexpr bool value = false; };
template<class TypeTag>
struct EnableGridVolumeVariablesCache<TypeTag, TTag::ExerciseFourBioMinTypeTag> { static constexpr bool value = false; };
template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::ExerciseFourBioMinTypeTag> { static constexpr bool value = false; };
} // end namespace properties
/*!
......@@ -97,16 +111,16 @@ class ExerciseFourBioMinProblem : public PorousMediumFlowProblem<TypeTag>
{
using ParentType = PorousMediumFlowProblem<TypeTag>;
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using FluidSystem = typename GET_PROP_TYPE(TypeTag, FluidSystem);
using SolidSystem = typename GET_PROP_TYPE(TypeTag, SolidSystem);
using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes);
using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
using GridView = GetPropType<TypeTag, Properties::GridView>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
using SolidSystem = GetPropType<TypeTag, Properties::SolidSystem>;
using Indices = typename GetPropType<TypeTag, Properties::ModelTraits>::Indices;
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
using BoundaryTypes = GetPropType<TypeTag, Properties::BoundaryTypes>;
using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>;
using FVGridGeometry = GetPropType<TypeTag, Properties::FVGridGeometry>;
using FVElementGeometry = typename GetPropType<TypeTag, Properties::FVGridGeometry>::LocalView;
// Grid dimension
enum
......@@ -116,11 +130,13 @@ class ExerciseFourBioMinProblem : public PorousMediumFlowProblem<TypeTag>
};
using GlobalPosition = Dune::FieldVector<Scalar, GridView::dimension>;
using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables)::LocalView;
using NumEqVector = GetPropType<TypeTag, Properties::NumEqVector>;
using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
using Element = typename GridView::template Codim<0>::Entity;
using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
// TODO: dumux-course-task
// set the chemistry TypeTag
using Chemistry = typename Dumux::SimpleBiominReactions<TypeTag>;
enum
......@@ -171,7 +187,7 @@ public:
concCa_ = getParam<Scalar>("Injection.ConcCa");
concUrea_ = getParam<Scalar>("Injection.ConcUrea");
unsigned int codim = GET_PROP_TYPE(TypeTag, FVGridGeometry)::discMethod == DiscretizationMethod::box ? dim : 0;
unsigned int codim = GetPropType<TypeTag, Properties::FVGridGeometry>::discMethod == DiscretizationMethod::box ? dim : 0;
Kxx_.resize(fvGridGeometry->gridView().size(codim));
Kyy_.resize(fvGridGeometry->gridView().size(codim));
......@@ -279,6 +295,7 @@ public:
values[conti0EqIdx + CaIdx] = - waterFlux * concCa_ / FluidSystem::molarMass(CaIdx);
values[conti0EqIdx + UreaIdx] = - waterFlux * concUrea_ / FluidSystem::molarMass(UreaIdx);
}
// TODO: dumux-course-task
// Set CO2 injection below aquitard after the injBioTime
else if(globalPos[0] < eps_
&& globalPos[1] > 2.0 + eps_
......@@ -351,6 +368,10 @@ public:
{
NumEqVector source(0.0);
// TODO: dumux-course-task
// set Chemistry
// set VolumeVariables
// call reactionSource() in chemistry
Chemistry chemistry;
const auto& volVars = elemVolVars[scv];