26#ifndef DUMUX_RICHARDS_CONDUCTION_PROBLEM_HH
27#define DUMUX_RICHARDS_CONDUCTION_PROBLEM_HH
30#include <dune/grid/yaspgrid.hh>
40#include "../spatialparams.hh"
49template <
class TypeTag>
50class RichardsNIConductionProblem;
61template<
class TypeTag>
62struct Grid<TypeTag, TTag::RichardsNIConduction> {
using type = Dune::YaspGrid<2>; };
65template<
class TypeTag>
69template<
class TypeTag>
73template<
class TypeTag>
104template <
class TypeTag>
122 enum { dimWorld = GridView::dimensionworld };
125 pressureIdx = Indices::pressureIdx,
126 liquidPhaseOnly = Indices::liquidPhaseOnly,
127 liquidPhaseIdx = FluidSystem::liquidPhaseIdx,
128 temperatureIdx = Indices::temperatureIdx
131 using Element =
typename GridView::template Codim<0>::Entity;
133 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
142 name_ = getParam<std::string>(
"Problem.Name");
143 temperatureHigh_ = 300.;
150 return temperatureExact_;
156 const auto someElement = *(elements(this->
gridGeometry().gridView()).begin());
159 const auto someInitSol =
initialAtPos(someElement.geometry().center());
162 someFvGeometry.bindElement(someElement);
163 const auto someScv = *(scvs(someFvGeometry).begin());
165 VolumeVariables volVars;
166 volVars.update(someElemSol, *
this, someElement, someScv);
169 const auto densityW = volVars.density(liquidPhaseIdx);
171 const auto densityS =volVars.solidDensity();
172 const auto heatCapacityS = volVars.solidHeatCapacity();
173 const auto storage = densityW*heatCapacityW*
porosity + densityS*heatCapacityS*(1 -
porosity);
174 const auto effectiveThermalConductivity = ThermalConductivityModel::effectiveThermalConductivity(volVars);
176 time = max(time, 1e-10);
177 for (
const auto& element : elements(this->
gridGeometry().gridView()))
180 fvGeometry.bindElement(element);
182 for (
auto&& scv : scvs(fvGeometry))
184 auto globalIdx = scv.dofIndex();
185 const auto& globalPos = scv.dofPosition();
188 temperatureExact_[globalIdx] = temperatureHigh_ + (someInitSol[temperatureIdx] - temperatureHigh_)
189 *erf(0.5*sqrt(globalPos[0]*globalPos[0]*storage/time/effectiveThermalConductivity));
204 const std::string&
name()
const
223 BoundaryTypes values;
224 if(globalPos[0] < eps_ || globalPos[0] > this->
gridGeometry().bBoxMax()[0] - eps_)
226 values.setAllDirichlet();
230 values.setAllNeumann();
244 PrimaryVariables values(0.0);
245 values = initial_(globalPos);
247 if (globalPos[0] < eps_)
249 values[temperatureIdx] = temperatureHigh_;
265 NumEqVector values(0.0);
295 return initial_(globalPos);
301 PrimaryVariables initial_(
const GlobalPosition &globalPos)
const
303 PrimaryVariables priVars(0.0);
304 priVars.setState(liquidPhaseOnly);
305 priVars[pressureIdx] = 1e5;
307 priVars[temperatureIdx] = 290.;
311 Scalar temperatureHigh_;
312 static constexpr Scalar eps_ = 1e-6;
315 std::vector<Scalar> temperatureExact_;
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 TPFA.
Relation for the saturation-dependent effective thermal conductivity.
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
std::string porosity() noexcept
I/O name of porosity.
Definition: name.hh:139
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
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
Material properties of pure water .
Definition: h2o.hh:61
static const Scalar liquidHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of liquid water .
Definition: h2o.hh:281
Policy for the H2O-N2 fluid system.
Definition: h2on2.hh:52
A two-phase fluid system with two components water Nitrogen for non-equilibrium models.
Definition: h2on2.hh:69
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
Test for the RichardsModel in combination with the NI model for a conduction problem: The simulation ...
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:106
const std::vector< Scalar > & getExactTemperature()
Get the analytical temperature.
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:148
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:242
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:293
BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
Specifies which kind of boundary condition should be used for which equation on a given boundary segm...
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:221
void updateExactTemperature(const SolutionVector &curSol, Scalar time)
Udpate the analytical temperature.
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:154
Scalar nonWettingReferencePressure() const
Returns the reference pressure [Pa] of the non-wetting fluid phase within a finite volume.
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:282
RichardsNIConductionProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:136
NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:263
const std::string & name() const
The problem name.
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:204
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:55
std::tuple< RichardsNI > InheritsFrom
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:55
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:56
std::tuple< RichardsNIConduction, BoxModel > InheritsFrom
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:56
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:57
std::tuple< RichardsNIConduction, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:57
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:62
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:76
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/richards/implicit/nonisothermal/conduction/problem.hh:77
Definition: porousmediumflow/richards/implicit/nonisothermal/spatialparams.hh:40
This model implements a variant of the Richards' equation for quasi-twophase flow.
Base class for all porous media problems.