MRF - non zero flux through walls in nonRotatingPatches
Summary
When including a patch in nonRotatingPatches, even if the patch is a wall, the flux through the patch is not 0. Indeed, printing phi from adjustPhi.C results in both an inflow and an outflow - which are equals and therefore cancel out, but in my opinion, should not be there. In a real-life problem, this might result in a conservation error in the case of a closed domain due to a small discrepancy between inflow and outflow.
Steps to reproduce
print out flux through patches (e.g. replace lines 61 onwards of adjustPhi.C with
scalar massInStart = massIn;
scalar massOutStart = fixedMassOut;
forAll(phip, i)
{
if (phip[i] < 0.0)
{
massIn -= phip[i];
}
else
{
fixedMassOut += phip[i];
}
}
Info << "Mass in " << phip.patch().name() << endl;
Info << "equal to " << massIn- massInStart << endl;
Info << "Mass out " << phip.patch().name() << endl;
Info << "equal to " << fixedMassOut - massOutStart << endl;
and simpleFoam on the attached tutorial (modified from mixerVessel2DAMI)
What is the expected correct behavior?
I would expect phi equal to 0 both inflow and outflow
Environment information
OpenFOAM v2112
Possible fixes
I tried to fix the issue by forcing flux to 0 in MRFZoneTemplates.C on the excludedFaces, but I don't believe this is correct.