Go to the documentation of this file.
36 namespace regionModels
38 namespace surfaceFilmModels
48 patchInjection::patchInjection
55 deltaStable_(coeffDict_.getOrDefault<scalar>(
"deltaStable", 0))
64 if (coeffDict_.readIfPresent(
"patches",
patchNames))
68 Info<<
" applying to patches:" <<
nl;
71 for (
const label patchi : patchSet)
73 patchIDs_[pidi++] = patchi;
76 patchIDs_.setSize(pidi);
77 patchInjectedMasses_.setSize(pidi, 0);
81 Info<<
" applying to all patches" <<
endl;
85 patchIDs_[patchi] = patchi;
88 patchInjectedMasses_.setSize(patchIDs_.size(), 0);
91 if (!patchIDs_.size())
94 <<
"No patches selected"
116 if (!patchIDs_.size())
return;
126 label patchi = patchIDs_[pidi];
131 scalar dMassPatch = 0;
137 scalar ddelta =
max(0.0,
delta[celli] - deltaStable_);
138 scalar dMass = ddelta*
rho[celli]*magSf[celli];
139 massToInject[celli] += dMass;
140 availableMass[celli] -= dMass;
144 patchInjectedMasses_[pidi] += dMassPatch;
145 addToInjectedMass(dMassPatch);
154 getModelProperty<scalarField>
156 "patchInjectedMasses",
161 scalarField patchInjectedMassTotals(patchInjectedMasses_);
163 patchInjectedMasses0 += patchInjectedMassTotals;
165 setModelProperty<scalarField>
167 "patchInjectedMasses",
171 patchInjectedMasses_ = 0;
183 getModelProperty<scalarField>
185 "patchInjectedMasses",
196 patchMasses[patchi] +=
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const word & name() const
Return name.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
scalarField patchInjectedMasses_
Injected mass for each patch at which the film is removed.
static constexpr const zero Zero
Global zero (0)
const labelList & processorPatches() const
Return list of processor patch labels.
virtual void patchInjectedMassTotals(scalarField &patchMasses) const
Accumulate the total mass injected for the patches into the.
virtual const volScalarField & delta() const =0
Return the film thickness [m].
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual ~patchInjection()
Destructor.
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
#define forAll(list, i)
Loop across all elements in list.
labelList patchIDs_
List of patch IDs at which the film is removed.
Base class for surface film models.
messageStream Info
Information stream (uses stdout - output is on the master only)
A patch is a list of labels that address the faces in the global face list.
virtual const volScalarField & magSf() const
Return the face area magnitudes / [m2].
const fvMesh & regionMesh() const
Return the region mesh database.
void setSize(const label newLen)
Same as resize()
wordList patchNames(nPatches)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Base class for film injection models, handling mass transfer from the film.
Macros for easy insertion into run-time selection tables.
virtual const volScalarField & rho() const =0
Return the film density [kg/m3].
const labelUList & faceCells() const
Return face-cell addressing.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
defineTypeNameAndDebug(kinematicSingleLayer, 0)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
A List of wordRe with additional matching capabilities.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
const globalMeshData & globalData() const
Return parallel info.
Smooth ATC in cells next to a set of patches supplied by type.