26#ifndef DUMUX_1P2CNI_TRANSIENT_BC_TEST_PROBLEM_HH
27#define DUMUX_1P2CNI_TRANSIENT_BC_TEST_PROBLEM_HH
30#include <dune/grid/uggrid.hh>
32#include <dune/grid/yaspgrid.hh>
48template <
class TypeTag>
62template<
class TypeTag>
63struct Grid<TypeTag,
TTag::OnePTwoCNITransientBC> {
using type = Dune::UGGrid<2>; };
65template<
class TypeTag>
66struct Grid<TypeTag,
TTag::OnePTwoCNITransientBC> {
using type = Dune::YaspGrid<2>; };
70template<
class TypeTag>
74template<
class TypeTag>
83template<
class TypeTag>
92template<
class TypeTag>
93struct UseMoles<TypeTag,
TTag::OnePTwoCNITransientBC> {
static constexpr bool value =
true; };
96#define ENABLECACHING false
100template<
class TypeTag>
102template<
class TypeTag>
104template<
class TypeTag>
133template <
class TypeTag>
148 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
149 using Element =
typename GridView::template Codim<0>::Entity;
158 pressureIdx = Indices::pressureIdx,
159 temperatureIdx = Indices::temperatureIdx,
162 H2OIdx = FluidSystem::compIdx(FluidSystem::MultiPhaseFluidSystem::H2OIdx),
163 N2Idx = FluidSystem::compIdx(FluidSystem::MultiPhaseFluidSystem::N2Idx),
166 contiH2OEqIdx = Indices::conti0EqIdx + H2OIdx,
167 contiN2EqIdx = Indices::conti0EqIdx + N2Idx,
168 energyEqIdx = Indices::energyEqIdx
173 static const int dimWorld = GridView::dimensionworld;
174 using GlobalPosition =
typename SubControlVolumeFace::GlobalPosition;
185 std::cout<<
"problem uses mole fractions"<<std::endl;
187 std::cout<<
"problem uses mass fractions"<<std::endl;
201 {
return 273.15 + 20; }
218 BoundaryTypes values;
220 if(globalPos[0] < this->
gridGeometry().bBoxMin()[0] + eps_ || globalPos[0] > this->
gridGeometry().bBoxMax()[0] - eps_)
221 values.setAllDirichlet();
223 values.setAllNeumann();
235 PrimaryVariables values = initial_(globalPos);
238 if (globalPos[0] < this->
gridGeometry().bBoxMin()[0] + eps_)
240 values[pressureIdx] += time_ * 1.0;
241 values[N2Idx] += time_ * 1e-8;
242 values[temperatureIdx] += time_ * 1e-3;
253 return NumEqVector(0.0);
275 {
return NumEqVector(0.0); }
286 {
return initial_(globalPos); }
300 PrimaryVariables initial_(
const GlobalPosition& globalPos)
const
302 PrimaryVariables priVars;
304 if (globalPos[0] < this->
gridGeometry().bBoxMin()[0] + eps_)
306 priVars[pressureIdx] = 1.1e5;
307 priVars[N2Idx] = 2e-10;
308 priVars[temperatureIdx] = 300.00;
312 priVars[pressureIdx] = 1.0e5;
313 priVars[N2Idx] = 0.0;
314 priVars[temperatureIdx] = 285.00;
319 static constexpr Scalar eps_ = 1e-6;
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.
A two-phase fluid system with two components water Nitrogen for non-equilibrium models.
make the local view function available whenever we use the grid geometry
Definition adapt.hh:29
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:153
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
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
Definition common/properties.hh:169
If disabled, the volume variables are not stored (reduces memory, but is slower).
Definition common/properties.hh:178
specifies if data on flux vars should be saved (faster, but more memory consuming)
Definition common/properties.hh:188
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
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
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 OnePTwoCModel in combination with the NI model for a convection problem.
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:135
void setTime(Scalar t)
Set the simulation time.
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:293
NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Neumann boundary segment.
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:251
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/transientbc/problem.hh:274
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/transientbc/problem.hh:216
OnePTwoCNITransientBCProblem(std::shared_ptr< const GridGeometry > gridGeometry)
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:177
PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
Evaluates the boundary conditions for a Dirichlet boundary segment.
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:233
PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
Evaluates the initial value for a control volume.
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:285
Scalar temperature() const
Returns the temperature within the domain [K].
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:200
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:54
std::tuple< OnePNCNI > InheritsFrom
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:54
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:55
std::tuple< OnePTwoCNITransientBC, CCTpfaModel > InheritsFrom
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:55
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:56
std::tuple< OnePTwoCNITransientBC, CCMpfaModel > InheritsFrom
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:56
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:57
std::tuple< OnePTwoCNITransientBC, BoxModel > InheritsFrom
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:57
Dune::YaspGrid< 2 > type
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:66
OnePTwoCNITransientBCProblem< TypeTag > type
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:71
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:77
FluidSystems::H2ON2< Scalar, FluidSystems::H2ON2DefaultPolicy< true > > H2ON2
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:78
FluidSystems::OnePAdapter< H2ON2, H2ON2::liquidPhaseIdx > type
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:79
GetPropType< TypeTag, Properties::Scalar > Scalar
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:87
OnePNCTestSpatialParams< GridGeometry, Scalar > type
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:88
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:86
static constexpr bool value
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:93
static constexpr bool value
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:101
static constexpr bool value
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:103
static constexpr bool value
Definition test/porousmediumflow/1pnc/implicit/1p2c/nonisothermal/transientbc/problem.hh:105
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.
#define ENABLECACHING
Definition test/freeflow/navierstokes/donea/problem.hh:28
Definition of the spatial parameters for the 1pnc problems.