27#ifndef DUMUX_1PNI_CONDUCTION_PROBLEM_HH
28#define DUMUX_1PNI_CONDUCTION_PROBLEM_HH
31#include <dune/grid/yaspgrid.hh>
48template <
class TypeTag>
61template<
class TypeTag>
62struct Grid<TypeTag,
TTag::OnePNIConduction> {
using type = Dune::YaspGrid<2>; };
65template<
class TypeTag>
69template<
class TypeTag>
77template<
class TypeTag>
108template <
class TypeTag>
122 enum { dimWorld = GridView::dimensionworld };
128 pressureIdx = Indices::pressureIdx,
129 temperatureIdx = Indices::temperatureIdx
132 using Element =
typename GridView::template Codim<0>::Entity;
133 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
144 temperatureHigh_ = 300.0;
151 return temperatureExact_;
157 const auto someElement = *(elements(this->
gridGeometry().gridView()).begin());
160 const auto someInitSol =
initialAtPos(someElement.geometry().center());
163 someFvGeometry.bindElement(someElement);
164 const auto someScv = *(scvs(someFvGeometry).begin());
166 VolumeVariables volVars;
167 volVars.update(someElemSol, *
this, someElement, someScv);
169 const auto porosity = this->
spatialParams().porosity(someElement, someScv, someElemSol);
170 const auto densityW = volVars.density();
172 const auto densityS = volVars.solidDensity();
173 const auto heatCapacityS = volVars.solidHeatCapacity();
174 const auto storage = densityW*heatCapacityW*porosity + densityS*heatCapacityS*(1 - porosity);
175 const auto effectiveThermalConductivity = ThermalConductivityModel::effectiveThermalConductivity(volVars);
177 time = max(time, 1e-10);
178 for (
const auto& element : elements(this->
gridGeometry().gridView()))
181 fvGeometry.bindElement(element);
183 for (
auto&& scv : scvs(fvGeometry))
185 auto globalIdx = scv.dofIndex();
186 const auto& globalPos = scv.dofPosition();
189 temperatureExact_[globalIdx] = temperatureHigh_ + (someInitSol[temperatureIdx] - temperatureHigh_)
190 *erf(0.5*sqrt(globalPos[0]*globalPos[0]*storage/time/effectiveThermalConductivity));
206 const std::string&
name()
const
225 BoundaryTypes bcTypes;
227 if(globalPos[0] < eps_ || globalPos[0] > this->
gridGeometry().bBoxMax()[0] - eps_)
228 bcTypes.setAllDirichlet();
230 bcTypes.setAllNeumann();
244 PrimaryVariables priVars(initial_());
245 if (globalPos[0] < eps_)
246 priVars[temperatureIdx] = temperatureHigh_;
274 PrimaryVariables initial_()
const
276 PrimaryVariables priVars(0.0);
277 priVars[pressureIdx] = 1.0e5;
278 priVars[temperatureIdx] = 290.0;
282 Scalar temperatureHigh_;
283 static constexpr Scalar eps_ = 1e-6;
285 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 .
Reation for a simple effective thermal conductivity.
A liquid phase consisting of a single component.
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 std::string & paramGroup() const
The parameter group in which to retrieve runtime parameters.
Definition common/fvproblem.hh:592
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 liquid phase consisting of a single component.
Definition 1pliquid.hh:46
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 OnePModel in combination with the NI model for a conduction problem.
Definition problem_conduction.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 problem_conduction.hh:223
OnePNIConductionProblem(std::shared_ptr< const GridGeometry > gridGeometry, const std::string ¶mGroup)
Definition problem_conduction.hh:137
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition problem_conduction.hh:265
void updateExactTemperature(const SolutionVector &curSol, Scalar time)
Udpate the analytical temperature.
Definition problem_conduction.hh:155
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition problem_conduction.hh:242
const std::string & name() const
The problem name.
Definition problem_conduction.hh:206
const std::vector< Scalar > & getExactTemperature()
Get the analytical temperature.
Definition problem_conduction.hh:149
Definition problem_conduction.hh:54
std::tuple< OnePNI > InheritsFrom
Definition problem_conduction.hh:54
Definition problem_conduction.hh:55
std::tuple< OnePNIConduction, BoxModel > InheritsFrom
Definition problem_conduction.hh:55
Definition problem_conduction.hh:56
std::tuple< OnePNIConduction, CCTpfaModel > InheritsFrom
Definition problem_conduction.hh:56
Definition problem_conduction.hh:57
std::tuple< OnePNIConduction, CCMpfaModel > InheritsFrom
Definition problem_conduction.hh:57
Dune::YaspGrid< 2 > type
Definition problem_conduction.hh:62
OnePNIConductionProblem< TypeTag > type
Definition problem_conduction.hh:66
FluidSystems::OnePLiquid< GetPropType< TypeTag, Properties::Scalar >, Components::H2O< GetPropType< TypeTag, Properties::Scalar > > > type
Definition problem_conduction.hh:72
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition problem_conduction.hh:81
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition problem_conduction.hh:80
OnePNISpatialParams< GridGeometry, Scalar > type
Definition problem_conduction.hh:82
Definition of the spatial parameters for the 1pni problems.
Definition porousmediumflow/1p/implicit/nonisothermal/spatialparams.hh:41
A single-phase, isothermal flow model using the fully implicit scheme.
Base class for all porous media problems.
Definition of the spatial parameters for the 1pni problems.