27#ifndef DUMUX_FVMPFAL2PFABOUND3DPRESSURE2P_ADAPTIVE_HH
28#define DUMUX_FVMPFAL2PFABOUND3DPRESSURE2P_ADAPTIVE_HH
76template<
class TypeTag>
85 dim = GridView::dimension, dimWorld = GridView::dimensionworld
92 using MaterialLaw =
typename SpatialParams::MaterialLaw;
103 using PrimaryVariables =
typename SolutionTypes::PrimaryVariables;
104 using ScalarSolutionType =
typename SolutionTypes::ScalarSolution;
108 pw = Indices::pressureW,
109 pn = Indices::pressureNw,
110 pGlobal = Indices::pressureGlobal,
111 sw = Indices::saturationW,
112 sn = Indices::saturationNw,
113 vw = Indices::velocityW,
114 vn = Indices::velocityNw,
115 vt = Indices::velocityTotal
119 wPhaseIdx = Indices::wPhaseIdx,
120 nPhaseIdx = Indices::nPhaseIdx,
121 pressureIdx = Indices::pressureIdx,
122 saturationIdx = Indices::saturationIdx,
123 pressureEqIdx = Indices::pressureEqIdx,
124 satEqIdx = Indices::satEqIdx,
125 numPhases = getPropValue<TypeTag, Properties::NumPhases>()
132 dirichletDirichlet = 1,
133 dirichletNeumann = 2,
142 using Element =
typename GridView::Traits::template Codim<0>::Entity;
143 using Grid =
typename GridView::Grid;
144 using Geometry =
typename Element::Geometry;
146 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
147 using GravityVector = Dune::FieldVector<Scalar, dimWorld>;
148 using DimMatrix = Dune::FieldMatrix<Scalar, dim, dim>;
150 using DimVector = Dune::FieldVector<Scalar, dim>;
179 const auto element = *problem_.gridView().template begin<0>();
180 FluidState fluidState;
181 fluidState.setPressure(wPhaseIdx, problem_.referencePressure(element));
182 fluidState.setPressure(nPhaseIdx, problem_.referencePressure(element));
183 fluidState.setTemperature(problem_.temperature(element));
184 fluidState.setSaturation(wPhaseIdx, 1.);
185 fluidState.setSaturation(nPhaseIdx, 0.);
197 int size = problem_.gridView().size(0);
199 if (problem_.gridAdapt().wasAdapted())
202 this->
A_.setSize(size, size);
203 this->
f_.resize(size);
208 asImp_().initializeMatrix();
220 gravity_(problem.gravity())
222 if (pressureType_ != pw && pressureType_ != pn)
224 DUNE_THROW(Dune::NotImplemented,
"Pressure type not supported!");
226 if (saturationType_ != sw && saturationType_ != sn)
228 DUNE_THROW(Dune::NotImplemented,
"Saturation type not supported!");
230 if (getPropValue<TypeTag, Properties::EnableCompressibility>())
232 DUNE_THROW(Dune::NotImplemented,
"Compressibility not supported!");
236 DUNE_THROW(Dune::NotImplemented,
"Dimension not supported!");
239 density_[wPhaseIdx] = 0.;
240 density_[nPhaseIdx] = 0.;
241 viscosity_[wPhaseIdx] = 0.;
242 viscosity_[nPhaseIdx] = 0.;
249 Implementation &asImp_()
250 {
return *
static_cast<Implementation *
>(
this);}
253 const Implementation &asImp_()
const
254 {
return *
static_cast<const Implementation *
>(
this);}
256 const GravityVector& gravity_;
258 Scalar density_[numPhases];
259 Scalar viscosity_[numPhases];
261 static constexpr Scalar threshold_ = 1e-15;
263 static const int pressureType_ = getPropValue<TypeTag, Properties::PressureFormulation>();
265 static const int saturationType_ = getPropValue<TypeTag, Properties::SaturationFormulation>();
267 static const int velocityType_ = getPropValue<TypeTag, Properties::VelocityFormulation>();
271template<
class TypeTag>
274 initializeMatrixRowSize();
275 this->A_.endrowsizes();
276 initializeMatrixIndices();
277 this->A_.endindices();
281template<
class TypeTag>
285 for (
const auto& element : elements(problem_.gridView()))
288 int globalIdxI = problem_.variables().index(element);
290 int levelI = element.level();
292 std::set<int> neighborIndices;
294 int numVertices = element.geometry().corners();
296 for (
int vIdxI = 0; vIdxI < numVertices; vIdxI++)
298 int vIdxIGlobal = problem_.variables().vertexMapper().subIndex(element, vIdxI, dim);
300 InteractionVolume& interactionVolume = this->interactionVolumes_.interactionVolume(vIdxIGlobal);
302 for (
int subVolumeIdx = 0; subVolumeIdx < InteractionVolume::subVolumeTotalNum; subVolumeIdx++)
304 if (interactionVolume.hasSubVolumeElement(subVolumeIdx))
306 auto neighbor = interactionVolume.getSubVolumeElement(subVolumeIdx);
307 int neighborIdx = problem_.variables().index(neighbor);
309 neighborIndices.insert(neighborIdx);
311 if (!interactionVolume.sameLevel())
313 if (neighbor.level() == levelI + 2)
315 for (
int vIdxJ = 0; vIdxJ < numVertices; vIdxJ++)
317 int vIdxJGlobal = problem_.variables().vertexMapper().subIndex(neighbor, vIdxJ, dim);
319 if (vIdxJGlobal != vIdxIGlobal)
322 = this->interactionVolumes_.interactionVolume(vIdxJGlobal);
324 if (interactionVolumeJ.isHangingNodeVolume())
326 std::set<int> neighborIndicesJ;
327 bool additionalEntries =
false;
329 for (
int subVolumeIdxJ = 0;
330 subVolumeIdxJ < InteractionVolume::subVolumeTotalNum; subVolumeIdxJ++)
332 if (interactionVolumeJ.hasSubVolumeElement(subVolumeIdxJ))
334 int globalIdxJJ = problem_.variables().index(interactionVolumeJ.getSubVolumeElement(subVolumeIdxJ));
336 neighborIndicesJ.insert(globalIdxJJ);
338 if (globalIdxI == globalIdxJJ)
340 additionalEntries =
true;
345 if (additionalEntries)
347 neighborIndices.insert(neighborIndicesJ.begin(), neighborIndicesJ.end());
358 this->A_.setrowsize(globalIdxI, neighborIndices.size());
365template<
class TypeTag>
369 for (
const auto& element : elements(problem_.gridView()))
372 int globalIdxI = problem_.variables().index(element);
374 int levelI = element.level();
377 this->A_.addindex(globalIdxI, globalIdxI);
379 int numVertices = element.geometry().corners();
381 for (
int vIdx = 0; vIdx < numVertices; vIdx++)
383 int vIdxGlobal = problem_.variables().vertexMapper().subIndex(element, vIdx, dim);
385 InteractionVolume& interactionVolume = this->interactionVolumes_.interactionVolume(vIdxGlobal);
386 for (
int subVolumeIdx = 0; subVolumeIdx < InteractionVolume::subVolumeTotalNum; subVolumeIdx++)
388 if (interactionVolume.hasSubVolumeElement(subVolumeIdx))
390 auto neighbor = interactionVolume.getSubVolumeElement(subVolumeIdx);
391 int globalIdxJ = problem_.variables().index(neighbor);
393 this->A_.addindex(globalIdxI, globalIdxJ);
395 if (interactionVolume.isHangingNodeVolume() && interactionVolume.getHangingNodeType() ==
396 InteractionVolume::sixSmallCells && !interactionVolume.sameLevel())
398 if (neighbor.level() == levelI-2)
400 this->A_.addindex(globalIdxJ, globalIdxI);
412template<
class TypeTag>
420 for (
const auto& vertex : vertices(problem_.gridView()))
423 if (vertex.partitionType() != Dune::InteriorEntity && vertex.partitionType() != Dune::BorderEntity)
428 int vIdxGlobal = problem_.variables().index(vertex);
430 InteractionVolume& interactionVolume = this->interactionVolumes_.interactionVolume(vIdxGlobal);
433 if (interactionVolume.isInnerVolume())
435 if (!interactionVolume.isHangingNodeVolume())
437 this->assembleInnerInteractionVolume(interactionVolume);
441 assembleHangingNodeInteractionVolume(interactionVolume);
447 this->assembleBoundaryInteractionVolume(interactionVolume);
456template<
class TypeTag>
459 auto element1 = interactionVolume.getSubVolumeElement(0);
460 auto element2 = interactionVolume.getSubVolumeElement(1);
461 auto element3 = interactionVolume.getSubVolumeElement(2);
462 auto element4 = interactionVolume.getSubVolumeElement(3);
463 auto element5 = interactionVolume.getSubVolumeElement(4);
464 auto element6 = interactionVolume.getSubVolumeElement(5);
465 auto element7 = interactionVolume.getSubVolumeElement(6);
466 auto element8 = interactionVolume.getSubVolumeElement(7);
469 const GlobalPosition& globalPos1 = element1.geometry().center();
470 const GlobalPosition& globalPos2 = element2.geometry().center();
471 const GlobalPosition& globalPos3 = element3.geometry().center();
472 const GlobalPosition& globalPos4 = element4.geometry().center();
473 const GlobalPosition& globalPos5 = element5.geometry().center();
474 const GlobalPosition& globalPos6 = element6.geometry().center();
475 const GlobalPosition& globalPos7 = element7.geometry().center();
476 const GlobalPosition& globalPos8 = element8.geometry().center();
479 Scalar volume1 = element1.geometry().volume();
480 Scalar volume2 = element2.geometry().volume();
481 Scalar volume3 = element3.geometry().volume();
482 Scalar volume4 = element4.geometry().volume();
483 Scalar volume5 = element5.geometry().volume();
484 Scalar volume6 = element6.geometry().volume();
485 Scalar volume7 DUNE_UNUSED = element7.geometry().volume();
486 Scalar volume8 DUNE_UNUSED = element8.geometry().volume();
489 int globalIdx1 = problem_.variables().index(element1);
490 int globalIdx2 = problem_.variables().index(element2);
491 int globalIdx3 = problem_.variables().index(element3);
492 int globalIdx4 = problem_.variables().index(element4);
493 int globalIdx5 = problem_.variables().index(element5);
494 int globalIdx6 = problem_.variables().index(element6);
495 int globalIdx7 = problem_.variables().index(element7);
496 int globalIdx8 = problem_.variables().index(element8);
499 CellData& cellData1 = problem_.variables().cellData(globalIdx1);
500 CellData& cellData2 = problem_.variables().cellData(globalIdx2);
501 CellData& cellData3 = problem_.variables().cellData(globalIdx3);
502 CellData& cellData4 = problem_.variables().cellData(globalIdx4);
503 CellData& cellData5 = problem_.variables().cellData(globalIdx5);
504 CellData& cellData6 = problem_.variables().cellData(globalIdx6);
505 CellData& cellData7 = problem_.variables().cellData(globalIdx7);
506 CellData& cellData8 = problem_.variables().cellData(globalIdx8);
509 Dune::FieldVector<Scalar, numPhases> lambda1(cellData1.mobility(wPhaseIdx));
510 lambda1[nPhaseIdx] = cellData1.mobility(nPhaseIdx);
513 Scalar lambdaTotal1 = lambda1[wPhaseIdx] + lambda1[nPhaseIdx];
516 Dune::FieldVector<Scalar, numPhases> lambda2(cellData2.mobility(wPhaseIdx));
517 lambda2[nPhaseIdx] = cellData2.mobility(nPhaseIdx);
520 Scalar lambdaTotal2 = lambda2[wPhaseIdx] + lambda2[nPhaseIdx];
523 Dune::FieldVector<Scalar, numPhases> lambda3(cellData3.mobility(wPhaseIdx));
524 lambda3[nPhaseIdx] = cellData3.mobility(nPhaseIdx);
527 Scalar lambdaTotal3 = lambda3[wPhaseIdx] + lambda3[nPhaseIdx];
530 Dune::FieldVector<Scalar, numPhases> lambda4(cellData4.mobility(wPhaseIdx));
531 lambda4[nPhaseIdx] = cellData4.mobility(nPhaseIdx);
534 Scalar lambdaTotal4 = lambda4[wPhaseIdx] + lambda4[nPhaseIdx];
537 Dune::FieldVector<Scalar, numPhases> lambda5(cellData5.mobility(wPhaseIdx));
538 lambda5[nPhaseIdx] = cellData5.mobility(nPhaseIdx);
541 Scalar lambdaTotal5 = lambda5[wPhaseIdx] + lambda5[nPhaseIdx];
544 Dune::FieldVector<Scalar, numPhases> lambda6(cellData6.mobility(wPhaseIdx));
545 lambda6[nPhaseIdx] = cellData6.mobility(nPhaseIdx);
548 Scalar lambdaTotal6 = lambda6[wPhaseIdx] + lambda6[nPhaseIdx];
551 Dune::FieldVector<Scalar, numPhases> lambda7(cellData7.mobility(wPhaseIdx));
552 lambda7[nPhaseIdx] = cellData7.mobility(nPhaseIdx);
555 Scalar lambdaTotal7 = lambda7[wPhaseIdx] + lambda7[nPhaseIdx];
558 Dune::FieldVector<Scalar, numPhases> lambda8(cellData8.mobility(wPhaseIdx));
559 lambda8[nPhaseIdx] = cellData8.mobility(nPhaseIdx);
562 Scalar lambdaTotal8 = lambda8[wPhaseIdx] + lambda8[nPhaseIdx];
564 std::vector<DimVector> lambda(8);
565 lambda[0][0] = lambdaTotal1;
566 lambda[0][1] = lambdaTotal1;
567 lambda[0][2] = lambdaTotal1;
568 lambda[1][0] = lambdaTotal2;
569 lambda[1][1] = lambdaTotal2;
570 lambda[1][2] = lambdaTotal2;
571 lambda[2][0] = lambdaTotal3;
572 lambda[2][1] = lambdaTotal3;
573 lambda[2][2] = lambdaTotal3;
574 lambda[3][0] = lambdaTotal4;
575 lambda[3][1] = lambdaTotal4;
576 lambda[3][2] = lambdaTotal4;
577 lambda[4][0] = lambdaTotal5;
578 lambda[4][1] = lambdaTotal5;
579 lambda[4][2] = lambdaTotal5;
580 lambda[5][0] = lambdaTotal6;
581 lambda[5][1] = lambdaTotal6;
582 lambda[5][2] = lambdaTotal6;
583 lambda[6][0] = lambdaTotal7;
584 lambda[6][1] = lambdaTotal7;
585 lambda[6][2] = lambdaTotal7;
586 lambda[7][0] = lambdaTotal8;
587 lambda[7][1] = lambdaTotal8;
588 lambda[7][2] = lambdaTotal8;
592 Dune::FieldVector<Scalar, 8> pc(0);
593 pc[0] = cellData1.capillaryPressure();
594 pc[1] = cellData2.capillaryPressure();
595 pc[2] = cellData3.capillaryPressure();
596 pc[3] = cellData4.capillaryPressure();
597 pc[4] = cellData5.capillaryPressure();
598 pc[5] = cellData6.capillaryPressure();
599 pc[6] = cellData7.capillaryPressure();
600 pc[7] = cellData8.capillaryPressure();
602 Dune::FieldVector<Scalar, 8> gravityDiff(0);
606 gravityDiff[0] = (problem_.bBoxMax() - globalPos1) * gravity_ * (density_[nPhaseIdx] - density_[wPhaseIdx]);
607 gravityDiff[1] = (problem_.bBoxMax() - globalPos2) * gravity_ * (density_[nPhaseIdx] - density_[wPhaseIdx]);
608 gravityDiff[2] = (problem_.bBoxMax() - globalPos3) * gravity_ * (density_[nPhaseIdx] - density_[wPhaseIdx]);
609 gravityDiff[3] = (problem_.bBoxMax() - globalPos4) * gravity_ * (density_[nPhaseIdx] - density_[wPhaseIdx]);
610 gravityDiff[4] = (problem_.bBoxMax() - globalPos5) * gravity_ * (density_[nPhaseIdx] - density_[wPhaseIdx]);
611 gravityDiff[5] = (problem_.bBoxMax() - globalPos6) * gravity_ * (density_[nPhaseIdx] - density_[wPhaseIdx]);
612 gravityDiff[6] = (problem_.bBoxMax() - globalPos7) * gravity_ * (density_[nPhaseIdx] - density_[wPhaseIdx]);
613 gravityDiff[7] = (problem_.bBoxMax() - globalPos8) * gravity_ * (density_[nPhaseIdx] - density_[wPhaseIdx]);
617 Dune::FieldVector<Dune::FieldVector<Scalar, 3>, 8> pcFlux(Dune::FieldVector<Scalar, 3>(0));
619 Scalar pcPotential0 = 0;
620 Scalar pcPotential1 = 0;
621 Scalar pcPotential2 = 0;
622 Scalar pcPotential3 = 0;
623 Scalar pcPotential4 = 0;
624 Scalar pcPotential5 = 0;
625 Scalar pcPotential6 = 0;
626 Scalar pcPotential7 = 0;
627 Scalar pcPotential8 = 0;
628 Scalar pcPotential9 = 0;
629 Scalar pcPotential10 = 0;
630 Scalar pcPotential11 = 0;
632 int hangingNodeType = interactionVolume.getHangingNodeType();
634 if (hangingNodeType == InteractionVolume::twoSmallCells)
637 PrimaryVariables source(0.0);
638 problem_.source(source, element1);
639 this->f_[globalIdx1] += volume1 / (8.0)
640 * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]);
641 problem_.source(source, element2);
642 this->f_[globalIdx2] += volume2 / (8.0)
643 * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]);
645 this->f_[globalIdx1] += this->evaluateErrorTerm(cellData1) * volume1 / (8.0);
646 this->f_[globalIdx2] += this->evaluateErrorTerm(cellData2) * volume2 / (8.0);
648 else if (hangingNodeType == InteractionVolume::fourSmallCellsEdge
649 || hangingNodeType == InteractionVolume::fourSmallCellsFace)
652 PrimaryVariables source(0.0);
653 problem_.source(source, element1);
654 this->f_[globalIdx1] += volume1 / (8.0)
655 * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]);
656 problem_.source(source, element2);
657 this->f_[globalIdx2] += volume2 / (8.0)
658 * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]);
659 problem_.source(source, element3);
660 this->f_[globalIdx3] += volume3 / (8.0)
661 * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]);
662 problem_.source(source, element4);
663 this->f_[globalIdx4] += volume4 / (8.0)
664 * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]);
666 this->f_[globalIdx1] += this->evaluateErrorTerm(cellData1) * volume1 / (8.0);
667 this->f_[globalIdx2] += this->evaluateErrorTerm(cellData2) * volume2 / (8.0);
668 this->f_[globalIdx3] += this->evaluateErrorTerm(cellData3) * volume3 / (8.0);
669 this->f_[globalIdx4] += this->evaluateErrorTerm(cellData4) * volume4 / (8.0);
671 else if (hangingNodeType == InteractionVolume::sixSmallCells)
674 PrimaryVariables source(0.0);
675 problem_.source(source, element1);
676 this->f_[globalIdx1] += volume1 / (8.0)
677 * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]);
678 problem_.source(source, element2);
679 this->f_[globalIdx2] += volume2 / (8.0)
680 * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]);
681 problem_.source(source, element3);
682 this->f_[globalIdx3] += volume3 / (8.0)
683 * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]);
684 problem_.source(source, element4);
685 this->f_[globalIdx4] += volume4 / (8.0)
686 * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]);
687 problem_.source(source, element4);
688 this->f_[globalIdx5] += volume5 / (8.0)
689 * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]);
690 problem_.source(source, element6);
691 this->f_[globalIdx6] += volume6 / (8.0)
692 * (source[wPhaseIdx] / density_[wPhaseIdx] + source[nPhaseIdx] / density_[nPhaseIdx]);
694 this->f_[globalIdx1] += this->evaluateErrorTerm(cellData1) * volume1 / (8.0);
695 this->f_[globalIdx2] += this->evaluateErrorTerm(cellData2) * volume2 / (8.0);
696 this->f_[globalIdx3] += this->evaluateErrorTerm(cellData3) * volume3 / (8.0);
697 this->f_[globalIdx4] += this->evaluateErrorTerm(cellData4) * volume4 / (8.0);
698 this->f_[globalIdx5] += this->evaluateErrorTerm(cellData5) * volume5 / (8.0);
699 this->f_[globalIdx6] += this->evaluateErrorTerm(cellData6) * volume6 / (8.0);
703 Dune::FieldVector<Scalar, 2 * dim - dim + 1> u(0);
706 Dune::FieldVector<bool, 4> useCases(
false);
709 int caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 0, 1, 2, 3, 4,
713 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx1, 0, 0);
714 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx2, 1, 1);
718 this->A_[globalIdx1][globalIdx1] += T[0][0];
719 this->A_[globalIdx1][globalIdx2] += T[0][1];
720 this->A_[globalIdx1][globalIdx3] += T[0][2];
721 this->A_[globalIdx1][globalIdx5] += T[0][3];
723 this->A_[globalIdx2][globalIdx1] -= TSecond[0][0];
724 this->A_[globalIdx2][globalIdx2] -= TSecond[0][1];
725 this->A_[globalIdx2][globalIdx3] -= TSecond[0][2];
726 this->A_[globalIdx2][globalIdx5] -= TSecond[0][3];
735 pcFlux[0][0] = Tu[0];
736 pcPotential0 = Tu[0];
743 this->A_[globalIdx1][globalIdx1] += T[0][0];
744 this->A_[globalIdx1][globalIdx2] += T[0][1];
745 this->A_[globalIdx1][globalIdx4] += T[0][2];
746 this->A_[globalIdx1][globalIdx6] += T[0][3];
748 this->A_[globalIdx2][globalIdx1] -= TSecond[0][0];
749 this->A_[globalIdx2][globalIdx2] -= TSecond[0][1];
750 this->A_[globalIdx2][globalIdx4] -= TSecond[0][2];
751 this->A_[globalIdx2][globalIdx6] -= TSecond[0][3];
759 pcFlux[0][0] = Tu[0];
760 pcPotential0 = Tu[0];
767 this->A_[globalIdx1][globalIdx1] += T[0][0];
768 this->A_[globalIdx1][globalIdx2] += T[0][1];
769 this->A_[globalIdx1][globalIdx4] += T[0][2];
770 this->A_[globalIdx1][globalIdx5] += T[0][3];
772 this->A_[globalIdx2][globalIdx1] -= TSecond[0][0];
773 this->A_[globalIdx2][globalIdx2] -= TSecond[0][1];
774 this->A_[globalIdx2][globalIdx4] -= TSecond[0][2];
775 this->A_[globalIdx2][globalIdx5] -= TSecond[0][3];
783 pcFlux[0][0] = Tu[0];
784 pcPotential0 = Tu[0];
791 this->A_[globalIdx1][globalIdx1] += T[0][0];
792 this->A_[globalIdx1][globalIdx2] += T[0][1];
793 this->A_[globalIdx1][globalIdx3] += T[0][2];
794 this->A_[globalIdx1][globalIdx6] += T[0][3];
796 this->A_[globalIdx2][globalIdx1] -= TSecond[0][0];
797 this->A_[globalIdx2][globalIdx2] -= TSecond[0][1];
798 this->A_[globalIdx2][globalIdx3] -= TSecond[0][2];
799 this->A_[globalIdx2][globalIdx6] -= TSecond[0][3];
807 pcFlux[0][0] = Tu[0];
808 pcPotential0 = Tu[0];
817 if (hangingNodeType == InteractionVolume::twoSmallCells
818 || hangingNodeType == InteractionVolume::fourSmallCellsDiag)
824 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 1, 3, 0,
829 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 1, 3, 0,
834 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx2, 1, 0);
835 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx4, 3, 1);
840 this->A_[globalIdx2][globalIdx2] += T[0][0];
841 this->A_[globalIdx2][globalIdx4] += T[0][1];
842 this->A_[globalIdx2][globalIdx1] += T[0][2];
843 this->A_[globalIdx2][globalIdx6] += T[0][3];
845 this->A_[globalIdx4][globalIdx2] -= TSecond[0][0];
846 this->A_[globalIdx4][globalIdx4] -= TSecond[0][1];
847 this->A_[globalIdx4][globalIdx1] -= TSecond[0][2];
848 this->A_[globalIdx4][globalIdx6] -= TSecond[0][3];
856 pcFlux[1][0] = Tu[0];
857 pcPotential1 = Tu[0];
860 pcFlux[3][1] = Tu[0];
865 this->A_[globalIdx2][globalIdx2] += T[0][0];
866 this->A_[globalIdx2][globalIdx4] += T[0][1];
867 this->A_[globalIdx2][globalIdx3] += T[0][2];
868 this->A_[globalIdx2][globalIdx8] += T[0][3];
870 this->A_[globalIdx4][globalIdx2] -= TSecond[0][0];
871 this->A_[globalIdx4][globalIdx4] -= TSecond[0][1];
872 this->A_[globalIdx4][globalIdx3] -= TSecond[0][2];
873 this->A_[globalIdx4][globalIdx8] -= TSecond[0][3];
881 pcFlux[1][0] = Tu[0];
882 pcPotential1 = Tu[0];
885 pcFlux[3][1] = Tu[0];
889 this->A_[globalIdx2][globalIdx2] += T[0][0];
890 this->A_[globalIdx2][globalIdx4] += T[0][1];
891 this->A_[globalIdx2][globalIdx3] += T[0][2];
892 this->A_[globalIdx2][globalIdx6] += T[0][3];
894 this->A_[globalIdx4][globalIdx2] -= TSecond[0][0];
895 this->A_[globalIdx4][globalIdx4] -= TSecond[0][1];
896 this->A_[globalIdx4][globalIdx3] -= TSecond[0][2];
897 this->A_[globalIdx4][globalIdx6] -= TSecond[0][3];
905 pcFlux[1][0] = Tu[0];
906 pcPotential1 = Tu[0];
909 pcFlux[3][1] = Tu[0];
913 this->A_[globalIdx2][globalIdx2] += T[0][0];
914 this->A_[globalIdx2][globalIdx4] += T[0][1];
915 this->A_[globalIdx2][globalIdx1] += T[0][2];
916 this->A_[globalIdx2][globalIdx8] += T[0][3];
918 this->A_[globalIdx4][globalIdx2] -= TSecond[0][0];
919 this->A_[globalIdx4][globalIdx4] -= TSecond[0][1];
920 this->A_[globalIdx4][globalIdx1] -= TSecond[0][2];
921 this->A_[globalIdx4][globalIdx8] -= TSecond[0][3];
929 pcFlux[1][0] = Tu[0];
930 pcPotential1 = Tu[0];
933 pcFlux[3][1] = Tu[0];
939 if (hangingNodeType != InteractionVolume::twoSmallCells
940 && hangingNodeType != InteractionVolume::fourSmallCellsDiag)
942 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 3, 2, 1,
946 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx4, 3, 0);
947 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx3, 2, 1);
953 this->A_[globalIdx4][globalIdx4] += T[0][0];
954 this->A_[globalIdx4][globalIdx3] += T[0][1];
955 this->A_[globalIdx4][globalIdx2] += T[0][2];
956 this->A_[globalIdx4][globalIdx8] += T[0][3];
958 this->A_[globalIdx3][globalIdx4] -= TSecond[0][0];
959 this->A_[globalIdx3][globalIdx3] -= TSecond[0][1];
960 this->A_[globalIdx3][globalIdx2] -= TSecond[0][2];
961 this->A_[globalIdx3][globalIdx8] -= TSecond[0][3];
969 pcPotential2 = Tu[0];
970 pcFlux[3][0] = Tu[0];
973 pcFlux[2][1] = Tu[0];
977 this->A_[globalIdx4][globalIdx4] += T[0][0];
978 this->A_[globalIdx4][globalIdx3] += T[0][1];
979 this->A_[globalIdx4][globalIdx1] += T[0][2];
980 this->A_[globalIdx4][globalIdx7] += T[0][3];
982 this->A_[globalIdx3][globalIdx4] -= TSecond[0][0];
983 this->A_[globalIdx3][globalIdx3] -= TSecond[0][1];
984 this->A_[globalIdx3][globalIdx1] -= TSecond[0][2];
985 this->A_[globalIdx3][globalIdx7] -= TSecond[0][3];
993 pcPotential2 = Tu[0];
994 pcFlux[3][0] = Tu[0];
997 pcFlux[2][1] = Tu[0];
1001 this->A_[globalIdx4][globalIdx4] += T[0][0];
1002 this->A_[globalIdx4][globalIdx3] += T[0][1];
1003 this->A_[globalIdx4][globalIdx1] += T[0][2];
1004 this->A_[globalIdx4][globalIdx8] += T[0][3];
1006 this->A_[globalIdx3][globalIdx4] -= TSecond[0][0];
1007 this->A_[globalIdx3][globalIdx3] -= TSecond[0][1];
1008 this->A_[globalIdx3][globalIdx1] -= TSecond[0][2];
1009 this->A_[globalIdx3][globalIdx8] -= TSecond[0][3];
1017 pcPotential2 = Tu[0];
1018 pcFlux[3][0] = Tu[0];
1021 pcFlux[2][1] = Tu[0];
1025 this->A_[globalIdx4][globalIdx4] += T[0][0];
1026 this->A_[globalIdx4][globalIdx3] += T[0][1];
1027 this->A_[globalIdx4][globalIdx2] += T[0][2];
1028 this->A_[globalIdx4][globalIdx7] += T[0][3];
1030 this->A_[globalIdx3][globalIdx4] -= TSecond[0][0];
1031 this->A_[globalIdx3][globalIdx3] -= TSecond[0][1];
1032 this->A_[globalIdx3][globalIdx2] -= TSecond[0][2];
1033 this->A_[globalIdx3][globalIdx7] -= TSecond[0][3];
1041 pcPotential2 = Tu[0];
1042 pcFlux[3][0] = Tu[0];
1045 pcFlux[2][1] = Tu[0];
1052 if (hangingNodeType == InteractionVolume::twoSmallCells
1053 || hangingNodeType == InteractionVolume::fourSmallCellsDiag)
1055 useCases[0] =
false;
1058 useCases[3] =
false;
1059 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 2, 0, 3, 1, 6,
1064 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 2, 0, 3,
1069 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx3, 2, 0);
1070 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx1, 0, 1);
1076 this->A_[globalIdx3][globalIdx3] += T[0][0];
1077 this->A_[globalIdx3][globalIdx1] += T[0][1];
1078 this->A_[globalIdx3][globalIdx4] += T[0][2];
1079 this->A_[globalIdx3][globalIdx7] += T[0][3];
1081 this->A_[globalIdx1][globalIdx3] -= TSecond[0][0];
1082 this->A_[globalIdx1][globalIdx1] -= TSecond[0][1];
1083 this->A_[globalIdx1][globalIdx4] -= TSecond[0][2];
1084 this->A_[globalIdx1][globalIdx7] -= TSecond[0][3];
1092 pcFlux[2][0] = Tu[0];
1093 pcPotential3 = Tu[0];
1096 pcFlux[0][1] = Tu[0];
1098 else if (caseL == 2)
1100 this->A_[globalIdx3][globalIdx3] += T[0][0];
1101 this->A_[globalIdx3][globalIdx1] += T[0][1];
1102 this->A_[globalIdx3][globalIdx2] += T[0][2];
1103 this->A_[globalIdx3][globalIdx5] += T[0][3];
1105 this->A_[globalIdx1][globalIdx3] -= TSecond[0][0];
1106 this->A_[globalIdx1][globalIdx1] -= TSecond[0][1];
1107 this->A_[globalIdx1][globalIdx2] -= TSecond[0][2];
1108 this->A_[globalIdx1][globalIdx5] -= TSecond[0][3];
1116 pcFlux[2][0] = Tu[0];
1117 pcPotential3 = Tu[0];
1120 pcFlux[0][1] = Tu[0];
1122 else if (caseL == 3)
1124 this->A_[globalIdx3][globalIdx3] += T[0][0];
1125 this->A_[globalIdx3][globalIdx1] += T[0][1];
1126 this->A_[globalIdx3][globalIdx2] += T[0][2];
1127 this->A_[globalIdx3][globalIdx7] += T[0][3];
1129 this->A_[globalIdx1][globalIdx3] -= TSecond[0][0];
1130 this->A_[globalIdx1][globalIdx1] -= TSecond[0][1];
1131 this->A_[globalIdx1][globalIdx2] -= TSecond[0][2];
1132 this->A_[globalIdx1][globalIdx7] -= TSecond[0][3];
1140 pcFlux[2][0] = Tu[0];
1141 pcPotential3 = Tu[0];
1144 pcFlux[0][1] = Tu[0];
1148 this->A_[globalIdx3][globalIdx3] += T[0][0];
1149 this->A_[globalIdx3][globalIdx1] += T[0][1];
1150 this->A_[globalIdx3][globalIdx4] += T[0][2];
1151 this->A_[globalIdx3][globalIdx5] += T[0][3];
1153 this->A_[globalIdx1][globalIdx3] -= TSecond[0][0];
1154 this->A_[globalIdx1][globalIdx1] -= TSecond[0][1];
1155 this->A_[globalIdx1][globalIdx4] -= TSecond[0][2];
1156 this->A_[globalIdx1][globalIdx5] -= TSecond[0][3];
1164 pcFlux[2][0] = Tu[0];
1165 pcPotential3 = Tu[0];
1168 pcFlux[0][1] = Tu[0];
1175 if (hangingNodeType == InteractionVolume::sixSmallCells)
1177 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 5, 4, 7,
1180 else if (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx6)
1182 caseL = this->transmissibilityCalculator_.transmissibilityCaseThree(T, interactionVolume, lambda, 4, 0, 2,5);
1184 int caseLSecond = this->transmissibilityCalculator_.transmissibilityCaseFour(TSecond, interactionVolume, lambda, 1, 5, 3,
1187 caseL = this->transmissibilityCalculator_.chooseTransmissibility(T, TSecond, 3, 4);
1189 if (caseL == caseLSecond)
1194 if (hangingNodeType == InteractionVolume::sixSmallCells)
1197 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx6, 5, 2);
1198 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx5, 4, 1);
1204 this->A_[globalIdx6][globalIdx6] += T[0][0];
1205 this->A_[globalIdx6][globalIdx5] += T[0][1];
1206 this->A_[globalIdx6][globalIdx8] += T[0][2];
1207 this->A_[globalIdx6][globalIdx2] += T[0][3];
1209 this->A_[globalIdx5][globalIdx6] -= TSecond[0][0];
1210 this->A_[globalIdx5][globalIdx5] -= TSecond[0][1];
1211 this->A_[globalIdx5][globalIdx8] -= TSecond[0][2];
1212 this->A_[globalIdx5][globalIdx2] -= TSecond[0][3];
1220 pcFlux[5][2] = Tu[0];
1221 pcPotential4 = Tu[0];
1224 pcFlux[4][1] = Tu[0];
1226 else if (caseL == 2)
1228 this->A_[globalIdx6][globalIdx6] += T[0][0];
1229 this->A_[globalIdx6][globalIdx5] += T[0][1];
1230 this->A_[globalIdx6][globalIdx7] += T[0][2];
1231 this->A_[globalIdx6][globalIdx1] += T[0][3];
1233 this->A_[globalIdx5][globalIdx6] -= TSecond[0][0];
1234 this->A_[globalIdx5][globalIdx5] -= TSecond[0][1];
1235 this->A_[globalIdx5][globalIdx7] -= TSecond[0][2];
1236 this->A_[globalIdx5][globalIdx1] -= TSecond[0][3];
1244 pcFlux[5][2] = Tu[0];
1245 pcPotential4 = Tu[0];
1248 pcFlux[4][1] = Tu[0];
1250 else if (caseL == 3)
1252 this->A_[globalIdx6][globalIdx6] += T[0][0];
1253 this->A_[globalIdx6][globalIdx5] += T[0][1];
1254 this->A_[globalIdx6][globalIdx7] += T[0][2];
1255 this->A_[globalIdx6][globalIdx2] += T[0][3];
1257 this->A_[globalIdx5][globalIdx6] -= TSecond[0][0];
1258 this->A_[globalIdx5][globalIdx5] -= TSecond[0][1];
1259 this->A_[globalIdx5][globalIdx7] -= TSecond[0][2];
1260 this->A_[globalIdx5][globalIdx2] -= TSecond[0][3];
1268 pcFlux[5][2] = Tu[0];
1269 pcPotential4 = Tu[0];
1272 pcFlux[4][1] = Tu[0];
1276 this->A_[globalIdx6][globalIdx6] += T[0][0];
1277 this->A_[globalIdx6][globalIdx5] += T[0][1];
1278 this->A_[globalIdx6][globalIdx8] += T[0][2];
1279 this->A_[globalIdx6][globalIdx1] += T[0][3];
1281 this->A_[globalIdx5][globalIdx6] -= TSecond[0][0];
1282 this->A_[globalIdx5][globalIdx5] -= TSecond[0][1];
1283 this->A_[globalIdx5][globalIdx8] -= TSecond[0][2];
1284 this->A_[globalIdx5][globalIdx1] -= TSecond[0][3];
1292 pcFlux[5][2] = Tu[0];
1293 pcPotential4 = Tu[0];
1296 pcFlux[4][1] = Tu[0];
1299 else if (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx6)
1302 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx6, 5, 2);
1303 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx5, 4, 1);
1307 this->A_[globalIdx6][globalIdx5] -= T[2][0];
1308 this->A_[globalIdx6][globalIdx1] -= T[2][1];
1309 this->A_[globalIdx6][globalIdx3] -= T[2][2];
1310 this->A_[globalIdx6][globalIdx6] -= T[2][3];
1312 this->A_[globalIdx5][globalIdx5] += TSecond[2][0];
1313 this->A_[globalIdx5][globalIdx1] += TSecond[2][1];
1314 this->A_[globalIdx5][globalIdx3] += TSecond[2][2];
1315 this->A_[globalIdx5][globalIdx6] += TSecond[2][3];
1323 pcFlux[5][2] = -Tu[2];
1324 pcPotential4 = -Tu[2];
1327 pcFlux[4][1] = -Tu[2];
1331 this->A_[globalIdx6][globalIdx2] += T[2][0];
1332 this->A_[globalIdx6][globalIdx6] += T[2][1];
1333 this->A_[globalIdx6][globalIdx4] += T[2][2];
1334 this->A_[globalIdx6][globalIdx5] += T[2][3];
1336 this->A_[globalIdx5][globalIdx2] -= TSecond[2][0];
1337 this->A_[globalIdx5][globalIdx6] -= TSecond[2][1];
1338 this->A_[globalIdx5][globalIdx4] -= TSecond[2][2];
1339 this->A_[globalIdx5][globalIdx5] -= TSecond[2][3];
1347 pcFlux[5][2] = Tu[2];
1348 pcPotential4 = Tu[2];
1351 pcFlux[4][1] = Tu[2];
1359 if (hangingNodeType == InteractionVolume::sixSmallCells)
1361 useCases[0] =
false;
1364 useCases[3] =
false;
1366 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 7, 5, 6, 4, 3,
1369 else if (hangingNodeType == InteractionVolume::fourSmallCellsDiag)
1372 useCases[1] =
false;
1373 useCases[2] =
false;
1375 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 7, 5, 6, 4, 3,
1378 else if (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx7)
1380 caseL = this->transmissibilityCalculator_.transmissibilityCaseThree(T, interactionVolume, lambda, 1, 5, 7, 0);
1382 int caseLSecond = this->transmissibilityCalculator_.transmissibilityCaseFour(TSecond, interactionVolume, lambda, 7, 3, 5, 2);
1384 caseL = this->transmissibilityCalculator_.chooseTransmissibility(T, TSecond, 3, 4);
1386 if (caseL == caseLSecond)
1390 if (hangingNodeType == InteractionVolume::sixSmallCells
1391 || hangingNodeType == InteractionVolume::fourSmallCellsDiag)
1394 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx8, 7, 2);
1395 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx6, 5, 1);
1401 this->A_[globalIdx8][globalIdx8] += T[0][0];
1402 this->A_[globalIdx8][globalIdx6] += T[0][1];
1403 this->A_[globalIdx8][globalIdx7] += T[0][2];
1404 this->A_[globalIdx8][globalIdx4] += T[0][3];
1406 this->A_[globalIdx6][globalIdx8] -= TSecond[0][0];
1407 this->A_[globalIdx6][globalIdx6] -= TSecond[0][1];
1408 this->A_[globalIdx6][globalIdx7] -= TSecond[0][2];
1409 this->A_[globalIdx6][globalIdx4] -= TSecond[0][3];
1417 pcFlux[7][2] = Tu[0];
1418 pcPotential5 = Tu[0];
1421 pcFlux[5][1] = Tu[0];
1423 else if (caseL == 2)
1425 this->A_[globalIdx8][globalIdx8] += T[0][0];
1426 this->A_[globalIdx8][globalIdx6] += T[0][1];
1427 this->A_[globalIdx8][globalIdx5] += T[0][2];
1428 this->A_[globalIdx8][globalIdx2] += T[0][3];
1430 this->A_[globalIdx6][globalIdx8] -= TSecond[0][0];
1431 this->A_[globalIdx6][globalIdx6] -= TSecond[0][1];
1432 this->A_[globalIdx6][globalIdx5] -= TSecond[0][2];
1433 this->A_[globalIdx6][globalIdx2] -= TSecond[0][3];
1441 pcFlux[7][2] = Tu[0];
1442 pcPotential5 = Tu[0];
1445 pcFlux[5][1] = Tu[0];
1447 else if (caseL == 3)
1449 this->A_[globalIdx8][globalIdx8] += T[0][0];
1450 this->A_[globalIdx8][globalIdx6] += T[0][1];
1451 this->A_[globalIdx8][globalIdx5] += T[0][2];
1452 this->A_[globalIdx8][globalIdx4] += T[0][3];
1454 this->A_[globalIdx6][globalIdx8] -= TSecond[0][0];
1455 this->A_[globalIdx6][globalIdx6] -= TSecond[0][1];
1456 this->A_[globalIdx6][globalIdx5] -= TSecond[0][2];
1457 this->A_[globalIdx6][globalIdx4] -= TSecond[0][3];
1465 pcFlux[7][2] = Tu[0];
1466 pcPotential5 = Tu[0];
1469 pcFlux[5][1] = Tu[0];
1473 this->A_[globalIdx8][globalIdx8] += T[0][0];
1474 this->A_[globalIdx8][globalIdx6] += T[0][1];
1475 this->A_[globalIdx8][globalIdx7] += T[0][2];
1476 this->A_[globalIdx8][globalIdx2] += T[0][3];
1478 this->A_[globalIdx6][globalIdx8] -= TSecond[0][0];
1479 this->A_[globalIdx6][globalIdx6] -= TSecond[0][1];
1480 this->A_[globalIdx6][globalIdx7] -= TSecond[0][2];
1481 this->A_[globalIdx6][globalIdx2] -= TSecond[0][3];
1489 pcFlux[7][2] = Tu[0];
1490 pcPotential5 = Tu[0];
1493 pcFlux[5][1] = Tu[0];
1496 else if (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx7)
1499 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx8, 7, 2);
1500 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx6, 5, 1);
1504 this->A_[globalIdx8][globalIdx2] -= T[1][0];
1505 this->A_[globalIdx8][globalIdx6] -= T[1][1];
1506 this->A_[globalIdx8][globalIdx8] -= T[1][2];
1507 this->A_[globalIdx8][globalIdx1] -= T[1][3];
1509 this->A_[globalIdx6][globalIdx2] += TSecond[1][0];
1510 this->A_[globalIdx6][globalIdx6] += TSecond[1][1];
1511 this->A_[globalIdx6][globalIdx8] += TSecond[1][2];
1512 this->A_[globalIdx6][globalIdx1] += TSecond[1][3];
1520 pcFlux[7][2] = -Tu[1];
1521 pcPotential5 = -Tu[1];
1524 pcFlux[5][1] = -Tu[1];
1528 this->A_[globalIdx8][globalIdx8] += T[1][0];
1529 this->A_[globalIdx8][globalIdx4] += T[1][1];
1530 this->A_[globalIdx8][globalIdx6] += T[1][2];
1531 this->A_[globalIdx8][globalIdx3] += T[1][3];
1533 this->A_[globalIdx6][globalIdx8] -= TSecond[1][0];
1534 this->A_[globalIdx6][globalIdx4] -= TSecond[1][1];
1535 this->A_[globalIdx6][globalIdx6] -= TSecond[1][2];
1536 this->A_[globalIdx6][globalIdx3] -= TSecond[1][3];
1544 pcFlux[7][2] = Tu[1];
1545 pcPotential5 = Tu[1];
1548 pcFlux[5][1] = Tu[1];
1556 if (hangingNodeType == InteractionVolume::fourSmallCellsDiag)
1558 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 6, 7, 4,
1561 else if (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx6)
1563 caseL = this->transmissibilityCalculator_.transmissibilityCaseThree(T, interactionVolume, lambda, 7, 3, 1, 6);
1565 int caseLSecond = this->transmissibilityCalculator_.transmissibilityCaseFour(TSecond, interactionVolume, lambda, 2, 6, 0,
1568 caseL = this->transmissibilityCalculator_.chooseTransmissibility(T, TSecond, 3, 4);
1570 if (caseL == caseLSecond)
1574 if (hangingNodeType == InteractionVolume::fourSmallCellsDiag)
1577 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx7, 6, 2);
1578 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx8, 7, 1);
1584 this->A_[globalIdx7][globalIdx7] += T[0][0];
1585 this->A_[globalIdx7][globalIdx8] += T[0][1];
1586 this->A_[globalIdx7][globalIdx5] += T[0][2];
1587 this->A_[globalIdx7][globalIdx3] += T[0][3];
1589 this->A_[globalIdx8][globalIdx7] -= TSecond[0][0];
1590 this->A_[globalIdx8][globalIdx8] -= TSecond[0][1];
1591 this->A_[globalIdx8][globalIdx5] -= TSecond[0][2];
1592 this->A_[globalIdx8][globalIdx3] -= TSecond[0][3];
1600 pcFlux[6][2] = Tu[0];
1601 pcPotential6 = Tu[0];
1604 pcFlux[7][1] = Tu[0];
1606 else if (caseL == 2)
1608 this->A_[globalIdx7][globalIdx7] += T[0][0];
1609 this->A_[globalIdx7][globalIdx8] += T[0][1];
1610 this->A_[globalIdx7][globalIdx6] += T[0][2];
1611 this->A_[globalIdx7][globalIdx4] += T[0][3];
1613 this->A_[globalIdx8][globalIdx7] -= TSecond[0][0];
1614 this->A_[globalIdx8][globalIdx8] -= TSecond[0][1];
1615 this->A_[globalIdx8][globalIdx6] -= TSecond[0][2];
1616 this->A_[globalIdx8][globalIdx4] -= TSecond[0][3];
1624 pcFlux[6][2] = Tu[0];
1625 pcPotential6 = Tu[0];
1628 pcFlux[7][1] = Tu[0];
1630 else if (caseL == 3)
1632 this->A_[globalIdx7][globalIdx7] += T[0][0];
1633 this->A_[globalIdx7][globalIdx8] += T[0][1];
1634 this->A_[globalIdx7][globalIdx6] += T[0][2];
1635 this->A_[globalIdx7][globalIdx3] += T[0][3];
1637 this->A_[globalIdx8][globalIdx7] -= TSecond[0][0];
1638 this->A_[globalIdx8][globalIdx8] -= TSecond[0][1];
1639 this->A_[globalIdx8][globalIdx6] -= TSecond[0][2];
1640 this->A_[globalIdx8][globalIdx3] -= TSecond[0][3];
1648 pcFlux[6][2] = Tu[0];
1649 pcPotential6 = Tu[0];
1652 pcFlux[7][1] = Tu[0];
1656 this->A_[globalIdx7][globalIdx7] += T[0][0];
1657 this->A_[globalIdx7][globalIdx8] += T[0][1];
1658 this->A_[globalIdx7][globalIdx5] += T[0][2];
1659 this->A_[globalIdx7][globalIdx4] += T[0][3];
1661 this->A_[globalIdx8][globalIdx7] -= TSecond[0][0];
1662 this->A_[globalIdx8][globalIdx8] -= TSecond[0][1];
1663 this->A_[globalIdx8][globalIdx5] -= TSecond[0][2];
1664 this->A_[globalIdx8][globalIdx4] -= TSecond[0][3];
1672 pcFlux[6][2] = Tu[0];
1673 pcPotential6 = Tu[0];
1676 pcFlux[7][1] = Tu[0];
1679 else if(hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx6)
1682 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx7, 6, 2);
1683 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx8, 7, 1);
1687 this->A_[globalIdx7][globalIdx8] -= T[2][0];
1688 this->A_[globalIdx7][globalIdx4] -= T[2][1];
1689 this->A_[globalIdx7][globalIdx2] -= T[2][2];
1690 this->A_[globalIdx7][globalIdx7] -= T[2][3];
1692 this->A_[globalIdx8][globalIdx8] += TSecond[2][0];
1693 this->A_[globalIdx8][globalIdx4] += TSecond[2][1];
1694 this->A_[globalIdx8][globalIdx2] += TSecond[2][2];
1695 this->A_[globalIdx8][globalIdx7] += TSecond[2][3];
1703 pcFlux[6][2] = -Tu[2];
1704 pcPotential6 = -Tu[2];
1707 pcFlux[7][1] = -Tu[2];
1709 else if (caseL == 4)
1711 this->A_[globalIdx7][globalIdx3] += T[2][0];
1712 this->A_[globalIdx7][globalIdx7] += T[2][1];
1713 this->A_[globalIdx7][globalIdx1] += T[2][2];
1714 this->A_[globalIdx7][globalIdx8] += T[2][3];
1716 this->A_[globalIdx8][globalIdx3] -= TSecond[2][0];
1717 this->A_[globalIdx8][globalIdx7] -= TSecond[2][1];
1718 this->A_[globalIdx8][globalIdx1] -= TSecond[2][2];
1719 this->A_[globalIdx8][globalIdx8] -= TSecond[2][3];
1727 pcFlux[6][2] = Tu[2];
1728 pcPotential6 = Tu[2];
1731 pcFlux[7][1] = Tu[2];
1739 if (hangingNodeType == InteractionVolume::sixSmallCells)
1742 useCases[1] =
false;
1743 useCases[2] =
false;
1746 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 4, 6, 5, 7, 0,
1749 else if (hangingNodeType == InteractionVolume::fourSmallCellsDiag)
1751 useCases[0] =
false;
1754 useCases[3] =
false;
1755 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 4, 6, 5, 7, 0,
1758 else if (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx7)
1760 caseL = this->transmissibilityCalculator_.transmissibilityCaseThree(T, interactionVolume, lambda, 2, 6, 4,
1763 int caseLSecond = this->transmissibilityCalculator_.transmissibilityCaseFour(TSecond, interactionVolume, lambda, 4, 0, 6,
1766 caseL = this->transmissibilityCalculator_.chooseTransmissibility(T, TSecond, 3, 4);
1768 if (caseL == caseLSecond)
1772 if (hangingNodeType == InteractionVolume::sixSmallCells
1773 || hangingNodeType == InteractionVolume::fourSmallCellsDiag)
1776 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx5, 4, 2);
1777 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx7, 6, 1);
1783 this->A_[globalIdx5][globalIdx5] += T[0][0];
1784 this->A_[globalIdx5][globalIdx7] += T[0][1];
1785 this->A_[globalIdx5][globalIdx6] += T[0][2];
1786 this->A_[globalIdx5][globalIdx1] += T[0][3];
1788 this->A_[globalIdx7][globalIdx5] -= TSecond[0][0];
1789 this->A_[globalIdx7][globalIdx7] -= TSecond[0][1];
1790 this->A_[globalIdx7][globalIdx6] -= TSecond[0][2];
1791 this->A_[globalIdx7][globalIdx1] -= TSecond[0][3];
1800 pcFlux[4][2] = Tu[0];
1801 pcPotential7 = Tu[0];
1804 pcFlux[6][1] = Tu[0];
1806 else if (caseL == 2)
1808 this->A_[globalIdx5][globalIdx5] += T[0][0];
1809 this->A_[globalIdx5][globalIdx7] += T[0][1];
1810 this->A_[globalIdx5][globalIdx8] += T[0][2];
1811 this->A_[globalIdx5][globalIdx3] += T[0][3];
1813 this->A_[globalIdx7][globalIdx5] -= TSecond[0][0];
1814 this->A_[globalIdx7][globalIdx7] -= TSecond[0][1];
1815 this->A_[globalIdx7][globalIdx8] -= TSecond[0][2];
1816 this->A_[globalIdx7][globalIdx3] -= TSecond[0][3];
1824 pcFlux[4][2] = Tu[0];
1825 pcPotential7 = Tu[0];
1828 pcFlux[6][1] = Tu[0];
1830 else if (caseL == 3)
1832 this->A_[globalIdx5][globalIdx5] += T[0][0];
1833 this->A_[globalIdx5][globalIdx7] += T[0][1];
1834 this->A_[globalIdx5][globalIdx8] += T[0][2];
1835 this->A_[globalIdx5][globalIdx1] += T[0][3];
1837 this->A_[globalIdx7][globalIdx5] -= TSecond[0][0];
1838 this->A_[globalIdx7][globalIdx7] -= TSecond[0][1];
1839 this->A_[globalIdx7][globalIdx8] -= TSecond[0][2];
1840 this->A_[globalIdx7][globalIdx1] -= TSecond[0][3];
1848 pcFlux[4][2] = Tu[0];
1849 pcPotential7 = Tu[0];
1852 pcFlux[6][1] = Tu[0];
1856 this->A_[globalIdx5][globalIdx5] += T[0][0];
1857 this->A_[globalIdx5][globalIdx7] += T[0][1];
1858 this->A_[globalIdx5][globalIdx6] += T[0][2];
1859 this->A_[globalIdx5][globalIdx3] += T[0][3];
1861 this->A_[globalIdx7][globalIdx5] -= TSecond[0][0];
1862 this->A_[globalIdx7][globalIdx7] -= TSecond[0][1];
1863 this->A_[globalIdx7][globalIdx6] -= TSecond[0][2];
1864 this->A_[globalIdx7][globalIdx3] -= TSecond[0][3];
1872 pcFlux[4][2] = Tu[0];
1873 pcPotential7 = Tu[0];
1876 pcFlux[6][1] = Tu[0];
1879 else if (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx7)
1882 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx5, 4, 2);
1883 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx7, 6, 1);
1887 this->A_[globalIdx5][globalIdx3] -= T[1][0];
1888 this->A_[globalIdx5][globalIdx7] -= T[1][1];
1889 this->A_[globalIdx5][globalIdx5] -= T[1][2];
1890 this->A_[globalIdx5][globalIdx4] -= T[1][3];
1892 this->A_[globalIdx7][globalIdx3] += TSecond[1][0];
1893 this->A_[globalIdx7][globalIdx7] += TSecond[1][1];
1894 this->A_[globalIdx7][globalIdx5] += TSecond[1][2];
1895 this->A_[globalIdx7][globalIdx4] += TSecond[1][3];
1903 pcFlux[4][2] = -Tu[1];
1904 pcPotential7 = -Tu[1];
1907 pcFlux[6][1] = -Tu[1];
1909 else if (caseL == 4)
1911 this->A_[globalIdx5][globalIdx5] += T[1][0];
1912 this->A_[globalIdx5][globalIdx1] += T[1][1];
1913 this->A_[globalIdx5][globalIdx7] += T[1][2];
1914 this->A_[globalIdx5][globalIdx2] += T[1][3];
1916 this->A_[globalIdx7][globalIdx5] -= TSecond[1][0];
1917 this->A_[globalIdx7][globalIdx1] -= TSecond[1][1];
1918 this->A_[globalIdx7][globalIdx7] -= TSecond[1][2];
1919 this->A_[globalIdx7][globalIdx2] -= TSecond[1][3];
1927 pcFlux[4][2] = Tu[1];
1928 pcPotential7 = Tu[1];
1931 pcFlux[6][1] = Tu[1];
1938 if (hangingNodeType == InteractionVolume::sixSmallCells)
1940 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 4, 0, 6,
1943 else if (hangingNodeType == InteractionVolume::twoSmallCells || hangingNodeType == InteractionVolume::fourSmallCellsFace)
1945 caseL = this->transmissibilityCalculator_.transmissibilityCaseTwo(T, interactionVolume, lambda, 4, 0, 2,
1948 else if (hangingNodeType == InteractionVolume::fourSmallCellsDiag
1949 || (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx7))
1951 useCases[0] =
false;
1953 useCases[2] =
false;
1956 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 4, 0, 6,
1959 else if (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx6)
1961 useCases[0] =
false;
1964 useCases[3] =
false;
1966 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 4, 0, 6,
1971 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx5, 4, 0);
1972 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx1, 0, 2);
1978 this->A_[globalIdx5][globalIdx5] += T[0][0];
1979 this->A_[globalIdx5][globalIdx1] += T[0][1];
1980 this->A_[globalIdx5][globalIdx7] += T[0][2];
1981 this->A_[globalIdx5][globalIdx6] += T[0][3];
1983 this->A_[globalIdx1][globalIdx5] -= TSecond[0][0];
1984 this->A_[globalIdx1][globalIdx1] -= TSecond[0][1];
1985 this->A_[globalIdx1][globalIdx7] -= TSecond[0][2];
1986 this->A_[globalIdx1][globalIdx6] -= TSecond[0][3];
1995 pcFlux[4][0] = Tu[0];
1996 pcPotential8 = Tu[0];
1999 pcFlux[0][2] = Tu[0];
2001 else if (caseL == 2)
2003 this->A_[globalIdx5][globalIdx5] += T[0][0];
2004 this->A_[globalIdx5][globalIdx1] += T[0][1];
2005 this->A_[globalIdx5][globalIdx3] += T[0][2];
2006 this->A_[globalIdx5][globalIdx2] += T[0][3];
2008 this->A_[globalIdx1][globalIdx5] -= TSecond[0][0];
2009 this->A_[globalIdx1][globalIdx1] -= TSecond[0][1];
2010 this->A_[globalIdx1][globalIdx3] -= TSecond[0][2];
2011 this->A_[globalIdx1][globalIdx2] -= TSecond[0][3];
2019 pcFlux[4][0] = Tu[0];
2020 pcPotential8 = Tu[0];
2023 pcFlux[0][2] = Tu[0];
2025 else if (caseL == 3)
2027 this->A_[globalIdx5][globalIdx5] += T[0][0];
2028 this->A_[globalIdx5][globalIdx1] += T[0][1];
2029 this->A_[globalIdx5][globalIdx3] += T[0][2];
2030 this->A_[globalIdx5][globalIdx6] += T[0][3];
2032 this->A_[globalIdx1][globalIdx5] -= TSecond[0][0];
2033 this->A_[globalIdx1][globalIdx1] -= TSecond[0][1];
2034 this->A_[globalIdx1][globalIdx3] -= TSecond[0][2];
2035 this->A_[globalIdx1][globalIdx6] -= TSecond[0][3];
2043 pcFlux[4][0] = Tu[0];
2044 pcPotential8 = Tu[0];
2047 pcFlux[0][2] = Tu[0];
2051 this->A_[globalIdx5][globalIdx5] += T[0][0];
2052 this->A_[globalIdx5][globalIdx1] += T[0][1];
2053 this->A_[globalIdx5][globalIdx7] += T[0][2];
2054 this->A_[globalIdx5][globalIdx2] += T[0][3];
2056 this->A_[globalIdx1][globalIdx5] -= TSecond[0][0];
2057 this->A_[globalIdx1][globalIdx1] -= TSecond[0][1];
2058 this->A_[globalIdx1][globalIdx7] -= TSecond[0][2];
2059 this->A_[globalIdx1][globalIdx2] -= TSecond[0][3];
2067 pcFlux[4][0] = Tu[0];
2068 pcPotential8 = Tu[0];
2071 pcFlux[0][2] = Tu[0];
2077 if (hangingNodeType == InteractionVolume::sixSmallCells)
2079 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 1, 5, 3,
2082 else if (hangingNodeType == InteractionVolume::twoSmallCells || hangingNodeType == InteractionVolume::fourSmallCellsFace)
2084 caseL = this->transmissibilityCalculator_.transmissibilityCaseOne(T, interactionVolume, lambda, 1, 5, 3,
2087 else if (hangingNodeType == InteractionVolume::fourSmallCellsDiag
2088 || (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx7))
2091 useCases[1] =
false;
2093 useCases[3] =
false;
2095 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 1, 5, 3,
2098 else if (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx6)
2101 useCases[1] =
false;
2102 useCases[2] =
false;
2105 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 1, 5, 3,
2110 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx2, 1, 2);
2111 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx6, 5, 0);
2115 this->A_[globalIdx2][globalIdx2] += T[0][0];
2116 this->A_[globalIdx2][globalIdx6] += T[0][1];
2117 this->A_[globalIdx2][globalIdx4] += T[0][2];
2118 this->A_[globalIdx2][globalIdx1] += T[0][3];
2120 this->A_[globalIdx6][globalIdx2] -= TSecond[0][0];
2121 this->A_[globalIdx6][globalIdx6] -= TSecond[0][1];
2122 this->A_[globalIdx6][globalIdx4] -= TSecond[0][2];
2123 this->A_[globalIdx6][globalIdx1] -= TSecond[0][3];
2132 pcFlux[1][2] = Tu[0];
2133 pcPotential9 = Tu[0];
2136 pcFlux[5][0] = Tu[0];
2138 else if (caseL == 2)
2140 this->A_[globalIdx2][globalIdx2] += T[0][0];
2141 this->A_[globalIdx2][globalIdx6] += T[0][1];
2142 this->A_[globalIdx2][globalIdx8] += T[0][2];
2143 this->A_[globalIdx2][globalIdx5] += T[0][3];
2145 this->A_[globalIdx6][globalIdx2] -= TSecond[0][0];
2146 this->A_[globalIdx6][globalIdx6] -= TSecond[0][1];
2147 this->A_[globalIdx6][globalIdx8] -= TSecond[0][2];
2148 this->A_[globalIdx6][globalIdx5] -= TSecond[0][3];
2157 pcFlux[1][2] = Tu[0];
2158 pcPotential9 = Tu[0];
2161 pcFlux[5][0] = Tu[0];
2163 else if (caseL == 3)
2165 this->A_[globalIdx2][globalIdx2] += T[0][0];
2166 this->A_[globalIdx2][globalIdx6] += T[0][1];
2167 this->A_[globalIdx2][globalIdx8] += T[0][2];
2168 this->A_[globalIdx2][globalIdx1] += T[0][3];
2170 this->A_[globalIdx6][globalIdx2] -= TSecond[0][0];
2171 this->A_[globalIdx6][globalIdx6] -= TSecond[0][1];
2172 this->A_[globalIdx6][globalIdx8] -= TSecond[0][2];
2173 this->A_[globalIdx6][globalIdx1] -= TSecond[0][3];
2181 pcFlux[1][2] = Tu[0];
2182 pcPotential9 = Tu[0];
2185 pcFlux[5][0] = Tu[0];
2189 this->A_[globalIdx2][globalIdx2] += T[0][0];
2190 this->A_[globalIdx2][globalIdx6] += T[0][1];
2191 this->A_[globalIdx2][globalIdx4] += T[0][2];
2192 this->A_[globalIdx2][globalIdx5] += T[0][3];
2194 this->A_[globalIdx6][globalIdx2] -= TSecond[0][0];
2195 this->A_[globalIdx6][globalIdx6] -= TSecond[0][1];
2196 this->A_[globalIdx6][globalIdx4] -= TSecond[0][2];
2197 this->A_[globalIdx6][globalIdx5] -= TSecond[0][3];
2205 pcFlux[1][2] = Tu[0];
2206 pcPotential9 = Tu[0];
2209 pcFlux[5][0] = Tu[0];
2215 if (hangingNodeType == InteractionVolume::fourSmallCellsFace)
2217 caseL = this->transmissibilityCalculator_.transmissibilityCaseTwo(T, interactionVolume, lambda, 7, 3, 1, 2);
2219 else if ((hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx7)
2220 || hangingNodeType == InteractionVolume::sixSmallCells)
2222 useCases[0] =
false;
2224 useCases[2] =
false;
2227 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 7, 3, 5, 1, 6,
2230 else if (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx6)
2232 useCases[0] =
false;
2235 useCases[3] =
false;
2237 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 7, 3, 5, 1, 6,
2240 else if (hangingNodeType == InteractionVolume::fourSmallCellsDiag)
2243 useCases[1] =
false;
2245 useCases[3] =
false;
2247 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 7, 3, 5, 1, 6,
2252 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx8, 7, 0);
2253 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx4, 3, 2);
2255 if (hangingNodeType != InteractionVolume::twoSmallCells)
2260 this->A_[globalIdx8][globalIdx8] += T[0][0];
2261 this->A_[globalIdx8][globalIdx4] += T[0][1];
2262 this->A_[globalIdx8][globalIdx6] += T[0][2];
2263 this->A_[globalIdx8][globalIdx7] += T[0][3];
2265 this->A_[globalIdx4][globalIdx8] -= TSecond[0][0];
2266 this->A_[globalIdx4][globalIdx4] -= TSecond[0][1];
2267 this->A_[globalIdx4][globalIdx6] -= TSecond[0][2];
2268 this->A_[globalIdx4][globalIdx7] -= TSecond[0][3];
2277 pcFlux[7][0] = Tu[0];
2278 pcPotential10 = Tu[0];
2281 pcFlux[3][2] = Tu[0];
2283 else if (caseL == 2)
2285 this->A_[globalIdx8][globalIdx8] += T[0][0];
2286 this->A_[globalIdx8][globalIdx4] += T[0][1];
2287 this->A_[globalIdx8][globalIdx2] += T[0][2];
2288 this->A_[globalIdx8][globalIdx3] += T[0][3];
2290 this->A_[globalIdx4][globalIdx8] -= TSecond[0][0];
2291 this->A_[globalIdx4][globalIdx4] -= TSecond[0][1];
2292 this->A_[globalIdx4][globalIdx2] -= TSecond[0][2];
2293 this->A_[globalIdx4][globalIdx3] -= TSecond[0][3];
2301 pcFlux[7][0] = Tu[0];
2302 pcPotential10 = Tu[0];
2305 pcFlux[3][2] = Tu[0];
2307 else if (caseL == 3)
2309 this->A_[globalIdx8][globalIdx8] += T[0][0];
2310 this->A_[globalIdx8][globalIdx4] += T[0][1];
2311 this->A_[globalIdx8][globalIdx2] += T[0][2];
2312 this->A_[globalIdx8][globalIdx7] += T[0][3];
2314 this->A_[globalIdx4][globalIdx8] -= TSecond[0][0];
2315 this->A_[globalIdx4][globalIdx4] -= TSecond[0][1];
2316 this->A_[globalIdx4][globalIdx2] -= TSecond[0][2];
2317 this->A_[globalIdx4][globalIdx7] -= TSecond[0][3];
2325 pcFlux[7][0] = Tu[0];
2326 pcPotential10 = Tu[0];
2329 pcFlux[3][2] = Tu[0];
2333 this->A_[globalIdx8][globalIdx8] += T[0][0];
2334 this->A_[globalIdx8][globalIdx4] += T[0][1];
2335 this->A_[globalIdx8][globalIdx6] += T[0][2];
2336 this->A_[globalIdx8][globalIdx3] += T[0][3];
2338 this->A_[globalIdx4][globalIdx8] -= TSecond[0][0];
2339 this->A_[globalIdx4][globalIdx4] -= TSecond[0][1];
2340 this->A_[globalIdx4][globalIdx6] -= TSecond[0][2];
2341 this->A_[globalIdx4][globalIdx3] -= TSecond[0][3];
2349 pcFlux[7][0] = Tu[0];
2350 pcPotential10 = Tu[0];
2353 pcFlux[3][2] = Tu[0];
2360 if (hangingNodeType == InteractionVolume::fourSmallCellsFace)
2362 caseL = this->transmissibilityCalculator_.transmissibilityCaseOne(T, interactionVolume, lambda, 2, 6, 0, 3);
2364 else if ((hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx7)
2365 || hangingNodeType == InteractionVolume::sixSmallCells)
2368 useCases[1] =
false;
2370 useCases[3] =
false;
2372 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 2, 6, 0, 4, 3,
2375 else if (hangingNodeType == InteractionVolume::fourSmallCellsEdge && globalIdx5 != globalIdx6)
2378 useCases[1] =
false;
2379 useCases[2] =
false;
2382 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 2, 6, 0, 4, 3,
2385 else if (hangingNodeType == InteractionVolume::fourSmallCellsDiag)
2387 useCases[0] =
false;
2389 useCases[2] =
false;
2392 caseL = this->transmissibilityCalculator_.transmissibility(T, interactionVolume, lambda, 2, 6, 0, 4, 3,
2397 T *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx3, 2, 2);
2398 TSecond *= this->interactionVolumes_.faceAreaFactor(interactionVolume, globalIdx7, 6, 0);
2400 if (hangingNodeType != InteractionVolume::twoSmallCells)
2404 this->A_[globalIdx3][globalIdx3] += T[0][0];
2405 this->A_[globalIdx3][globalIdx7] += T[0][1];
2406 this->A_[globalIdx3][globalIdx1] += T[0][2];
2407 this->A_[globalIdx3][globalIdx4] += T[0][3];
2409 this->A_[globalIdx7][globalIdx3] -= TSecond[0][0];
2410 this->A_[globalIdx7][globalIdx7] -= TSecond[0][1];
2411 this->A_[globalIdx7][globalIdx1] -= TSecond[0][2];
2412 this->A_[globalIdx7][globalIdx4] -= TSecond[0][3];
2421 pcFlux[2][2] = Tu[0];
2422 pcPotential11 = Tu[0];
2425 pcFlux[6][0] = Tu[0];
2427 else if (caseL == 2)
2429 this->A_[globalIdx3][globalIdx3] += T[0][0];
2430 this->A_[globalIdx3][globalIdx7] += T[0][1];
2431 this->A_[globalIdx3][globalIdx5] += T[0][2];
2432 this->A_[globalIdx3][globalIdx8] += T[0][3];
2434 this->A_[globalIdx7][globalIdx3] -= TSecond[0][0];
2435 this->A_[globalIdx7][globalIdx7] -= TSecond[0][1];
2436 this->A_[globalIdx7][globalIdx5] -= TSecond[0][2];
2437 this->A_[globalIdx7][globalIdx8] -= TSecond[0][3];
2446 pcFlux[2][2] = Tu[0];
2447 pcPotential11 = Tu[0];
2450 pcFlux[6][0] = Tu[0];
2452 else if (caseL == 3)
2454 this->A_[globalIdx3][globalIdx3] += T[0][0];
2455 this->A_[globalIdx3][globalIdx7] += T[0][1];
2456 this->A_[globalIdx3][globalIdx5] += T[0][2];
2457 this->A_[globalIdx3][globalIdx4] += T[0][3];
2459 this->A_[globalIdx7][globalIdx3] -= TSecond[0][0];
2460 this->A_[globalIdx7][globalIdx7] -= TSecond[0][1];
2461 this->A_[globalIdx7][globalIdx5] -= TSecond[0][2];
2462 this->A_[globalIdx7][globalIdx4] -= TSecond[0][3];
2470 pcFlux[2][2] = Tu[0];
2471 pcPotential11 = Tu[0];
2474 pcFlux[6][0] = Tu[0];
2478 this->A_[globalIdx3][globalIdx3] += T[0][0];
2479 this->A_[globalIdx3][globalIdx7] += T[0][1];
2480 this->A_[globalIdx3][globalIdx1] += T[0][2];
2481 this->A_[globalIdx3][globalIdx8] += T[0][3];
2483 this->A_[globalIdx7][globalIdx3] -= TSecond[0][0];
2484 this->A_[globalIdx7][globalIdx7] -= TSecond[0][1];
2485 this->A_[globalIdx7][globalIdx1] -= TSecond[0][2];
2486 this->A_[globalIdx7][globalIdx8] -= TSecond[0][3];
2494 pcFlux[2][2] = Tu[0];
2495 pcPotential11 = Tu[0];
2498 pcFlux[6][0] = Tu[0];
2502 if (pc[0] == 0 && pc[1] == 0 && pc[2] == 0 && pc[3] == 0 && pc[4] == 0 && pc[5] == 0 && pc[6] == 0
2509 Dune::FieldVector<Scalar, numPhases> lambda0Upw(0.0);
2510 lambda0Upw[wPhaseIdx] = (pcPotential0 >= 0) ? lambda1[wPhaseIdx] : lambda2[wPhaseIdx];
2511 lambda0Upw[nPhaseIdx] = (pcPotential0 >= 0) ? lambda1[nPhaseIdx] : lambda2[nPhaseIdx];
2514 Dune::FieldVector<Scalar, numPhases> lambda1Upw(0.0);
2515 lambda1Upw[wPhaseIdx] = (pcPotential1 >= 0) ? lambda2[wPhaseIdx] : lambda4[wPhaseIdx];
2516 lambda1Upw[nPhaseIdx] = (pcPotential1 >= 0) ? lambda2[nPhaseIdx] : lambda4[nPhaseIdx];
2519 Dune::FieldVector<Scalar, numPhases> lambda2Upw(0.0);
2520 lambda2Upw[wPhaseIdx] = (pcPotential2 >= 0) ? lambda4[wPhaseIdx] : lambda3[wPhaseIdx];
2521 lambda2Upw[nPhaseIdx] = (pcPotential2 >= 0) ? lambda4[nPhaseIdx] : lambda3[nPhaseIdx];
2524 Dune::FieldVector<Scalar, numPhases> lambda3Upw(0.0);
2525 lambda3Upw[wPhaseIdx] = (pcPotential3 >= 0) ? lambda3[wPhaseIdx] : lambda1[wPhaseIdx];
2526 lambda3Upw[nPhaseIdx] = (pcPotential3 >= 0) ? lambda3[nPhaseIdx] : lambda1[nPhaseIdx];
2529 Dune::FieldVector<Scalar, numPhases> lambda4Upw(0.0);
2530 lambda4Upw[wPhaseIdx] = (pcPotential4 >= 0) ? lambda6[wPhaseIdx] : lambda5[wPhaseIdx];
2531 lambda4Upw[nPhaseIdx] = (pcPotential4 >= 0) ? lambda6[nPhaseIdx] : lambda5[nPhaseIdx];
2534 Dune::FieldVector<Scalar, numPhases> lambda5Upw(0.0);
2535 lambda5Upw[wPhaseIdx] = (pcPotential5 >= 0) ? lambda8[wPhaseIdx] : lambda6[wPhaseIdx];
2536 lambda5Upw[nPhaseIdx] = (pcPotential5 >= 0) ? lambda8[nPhaseIdx] : lambda6[nPhaseIdx];
2539 Dune::FieldVector<Scalar, numPhases> lambda6Upw(0.0);
2540 lambda6Upw[wPhaseIdx] = (pcPotential6 >= 0) ? lambda7[wPhaseIdx] : lambda8[wPhaseIdx];
2541 lambda6Upw[nPhaseIdx] = (pcPotential6 >= 0) ? lambda7[nPhaseIdx] : lambda8[nPhaseIdx];
2544 Dune::FieldVector<Scalar, numPhases> lambda7Upw(0.0);
2545 lambda7Upw[wPhaseIdx] = (pcPotential7 >= 0) ? lambda5[wPhaseIdx] : lambda7[wPhaseIdx];
2546 lambda7Upw[nPhaseIdx] = (pcPotential7 >= 0) ? lambda5[nPhaseIdx] : lambda7[nPhaseIdx];
2549 Dune::FieldVector<Scalar, numPhases> lambda8Upw(0.0);
2550 lambda8Upw[wPhaseIdx] = (pcPotential8 >= 0) ? lambda5[wPhaseIdx] : lambda1[wPhaseIdx];
2551 lambda8Upw[nPhaseIdx] = (pcPotential8 >= 0) ? lambda5[nPhaseIdx] : lambda1[nPhaseIdx];
2554 Dune::FieldVector<Scalar, numPhases> lambda9Upw(0.0);
2555 lambda9Upw[wPhaseIdx] = (pcPotential9 >= 0) ? lambda2[wPhaseIdx] : lambda6[wPhaseIdx];
2556 lambda9Upw[nPhaseIdx] = (pcPotential9 >= 0) ? lambda2[nPhaseIdx] : lambda6[nPhaseIdx];
2559 Dune::FieldVector<Scalar, numPhases> lambda10Upw(0.0);
2560 lambda10Upw[wPhaseIdx] = (pcPotential10 >= 0) ? lambda8[wPhaseIdx] : lambda4[wPhaseIdx];
2561 lambda10Upw[nPhaseIdx] = (pcPotential10 >= 0) ? lambda8[nPhaseIdx] : lambda4[nPhaseIdx];
2564 Dune::FieldVector<Scalar, numPhases> lambda11Upw(0.0);
2565 lambda11Upw[wPhaseIdx] = (pcPotential11 >= 0) ? lambda3[wPhaseIdx] : lambda7[wPhaseIdx];
2566 lambda11Upw[nPhaseIdx] = (pcPotential11 >= 0) ? lambda3[nPhaseIdx] : lambda7[nPhaseIdx];
2568 for (
int i = 0; i < numPhases; i++)
2570 Scalar lambdaT0 = lambda0Upw[wPhaseIdx] + lambda0Upw[nPhaseIdx];
2571 Scalar lambdaT1 = lambda1Upw[wPhaseIdx] + lambda1Upw[nPhaseIdx];
2572 Scalar lambdaT2 = lambda2Upw[wPhaseIdx] + lambda2Upw[nPhaseIdx];
2573 Scalar lambdaT3 = lambda3Upw[wPhaseIdx] + lambda3Upw[nPhaseIdx];
2574 Scalar lambdaT4 = lambda4Upw[wPhaseIdx] + lambda4Upw[nPhaseIdx];
2575 Scalar lambdaT5 = lambda5Upw[wPhaseIdx] + lambda5Upw[nPhaseIdx];
2576 Scalar lambdaT6 = lambda6Upw[wPhaseIdx] + lambda6Upw[nPhaseIdx];
2577 Scalar lambdaT7 = lambda7Upw[wPhaseIdx] + lambda7Upw[nPhaseIdx];
2578 Scalar lambdaT8 = lambda8Upw[wPhaseIdx] + lambda8Upw[nPhaseIdx];
2579 Scalar lambdaT9 = lambda9Upw[wPhaseIdx] + lambda9Upw[nPhaseIdx];
2580 Scalar lambdaT10 = lambda10Upw[wPhaseIdx] + lambda10Upw[nPhaseIdx];
2581 Scalar lambdaT11 = lambda11Upw[wPhaseIdx] + lambda11Upw[nPhaseIdx];
2582 Scalar fracFlow0 = (lambdaT0 > threshold_) ? lambda0Upw[i] / (lambdaT0) : 0.0;
2583 Scalar fracFlow1 = (lambdaT1 > threshold_) ? lambda1Upw[i] / (lambdaT1) : 0.0;
2584 Scalar fracFlow2 = (lambdaT2 > threshold_) ? lambda2Upw[i] / (lambdaT2) : 0.0;
2585 Scalar fracFlow3 = (lambdaT3 > threshold_) ? lambda3Upw[i] / (lambdaT3) : 0.0;
2586 Scalar fracFlow4 = (lambdaT4 > threshold_) ? lambda4Upw[i] / (lambdaT4) : 0.0;
2587 Scalar fracFlow5 = (lambdaT5 > threshold_) ? lambda5Upw[i] / (lambdaT5) : 0.0;
2588 Scalar fracFlow6 = (lambdaT6 > threshold_) ? lambda6Upw[i] / (lambdaT6) : 0.0;
2589 Scalar fracFlow7 = (lambdaT7 > threshold_) ? lambda7Upw[i] / (lambdaT7) : 0.0;
2590 Scalar fracFlow8 = (lambdaT8 > threshold_) ? lambda8Upw[i] / (lambdaT8) : 0.0;
2591 Scalar fracFlow9 = (lambdaT9 > threshold_) ? lambda9Upw[i] / (lambdaT9) : 0.0;
2592 Scalar fracFlow10 = (lambdaT10 > threshold_) ? lambda10Upw[i] / (lambdaT10) : 0.0;
2593 Scalar fracFlow11 = (lambdaT11 > threshold_) ? lambda11Upw[i] / (lambdaT11) : 0.0;
2595 switch (pressureType_)
2602 this->f_[globalIdx1] -= (fracFlow0 * pcFlux[0][0] - fracFlow3 * pcFlux[0][1] - fracFlow8 * pcFlux[0][2]);
2603 this->f_[globalIdx2] -= (fracFlow1 * pcFlux[1][0] - fracFlow0 * pcFlux[1][1] + fracFlow9 * pcFlux[1][2]);
2604 this->f_[globalIdx3] -= (fracFlow3 * pcFlux[2][0] - fracFlow2 * pcFlux[2][1] + fracFlow11 * pcFlux[2][2]);
2605 this->f_[globalIdx4] -= (fracFlow2 * pcFlux[3][0] - fracFlow1 * pcFlux[3][1] - fracFlow10 * pcFlux[3][2]);
2606 this->f_[globalIdx5] -= (fracFlow8 * pcFlux[4][0] - fracFlow4 * pcFlux[4][1] + fracFlow7 * pcFlux[4][2]);
2607 this->f_[globalIdx6] -= (-fracFlow9 * pcFlux[5][0] - fracFlow5 * pcFlux[5][1] + fracFlow4 * pcFlux[5][2]);
2608 this->f_[globalIdx7] -= (-fracFlow11 * pcFlux[6][0] - fracFlow7 * pcFlux[6][1] + fracFlow6 * pcFlux[6][2]);
2609 this->f_[globalIdx8] -= (fracFlow10 * pcFlux[7][0] - fracFlow6 * pcFlux[7][1] + fracFlow5 * pcFlux[7][2]);
2618 this->f_[globalIdx1] += (fracFlow0 * pcFlux[0][0] - fracFlow3 * pcFlux[0][1] - fracFlow8 * pcFlux[0][2]);
2619 this->f_[globalIdx2] += (fracFlow1 * pcFlux[1][0] - fracFlow0 * pcFlux[1][1] + fracFlow9 * pcFlux[1][2]);
2620 this->f_[globalIdx3] += (fracFlow3 * pcFlux[2][0] - fracFlow2 * pcFlux[2][1] + fracFlow11 * pcFlux[2][2]);
2621 this->f_[globalIdx4] += (fracFlow2 * pcFlux[3][0] - fracFlow1 * pcFlux[3][1] - fracFlow10 * pcFlux[3][2]);
2622 this->f_[globalIdx5] += (fracFlow8 * pcFlux[4][0] - fracFlow4 * pcFlux[4][1] + fracFlow7 * pcFlux[4][2]);
2623 this->f_[globalIdx6] += (-fracFlow9 * pcFlux[5][0] - fracFlow5 * pcFlux[5][1] + fracFlow4 * pcFlux[5][2]);
2624 this->f_[globalIdx7] += (-fracFlow11 * pcFlux[6][0] - fracFlow7 * pcFlux[6][1] + fracFlow6 * pcFlux[6][2]);
2625 this->f_[globalIdx8] += (fracFlow10 * pcFlux[7][0] - fracFlow6 * pcFlux[7][1] + fracFlow5 * pcFlux[7][2]);
Interactionvolume container for 3-d MPFA L-method on an h-adaptive grid.
3-d finite Volume-MPFAL implementation of a two-phase pressure equation.
Provides methods for transmissibility calculation in 3-d.
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 density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
3-d finite volume MPFA L-method discretization of a two-phase flow pressure equation of the sequentia...
Definition: 3dpressure.hh:74
typename TransmissibilityCalculator::TransmissibilityType TransmissibilityType
Type including methods for calculation of MPFA transmissibilities.
Definition: 3dpressure.hh:153
void update()
Pressure update.
Definition: 3dpressure.hh:272
InteractionVolumeContainer interactionVolumes_
Definition: 3dpressure.hh:508
GetPropType< TypeTag, Properties::MPFAInteractionVolume > InteractionVolume
Type for storing interaction volume information.
Definition: 3dpressure.hh:155
3-d finite volume MPFA L-method discretization of a two-phase flow pressure equation of the sequentia...
Definition: 3dpressureadaptive.hh:78
void update()
updates the pressure field (analog to update function in IMPET)
Definition: 3dpressureadaptive.hh:195
void assembleHangingNodeInteractionVolume(InteractionVolume &interactionVolume)
assembles the matrix entries of one hanging node interaction volume into the global matrix
Definition: 3dpressureadaptive.hh:457
void assemble()
assembles the global matrix and rhs vector for the pressure solution
Definition: 3dpressureadaptive.hh:413
void initializeMatrix()
Initializes the sparse matrix for the pressure solution.
Definition: 3dpressureadaptive.hh:272
void initializeMatrixRowSize()
Initializes the row size of the sparse matrix for the pressure solution.
Definition: 3dpressureadaptive.hh:282
void initializeMatrixIndices()
Initializes the indices of the sparse matrix for the pressure solution.
Definition: 3dpressureadaptive.hh:366
FvMpfaL3dPressure2pAdaptive(Problem &problem)
Constructs a FvMpfaL3dPressure2pAdaptive object.
Definition: 3dpressureadaptive.hh:218
friend ParentType
Definition: 3dpressureadaptive.hh:168
void initialize(bool solveTwice=true)
Initializes the pressure model.
Definition: 3dpressureadaptive.hh:177
Provides methods for transmissibility calculation in 3-d.
Definition: 3dtransmissibilitycalculator.hh:51
Dune::FieldMatrix< Scalar, dim, 2 *dim - dim+1 > TransmissibilityType
Type of the transmissibility matrix.
Definition: 3dtransmissibilitycalculator.hh:78
The finite volume base class for the solution of a pressure equation.
Definition: sequential/cellcentered/pressure.hh:49
void initialize()
Initialize pressure model.
Definition: sequential/cellcentered/pressure.hh:213
PressureSolution & pressure()
Returns the vector containing the pressure solution.
Definition: sequential/cellcentered/pressure.hh:120
Matrix A_
Global stiffnes matrix (sparse matrix which is build by the initializeMatrix() function)
Definition: sequential/cellcentered/pressure.hh:324
RHSVector f_
Right hand side vector.
Definition: sequential/cellcentered/pressure.hh:325