24#ifndef DUMUX_ELEMENTDATA2P_HH
25#define DUMUX_ELEMENTDATA2P_HH
31template<
class TypeTag>
46template<
class TypeTag,
bool enableCompressibility>
61template<
class TypeTag>
72 dim = GridView::dimension, dimWorld = GridView::dimensionworld
79 wPhaseIdx = Indices::wPhaseIdx, nPhaseIdx = Indices::nPhaseIdx
83 numPhases = getPropValue<TypeTag, Properties::NumPhases>()
86 Scalar saturation_[numPhases];
87 Scalar pressure_[numPhases];
88 Scalar potential_[numPhases];
89 Scalar mobility_[numPhases];
90 Scalar fracFlowFunc_[numPhases];
92 Scalar capillaryPressure_;
101 for (
int i = 0; i < numPhases;i++)
103 saturation_[i] = 0.0;
107 fracFlowFunc_[i] = 0.0;
109 capillaryPressure_ = 0.0;
127 FluidState& fluidState()
129 DUNE_THROW(Dune::NotImplemented,
"fluid states not stored in cell data of incompressible models!");
133 const FluidState& fluidState()
const
135 DUNE_THROW(Dune::NotImplemented,
"fluid states not stored in cell data of incompressible models!");
150 return pressure_[phaseIdx];
160 return pressure_[phaseIdx];
171 pressure_[phaseIdx] = press;
177 return pressure_[wPhaseIdx];
183 return pressure_[wPhaseIdx];
193 pressure_[wPhaseIdx] = press;
203 return potential_[phaseIdx];
213 return potential_[phaseIdx];
224 potential_[phaseIdx] = pot;
234 return saturation_[phaseIdx];
244 return saturation_[phaseIdx];
255 saturation_[phaseIdx] = sat;
269 return mobility_[phaseIdx];
279 return mobility_[phaseIdx];
300 return fracFlowFunc_[phaseIdx];
310 return fracFlowFunc_[phaseIdx];
321 fracFlowFunc_[phaseIdx] = fracFlowFunc;
327 return capillaryPressure_;
333 return capillaryPressure_;
343 capillaryPressure_ = pc;
371 DUNE_THROW(Dune::NotImplemented,
"density function not implemented in cell data of incompressible models!");
373 Scalar
density(
int phaseIdx)
const
375 DUNE_THROW(Dune::NotImplemented,
"density function not implemented in cell data of incompressible models!");
381 DUNE_THROW(Dune::NotImplemented,
"viscosity function not implemented in cell data of incompressible models!");
386 DUNE_THROW(Dune::NotImplemented,
"viscosity function not implemented in cell data of incompressible models!");
403template<
class TypeTag>
414 dim = GridView::dimension, dimWorld = GridView::dimensionworld
421 wPhaseIdx = Indices::wPhaseIdx, nPhaseIdx = Indices::nPhaseIdx
425 numPhases = getPropValue<TypeTag, Properties::NumPhases>()
428 Scalar potential_[numPhases];
429 Scalar mobility_[numPhases];
430 Scalar fracFlowFunc_[numPhases];
434 FluidState fluidState_;
440 for (
int i = 0; i < numPhases;i++)
444 fracFlowFunc_[i] = 0.0;
483 return fluidState_.pressure(phaseIdx);
493 return fluidState_.pressure(phaseIdx);
504 fluidState_.setPressure(phaseIdx, press);
514 return potential_[phaseIdx];
524 return potential_[phaseIdx];
535 potential_[phaseIdx] = pot;
540 Scalar globalPressure()
542 DUNE_THROW(Dune::NotImplemented,
"no global pressure defined for compressible models!");
546 Scalar globalPressure()
const
548 DUNE_THROW(Dune::NotImplemented,
"no global pressure defined for compressible models!");
552 void setGlobalPressure(Scalar press)
554 DUNE_THROW(Dune::NotImplemented,
"no global pressure defined for compressible models!");
565 return fluidState_.saturation(phaseIdx);
575 return fluidState_.saturation(phaseIdx);
586 fluidState_.setSaturation(phaseIdx, sat);
600 return mobility_[phaseIdx];
610 return mobility_[phaseIdx];
631 return fracFlowFunc_[phaseIdx];
641 return fracFlowFunc_[phaseIdx];
652 fracFlowFunc_[phaseIdx] = fracFlowFunc;
658 return fluidState_.pressure(nPhaseIdx) - fluidState_.pressure(wPhaseIdx);
664 return fluidState_.pressure(nPhaseIdx) - fluidState_.pressure(wPhaseIdx);
669 void setCapillaryPressure(Scalar pc)
671 DUNE_THROW(Dune::NotImplemented,
"no capillary pressure stored for compressible models!");
682 return fluidState_.density(phaseIdx);
692 return fluidState_.density(phaseIdx);
703 fluidState_.setDensity(phaseIdx,
density);
713 return fluidState_.viscosity(phaseIdx);
723 return fluidState_.viscosity(phaseIdx);
734 fluidState_.setViscosity(phaseIdx,
viscosity);
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 mobility(int phaseIdx) noexcept
I/O name of mobility for multiphase systems.
Definition: name.hh:101
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:74
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Class storing data assigned to a cell-cell interfaces, so-called flux-data.
Definition: 2p/sequential/fluxdata.hh:41
Class including data of one grid cell.
Definition: 2p/sequential/celldata.hh:47
Scalar globalPressure() const
Returns the global pressure of the cell.
Definition: 2p/sequential/celldata.hh:181
Scalar mobility(int phaseIdx)
Returns the cell phase mobility.
Definition: 2p/sequential/celldata.hh:267
Scalar pressure(int phaseIdx)
Returns the cell phase pressure.
Definition: 2p/sequential/celldata.hh:148
Scalar pressure(int phaseIdx) const
Returns the cell phase pressure.
Definition: 2p/sequential/celldata.hh:158
void setCapillaryPressure(Scalar pc)
Sets the cell capillary pressure.
Definition: 2p/sequential/celldata.hh:341
Scalar mobility(int phaseIdx) const
Returns the cell phase mobility.
Definition: 2p/sequential/celldata.hh:277
Scalar saturation(int phaseIdx) const
Returns the cell phase saturation.
Definition: 2p/sequential/celldata.hh:242
FluxData & fluxData()
Returns the flux data of the cell.
Definition: 2p/sequential/celldata.hh:114
void setMobility(int phaseIdx, Scalar mobility)
Sets the cell phase mobility.
Definition: 2p/sequential/celldata.hh:288
Scalar saturation(int phaseIdx)
Returns the cell phase saturation.
Definition: 2p/sequential/celldata.hh:232
const FluxData & fluxData() const
Returns the flux data of the cell.
Definition: 2p/sequential/celldata.hh:120
Scalar fracFlowFunc(int phaseIdx) const
Returns the cell phase fractional flow function.
Definition: 2p/sequential/celldata.hh:308
void setPressure(int phaseIdx, Scalar press)
Sets the cell phase pressure.
Definition: 2p/sequential/celldata.hh:169
Scalar capillaryPressure() const
Returns the cell capillary pressure.
Definition: 2p/sequential/celldata.hh:331
void setSaturation(int phaseIdx, Scalar sat)
Sets the cell phase saturation.
Definition: 2p/sequential/celldata.hh:253
Scalar volumeCorrection() const
Returns the cell volume correction needed in the pressure equation.
Definition: 2p/sequential/celldata.hh:362
CellData2P()
Constructs a CellData2P object.
Definition: 2p/sequential/celldata.hh:99
Scalar potential(int phaseIdx) const
Returns the cell phase potential.
Definition: 2p/sequential/celldata.hh:211
void setGlobalPressure(Scalar press)
Sets the cell global pressure.
Definition: 2p/sequential/celldata.hh:191
void setUpdate(Scalar update)
Store transport update.
Definition: 2p/sequential/celldata.hh:351
Scalar potential(int phaseIdx)
Returns the cell phase potential.
Definition: 2p/sequential/celldata.hh:201
Scalar volumeCorrection()
Returns the cell volume correction needed in the pressure equation.
Definition: 2p/sequential/celldata.hh:357
void setFracFlowFunc(int phaseIdx, Scalar fracFlowFunc)
Sets the cell phase fractional flow function.
Definition: 2p/sequential/celldata.hh:319
Scalar fracFlowFunc(int phaseIdx)
Returns the cell phase fractional flow function.
Definition: 2p/sequential/celldata.hh:298
void setPotential(int phaseIdx, Scalar pot)
Sets the cell phase potential.
Definition: 2p/sequential/celldata.hh:222
Scalar globalPressure()
Returns the global pressure of the cell.
Definition: 2p/sequential/celldata.hh:175
Scalar capillaryPressure()
Returns the cell capillary pressure.
Definition: 2p/sequential/celldata.hh:325
Scalar capillaryPressure() const
Returns the cell capillary pressure.
Definition: 2p/sequential/celldata.hh:662
void setMobility(int phaseIdx, Scalar mobility)
Sets the cell phase mobility.
Definition: 2p/sequential/celldata.hh:619
void setUpdate(Scalar update)
Store transport update.
Definition: 2p/sequential/celldata.hh:742
Scalar density(int phaseIdx) const
Returns the cell phase density.
Definition: 2p/sequential/celldata.hh:690
Scalar potential(int phaseIdx)
Returns the cell phase potential.
Definition: 2p/sequential/celldata.hh:512
void setPotential(int phaseIdx, Scalar pot)
Sets the cell phase potential.
Definition: 2p/sequential/celldata.hh:533
Scalar potential(int phaseIdx) const
Returns the cell phase potential.
Definition: 2p/sequential/celldata.hh:522
Scalar mobility(int phaseIdx) const
Returns the cell phase mobility.
Definition: 2p/sequential/celldata.hh:608
Scalar capillaryPressure()
Returns the cell capillary pressure.
Definition: 2p/sequential/celldata.hh:656
void setSaturation(int phaseIdx, Scalar sat)
Sets the cell phase saturation.
Definition: 2p/sequential/celldata.hh:584
void setPressure(int phaseIdx, Scalar press)
Sets the cell phase pressure.
Definition: 2p/sequential/celldata.hh:502
Scalar viscosity(int phaseIdx)
Returns the cell phase viscosity.
Definition: 2p/sequential/celldata.hh:711
Scalar density(int phaseIdx)
Returns the cell phase density.
Definition: 2p/sequential/celldata.hh:680
Scalar saturation(int phaseIdx) const
Returns the cell phase saturation.
Definition: 2p/sequential/celldata.hh:573
Scalar fracFlowFunc(int phaseIdx)
Returns the cell phase fractional flow function.
Definition: 2p/sequential/celldata.hh:629
Scalar mobility(int phaseIdx)
Returns the cell phase mobility.
Definition: 2p/sequential/celldata.hh:598
Scalar volumeCorrection() const
Returns the cell volume correction needed in the pressure equation.
Definition: 2p/sequential/celldata.hh:754
Scalar viscosity(int phaseIdx) const
Returns the cell phase viscosity.
Definition: 2p/sequential/celldata.hh:721
Scalar pressure(int phaseIdx) const
Returns the cell phase pressure.
Definition: 2p/sequential/celldata.hh:491
void setDensity(int phaseIdx, Scalar density)
Sets the cell phase density.
Definition: 2p/sequential/celldata.hh:701
Scalar volumeCorrection()
Returns the cell volume correction needed in the pressure equation.
Definition: 2p/sequential/celldata.hh:748
Scalar pressure(int phaseIdx)
Returns the cell phase pressure.
Definition: 2p/sequential/celldata.hh:481
CellData2P()
Constructs a CellData2P object.
Definition: 2p/sequential/celldata.hh:438
const FluxData & fluxData() const
Returns the flux data of the cell.
Definition: 2p/sequential/celldata.hh:456
Scalar fracFlowFunc(int phaseIdx) const
Returns the cell phase fractional flow function.
Definition: 2p/sequential/celldata.hh:639
const FluidState & fluidState() const
Returns the FluidState object for this cell.
Definition: 2p/sequential/celldata.hh:467
void setFracFlowFunc(int phaseIdx, Scalar fracFlowFunc)
Sets the cell phase fractional flow function.
Definition: 2p/sequential/celldata.hh:650
FluxData & fluxData()
Returns the flux data of the cell.
Definition: 2p/sequential/celldata.hh:450
FluidState & fluidState()
Returns the FluidState object for this cell.
Definition: 2p/sequential/celldata.hh:462
void setViscosity(int phaseIdx, Scalar viscosity)
Sets the cell phase viscosity.
Definition: 2p/sequential/celldata.hh:732
Scalar saturation(int phaseIdx)
Returns the cell phase saturation.
Definition: 2p/sequential/celldata.hh:563
Base file for properties related to sequential models.
Class including the variables and data of discretized data of the constitutive relations.