26#ifndef DUMUX_3PNI_CONDUCTION_PROBLEM_HH
27#define DUMUX_3PNI_CONDUCTION_PROBLEM_HH
30#include <dune/grid/yaspgrid.hh>
46template <
class TypeTag>
59template<
class TypeTag>
60struct Grid<TypeTag,
TTag::ThreePNIConduction> {
using type = Dune::YaspGrid<2>; };
63template<
class TypeTag>
68template<
class TypeTag>
73template<
class TypeTag>
108template <
class TypeTag>
129 pressureIdx = Indices::pressureIdx,
130 swIdx = Indices::swIdx,
131 snIdx = Indices::snIdx,
132 temperatureIdx = Indices::temperatureIdx,
133 wPhaseIdx = FluidSystem::wPhaseIdx
136 enum { dimWorld = GridView::dimensionworld };
138 using Element =
typename GridView::template Codim<0>::Entity;
139 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
149 temperatureHigh_ = 300.0;
156 return temperatureExact_;
162 const auto someElement = *(elements(this->
gridGeometry().gridView()).begin());
165 const auto someInitSol =
initialAtPos(someElement.geometry().center());
168 someFvGeometry.bindElement(someElement);
169 const auto someScv = *(scvs(someFvGeometry).begin());
171 VolumeVariables volVars;
172 volVars.update(someElemSol, *
this, someElement, someScv);
174 const auto porosity = this->
spatialParams().porosity(someElement, someScv, someElemSol);
175 const auto densityW = volVars.density(wPhaseIdx);
177 const auto densityS = volVars.solidDensity();
178 const auto heatCapacityS = volVars.solidHeatCapacity();
179 const auto storage = densityW*heatCapacityW*porosity + densityS*heatCapacityS*(1 - porosity);
180 const auto effectiveThermalConductivity = ThermalConductivityModel::effectiveThermalConductivity(volVars);
182 time = max(time, 1e-10);
183 for (
const auto& element : elements(this->
gridGeometry().gridView()))
186 fvGeometry.bindElement(element);
188 for (
auto&& scv : scvs(fvGeometry))
190 auto globalIdx = scv.dofIndex();
191 const auto& globalPos = scv.dofPosition();
194 temperatureExact_[globalIdx] = temperatureHigh_ + (someInitSol[temperatureIdx] - temperatureHigh_)
195 *erf(0.5*sqrt(globalPos[0]*globalPos[0]*storage/time/effectiveThermalConductivity));
211 const std::string&
name()
const
230 BoundaryTypes values;
231 if(globalPos[0] < eps_ || globalPos[0] > this->
gridGeometry().bBoxMax()[0] - eps_)
233 values.setAllDirichlet();
237 values.setAllNeumann();
251 if (globalPos[0] < eps_)
252 values[temperatureIdx] = temperatureHigh_;
266 return NumEqVector(0.0);
290 return NumEqVector(0.0);
301 PrimaryVariables values;
302 values[pressureIdx] = 1e5;
304 values[snIdx] = 1e-5;
305 values[temperatureIdx] = 290;
312 Scalar temperatureHigh_;
313 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 mpfa.
Properties for all models using cell-centered finite volume scheme with TPFA.
Material properties of pure water .
Relation for the saturation-dependent effective thermal conductivity.
A three-phase fluid system featuring gas, NAPL and water as phases and distilled water and air (Pseu...
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
T getParam(Args &&... args)
A free function to get a parameter from the parameter tree singleton.
Definition parameters.hh:428
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
Definition common/properties.hh:47
Type tag for numeric models.
Definition grid.hh:35
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
A three-phase fluid system featuring gas, NAPL and water as phases and distilled water and air (Pseu...
Definition h2oairmesitylene.hh:57
SpatialParams & spatialParams()
Returns the spatial parameters object.
Definition dumux/porousmediumflow/problem.hh:146
PorousMediumFlowProblem(std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< SpatialParams > spatialParams, const std::string ¶mGroup="")
Constructor, passing the spatial parameters.
Definition dumux/porousmediumflow/problem.hh:67
Test for the ThreePModel in combination with the NI model for a conduction problem.
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:110
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/3p/implicit/conduction/problem.hh:228
NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:264
const std::string & name() const
The problem name.
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:211
const std::vector< Scalar > & getExactTemperature()
Get the analytical temperature.
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:154
ThreePNIConductionProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:142
void updateExactTemperature(const SolutionVector &curSol, Scalar time)
Udpate the analytical temperature.
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:160
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:299
NumEqVector sourceAtPos(const GlobalPosition &globalPos) const
Evaluates the source term for all phases within a given sub-controlvolume.
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:288
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:247
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:52
std::tuple< ThreePNI > InheritsFrom
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:52
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:53
std::tuple< ThreePNIConduction, BoxModel > InheritsFrom
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:53
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:54
std::tuple< ThreePNIConduction, CCTpfaModel > InheritsFrom
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:54
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:55
std::tuple< ThreePNIConduction, CCMpfaModel > InheritsFrom
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:55
Dune::YaspGrid< 2 > type
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:60
ThreePNIConductionProblem< TypeTag > type
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:64
FluidSystems::H2OAirMesitylene< GetPropType< TypeTag, Properties::Scalar > > type
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:70
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:76
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:77
ThreePNISpatialParams< GridGeometry, Scalar > type
Definition test/porousmediumflow/3p/implicit/conduction/problem.hh:78
Definition of the spatial parameters for the 3pni problems.
Definition porousmediumflow/3p/implicit/conduction/spatialparams.hh:44
Adaption of the fully implicit scheme to the three-phase flow model.
Base class for all porous media problems.
Definition of the spatial parameters for the 3pni problems.