38template<
class CloudType>
43 ejectedParcelType_(0),
44 injectionOffset_(1.1),
47 diameterParcelPatch_(0),
51 nParcelsTransferred_(0),
53 totalMassTransferred_(0)
57template<
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_()
90template<
class CloudType>
98 ejectedParcelType_(sfm.ejectedParcelType_),
99 injectionOffset_(sfm.injectionOffset_),
100 minDiameter_(sfm.minDiameter_),
101 massParcelPatch_(sfm.massParcelPatch_),
102 diameterParcelPatch_(sfm.diameterParcelPatch_),
103 UFilmPatch_(sfm.UFilmPatch_),
104 rhoFilmPatch_(sfm.rhoFilmPatch_),
105 deltaFilmPatch_(sfm.deltaFilmPatch_),
106 nParcelsTransferred_(sfm.nParcelsTransferred_),
107 nParcelsInjected_(sfm.nParcelsInjected_),
108 totalMassTransferred_(sfm.totalMassTransferred_)
114template<
class CloudType>
121template<
class CloudType>
122template<
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);
178template<
class CloudType>
179template<
class TrackCloudType>
192 mesh.
time().objectRegistry::template findObject
195 "surfaceFilmProperties"
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],
265template<
class CloudType>
268 const label filmPatchi,
269 const label primaryPatchi,
276 diameterParcelPatch_ =
281 filmModel.
toPrimary(filmPatchi, UFilmPatch_);
284 filmModel.
toPrimary(filmPatchi, rhoFilmPatch_);
286 deltaFilmPatch_[primaryPatchi] =
288 filmModel.
toPrimary(filmPatchi, deltaFilmPatch_[primaryPatchi]);
292template<
class CloudType>
295 const label filmPatchi,
301 massParcelPatch_.setSize(filmModel.
Uf().
size(),
Zero);
306 map.
mapToField(massParcelPatch, massParcelPatch_);
312 map.
mapToField(diameterParcelPatch, diameterParcelPatch_);
317 rhoFilmPatch_.setSize(UFilmPatch_.size(),
Zero);
320 deltaFilmPatch_[filmPatchi].setSize(UFilmPatch_.size(),
Zero);
321 map.
mapToField(filmModel.
h(), deltaFilmPatch_[filmPatchi]);
325template<
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_;
355template<
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;
const uniformDimensionedVectorField & g
Base class for cloud sub-models.
Templated base class for dsmc cloud.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void setSize(const label newLen)
Same as resize()
Templated wall surface film model class.
virtual void setParcelProperties(parcelType &p, const label filmFacei) const
Set the individual parcel properties.
virtual void cacheFilmFields(const label filmPatchi, const label primaryPatchi, const regionModels::surfaceFilmModels::surfaceFilmRegionModel &)
Cache the film fields in preparation for injection.
void inject(TrackCloudType &cloud)
Inject parcels into the cloud.
void injectParticles(const label primaryPatchi, const labelList &injectorCellsPatch, TrackCloudType &cloud)
Inject particles in cloud.
virtual ~SurfaceFilmModel()
Destructor.
CloudType::parcelType parcelType
Convenience typedef to the cloud's parcel type.
void size(const label n)
Older name for setAddressableSize.
A cloud is a registry collection of lagrangian particles.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
InfoProxy< ensightCells > info() const
Return info proxy.
Mesh data needed to do the Finite Volume discretisation.
const volVectorField & C() const
Return cell centres as volVectorField.
const Time & time() const
Return the top-level database.
const surfaceVectorField & Sf() const
Return cell face area vectors.
const surfaceScalarField & magSf() const
Return cell face area magnitudes.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
const regionFaModel & region() const
Access to this region.
const areaVectorField & Uf() const
Access const reference Uf.
const areaScalarField & h() const
Access const reference h.
virtual const areaScalarField & rho() const =0
Access const reference rho.
virtual const volScalarField & cloudDiameterTrans() const =0
Return the parcel diameters originating from film to cloud.
virtual const volScalarField & cloudMassTrans() const =0
Return mass transfer source - Eulerian phase only.
Base class for area region models.
label patchID() const
Return patch ID.
const Switch & active() const
Return the active flag.
const volSurfaceMapping & vsm() const
Return mapping between surface and volume fields.
const labelList & primaryPatchIDs() const
Return the list of patch IDs on the primary region coupled.
void toPrimary(const label regionPatchi, List< Type > ®ionField) const
Convert a local region field to the primary region.
const labelList & intCoupledPatchIDs() const
Return the list of patch IDs internally coupled with the.
Switch active() const
Return the active flag.
Base class for surface film models.
virtual const volVectorField & Us() const =0
Return the film surface velocity [m/s].
virtual const volScalarField & rho() const =0
Return the film density [kg/m3].
virtual const volScalarField & delta() const =0
Return the film thickness [m].
virtual const volScalarField & cloudDiameterTrans() const =0
Return the parcel diameters originating from film.
virtual const volScalarField & cloudMassTrans() const =0
Return the film mass available for transfer.
Volume to surface and surface to volume mapping.
void mapToField(const GeometricField< Type, faPatchField, areaMesh > &af, Field< Type > &f) const
Map surface field to field.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
constexpr scalar pi(M_PI)
Different types of constants.
dimensionedScalar pos(const dimensionedScalar &ds)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedScalar pow3(const dimensionedScalar &ds)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
A non-counting (dummy) refCount.