Update sGamma handling

This commit is contained in:
Hrvoje Jasak 2019-07-01 18:26:31 +01:00
parent e2bffde2aa
commit 2a83c710b9
2 changed files with 12 additions and 9 deletions

View file

@ -124,7 +124,7 @@ void Foam::immersedBoundaryFvPatch::updatePhi
scalar rDeltaT = 1.0/deltaT; scalar rDeltaT = 1.0/deltaT;
// Multiply the raw mesh motion flux with the masking function // Multiply the raw mesh motion flux with the masking function
scalarField sGamma = scalarField ibAreaRatio =
mag(ibPolyPatch_.correctedFaceAreas())/mag(mesh.faceAreas()); mag(ibPolyPatch_.correctedFaceAreas())/mag(mesh.faceAreas());
// Scaling of internal mesh flux field should be done only for the current // Scaling of internal mesh flux field should be done only for the current
@ -140,7 +140,7 @@ void Foam::immersedBoundaryFvPatch::updatePhi
const label faceI = deadFaces[dfI]; const label faceI = deadFaces[dfI];
if (mesh.isInternalFace(faceI)) if (mesh.isInternalFace(faceI))
{ {
phiIn[faceI] *= sGamma[faceI]; phiIn[faceI] = scalar(0);
} }
} }
@ -150,7 +150,7 @@ void Foam::immersedBoundaryFvPatch::updatePhi
const label faceI = cutFaces[cfI]; const label faceI = cutFaces[cfI];
if (mesh.isInternalFace(faceI)) if (mesh.isInternalFace(faceI))
{ {
phiIn[faceI] *= sGamma[faceI]; phiIn[faceI] *= ibAreaRatio[faceI];
} }
} }
@ -160,7 +160,7 @@ void Foam::immersedBoundaryFvPatch::updatePhi
if (!isA<immersedBoundaryFvPatch>(mesh.boundary()[patchI])) if (!isA<immersedBoundaryFvPatch>(mesh.boundary()[patchI]))
{ {
phi.boundaryField()[patchI] *= phi.boundaryField()[patchI] *=
mesh.boundary()[patchI].patchSlice(sGamma); mesh.boundary()[patchI].patchSlice(ibAreaRatio);
} }
} }
@ -231,12 +231,11 @@ void Foam::immersedBoundaryFvPatch::updatePhi
// Attempt to correct via old volume // Attempt to correct via old volume
scalar corrOldVol = newVols[cellI] - divPhi[cellI]*deltaT; scalar corrOldVol = newVols[cellI] - divPhi[cellI]*deltaT;
// Info<< "Flux maneouvre for cell " << cellI << ": " // Pout<< "Flux maneouvre for cell " << cellI << ": "
// << " error: " << magDivPhi[cellI] // << " error: " << magDivPhi[cellI]
// << " V: " << newVols[cellI] // << " V: " << newVols[cellI]
// << " V0: " << oldVols[cellI] // << " V0: " << oldVols[cellI]
// << " divPhi: " << divPhi[cellI] // << " divPhi: " << divPhi[cellI];
// << endl;
if (corrOldVol < SMALL) if (corrOldVol < SMALL)
{ {
@ -248,6 +247,10 @@ void Foam::immersedBoundaryFvPatch::updatePhi
{ {
oldVols[cellI] = corrOldVol; oldVols[cellI] = corrOldVol;
} }
// scalar corrDivMeshPhi =
// mag((newVols[cellI] - oldVols[cellI]) - divPhi[cellI]*deltaT);
// Pout<< " Corrected: " << corrDivMeshPhi << endl;
} }
} }
} }

View file

@ -36,7 +36,7 @@ scalar velMag = 0.0;
if (mesh.nInternalFaces()) if (mesh.nInternalFaces())
{ {
surfaceScalarField magPhi = pos(sGamma - 0.5)*mag(phi); surfaceScalarField magPhi = sGamma*mag(phi);
surfaceScalarField SfUfbyDelta = surfaceScalarField SfUfbyDelta =
mesh.surfaceInterpolation::deltaCoeffs()*magPhi; mesh.surfaceInterpolation::deltaCoeffs()*magPhi;
@ -50,7 +50,7 @@ if (mesh.nInternalFaces())
velMag = max(magPhi/mesh.magSf()).value(); velMag = max(magPhi/mesh.magSf()).value();
} }
Info<< "Courant Number mean: " << meanCoNum Info<< "Immersed boundary Courant Number mean: " << meanCoNum
<< " max: " << CoNum << " max: " << CoNum
<< " velocity magnitude: " << velMag << " velocity magnitude: " << velMag
<< endl; << endl;