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>
48template <
class TypeTag>
49class OnePTwoCThermalNonequilibriumProblem;
59template<
class TypeTag>
60struct Grid<TypeTag, TTag::OnePTwoCThermalNonequilibrium> {
using type = Dune::YaspGrid<2>; };
63template<
class TypeTag>
67template<
class TypeTag>
68struct FluidSystem<TypeTag, TTag::OnePTwoCThermalNonequilibrium>
76template<
class TypeTag>
85template<
class TypeTag>
86struct UseMoles<TypeTag, TTag::OnePTwoCThermalNonequilibrium> {
static constexpr bool value =
true; };
106template <
class TypeTag>
122 using ElementVolumeVariables =
typename GridVariables::GridVolumeVariables::LocalView;
123 using ElementFluxVariablesCache =
typename GridVariables::GridFluxVariablesCache::LocalView;
125 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
126 using Element =
typename GridView::template Codim<0>::Entity;
135 pressureIdx = Indices::pressureIdx,
136 temperatureIdx = Indices::temperatureIdx,
137 temperatureSolidIdx = Indices::temperatureSolidIdx,
140 H2OIdx = FluidSystem::compIdx(FluidSystem::MultiPhaseFluidSystem::H2OIdx),
141 N2Idx = FluidSystem::compIdx(FluidSystem::MultiPhaseFluidSystem::N2Idx),
144 contiH2OEqIdx = Indices::conti0EqIdx + H2OIdx,
145 contiN2EqIdx = Indices::conti0EqIdx + N2Idx,
146 energyEqIdx = Indices::energyEqIdx
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 darcyVelocity_ = getParam<Scalar>(
"Problem.DarcyVelocity");
174 {
return *gridVariables_; }
196 BoundaryTypes values;
198 if(globalPos[0] < eps_)
199 values.setAllDirichlet();
201 values.setAllNeumann();
213 PrimaryVariables values = initial_(globalPos);
236 const FVElementGeometry& fvGeometry,
237 const ElementVolumeVariables& elemVolVars,
238 const ElementFluxVariablesCache& elemFluxVarsCache,
239 const SubControlVolumeFace& scvf)
const
241 NumEqVector flux(0.0);
242 const auto& globalPos = scvf.ipGlobal();
243 const auto& scv = fvGeometry.scv(scvf.insideScvIdx());
245 if (globalPos[0] > this->
gridGeometry().bBoxMax()[0] - eps_)
247 flux[contiH2OEqIdx] = -darcyVelocity_*elemVolVars[scv].molarDensity();
248 flux[contiN2EqIdx] = -darcyVelocity_*elemVolVars[scv].molarDensity()*elemVolVars[scv].moleFraction(0, N2Idx);
249 flux[energyEqIdx] = -darcyVelocity_
250 *elemVolVars[scv].density()
275 {
return NumEqVector(0.0); }
286 {
return initial_(globalPos); }
292 PrimaryVariables initial_(
const GlobalPosition &globalPos)
const
294 PrimaryVariables priVars;
295 priVars[pressureIdx] = 1e5;
296 priVars[N2Idx] = 1e-5;
297 priVars[temperatureIdx] = 285.;
298 priVars[temperatureSolidIdx] = 285.;
301 static constexpr Scalar eps_ = 1e-6;
302 std::shared_ptr<GridVariables> gridVariables_;
303 Scalar darcyVelocity_;
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.
An adapter for multi-phase fluid systems to be used with (compositional) one-phase models.
Material properties of pure water .
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 pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:34
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
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 liquidEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of liquid water .
Definition: h2o.hh:217
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
Definition of a problem, for the 1pnc problem.
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:108
OnePTwoCThermalNonequilibriumProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:155
NumEqVector neumann(const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:235
NumEqVector sourceAtPos(const GlobalPosition &globalPos) const
Evaluates the source term for all phases within a given sub-control volume.
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:274
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:211
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:285
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/nonequilibrium/problem.hh:194
const GridVariables & gridVariables() const
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:173
void setGridVariables(std::shared_ptr< GridVariables > gridVariables)
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:170
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:54
std::tuple< OnePNCNonEquil > InheritsFrom
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:54
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:55
std::tuple< OnePTwoCThermalNonequilibrium, CCTpfaModel > InheritsFrom
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:55
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:56
std::tuple< OnePTwoCThermalNonequilibrium, BoxModel > InheritsFrom
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:56
Dune::YaspGrid< 2 > type
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:60
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:70
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:80
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: test/porousmediumflow/1pnc/implicit/nonequilibrium/problem.hh:79
Definition of the spatial parameters for the 1pnc test problems.
Definition: porousmediumflow/1pnc/implicit/nonequilibrium/spatialparams.hh:43
Adaption of the fully implicit model to the one-phase n-component flow model.
Base class for all porous media problems.
Definition of the spatial parameters for the MaxwellStefan problem.