24#ifndef DUMUX_DIFFUSIONPROBLEM_2P_HH
25#define DUMUX_DIFFUSIONPROBLEM_2P_HH
38template<
class TypeTag>
45 using Grid =
typename GridView::Grid;
54 using Element =
typename GridView::Traits::template Codim<0>::Entity;
58 dim = Grid::dimension, dimWorld = Grid::dimensionworld
61 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
62 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
78 spatialParams_ = std::make_shared<SpatialParams>(asImp_());
80 if (getParam<bool>(
"Problem.EnableGravity"))
81 gravity_[dim - 1] = -9.81;
83 pressModel_ = std::make_shared<PressureModel>(asImp_());
95 spatialParams_ = Dune::stackobject_to_shared_ptr<SpatialParams>(
spatialParams);
97 if (getParam<bool>(
"Problem.EnableGravity"))
98 gravity_[dim - 1] = -9.81;
100 pressModel_ = std::make_shared<PressureModel>(asImp_());
111 spatialParams_ = std::make_shared<SpatialParams>(asImp_());
113 if (getParam<bool>(
"Problem.EnableGravity"))
114 gravity_[dim - 1] = -9.81;
116 pressModel_ = std::make_shared<PressureModel>(asImp_());
127 spatialParams_ = Dune::stackobject_to_shared_ptr<SpatialParams>(
spatialParams);
129 if (getParam<bool>(
"Problem.EnableGravity"))
130 gravity_[dim - 1] = -9.81;
132 pressModel_ = std::make_shared<PressureModel>(asImp_());
160 return this->asImp_().temperatureAtPos(element.geometry().center());
171 DUNE_THROW(Dune::InvalidStateException,
172 "The problem does not provide "
173 "a temperatureAtPos() method.");
183 return this->asImp_().referencePressureAtPos(element.geometry().center());
194 DUNE_THROW(Dune::InvalidStateException,
195 "The problem does not provide "
196 "a referencePressureAtPos() method.");
215 return *spatialParams_;
223 return *spatialParams_;
230 {
return *pressModel_; }
234 {
return *pressModel_; }
240 Implementation &asImp_()
241 {
return *
static_cast<Implementation *
>(
this); }
244 const Implementation &asImp_()
const
245 {
return *
static_cast<const Implementation *
>(
this); }
247 GravityVector gravity_;
250 std::shared_ptr<SpatialParams> spatialParams_;
251 bool newSpatialParams_;
252 std::shared_ptr<PressureModel> pressModel_;
Base class for definition of an sequential diffusion (pressure) or transport problem.
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:150
Base class for stationary solution of a two-phase diffusion/pressure equation.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:40
void timeIntegration()
Time integration function called by the time manager.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:145
DiffusionProblem2P(Grid &grid)
Constructs a DiffusionProblem2P object.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:108
const GravityVector & gravity() const
Returns the acceleration due to gravity.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:205
PressureModel & pressureModel()
Returns the pressure model used for the problem.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:229
Scalar referencePressure(const Element &element) const
Returns the reference pressure for evaluation of constitutive relations.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:181
const PressureModel & pressureModel() const
Returns the pressure model used for the problem. // TODO doc me!
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:233
DiffusionProblem2P(TimeManager &timeManager, Grid &grid)
Constructs a DiffusionProblem2P object.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:75
Scalar temperatureAtPos(const GlobalPosition &globalPos) const
Returns the temperature within the domain.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:168
DiffusionProblem2P(Grid &grid, SpatialParams &spatialParams)
Constructs a DiffusionProblem2P object.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:124
Scalar referencePressureAtPos(const GlobalPosition &globalPos) const
Returns the reference pressure for evaluation of constitutive relations.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:191
SpatialParams & spatialParams()
Returns the spatial parameters object.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:213
DiffusionProblem2P(TimeManager &timeManager, Grid &grid, SpatialParams &spatialParams)
Constructs a DiffusionProblem2P object.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:92
Scalar temperature(const Element &element) const
Returns the temperature within the domain.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:158
const SpatialParams & spatialParams() const
Returns the spatial parameters object.
Definition: porousmediumflow/2p/sequential/diffusion/problem.hh:221
Base class for definition of an sequential diffusion (pressure) or transport problem.
Definition: onemodelproblem.hh:46
TimeManager & timeManager()
Returns TimeManager object used by the simulation.
Definition: onemodelproblem.hh:551
Base file for properties related to sequential models.