43 if (
p.needReference())
46 scalar fixedMassOut = 0.0;
47 scalar adjustableMassOut = 0.0;
49 surfaceScalarField::Boundary& bphi =
50 phi.boundaryFieldRef();
59 if (Up.
fixesValue() && !isA<inletOutletFvPatchVectorField>(Up))
69 fixedMassOut += phip[i];
83 adjustableMassOut += phip[i];
91 scalar totalFlux = VSMALL +
sum(
mag(
phi)).value();
97 scalar massCorr = 1.0;
98 scalar magAdjustableMassOut =
mag(adjustableMassOut);
102 magAdjustableMassOut > VSMALL
103 && magAdjustableMassOut/totalFlux > SMALL
106 massCorr = (massIn - fixedMassOut)/adjustableMassOut;
108 else if (
mag(fixedMassOut - massIn)/totalFlux > 1
e-8)
111 <<
"Continuity error cannot be removed by adjusting the"
112 " outflow.\nPlease check the velocity boundary conditions"
113 " and/or run potentialFoam to initialise the outflow." <<
nl
114 <<
"Total flux : " << totalFlux <<
nl
115 <<
"Specified mass inflow : " << massIn <<
nl
116 <<
"Specified mass outflow : " << fixedMassOut <<
nl
117 <<
"Adjustable mass outflow : " << adjustableMassOut <<
nl
131 || isA<inletOutletFvPatchVectorField>(Up)
145 return mag(massIn)/totalFlux < SMALL
146 &&
mag(fixedMassOut)/totalFlux < SMALL
147 &&
mag(adjustableMassOut)/totalFlux < SMALL;