24#ifndef DUMUX_FVMPFAL2DVELOCITY2P_HH
25#define DUMUX_FVMPFAL2DVELOCITY2P_HH
27#include <dune/grid/common/gridenums.hh>
64 dim = GridView::dimension, dimWorld = GridView::dimensionworld
79 using PrimaryVariables =
typename SolutionTypes::PrimaryVariables;
82 using Element =
typename GridView::Traits::template Codim<0>::Entity;
83 using Grid =
typename GridView::Grid;
84 using IndexSet =
typename GridView::IndexSet;
86 using Geometry =
typename Element::Geometry;
87 using JacobianTransposed =
typename Geometry::JacobianTransposed ;
93 using InnerBoundaryVolumeFaces = std::vector<Dune::FieldVector<bool, 2*dim> >;
97 pw = Indices::pressureW,
98 pn = Indices::pressureNw,
99 pGlobal = Indices::pressureGlobal,
100 sw = Indices::saturationW,
101 sn = Indices::saturationNw,
102 vw = Indices::velocityW,
103 vn = Indices::velocityNw,
104 vt = Indices::velocityTotal
108 wPhaseIdx = Indices::wPhaseIdx,
109 nPhaseIdx = Indices::nPhaseIdx,
110 pressureIdx = Indices::pressureIdx,
111 saturationIdx = Indices::saturationIdx,
112 pressureEqIdx = Indices::pressureEqIdx,
113 satEqIdx = Indices::satEqIdx,
114 numPhases = getPropValue<TypeTag, Properties::NumPhases>()
117 using LocalPosition = Dune::FieldVector<Scalar, dim>;
118 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
119 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
120 using DimMatrix = Dune::FieldMatrix<Scalar, dim, dim>;
121 using DimVector = Dune::FieldVector<Scalar, dim>;
142 CellData& cellData1, CellData& cellData2, CellData& cellData3, CellData& cellData4,
143 InnerBoundaryVolumeFaces& innerBoundaryVolumeFaces);
145 CellData& cellData,
int elemIdx);
150 const auto element = *problem_.gridView().template begin<0>();
151 FluidState fluidState;
152 fluidState.setPressure(wPhaseIdx, problem_.referencePressure(element));
153 fluidState.setPressure(nPhaseIdx, problem_.referencePressure(element));
154 fluidState.setTemperature(problem_.temperature(element));
155 fluidState.setSaturation(wPhaseIdx, 1.);
156 fluidState.setSaturation(nPhaseIdx, 0.);
175 template<
class MultiWriter>
180 Dune::BlockVector < DimVector > &velocityWetting
181 = *(writer.template allocateManagedBuffer<Scalar,dim>(problem_.gridView().size(0)));
182 Dune::BlockVector < DimVector > &velocityNonwetting
183 = *(writer.template allocateManagedBuffer<Scalar,dim>(problem_.gridView().size(0)));
186 for (
const auto& element : elements(problem_.gridView()))
189 int eIdxGlobal = problem_.variables().index(element);
191 CellData & cellData = problem_.variables().cellData(eIdxGlobal);
193 Dune::FieldVector < Scalar, 2 * dim > fluxW(0);
194 Dune::FieldVector < Scalar, 2 * dim > fluxNw(0);
197 for (
const auto& intersection : intersections(problem_.gridView(), element))
199 int isIndex = intersection.indexInInside();
201 fluxW[isIndex] += intersection.geometry().volume()
202 * (intersection.centerUnitOuterNormal() * cellData.fluxData().velocity(wPhaseIdx, isIndex));
203 fluxNw[isIndex] += intersection.geometry().volume()
204 * (intersection.centerUnitOuterNormal() * cellData.fluxData().velocity(nPhaseIdx, isIndex));
207 DimVector refVelocity(0);
208 refVelocity[0] = 0.5 * (fluxW[1] - fluxW[0]);
209 refVelocity[1] = 0.5 * (fluxW[3] - fluxW[2]);
211 const DimVector& localPos = referenceElement(element).position(0, 0);
214 const JacobianTransposed jacobianT = element.geometry().jacobianTransposed(localPos);
217 DimVector elementVelocity(0);
218 jacobianT.umtv(refVelocity, elementVelocity);
219 elementVelocity /= element.geometry().integrationElement(localPos);
221 velocityWetting[eIdxGlobal] = elementVelocity;
224 refVelocity[0] = 0.5 * (fluxNw[1] - fluxNw[0]);
225 refVelocity[1] = 0.5 * (fluxNw[3] - fluxNw[2]);
229 jacobianT.umtv(refVelocity, elementVelocity);
230 elementVelocity /= element.geometry().integrationElement(localPos);
232 velocityNonwetting[eIdxGlobal] = elementVelocity;
235 writer.attachCellData(velocityWetting,
"wetting-velocity", dim);
236 writer.attachCellData(velocityNonwetting,
"nonwetting-velocity", dim);
256 static const int velocityType_ = getPropValue<TypeTag, Properties::VelocityFormulation>();
258 static const int pressureType_ = getPropValue<TypeTag, Properties::PressureFormulation>();
260 static const int saturationType_ = getPropValue<TypeTag, Properties::SaturationFormulation>();
277template<
class TypeTag>
279 CellData& cellData1, CellData& cellData2,
280 CellData& cellData3, CellData& cellData4,
281 InnerBoundaryVolumeFaces& innerBoundaryVolumeFaces)
288 int level1 = element1.level();
289 int level2 = element2.level();
290 int level3 = element3.level();
291 int level4 = element4.level();
294 int eIdxGlobal1 = problem_.variables().index(element1);
295 int eIdxGlobal2 = problem_.variables().index(element2);
296 int eIdxGlobal3 = problem_.variables().index(element3);
297 int eIdxGlobal4 = problem_.variables().index(element4);
300 Dune::FieldVector < Scalar, 2 * dim > potW(0);
301 Dune::FieldVector < Scalar, 2 * dim > potNw(0);
303 potW[0] = cellData1.potential(wPhaseIdx);
304 potW[1] = cellData2.potential(wPhaseIdx);
305 potW[2] = cellData3.potential(wPhaseIdx);
306 potW[3] = cellData4.potential(wPhaseIdx);
308 potNw[0] = cellData1.potential(nPhaseIdx);
309 potNw[1] = cellData2.potential(nPhaseIdx);
310 potNw[2] = cellData3.potential(nPhaseIdx);
311 potNw[3] = cellData4.potential(nPhaseIdx);
314 Dune::FieldVector < Scalar, numPhases > lambda1(cellData1.mobility(wPhaseIdx));
315 lambda1[nPhaseIdx] = cellData1.mobility(nPhaseIdx);
318 Scalar lambdaTotal1 = lambda1[wPhaseIdx] + lambda1[nPhaseIdx];
321 Dune::FieldVector < Scalar, numPhases > lambda2(cellData2.mobility(wPhaseIdx));
322 lambda2[nPhaseIdx] = cellData2.mobility(nPhaseIdx);
325 Scalar lambdaTotal2 = lambda2[wPhaseIdx] + lambda2[nPhaseIdx];
328 Dune::FieldVector < Scalar, numPhases > lambda3(cellData3.mobility(wPhaseIdx));
329 lambda3[nPhaseIdx] = cellData3.mobility(nPhaseIdx);
332 Scalar lambdaTotal3 = lambda3[wPhaseIdx] + lambda3[nPhaseIdx];
335 Dune::FieldVector < Scalar, numPhases > lambda4(cellData4.mobility(wPhaseIdx));
336 lambda4[nPhaseIdx] = cellData4.mobility(nPhaseIdx);
339 Scalar lambdaTotal4 = lambda4[wPhaseIdx] + lambda4[nPhaseIdx];
342 std::vector < DimVector > lambda(2 * dim);
344 lambda[0][0] = lambdaTotal1;
345 lambda[0][1] = lambdaTotal1;
346 lambda[1][0] = lambdaTotal2;
347 lambda[1][1] = lambdaTotal2;
348 lambda[2][0] = lambdaTotal3;
349 lambda[2][1] = lambdaTotal3;
350 lambda[3][0] = lambdaTotal4;
351 lambda[3][1] = lambdaTotal4;
353 Scalar potentialDiffW12 = 0;
354 Scalar potentialDiffW14 = 0;
355 Scalar potentialDiffW32 = 0;
356 Scalar potentialDiffW34 = 0;
358 Scalar potentialDiffNw12 = 0;
359 Scalar potentialDiffNw14 = 0;
360 Scalar potentialDiffNw32 = 0;
361 Scalar potentialDiffNw34 = 0;
364 Dune::FieldVector < Scalar, 2 * dim > fluxW(0);
365 Dune::FieldVector < Scalar, 2 * dim > fluxNw(0);
367 Dune::FieldMatrix < Scalar, dim, 2 * dim - dim + 1 > T(0);
369 Dune::FieldVector<Scalar, 2 * dim - dim + 1> u(0);
371 int lType = transmissibilityCalculator_.calculateTransmissibility(T, interactionVolume, lambda, 0, 1, 2, 3);
373 if (lType == TransmissibilityCalculator::rightTriangle)
382 potentialDiffW12 = Tu[1];
391 potentialDiffNw12 = Tu[1];
402 potentialDiffW12 = Tu[1];
411 potentialDiffNw12 = Tu[1];
414 lType = transmissibilityCalculator_.calculateTransmissibility(T, interactionVolume, lambda, 1, 2, 3, 0);
416 if (lType == TransmissibilityCalculator::rightTriangle)
425 potentialDiffW32 = -Tu[1];
434 potentialDiffNw32 = -Tu[1];
445 potentialDiffW32 = -Tu[1];
454 potentialDiffNw32 = -Tu[1];
457 lType = transmissibilityCalculator_.calculateTransmissibility(T, interactionVolume, lambda, 2, 3, 0, 1);
459 if (lType == TransmissibilityCalculator::rightTriangle)
468 potentialDiffW34 = Tu[1];
477 potentialDiffNw34 = Tu[1];
488 potentialDiffW34 = Tu[1];
497 potentialDiffNw34 = Tu[1];
500 lType = transmissibilityCalculator_.calculateTransmissibility(T, interactionVolume, lambda, 3, 0, 1, 2);
502 if (lType == TransmissibilityCalculator::rightTriangle)
511 potentialDiffW14 = -Tu[1];
520 potentialDiffNw14 = -Tu[1];
531 potentialDiffW14 = -Tu[1];
540 potentialDiffNw14 = -Tu[1];
544 cellData1.fluxData().addUpwindPotential(wPhaseIdx, interactionVolume.
getIndexOnElement(0, 0), potentialDiffW12);
545 cellData1.fluxData().addUpwindPotential(nPhaseIdx, interactionVolume.
getIndexOnElement(0, 0), potentialDiffNw12);
546 cellData1.fluxData().addUpwindPotential(wPhaseIdx, interactionVolume.
getIndexOnElement(0, 1), potentialDiffW14);
547 cellData1.fluxData().addUpwindPotential(nPhaseIdx, interactionVolume.
getIndexOnElement(0, 1), potentialDiffNw14);
548 cellData2.fluxData().addUpwindPotential(wPhaseIdx, interactionVolume.
getIndexOnElement(1, 0), -potentialDiffW32);
549 cellData2.fluxData().addUpwindPotential(nPhaseIdx, interactionVolume.
getIndexOnElement(1, 0), -potentialDiffNw32);
550 cellData2.fluxData().addUpwindPotential(wPhaseIdx, interactionVolume.
getIndexOnElement(1, 1), -potentialDiffW12);
551 cellData2.fluxData().addUpwindPotential(nPhaseIdx, interactionVolume.
getIndexOnElement(1, 1), -potentialDiffNw12);
552 cellData3.fluxData().addUpwindPotential(wPhaseIdx, interactionVolume.
getIndexOnElement(2, 0), potentialDiffW34);
553 cellData3.fluxData().addUpwindPotential(nPhaseIdx, interactionVolume.
getIndexOnElement(2, 0), potentialDiffNw34);
554 cellData3.fluxData().addUpwindPotential(wPhaseIdx, interactionVolume.
getIndexOnElement(2, 1), potentialDiffW32);
555 cellData3.fluxData().addUpwindPotential(nPhaseIdx, interactionVolume.
getIndexOnElement(2, 1), potentialDiffNw32);
556 cellData4.fluxData().addUpwindPotential(wPhaseIdx, interactionVolume.
getIndexOnElement(3, 0), -potentialDiffW14);
557 cellData4.fluxData().addUpwindPotential(nPhaseIdx, interactionVolume.
getIndexOnElement(3, 0), -potentialDiffNw14);
558 cellData4.fluxData().addUpwindPotential(wPhaseIdx, interactionVolume.
getIndexOnElement(3, 1), -potentialDiffW34);
559 cellData4.fluxData().addUpwindPotential(nPhaseIdx, interactionVolume.
getIndexOnElement(3, 1), -potentialDiffNw34);
562 Dune::FieldVector < Scalar, numPhases > lambda12Upw(0.0);
563 lambda12Upw[wPhaseIdx] = (potentialDiffW12 >= 0) ? lambda1[wPhaseIdx] : lambda2[wPhaseIdx];
564 lambda12Upw[nPhaseIdx] = (potentialDiffNw12 >= 0) ? lambda1[nPhaseIdx] : lambda2[nPhaseIdx];
567 Dune::FieldVector < Scalar, numPhases > lambda14Upw(0.0);
568 lambda14Upw[wPhaseIdx] = (potentialDiffW14 >= 0) ? lambda1[wPhaseIdx] : lambda4[wPhaseIdx];
569 lambda14Upw[nPhaseIdx] = (potentialDiffNw14 >= 0) ? lambda1[nPhaseIdx] : lambda4[nPhaseIdx];
572 Dune::FieldVector < Scalar, numPhases > lambda32Upw(0.0);
573 lambda32Upw[wPhaseIdx] = (potentialDiffW32 >= 0) ? lambda3[wPhaseIdx] : lambda2[wPhaseIdx];
574 lambda32Upw[nPhaseIdx] = (potentialDiffNw32 >= 0) ? lambda3[nPhaseIdx] : lambda2[nPhaseIdx];
577 Dune::FieldVector < Scalar, numPhases > lambda34Upw(0.0);
578 lambda34Upw[wPhaseIdx] = (potentialDiffW34 >= 0) ? lambda3[wPhaseIdx] : lambda4[wPhaseIdx];
579 lambda34Upw[nPhaseIdx] = (potentialDiffNw34 >= 0) ? lambda3[nPhaseIdx] : lambda4[nPhaseIdx];
581 for (
int i = 0; i < numPhases; i++)
584 DimVector vel12 = interactionVolume.
getNormal(0, 0);
585 DimVector vel14 = interactionVolume.
getNormal(3, 0);
586 DimVector vel23 = interactionVolume.
getNormal(1, 0);
587 DimVector vel21 = interactionVolume.
getNormal(0, 0);
588 DimVector vel34 = interactionVolume.
getNormal(2, 0);
589 DimVector vel32 = interactionVolume.
getNormal(1, 0);
590 DimVector vel41 = interactionVolume.
getNormal(3, 0);
591 DimVector vel43 = interactionVolume.
getNormal(2, 0);
593 Dune::FieldVector < Scalar, 2 * dim > flux(0);
608 vel12 *= flux[0] / (2 * interactionVolume.
getFaceArea(0, 0));
609 vel14 *= flux[3] / (2 * interactionVolume.
getFaceArea(0, 1));
610 vel23 *= flux[1] / (2 * interactionVolume.
getFaceArea(1, 0));
611 vel21 *= flux[0] / (2 * interactionVolume.
getFaceArea(1, 1));
612 vel34 *= flux[2] / (2 * interactionVolume.
getFaceArea(2, 0));
613 vel32 *= flux[1] / (2 * interactionVolume.
getFaceArea(2, 1));
614 vel41 *= flux[3] / (2 * interactionVolume.
getFaceArea(3, 0));
615 vel43 *= flux[2] / (2 * interactionVolume.
getFaceArea(3, 1));
621 else if (level2 < level1)
629 else if (level3 < level2)
637 else if (level4 < level3)
645 else if (level1 < level4)
650 Scalar lambdaT12 = lambda12Upw[wPhaseIdx] + lambda12Upw[nPhaseIdx];
651 Scalar lambdaT14 = lambda14Upw[wPhaseIdx] + lambda14Upw[nPhaseIdx];
652 Scalar lambdaT32 = lambda32Upw[wPhaseIdx] + lambda32Upw[nPhaseIdx];
653 Scalar lambdaT34 = lambda34Upw[wPhaseIdx] + lambda34Upw[nPhaseIdx];
654 Scalar fracFlow12 = (lambdaT12 > threshold_) ? lambda12Upw[i] / (lambdaT12) : 0.0;
655 Scalar fracFlow14 = (lambdaT14 > threshold_) ? lambda14Upw[i] / (lambdaT14) : 0.0;
656 Scalar fracFlow32 = (lambdaT32 > threshold_) ? lambda32Upw[i] / (lambdaT32) : 0.0;
657 Scalar fracFlow34 = (lambdaT34 > threshold_) ? lambda34Upw[i] / (lambdaT34) : 0.0;
668 if (innerBoundaryVolumeFaces[eIdxGlobal1][interactionVolume.
getIndexOnElement(0, 0)])
672 if (innerBoundaryVolumeFaces[eIdxGlobal1][interactionVolume.
getIndexOnElement(0, 1)])
676 if (innerBoundaryVolumeFaces[eIdxGlobal2][interactionVolume.
getIndexOnElement(1, 0)])
680 if (innerBoundaryVolumeFaces[eIdxGlobal2][interactionVolume.
getIndexOnElement(1, 1)])
684 if (innerBoundaryVolumeFaces[eIdxGlobal3][interactionVolume.
getIndexOnElement(2, 0)])
688 if (innerBoundaryVolumeFaces[eIdxGlobal3][interactionVolume.
getIndexOnElement(2, 1)])
692 if (innerBoundaryVolumeFaces[eIdxGlobal4][interactionVolume.
getIndexOnElement(3, 0)])
696 if (innerBoundaryVolumeFaces[eIdxGlobal4][interactionVolume.
getIndexOnElement(3, 1)])
702 cellData1.fluxData().addVelocity(i, interactionVolume.
getIndexOnElement(0, 0), vel12);
703 cellData1.fluxData().addVelocity(i, interactionVolume.
getIndexOnElement(0, 1), vel14);
704 cellData2.fluxData().addVelocity(i, interactionVolume.
getIndexOnElement(1, 0), vel23);
705 cellData2.fluxData().addVelocity(i, interactionVolume.
getIndexOnElement(1, 1), vel21);
706 cellData3.fluxData().addVelocity(i, interactionVolume.
getIndexOnElement(2, 0), vel34);
707 cellData3.fluxData().addVelocity(i, interactionVolume.
getIndexOnElement(2, 1), vel32);
708 cellData4.fluxData().addVelocity(i, interactionVolume.
getIndexOnElement(3, 0), vel41);
709 cellData4.fluxData().addVelocity(i, interactionVolume.
getIndexOnElement(3, 1), vel43);
712 cellData1.fluxData().setVelocityMarker(interactionVolume.
getIndexOnElement(0, 0));
713 cellData1.fluxData().setVelocityMarker(interactionVolume.
getIndexOnElement(0, 1));
714 cellData2.fluxData().setVelocityMarker(interactionVolume.
getIndexOnElement(1, 0));
715 cellData2.fluxData().setVelocityMarker(interactionVolume.
getIndexOnElement(1, 1));
716 cellData3.fluxData().setVelocityMarker(interactionVolume.
getIndexOnElement(2, 0));
717 cellData3.fluxData().setVelocityMarker(interactionVolume.
getIndexOnElement(2, 1));
718 cellData4.fluxData().setVelocityMarker(interactionVolume.
getIndexOnElement(3, 0));
719 cellData4.fluxData().setVelocityMarker(interactionVolume.
getIndexOnElement(3, 1));
731template<
class TypeTag>
733 CellData& cellData,
int elemIdx)
738 const GlobalPosition& globalPos = element.geometry().center();
741 DimMatrix
permeability(problem_.spatialParams().intrinsicPermeability(element));
744 Dune::FieldVector < Scalar, numPhases > lambda(cellData.mobility(wPhaseIdx));
745 lambda[nPhaseIdx] = cellData.mobility(nPhaseIdx);
747 for (
int fIdx = 0; fIdx < dim; fIdx++)
757 const auto refElement = referenceElement(element);
759 const LocalPosition& localPos = refElement.position(boundaryFaceIdx, 1);
761 const GlobalPosition& globalPosFace = element.geometry().global(localPos);
763 DimVector distVec(globalPosFace - globalPos);
764 Scalar dist = distVec.two_norm();
765 DimVector unitDistVec(distVec);
769 Scalar satWBound = cellData.saturation(wPhaseIdx);
774 switch (saturationType_)
778 satWBound = satBound;
783 satWBound = 1 - satBound;
793 const auto fluidMatrixInteraction = Deprecated::makePcKrSw(Scalar{}, problem_.spatialParams(), element);
795 Scalar pcBound = fluidMatrixInteraction.pc(satWBound);
797 Scalar gravityDiffBound = (problem_.bBoxMax() - globalPosFace) * gravity_
798 * (density_[nPhaseIdx] - density_[wPhaseIdx]);
800 pcBound += gravityDiffBound;
802 Dune::FieldVector <Scalar, numPhases> lambdaBound(fluidMatrixInteraction.krw(satWBound));
803 lambdaBound[nPhaseIdx] = fluidMatrixInteraction.krn(satWBound);
804 lambdaBound[wPhaseIdx] /= viscosity_[wPhaseIdx];
805 lambdaBound[nPhaseIdx] /= viscosity_[nPhaseIdx];
807 Scalar gdeltaZ = (problem_.bBoxMax()-globalPosFace) * gravity_;
808 Scalar potentialBoundW = interactionVolume.
getDirichletValues(intVolFaceIdx)[pressureIdx] + density_[wPhaseIdx]*gdeltaZ;
809 Scalar potentialBoundNw = potentialBoundW;
812 switch (pressureType_)
816 potentialBoundNw += pcBound;
822 potentialBoundW -= pcBound;
827 Scalar potentialDiffW = (cellData.potential(wPhaseIdx) - potentialBoundW) / dist;
828 Scalar potentialDiffNw = (cellData.potential(nPhaseIdx) - potentialBoundNw) / dist;
831 cellData.fluxData().addUpwindPotential(wPhaseIdx, boundaryFaceIdx, potentialDiffW);
832 cellData.fluxData().addUpwindPotential(nPhaseIdx, boundaryFaceIdx, potentialDiffNw);
835 DimVector velocityW(0);
836 DimVector velocityNw(0);
839 DimVector pressGradient = unitDistVec;
840 pressGradient *= (cellData.potential(wPhaseIdx) - potentialBoundW) / dist;
843 pressGradient = unitDistVec;
844 pressGradient *= (cellData.potential(nPhaseIdx) - potentialBoundNw) / dist;
847 velocityW *= (potentialDiffW >= 0.) ? lambda[wPhaseIdx] : lambdaBound[wPhaseIdx];
848 velocityNw *= (potentialDiffNw >= 0.) ? lambda[nPhaseIdx] : lambdaBound[nPhaseIdx];
855 velocityW += cellData.fluxData().velocity(wPhaseIdx, boundaryFaceIdx);
856 velocityNw += cellData.fluxData().velocity(nPhaseIdx, boundaryFaceIdx);
857 cellData.fluxData().setVelocity(wPhaseIdx, boundaryFaceIdx, velocityW);
858 cellData.fluxData().setVelocity(nPhaseIdx, boundaryFaceIdx, velocityNw);
859 cellData.fluxData().setVelocityMarker(boundaryFaceIdx);
865 const auto refElement = referenceElement(element);
867 const LocalPosition& localPos = refElement.position(boundaryFaceIdx, 1);
869 const GlobalPosition& globalPosFace = element.geometry().global(localPos);
871 DimVector distVec(globalPosFace - globalPos);
872 Scalar dist = distVec.two_norm();
873 DimVector unitDistVec(distVec);
877 PrimaryVariables boundValues(interactionVolume.
getNeumannValues(intVolFaceIdx));
879 boundValues[wPhaseIdx] /= density_[wPhaseIdx];
880 boundValues[nPhaseIdx] /= density_[nPhaseIdx];
882 DimVector velocityW(unitDistVec);
883 DimVector velocityNw(unitDistVec);
885 velocityW *= boundValues[wPhaseIdx] / (2 * interactionVolume.
getFaceArea(elemIdx, fIdx));
886 velocityNw *= boundValues[nPhaseIdx]
887 / (2 * interactionVolume.
getFaceArea(elemIdx, fIdx));
890 cellData.fluxData().addUpwindPotential(wPhaseIdx, boundaryFaceIdx, boundValues[wPhaseIdx]);
891 cellData.fluxData().addUpwindPotential(nPhaseIdx, boundaryFaceIdx, boundValues[nPhaseIdx]);
894 velocityW += cellData.fluxData().velocity(wPhaseIdx, boundaryFaceIdx);
895 velocityNw += cellData.fluxData().velocity(nPhaseIdx, boundaryFaceIdx);
896 cellData.fluxData().setVelocity(wPhaseIdx, boundaryFaceIdx, velocityW);
897 cellData.fluxData().setVelocity(nPhaseIdx, boundaryFaceIdx, velocityNw);
898 cellData.fluxData().setVelocityMarker(boundaryFaceIdx);
902 DUNE_THROW(Dune::NotImplemented,
903 "No valid boundary condition type defined for pressure equation!");
Provides methods for transmissibility calculation 2-d.
Class including the information of an interaction volume of a MPFA L-method that does not change with...
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type GetProp
get the type of a property (equivalent to old macro GET_PROP(...))
Definition: propertysystem.hh:140
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 viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:74
std::string permeability() noexcept
I/O name of permeability.
Definition: name.hh:143
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
bool isNeumann(unsigned eqIdx) const
Returns true if an equation is used to specify a Neumann condition.
Definition: common/boundarytypes.hh:273
bool isDirichlet(unsigned eqIdx) const
Returns true if an equation is used to specify a Dirichlet condition.
Definition: common/boundarytypes.hh:236
Provides methods for transmissibility calculation in 2-d.
Definition: 2dtransmissibilitycalculator.hh:44
Class for calculating 2-d velocities from cell-wise constant pressure values.
Definition: lmethod/2dvelocity.hh:60
Scalar viscosity_[numPhases]
Definition: lmethod/2dvelocity.hh:250
void addOutputVtkFields(MultiWriter &writer)
Adds velocity output to the output file.
Definition: lmethod/2dvelocity.hh:176
const GravityVector & gravity_
Definition: lmethod/2dvelocity.hh:247
int vtkOutputLevel_
Definition: lmethod/2dvelocity.hh:252
void calculateBoundaryInteractionVolumeVelocity(InteractionVolume &interactionVolume, CellData &cellData, int elemIdx)
Calculates the velocity at a boundary flux faces.
Definition: lmethod/2dvelocity.hh:732
void initialize()
Initializes the velocity model.
Definition: lmethod/2dvelocity.hh:148
static const int velocityType_
gives kind of velocity used ( , , )
Definition: lmethod/2dvelocity.hh:256
static const int saturationType_
gives kind of saturation used ( , )
Definition: lmethod/2dvelocity.hh:260
TransmissibilityCalculator transmissibilityCalculator_
Definition: lmethod/2dvelocity.hh:245
void calculateInnerInteractionVolumeVelocity(InteractionVolume &interactionVolume, CellData &cellData1, CellData &cellData2, CellData &cellData3, CellData &cellData4, InnerBoundaryVolumeFaces &innerBoundaryVolumeFaces)
Calculate velocities for flux faces of an interaction volume.
Definition: lmethod/2dvelocity.hh:278
static const int pressureType_
gives kind of pressure used ( , , )
Definition: lmethod/2dvelocity.hh:258
Scalar density_[numPhases]
Definition: lmethod/2dvelocity.hh:249
static constexpr Scalar threshold_
Definition: lmethod/2dvelocity.hh:254
FvMpfaL2dVelocity2p(Problem &problem)
Constructs a FvMpfaL2dVelocity2p object.
Definition: lmethod/2dvelocity.hh:129
Class including the information of an interaction volume of a MPFA L-method that does not change with...
Definition: linteractionvolume.hh:41
int getIndexOnElement(int subVolumeIdx, int subVolumeFaceIdx)
Map from local interaction volume numbering to numbering of the Dune reference element.
Definition: linteractionvolume.hh:258
DimVector & getNormal(int subVolumeIdx, int subVolumeFaceIdxInInside)
Get a flux face normal.
Definition: linteractionvolume.hh:364
Element getSubVolumeElement(int subVolumeIdx)
Get an element of the interaction volume.
Definition: linteractionvolume.hh:281
BoundaryTypes & getBoundaryType(int subVolumeFaceIdx)
Get boundary condtion types for a flux face.
Definition: linteractionvolume.hh:292
Scalar & getFaceArea(int subVolumeIdx, int subVolumeFaceIdxInInside)
Get a flux face area.
Definition: linteractionvolume.hh:388
PrimaryVariables & getNeumannValues(int subVolumeFaceIdx)
Get the Neumann boundary condtions for a flux face.
Definition: linteractionvolume.hh:352
bool isBoundaryFace(int subVolumeFaceIdx)
Returns true if an interaction volume flux face is a boundary face.
Definition: linteractionvolume.hh:330
int getFaceIndexFromSubVolume(int subVolumeIdx, int subVolumeFaceIdx)
Map from local interaction volume numbering on element to numbering on interaction volume.
Definition: linteractionvolume.hh:270
PrimaryVariables & getDirichletValues(int subVolumeFaceIdx)
Get the Dirichlet boundary condtions for a flux face.
Definition: linteractionvolume.hh:341
Specifies the properties for immiscible 2p diffusion/pressure models.
Properties for a MPFA method.