Go to the documentation of this file.
40 if (
p.needReference())
43 scalar fixedMassOut = 0.0;
44 scalar adjustableMassOut = 0.0;
55 if (Up.
fixesValue() && !isA<inletOutletFvPatchVectorField>(Up))
65 fixedMassOut += phip[i];
79 adjustableMassOut += phip[i];
93 scalar massCorr = 1.0;
94 scalar magAdjustableMassOut =
mag(adjustableMassOut);
98 magAdjustableMassOut > VSMALL
99 && magAdjustableMassOut/totalFlux > SMALL
102 massCorr = (massIn - fixedMassOut)/adjustableMassOut;
104 else if (
mag(fixedMassOut - massIn)/totalFlux > 1
e-6)
107 <<
"Continuity error cannot be removed by adjusting the"
108 " outflow.\nPlease check the velocity boundary conditions"
109 " and/or run potentialFoam to initialise the outflow." <<
nl
110 <<
"Total flux : " << totalFlux <<
nl
111 <<
"Specified mass inflow : " << massIn <<
nl
112 <<
"Specified mass outflow : " << fixedMassOut <<
nl
113 <<
"Adjustable mass outflow : " << adjustableMassOut <<
nl
127 || isA<inletOutletFvPatchVectorField>(Up)
141 return mag(massIn)/totalFlux < SMALL
142 &&
mag(fixedMassOut)/totalFlux < SMALL
143 &&
mag(adjustableMassOut)/totalFlux < SMALL;
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
bool adjustPhi(surfaceScalarField &phi, const volVectorField &U, volScalarField &p)
Adjust the balance of fluxes to obey continuity.
#define forAll(list, i)
Loop across all elements in list.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
const Type & value() const
Return const reference to value.
dimensioned< scalar > mag(const dimensioned< Type > &)
virtual bool fixesValue() const
Return true if this patch field fixes a value.
For cases which do no have a pressure boundary adjust the balance of fluxes to obey continuity....
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionedScalar e
Elementary charge.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Generic GeometricField class.
virtual bool coupled() const
Return true if this patch field is coupled.