55 if (isA<immersedBoundaryFvPatchVectorField>(Up))
63 const immersedBoundaryFvPatchVectorField& ibU =
64 refCast<const immersedBoundaryFvPatchVectorField>(Up);
72 const scalar triFlux =
sum(ibU.refValue() & ibPatch.
triSf());
86 const label curFace = ibFaces[faceI];
87 const bool curFlip = ibFaceFlips[faceI];
89 if (
mesh.isInternalFace(curFace))
91 const scalar curFlux = phiInternal[curFace];
124 const label patchID =
125 mesh.boundaryMesh().whichPatch(curFace);
127 mesh.boundaryMesh()[patchID].whichFace(curFace);
129 const scalar curFlux =
130 phi.boundaryField()[patchID][faceID];
137 if (
mesh.boundaryMesh()[patchID].coupled())
143 fixedFlux += curFlux;
153 scalar imbalance = (fluxIn - fluxOut + fixedFlux) - triFlux;
157 Info<<
"triFlux = " << triFlux
158 <<
" fluxIn = " << fluxIn <<
" fluxOut = " << fluxOut
159 <<
" fixedFlux = " << fixedFlux
160 <<
" imbalance = " << imbalance
164 scalar massCorr = 1.0;
166 if (
mag(imbalance) > SMALL)
170 if (fluxIn > fluxOut)
174 massCorr = 1 - imbalance/(fluxIn + SMALL);
178 Info<<
"Scaling down incoming flux with factor = "
182 scalar newFluxIn = 0;
187 const label curFace = ibFaces[faceI];
188 const bool curFlip = ibFaceFlips[faceI];
190 if (
mesh.isInternalFace(curFace))
193 scalar& curFlux = phiInternal[curFace];
202 newFluxIn -= curFlux;
212 newFluxIn += curFlux;
221 massCorr = 1 + imbalance/(fluxOut + SMALL);
225 Info<<
"Scaling down outgoing flux with factor = "
229 scalar newFluxOut = 0;
234 const label curFace = ibFaces[faceI];
235 const bool curFlip = ibFaceFlips[faceI];
237 if (
mesh.isInternalFace(curFace))
240 scalar& curFlux = phiInternal[curFace];
249 newFluxOut += curFlux;
259 newFluxOut -= curFlux;