View Issue Details

IDProjectCategoryView StatusLast Update
0003825OpenFOAM[All Projects] Bugpublic2022-04-11 16:10
ReporterNicolasDelaisseAssigned Tohenry 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSCentOSOS Version7
Product Version8 
Fixed in Versiondev 
Summary0003825: In cavitatingFoam correction of Uf is done with relative phi instead of absolute phi
DescriptionIn the solver cavitatingFoam.C, in case of a dynamic mesh, Uf is corrected In pEqn.H, on line 83 with the flux phi, which has been made relative on line 19, see the code below:
----------------------------------------------------
phi = fvc::flux(HbyA) + rhorAUf*fvc::ddtCorr(U, phi, Uf);
fvc::makeRelative(phi, U);
....
// Correct Uf if the mesh is moving
fvc::correctUf(Uf, U, phi);
-----------------------------------------------------

Based on the implementation of fvc::correctUf in fvcMeshPhi.C (see below), I believe the absolute flux phi should be used. This is also supported by the use of the function in other solvers.
----------------------------------------------------
 void Foam::fvc::correctUf
 (
     autoPtr<surfaceVectorField>& Uf,
     const volVectorField& U,
     const surfaceScalarField& phi
 )
 {
     const fvMesh& mesh = U.mesh();
 
     if (mesh.dynamic())
     {
         Uf() = fvc::interpolate(U);
         surfaceVectorField n(mesh.Sf()/mesh.magSf());
         Uf() += n*(phi/mesh.magSf() - (n & Uf()));
     }
 }
 ----------------------------------------------------

If this is not a bug, I would appreciate a comment on why the relative flux is used and why this is different from other solvers.
Otherwise, a possible fix is proposed below:
 ----------------------------------------------------
// Correct Uf if the mesh is moving
fvc::correctUf(Uf, U, fvc::absolute(phi, U));
 ----------------------------------------------------

Thanks in advance
TagsNo tags attached.

Activities

henry

2022-04-11 16:10

manager   ~0012544

Resolved by commit 48e2ff1fecc05b19fa3f421b2bbec6b2be3f735d

Issue History

Date Modified Username Field Change
2022-04-11 15:52 NicolasDelaisse New Issue
2022-04-11 16:10 henry Assigned To => henry
2022-04-11 16:10 henry Status new => resolved
2022-04-11 16:10 henry Resolution open => fixed
2022-04-11 16:10 henry Fixed in Version => dev
2022-04-11 16:10 henry Note Added: 0012544