24#ifndef DUMUX_FLUXDATA2P_HH
25#define DUMUX_FLUXDATA2P_HH
39template<
class TypeTag>
48 dim = GridView::dimension
51 using Indices =
typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
55 wPhaseIdx = Indices::wPhaseIdx, nPhaseIdx = Indices::nPhaseIdx
63 using DimVector = Dune::FieldVector<Scalar, dim>;
64 using VelocityVector = Dune::FieldVector<DimVector, 2*dim>;
66 VelocityVector velocity_[numPhases];
67 Scalar upwindPotential_[2 * dim][numPhases];
68 bool velocityMarker_[2 * dim];
75 for (
int fIdx = 0; fIdx < 2*dim; fIdx++)
77 for (
int phaseIdx = 0; phaseIdx < numPhases; phaseIdx++)
79 velocity_[phaseIdx][fIdx] = DimVector(0.0);
81 upwindPotential_[fIdx][phaseIdx] = 0.0;
83 velocityMarker_[fIdx] =
false;
97 const DimVector&
velocity(
int phaseIdx,
int indexInInside)
99 return velocity_[phaseIdx][indexInInside];
108 const DimVector&
velocity(
int phaseIdx,
int indexInInside)
const
110 return velocity_[phaseIdx][indexInInside];
122 velocity_[phaseIdx][indexInInside] =
velocity;
134 velocity_[phaseIdx][indexInInside] +=
velocity;
140 for (
int i = 0; i < 2 * dim; i++)
142 for (
int j = 0; j < numPhases; j++)
144 velocity_[j][i] = 0.;
145 upwindPotential_[i][j] = 0.;
147 velocityMarker_[i] =
false;
158 return velocity_[wPhaseIdx][indexInInside]
159 + velocity_[nPhaseIdx][indexInInside];
169 return velocity_[wPhaseIdx][indexInInside]
170 + velocity_[nPhaseIdx][indexInInside];
181 velocityMarker_[indexInInside] =
true;
192 return velocityMarker_[indexInInside];
198 for (
int i = 0; i < 2*dim; i++)
199 velocityMarker_[i] =
false;
211 return (upwindPotential_[indexInInside][phaseIdx] > 0.);
223 return (upwindPotential_[indexInInside][phaseIdx] > 0.);
234 return upwindPotential_[indexInInside][phaseIdx];
245 return upwindPotential_[indexInInside][phaseIdx];
257 upwindPotential_[indexInInside][phaseIdx] = pot;
269 upwindPotential_[indexInInside][phaseIdx] += pot;
#define GET_PROP_VALUE(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:282
#define GET_PROP_TYPE(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:283
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Property tag NumPhases
Number of phases in the system.
Definition: porousmediumflow/sequential/properties.hh:69
Class storing data assigned to a cell-cell interfaces, so-called flux-data.
Definition: 2p/sequential/fluxdata.hh:41
bool haveVelocity(int indexInInside)
Check the velocity marker Returns true if a velocity marker was set, otherwise false
Definition: 2p/sequential/fluxdata.hh:190
bool isUpwindCell(int phaseIdx, int indexInInside) const
Checks for upwind direction Returns true if the cell is the upwind cell, otherwise false
Definition: 2p/sequential/fluxdata.hh:221
void setVelocity(int phaseIdx, int indexInInside, const DimVector &velocity)
Sets the phase velocity vector at a cell-cell interface.
Definition: 2p/sequential/fluxdata.hh:120
const DimVector & velocity(int phaseIdx, int indexInInside) const
Returns the phase velocity vector at a cell-cell interface.
Definition: 2p/sequential/fluxdata.hh:108
void setUpwindPotential(int phaseIdx, int indexInInside, Scalar pot)
Sets the phase upwind potential at a cell-cell interface.
Definition: 2p/sequential/fluxdata.hh:255
void addVelocity(int phaseIdx, int indexInInside, const DimVector &velocity)
Adds a phase velocity vector to the one previously stored.
Definition: 2p/sequential/fluxdata.hh:132
Scalar upwindPotential(int phaseIdx, int indexInInside) const
Returns the phase upwind potential at a cell-cell interface.
Definition: 2p/sequential/fluxdata.hh:243
void resetVelocity()
Resets velocities and potentials.
Definition: 2p/sequential/fluxdata.hh:138
const DimVector & velocity(int phaseIdx, int indexInInside)
Returns the phase velocity vector at a cell-cell interface.
Definition: 2p/sequential/fluxdata.hh:97
DimVector velocityTotal(int indexInInside)
Returns the total velocity vector at a cell-cell interface.
Definition: 2p/sequential/fluxdata.hh:156
bool isUpwindCell(int phaseIdx, int indexInInside)
Checks for upwind direction Returns true if the cell is the upwind cell, otherwise false
Definition: 2p/sequential/fluxdata.hh:209
void setVelocityMarker(int indexInInside)
Sets the velocity marker at a cell-cell interface This marker can be used to check if a velocity has ...
Definition: 2p/sequential/fluxdata.hh:179
FluxData2P()
Constructs a FluxData2P object.
Definition: 2p/sequential/fluxdata.hh:73
void resetVelocityMarker()
Resets the velocity marker.
Definition: 2p/sequential/fluxdata.hh:196
DimVector velocityTotal(int indexInInside) const
Returns the total velocity vector at a cell-cell interface.
Definition: 2p/sequential/fluxdata.hh:167
Scalar upwindPotential(int phaseIdx, int indexInInside)
Returns the phase upwind potential at a cell-cell interface.
Definition: 2p/sequential/fluxdata.hh:232
void addUpwindPotential(int phaseIdx, int indexInInside, Scalar pot)
Adds a phase upwind potential to the one previously stored.
Definition: 2p/sequential/fluxdata.hh:267
Base file for properties related to sequential models.