26#ifndef DUMUX_THERMOCHEM_PROBLEM_HH
27#define DUMUX_THERMOCHEM_PROBLEM_HH
29#include <dune/grid/yaspgrid.hh>
49template <
class TypeTag>
50class ThermoChemProblem;
60template<
class TypeTag>
61struct Grid<TypeTag, TTag::ThermoChem> {
using type = Dune::YaspGrid<2>; };
63template<
class TypeTag>
67template<
class TypeTag>
72 static constexpr auto phaseIdx = H2ON2::gasPhaseIdx;
76template<
class TypeTag>
90template<
class TypeTag>
99template<
class TypeTag>
100struct UseMoles<TypeTag, TTag::ThermoChem> {
static constexpr bool value =
true; };
116template <
class TypeTag>
126 using ElementVolumeVariables =
typename GridVariables::GridVolumeVariables::LocalView;
127 using ElementFluxVariablesCache =
typename GridVariables::GridFluxVariablesCache::LocalView;
128 using VolumeVariables =
typename GridVariables::GridVolumeVariables::VolumeVariables;
133 using Element =
typename GridView::template Codim<0>::Entity;
135 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
136 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
142 enum { dim = GridView::dimension };
143 enum { dimWorld = GridView::dimensionworld };
148 pressureIdx = Indices::pressureIdx,
149 H2OIdx = FluidSystem::compIdx(FluidSystem::MultiPhaseFluidSystem::H2OIdx),
151 CaOIdx = FluidSystem::numComponents,
152 CaO2H2Idx = FluidSystem::numComponents+1,
155 conti0EqIdx = Indices::conti0EqIdx,
158 cPhaseIdx = SolidSystem::comp0Idx,
160 temperatureIdx = Indices::temperatureIdx,
161 energyEqIdx = Indices::energyEqIdx
164 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
170 name_ = getParam<std::string>(
"Problem.Name");
171 FluidSystem::init(473.15,
179 boundaryPressure_ = getParam<Scalar>(
"Problem.BoundaryPressure");
180 boundaryVaporMoleFrac_ = getParam<Scalar>(
"Problem.BoundaryMoleFraction");
181 boundaryTemperature_ = getParam<Scalar>(
"Problem.BoundaryTemperature");
184 permeability_.resize(
gridGeometry->gridView().size(codim));
186 reactionRate_.resize(
gridGeometry->gridView().size(codim));
204 timeStepSize_ = timeStepSize;
217 BoundaryTypes values;
220 values.setDirichlet(pressureIdx);
221 values.setDirichlet(H2OIdx);
222 values.setDirichlet(temperatureIdx);
234 PrimaryVariables priVars(0.0);
236 priVars[pressureIdx] = boundaryPressure_;
237 priVars[H2OIdx] = boundaryVaporMoleFrac_;
238 priVars[temperatureIdx] = boundaryTemperature_;
239 priVars[CaO2H2Idx] = 0.0;
240 priVars[CaOIdx] = 0.2;
260 const FVElementGeometry& fvGeometry,
261 const ElementVolumeVariables& elemVolVars,
262 const ElementFluxVariablesCache& elemFluxVarsCache,
263 const SubControlVolumeFace& scvf)
const
265 NumEqVector flux(0.0);
277 PrimaryVariables priVars(0.0);
285 pInit = getParam<Scalar>(
"Problem.PressureInitial");
286 tInit = getParam<Scalar>(
"Problem.TemperatureInitial");
287 h2oInit = getParam<Scalar>(
"Problem.VaporInitial");
288 CaOInit = getParam<Scalar>(
"Problem.CaOInitial");
289 CaO2H2Init = getParam<Scalar>(
"Problem.CaO2H2Initial");
291 priVars[pressureIdx] = pInit;
292 priVars[H2OIdx] = h2oInit;
293 priVars[temperatureIdx] = tInit;
298 priVars[CaOIdx] = CaOInit;
299 priVars[CaO2H2Idx] = CaO2H2Init;
322 NumEqVector
source(
const Element &element,
323 const FVElementGeometry& fvGeometry,
324 const ElementVolumeVariables& elemVolVars,
325 const SubControlVolume &scv)
const
329 const auto& volVars = elemVolVars[scv];
332 const auto elemSol =
elementSolution(element, elemVolVars, fvGeometry);
333 Scalar qMole = qMass/FluidSystem::molarMass(H2OIdx)*(1-volVars.porosity());
337 if (-qMole*timeStepSize_ + volVars.solidVolumeFraction(cPhaseIdx)* volVars.solidComponentMolarDensity(cPhaseIdx) < 0 + eps_)
339 qMole = -volVars.solidVolumeFraction(cPhaseIdx)* volVars.solidComponentMolarDensity(cPhaseIdx)/timeStepSize_;
341 source[conti0EqIdx+CaO2H2Idx] = qMole;
342 source[conti0EqIdx+CaOIdx] = - qMole;
343 source[conti0EqIdx+H2OIdx] = - qMole;
345 Scalar deltaH = 108e3;
346 source[energyEqIdx] = qMole * deltaH;
357 return permeability_;
373 return reactionRate_;
383 for (
const auto& element : elements(this->
gridGeometry().gridView()))
388 fvGeometry.bindElement(element);
390 for (
auto&& scv : scvs(fvGeometry))
392 VolumeVariables volVars;
393 volVars.update(elemSol, *
this, element, scv);
394 const auto dofIdxGlobal = scv.dofIndex();
395 permeability_[dofIdxGlobal] = this->
spatialParams().permeability(element, scv, elemSol);
396 porosity_[dofIdxGlobal] = volVars.porosity();
405 static constexpr Scalar eps_ = 1e-6;
408 Scalar boundaryPressure_;
409 Scalar boundaryVaporMoleFrac_;
410 Scalar boundaryTemperature_;
412 std::vector<double> permeability_;
413 std::vector<double> porosity_;
414 std::vector<double> reactionRate_;
417 Scalar timeStepSize_;
Element solution classes and factory functions.
Defines a type tag and some properties for models using the box scheme.
Properties for all models using cell-centered finite volume scheme with mpfa.
Properties for all models using cell-centered finite volume scheme with TPFA.
Material properties of pure Calciumhydroxide .
Reation for a simple effective thermal conductivity.
An adapter for multi-phase fluid systems to be used with (compositional) one-phase models.
A solid phase consisting of multiple inert solid components.
Corrected material properties of pure Calcium-Oxide without considering a porosity change in the rea...
Class for the evaluation of the reaction rate of Calciumoxide to Halciumhydroxide.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:38
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethod::box, BoxElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for box schemes.
Definition: box/elementsolution.hh:115
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
Base class for all finite-volume problems.
Definition: common/fvproblem.hh:50
const GridGeometry & gridGeometry() const
The finite volume grid geometry.
Definition: common/fvproblem.hh:588
The DUNE grid type.
Definition: common/properties.hh:57
Property to specify the type of a problem which has to be solved.
Definition: common/properties.hh:69
Property whether to use moles or kg as amount unit for balance equations.
Definition: common/properties.hh:102
The type of the spatial parameters object.
Definition: common/properties.hh:221
The type of the fluid system to use.
Definition: common/properties.hh:223
The type of the solid system to use.
Definition: common/properties.hh:227
A class for the CaO2H2 properties.
Definition: cao2h2.hh:46
An adapter for multi-phase fluid systems to be used with (compositional) one-phase models.
Definition: 1padapter.hh:46
A two-phase fluid system with two components water Nitrogen for non-equilibrium models.
Definition: h2on2.hh:69
A solid phase consisting of multiple inert solid components.
Definition: compositionalsolidphase.hh:42
Base class for all fully implicit porous media problems.
Definition: dumux/porousmediumflow/problem.hh:39
SpatialParams & spatialParams()
Returns the spatial parameters object.
Definition: dumux/porousmediumflow/problem.hh:146
A class for the ModifiedCaO properties.
Definition: modifiedcao.hh:44
Test for the 1pncmin model in combination with the NI model for a quasi batch reaction of Calciumoxyd...
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:118
void updateVtkOutput(const SolutionVector &curSol)
Adds additional VTK output data to the VTKWriter.
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:381
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:215
NumEqVector source(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Evaluates the source term for all phases within a given sub-control volume in units of .
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:322
ThermoChemProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:167
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial values for a control volume in .
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:275
NumEqVector neumann(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Neumann boundary segment in dependency on the current solutio...
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:259
const std::vector< Scalar > & getPerm()
Returns the permeability.
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:355
const std::vector< Scalar > & getRRate()
Returns the reaction rate.
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:371
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:232
const std::string name() const
The problem name.
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:194
void setTimeStepSize(Scalar timeStepSize)
Sets the currently used time step size.
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:202
const std::vector< Scalar > & getPoro()
Returns the porosity.
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:363
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:55
std::tuple< OnePNCMinNI > InheritsFrom
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:55
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:56
std::tuple< ThermoChem, BoxModel > InheritsFrom
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:56
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:61
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:70
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:79
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:93
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1pncmin/implicit/nonisothermal/problem.hh:94
Class for the evaluation of the reaction rate of Calciumoxide to Halciumhydroxide.
Definition: reaction.hh:38
VolumeVariables::PrimaryVariables::value_type thermoChemReaction(const VolumeVariables &volVars) const
Evaluates the reaction kinetics (see Nagel et al. 2014 ).
Definition: reaction.hh:46
Definition of the spatial parameters for the thermochemistry problem which uses the non-insothermal 1...
Definition: porousmediumflow/1pncmin/implicit/nonisothermal/spatialparams.hh:42
A single-phase, multi-component model considering mineralization processes.
Base class for all porous media problems.
Definition of the spatial parameters for the MaxwellStefan problem.