35 namespace regionModels
37 namespace areaSurfaceFilmModels
49 injectionModelList::injectionModelList
70 Info<<
" Selecting film injection models" <<
endl;
76 for (
const word& model : models)
129 for (injectionModel& im : models)
147 const List<labelPair>& patchFaces
150 if (patchFaces.size() != availableMass.
size())
153 <<
"film has " << patchFaces.size()
154 <<
" faces, but availableMass has " << availableMass.
size()
162 for (injectionModel& im : models)
172 massInjected_ +=
gSum(massToInjectTmp);
177 const labelPair& patchAndFace = patchFaces[i];
179 if (patchAndFace.first() >= 0)
182 = massToInjectTmp[i];
185 = diameterToInjectTmp[i];
196 scalar injectedMass = 0;
197 scalar patchInjectedMasses = 0;
199 for (
const injectionModel& im : *
this)
201 injectedMass += im.injectedMassTotal();
202 im.patchInjectedMassTotals(patchInjectedMasses);
208 scalar mass(massInjected_);
211 os <<
indent <<
"injected mass = " << injectedMass <<
nl;
213 if (
mag(patchInjectedMasses) > VSMALL)
217 for (
const label patchi :
film().primaryPatchIDs())
219 os <<
' ' <<
pbm[patchi].name();
221 os <<
" = " << patchInjectedMasses <<
nl;
226 for (
const label patchi :
film().primaryPatchIDs())
228 os <<
' ' <<
pbm[patchi].name();
230 os <<
" " << mass <<
endl;
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return an entry data stream. FatalIOError if not found, or not a stream. ...
const polyBoundaryMesh & pbm
void size(const label n)
Older name for setAddressableSize.
Ostream & indent(Ostream &os)
Indent stream.
virtual void correct(scalarField &availableMass, volScalarField &massToInject, volScalarField &diameterToInject)
Correct.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Type getBaseProperty(const word &entryName, const Type &defaultValue=Type(Zero)) const
Retrieve generic property from the base model.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void info(Ostream &os)
Provide some info.
const dictionary & dict() const
Return const access to the cloud dictionary.
Base class for film injection models, handling mass transfer from the film.
label nFaces() const noexcept
Number of patch faces.
virtual bool writeTime() const
Flag to indicate when to write a property.
#define forAll(list, i)
Loop across all elements in list.
Type gSum(const FieldField< Field, Type > &f)
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
label size() const noexcept
The number of entries in the list.
const fvMesh & primaryMesh() const noexcept
Return the reference to the primary mesh database.
const faMesh & regionMesh() const
Return the region mesh database.
errorManip< error > abort(error &err)
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Pair< label > labelPair
A pair of labels.
OBJstream os(runTime.globalPath()/outputName)
void setSize(const label newLen)
Same as resize()
const labelList & primaryPatchIDs() const
List of patch IDs on the primary region coupled to this region.
bool empty() const noexcept
True if the list is empty (ie, size() is zero)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
void setBaseProperty(const word &entryName, const Type &value)
Add generic property to the base model.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual ~injectionModelList()
Destructor.
const List< labelPair > & whichPatchFaces() const
The polyPatch/local-face for each faceLabels()
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
static autoPtr< injectionModel > New(liquidFilmBase &film, const dictionary &dict, const word &mdoelType)
Return a reference to the selected injection model.
static constexpr const zero Zero
Global zero (0)
const liquidFilmBase & film() const
Return const access to the film surface film model.