26#ifndef DUMUX_1P2CNI_CONDUCTION_TEST_PROBLEM_HH
27#define DUMUX_1P2CNI_CONDUCTION_TEST_PROBLEM_HH
30#include <dune/grid/uggrid.hh>
32#include <dune/grid/yaspgrid.hh>
44#include "../../spatialparams.hh"
48template <
class TypeTag>
49class OnePTwoCNIConductionProblem;
62template<
class TypeTag>
63struct Grid<TypeTag, TTag::OnePTwoCNIConduction> {
using type = Dune::UGGrid<2>; };
65template<
class TypeTag>
66struct Grid<TypeTag, TTag::OnePTwoCNIConduction> {
using type = Dune::YaspGrid<2>; };
70template<
class TypeTag>
74template<
class TypeTag>
83template<
class TypeTag>
92template<
class TypeTag>
93struct UseMoles<TypeTag, TTag::OnePTwoCNIConduction> {
static constexpr bool value =
true; };
120template <
class TypeTag>
133 using Element =
typename GridView::template Codim<0>::Entity;
143 pressureIdx = Indices::pressureIdx,
144 temperatureIdx = Indices::temperatureIdx,
146 N2Idx = FluidSystem::compIdx(FluidSystem::MultiPhaseFluidSystem::N2Idx)
150 static constexpr bool useMoles = getPropValue<TypeTag, Properties::UseMoles>();
151 static const int dimWorld = GridView::dimensionworld;
152 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
163 std::cout<<
"problem uses mole fractions"<<std::endl;
165 std::cout<<
"problem uses mass fractions"<<std::endl;
167 temperatureExact_.resize(
gridGeometry->numDofs(), 290.0);
173 return temperatureExact_;
179 const auto someElement = *(elements(this->
gridGeometry().gridView()).begin());
182 const auto someInitSol =
initialAtPos(someElement.geometry().center());
185 someFvGeometry.bindElement(someElement);
186 const auto someScv = *(scvs(someFvGeometry).begin());
188 VolumeVariables volVars;
189 volVars.update(someElemSol, *
this, someElement, someScv);
192 const auto densityW = volVars.density();
194 const auto densityS = volVars.solidDensity();
195 const auto heatCapacityS = volVars.solidHeatCapacity();
196 const auto storage = densityW*heatCapacityW*
porosity + densityS*heatCapacityS*(1 -
porosity);
197 const auto effectiveThermalConductivity = ThermalConductivityModel::effectiveThermalConductivity(volVars);
199 time = max(time, 1e-10);
200 for (
const auto& element : elements(this->
gridGeometry().gridView()))
203 fvGeometry.bindElement(element);
205 for (
auto&& scv : scvs(fvGeometry))
207 auto globalIdx = scv.dofIndex();
208 const auto& globalPos = scv.dofPosition();
211 temperatureExact_[globalIdx] = temperatureHigh_ + (someInitSol[temperatureIdx] - temperatureHigh_)
212 *erf(0.5*sqrt(globalPos[0]*globalPos[0]*storage/time/effectiveThermalConductivity));
229 {
return 273.15 + 20; }
246 BoundaryTypes values;
248 if(globalPos[0] < eps_ || globalPos[0] > this->
gridGeometry().bBoxMax()[0] - eps_)
250 values.setAllDirichlet();
254 values.setAllNeumann();
267 PrimaryVariables values = initial_(globalPos);
270 if (globalPos[0] < eps_)
271 values[temperatureIdx] = temperatureHigh_;
280 {
return NumEqVector(0.0); }
301 {
return NumEqVector(0.0); }
312 {
return initial_(globalPos); }
318 PrimaryVariables initial_(
const GlobalPosition &globalPos)
const
320 PrimaryVariables priVars;
321 priVars[pressureIdx] = 1e5;
322 priVars[N2Idx] = 1e-5;
323 priVars[temperatureIdx] = 290.;
326 static constexpr Scalar eps_ = 1e-6;
327 Scalar temperatureHigh_;
328 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 .
An adapter for multi-phase fluid systems to be used with (compositional) one-phase models.
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
UndefinedProperty 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
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
An adapter for multi-phase fluid systems to be used with (compositional) one-phase models.
Definition: 1padapter.hh:46
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
Definition of a problem, for the 1pnc problem.
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:122
Scalar temperature() const
Returns the temperature within the domain [K].
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:228
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:311
OnePTwoCNIConductionProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:155
NumEqVector sourceAtPos(const GlobalPosition &globalPos) const
Evaluates the source term for all phases within a given sub-control volume.
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:300
void updateExactTemperature(const SolutionVector &curSol, Scalar time)
Udpate the analytical temperature.
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:177
const std::vector< Scalar > & getExactTemperature()
Get the analytical temperature.
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:171
NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:279
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:265
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/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:244
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:54
std::tuple< OnePNCNI > InheritsFrom
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:54
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:55
std::tuple< OnePTwoCNIConduction, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:55
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:56
std::tuple< OnePTwoCNIConduction, CCMpfaModel > InheritsFrom
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:56
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:57
std::tuple< OnePTwoCNIConduction, BoxModel > InheritsFrom
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:57
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:66
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:77
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:86
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/conduction/problem.hh:87
Definition of the spatial parameters for the 1pnc test problems.
Definition: porousmediumflow/1pnc/implicit/1p2c/spatialparams.hh:41
Adaption of the fully implicit model to the one-phase n-component flow model.
Base class for all porous media problems.