47 scalar fixedMassOut = 0.0;
48 scalar adjustableMassOut = 0.0;
55 if (!isA<processorFvsPatchScalarField>(phip))
60 && !isA<inletOutletFvPatchVectorField>(Up)
71 fixedMassOut += phip[i];
85 adjustableMassOut += phip[i];
93 scalar totalFlux = VSMALL +
sum(
mag(phi)).value();
99 scalar massCorr = 1.0;
100 scalar magAdjustableMassOut =
mag(adjustableMassOut);
104 magAdjustableMassOut > VSMALL
105 && magAdjustableMassOut/totalFlux > SMALL
108 massCorr = (massIn - fixedMassOut)/adjustableMassOut;
110 else if(
mag(fixedMassOut - massIn)/totalFlux > 1
e-10)
114 "adjustPhi(surfaceScalarField& phi, const volVectorField& U,"
115 "const volScalarField& p"
116 ) <<
"Continuity error cannot be removed by adjusting the"
117 " outflow.\nPlease check the velocity boundary conditions"
118 " and/or run potentialFoam to initialise the outflow." <<
nl
119 <<
"Total flux : " << totalFlux <<
nl
120 <<
"Specified mass inflow : " << massIn <<
nl
121 <<
"Specified mass outflow : " << fixedMassOut <<
nl
122 <<
"Adjustable mass outflow : " << adjustableMassOut <<
nl
131 if (!isA<processorFvsPatchScalarField>(phip))
136 || isA<inletOutletFvPatchVectorField>(Up)
150 return mag(massIn)/totalFlux < SMALL
151 &&
mag(fixedMassOut)/totalFlux < SMALL
152 &&
mag(adjustableMassOut)/totalFlux < SMALL;