This commit is contained in:
Hrvoje Jasak 2017-12-28 19:37:14 +00:00
parent 47f7fcddc6
commit a6c6e3e64d

View file

@ -78,7 +78,6 @@ void Foam::immersedBoundaryFvPatch::makeSf(slicedSurfaceVectorField& Sf) const
// HJ, 30/Nov/2017 // HJ, 30/Nov/2017
Sf.boundaryField()[index()].UList::operator= Sf.boundaryField()[index()].UList::operator=
( (
// vectorField::subField(ibPolyPatch_.ibPatch().areas(), size())
vectorField::subField(ibPolyPatch_.correctedIbPatchFaceAreas(), size()) vectorField::subField(ibPolyPatch_.correctedIbPatchFaceAreas(), size())
); );
} }
@ -152,11 +151,10 @@ void Foam::immersedBoundaryFvPatch::updatePhi
// Check and adjust the immersed boundary space conservation law // Check and adjust the immersed boundary space conservation law
// The mesh motion fluxes come from the actual mesh motion or the motion // The mesh motion fluxes come from the actual mesh motion or the motion
// of the oimmersed boundary // of the immersed boundary
// The new cell volumes come from the current mesh configuration // The new cell volumes come from the current mesh configuration
// Neither can be touched. // The space conservation law will be satisfied by adjusting either
// The space conservation law will be satisfied by adjusting the old cell // the old or the new cell volume. HJ, 15/Dec/2017
// volume. HJ, 15/Dec/2017
// First sum up all the fluxes // First sum up all the fluxes
scalarField divPhi(mesh.nCells(), 0); scalarField divPhi(mesh.nCells(), 0);
@ -201,16 +199,14 @@ void Foam::immersedBoundaryFvPatch::updatePhi
{ {
if (magDivPhi[cellI] > SMALL) if (magDivPhi[cellI] > SMALL)
{ {
scalar corrOldVol = V[cellI] - divPhi[cellI]*deltaT; // Attempt to correct via old volume
scalar corrOldVol = newVols[cellI] - divPhi[cellI]*deltaT;
// Info<< "Flux maneouvre for cell " << cellI << ": " // Info<< "Flux maneouvre for cell " << cellI << ": "
// << " V: " << V[cellI] // << " V: " << newVols[cellI]
// << " V0: " << oldVols[cellI] // << " V0: " << oldVols[cellI]
// << " divPhi: " << divPhi[cellI] // << " divPhi: " << divPhi[cellI]
// << " Vcorr: " << corrOldVol // << " error: " << magDivPhi[cellI];
// << " error: " << magDivPhi[cellI]
// << " corr: "
// << (V[cellI] - Foam::max(corrOldVol, SMALL))*rDeltaT - divPhi[cellI]
// << endl;
if (corrOldVol < SMALL) if (corrOldVol < SMALL)
{ {