Go to the documentation of this file.
38 template<
class CloudType>
43 ejectedParcelType_(0),
44 injectionOffset_(1.1),
47 diameterParcelPatch_(0),
51 nParcelsTransferred_(0),
53 totalMassTransferred_(0)
57 template<
class CloudType>
69 this->coeffDict().template getOrDefault<label>(
"ejectedParcelType", -1)
73 this->coeffDict().template getOrDefault<scalar>(
"injectionOffset", 1.1)
77 this->coeffDict().template getOrDefault<scalar>(
"minDiameter", -1)
80 diameterParcelPatch_(0),
84 nParcelsTransferred_(0),
86 totalMassTransferred_()
90 template<
class CloudType>
114 template<
class CloudType>
121 template<
class CloudType>
122 template<
class CloudTrackType>
125 const label primaryPatchi,
127 CloudTrackType&
cloud
136 forAll(injectorCellsPatch, j)
138 if (diameterParcelPatch_[j] > 0)
140 const label celli = injectorCellsPatch[j];
142 const scalar offset =
145 diameterParcelPatch_[j],
146 deltaFilmPatch_[primaryPatchi][j]
148 const point pos = Cf[j] - injectionOffset_*offset*Sf[j]/magSf[j];
155 cloud.setParcelThermoProperties(*pPtr, 0.0);
157 setParcelProperties(*pPtr, j);
159 if (pPtr->nParticle() > 0.001)
162 cloud.checkParcelProperties(*pPtr, 0.0,
false);
165 cloud.addParticle(pPtr);
178 template<
class CloudType>
179 template<
class TrackCloudType>
192 mesh.
time().objectRegistry::template findObject
195 "surfaceFilmProperties"
199 if (filmModel && filmModel->
active())
207 const label filmPatchi = filmPatches[i];
208 const label primaryPatchi = primaryPatches[i];
212 cacheFilmFields(filmPatchi, primaryPatchi, *filmModel);
214 injectParticles(primaryPatchi, injectorCellsPatch,
cloud);
220 mesh.
time().objectRegistry::template
221 sortedNames<regionModels::regionFaModel>();
226 mesh.
time().objectRegistry::template cfindObject
232 if (regionFa && isA<areaFilm>(*regionFa) && regionFa->
active())
235 const_cast<areaFilm&
>(refCast<const areaFilm>(*regionFa));
241 cacheFilmFields(
patchId, film);
245 forAll(injectorCellsPatch, facei)
247 if (diameterParcelPatch_[facei] > 0)
253 -massParcelPatch_[facei],
265 template<
class CloudType>
268 const label filmPatchi,
269 const label primaryPatchi,
274 filmModel.
toPrimary(filmPatchi, massParcelPatch_);
276 diameterParcelPatch_ =
281 filmModel.
toPrimary(filmPatchi, UFilmPatch_);
284 filmModel.
toPrimary(filmPatchi, rhoFilmPatch_);
286 deltaFilmPatch_[primaryPatchi] =
288 filmModel.
toPrimary(filmPatchi, deltaFilmPatch_[primaryPatchi]);
292 template<
class CloudType>
295 const label filmPatchi,
301 massParcelPatch_.setSize(filmModel.
Uf().size(),
Zero);
306 map.
mapToField(massParcelPatch, massParcelPatch_);
311 diameterParcelPatch_.setSize(filmModel.
Uf().size(),
Zero);
312 map.
mapToField(diameterParcelPatch, diameterParcelPatch_);
314 UFilmPatch_.setSize(filmModel.
Uf().size(), vector::zero);
317 rhoFilmPatch_.setSize(UFilmPatch_.size(),
Zero);
320 deltaFilmPatch_[filmPatchi].setSize(UFilmPatch_.size(),
Zero);
321 map.
mapToField(filmModel.
h(), deltaFilmPatch_[filmPatchi]);
325 template<
class CloudType>
329 const label filmFacei
334 p.d() = diameterParcelPatch_[filmFacei];
335 p.U() = UFilmPatch_[filmFacei];
336 p.rho() = rhoFilmPatch_[filmFacei];
338 p.nParticle() = massParcelPatch_[filmFacei]/
p.rho()/vol;
340 if (minDiameter_ != -1)
342 if (
p.d() < minDiameter_)
348 if (ejectedParcelType_ >= 0)
350 p.typeId() = ejectedParcelType_;
355 template<
class CloudType>
359 this->
template getModelProperty<label>(
"nParcelsTransferred");
362 this->
template getModelProperty<label>(
"nParcelsInjected");
364 scalar massTransferred0 =
365 this->
template getModelProperty<scalar>(
"massTransferred");
373 scalar massTransferredTotal =
377 os <<
" Surface film:" <<
nl
378 <<
" - parcels absorbed = " << nTransTotal <<
nl
379 <<
" - mass absorbed = " << massTransferredTotal <<
nl
380 <<
" - parcels ejected = " << nInjectTotal <<
endl;
382 if (this->writeTime())
384 this->setModelProperty(
"nParcelsTransferred", nTransTotal);
385 this->setModelProperty(
"nParcelsInjected", nInjectTotal);
386 this->setModelProperty(
"massTransferred", massTransferredTotal);
388 nParcelsTransferred_ = 0;
389 nParcelsInjected_ = 0;
390 totalMassTransferred_ = 0;
virtual void cacheFilmFields(const label filmPatchi, const label primaryPatchi, const regionModels::surfaceFilmModels::surfaceFilmRegionModel &)
Cache the film fields in preparation for injection.
A class for handling words, derived from Foam::string.
Switch active() const
Return the active flag.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
static constexpr const zero Zero
Global zero (0)
const dimensionedVector & g_
Gravitational acceleration constant.
Different types of constants.
scalar injectionOffset_
Injection offset position.
scalar totalMassTransferred_
Total mass transferred to the film.
virtual const volScalarField & delta() const =0
Return the film thickness [m].
Field< vector > UFilmPatch_
Film velocity / patch face.
Base class for cloud sub-models.
label nParcelsTransferred_
Number of parcels transferred to the film model.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const volSurfaceMapping & vsm() const
Return mapping between surface and volume fields.
virtual ~SurfaceFilmModel()
Destructor.
label nParcelsInjected_
Number of parcels injected from the film model.
void mapToField(const GeometricField< Type, faPatchField, areaMesh > &af, Field< Type > &f) const
Map surface field to field.
#define forAll(list, i)
Loop across all elements in list.
virtual const volScalarField & cloudDiameterTrans() const =0
Return the parcel diameters originating from film.
const areaVectorField & Uf() const
Access const reference Uf.
virtual const volVectorField & Us() const =0
Return the film surface velocity [m/s].
void toPrimary(const label regionPatchi, List< Type > ®ionField) const
Convert a local region field to the primary region.
Field< scalarField > deltaFilmPatch_
Film height of all film patches / patch face.
Foam::KinematicCloud< Cloud< basicKinematicCollidingParcel > > ::parcelType parcelType
Convenience typedef to the cloud's parcel type.
virtual const volScalarField & cloudMassTrans() const =0
Return the film mass available for transfer.
Base class for surface film models.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
dimensionedScalar pow3(const dimensionedScalar &ds)
Templated wall surface film model class.
const fvMesh & mesh() const
Return reference to the mesh.
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
void inject(TrackCloudType &cloud)
Inject parcels into the cloud.
scalarField massParcelPatch_
Parcel mass / patch face.
const Switch & active() const
Return the active flag.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Templated base class for dsmc cloud.
const volVectorField & C() const
Return cell centres as volVectorField.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
virtual const volScalarField & rho() const =0
Return the film density [kg/m3].
virtual const volScalarField & cloudMassTrans() const =0
Return mass transfer source - Eulerian phase only.
scalarField rhoFilmPatch_
Film density / patch face.
Mesh data needed to do the Finite Volume discretisation.
scalar minDiameter_
Minimum diameter particle injection.
const uniformDimensionedVectorField & g
const regionFaModel & region() const
Access to this region.
virtual void setParcelProperties(parcelType &p, const label filmFacei) const
Set the individual parcel properties.
const labelList & primaryPatchIDs() const
Return the list of patch IDs on the primary region coupled.
virtual const areaScalarField & rho() const =0
Access const reference rho.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
virtual void addSources(const label patchi, const label facei, const scalar massSource, const vector &momentumSource, const scalar pressureSource, const scalar energySource=0)
Add sources.
A cloud is a registry collection of lagrangian particles.
void injectParticles(const label primaryPatchi, const labelList &injectorCellsPatch, TrackCloudType &cloud)
Inject particles in cloud.
constexpr scalar pi(M_PI)
Volume to surface and surface to volume mapping.
Base class for area region models.
const areaScalarField & h() const
Access const reference h.
label patchID() const
Return patch ID.
virtual void info(Ostream &os)
Write surface film info to stream.
label ejectedParcelType_
Ejected parcel type label - id assigned to identify parcel for.
virtual const volScalarField & cloudDiameterTrans() const =0
Return the parcel diameters originating from film to cloud.
const Time & time() const
Return the top-level database.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
SurfaceFilmModel(CloudType &owner)
Construct null from owner.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
scalarField diameterParcelPatch_
Parcel diameter / patch face.
const labelList & intCoupledPatchIDs() const
Return the list of patch IDs internally coupled with the.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
dimensionedScalar pos(const dimensionedScalar &ds)
const surfaceVectorField & Sf() const
Return cell face area vectors.