38 template<
class CloudType>
43 ejectedParcelType_(0),
44 injectionOffset_(1.1),
47 diameterParcelPatch_(),
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_(),
84 nParcelsTransferred_(0),
86 totalMassTransferred_()
90 template<
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_)
114 template<
class CloudType>
115 template<
class CloudTrackType>
118 const label primaryPatchi,
120 CloudTrackType&
cloud 129 forAll(injectorCells, facei)
131 const label celli = injectorCells[facei];
133 if (diameterParcelPatch_[facei] > 0)
135 const scalar offset =
140 diameterParcelPatch_[facei],
141 deltaFilmPatch_[primaryPatchi][facei]
152 cloud.setParcelThermoProperties(*pPtr, 0.0);
154 setParcelProperties(*pPtr, facei);
156 if (pPtr->nParticle() > 0.001)
159 cloud.checkParcelProperties(*pPtr, 0.0,
false);
162 cloud.addParticle(pPtr);
176 template<
class CloudType>
177 template<
class CloudTrackType>
181 CloudTrackType&
cloud 190 forAll(patchFaces, filmFacei)
192 const labelPair& patchAndFace = patchFaces[filmFacei];
193 const label patchi = patchAndFace.
first();
194 const label facei = patchAndFace.
second();
196 if (patchi < 0)
continue;
200 if (diameterParcelPatch_[filmFacei] > 0)
202 const scalar offset =
203 injectionOffset_ *
max 205 diameterParcelPatch_[filmFacei],
206 deltaFilmPatch_[patchi][facei]
217 new parcelType(this->owner().pMesh(),
pos, celli);
220 cloud.setParcelThermoProperties(*pPtr, 0.0);
222 setParcelProperties(*pPtr, filmFacei);
224 if (pPtr->nParticle() > 0.001)
227 cloud.checkParcelProperties(*pPtr, 0.0,
false);
230 cloud.addParticle(pPtr);
244 template<
class CloudType>
245 template<
class TrackCloudType>
258 const auto* filmPtr =
259 mesh.
time().objectRegistry::template findObject<regionFilm>
261 "surfaceFilmProperties" 264 if (filmPtr && filmPtr->active())
266 const auto& film = *filmPtr;
267 const labelList& filmPatches = film.intCoupledPatchIDs();
272 const label filmPatchi = filmPatches[i];
273 const label primaryPatchi = primaryPatches[i];
275 cacheFilmFields(filmPatchi, primaryPatchi, film);
290 const areaFilm& regionFa
291 :
mesh.
time().objectRegistry::template csorted<areaFilm>()
294 if (regionFa.active())
296 auto& film =
const_cast<areaFilm&
>(regionFa);
302 cacheFilmFields(film);
304 injectParticles(patchFaces,
cloud);
306 forAll(patchFaces, filmFacei)
308 const label patchi = patchFaces[filmFacei].
first();
309 const label facei = patchFaces[filmFacei].second();
311 if (diameterParcelPatch_[filmFacei] > 0)
317 -massParcelPatch_[filmFacei],
329 template<
class CloudType>
332 const label filmPatchi,
333 const label primaryPatchi,
338 filmModel.
toPrimary(filmPatchi, massParcelPatch_);
340 diameterParcelPatch_ =
345 filmModel.
toPrimary(filmPatchi, UFilmPatch_);
348 filmModel.
toPrimary(filmPatchi, rhoFilmPatch_);
350 deltaFilmPatch_[primaryPatchi] =
352 filmModel.
toPrimary(filmPatchi, deltaFilmPatch_[primaryPatchi]);
356 template<
class CloudType>
369 const label nFaces = film.
Uf().
size();
374 massParcelPatch_.resize(nFaces,
Zero);
377 diameterParcelPatch_.resize(nFaces,
Zero);
397 const label patchi = patchFaces[i].
first();
398 const label facei = patchFaces[i].second();
402 deltaFilmPatch_[patchi][facei] = film.
h()[i];
408 template<
class CloudType>
412 const label filmFacei
417 p.d() = diameterParcelPatch_[filmFacei];
418 p.U() = UFilmPatch_[filmFacei];
419 p.rho() = rhoFilmPatch_[filmFacei];
421 p.nParticle() = massParcelPatch_[filmFacei]/
p.rho()/vol;
423 if (minDiameter_ != -1)
425 if (
p.d() < minDiameter_)
431 if (ejectedParcelType_ >= 0)
433 p.typeId() = ejectedParcelType_;
438 template<
class CloudType>
444 this->
template getModelProperty<label>(
"nParcelsTransferred");
447 this->
template getModelProperty<label>(
"nParcelsInjected");
449 scalar massTransferred0 =
450 this->
template getModelProperty<scalar>(
"massTransferred");
458 scalar massTransferredTotal =
462 Log_<<
" Surface film:" <<
nl 463 <<
" - parcels absorbed = " << nTransTotal <<
nl 464 <<
" - mass absorbed = " << massTransferredTotal <<
nl 465 <<
" - parcels ejected = " << nInjectTotal <<
endl;
467 if (this->writeTime())
469 this->setModelProperty(
"nParcelsTransferred", nTransTotal);
470 this->setModelProperty(
"nParcelsInjected", nInjectTotal);
471 this->setModelProperty(
"massTransferred", massTransferredTotal);
473 nParcelsTransferred_ = 0;
474 nParcelsInjected_ = 0;
475 totalMassTransferred_ = 0;
Different types of constants.
const polyBoundaryMesh & pbm
void mapToSurface(const GeometricBoundaryField< Type, fvPatchField, volMesh > &, Field< Type > &result) const
Map volume boundary fields as area field.
const T & first() const noexcept
Access the first element.
void size(const label n)
Older name for setAddressableSize.
const surfaceVectorField & Sf() const
Return cell face area vectors.
void injectParticles(const label primaryPatchi, const labelUList &injectorCells, TrackCloudType &cloud)
Inject particles in cloud.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
virtual const volVectorField & Us() const =0
Return the film surface velocity [m/s].
Base class for surface film models.
void resize(const label len)
Adjust allocated size of list.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const volSurfaceMapping & vsm() const
Return mapping between surface and volume fields.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
T & first()
Access first element of the list, position [0].
Ostream & endl(Ostream &os)
Add newline and flush stream.
const labelList & whichPolyPatches() const
The polyPatches related to the areaMesh, in sorted order.
Base class for cloud sub-models.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
virtual const volScalarField & cloudMassTrans() const =0
Return mass transfer source - Eulerian phase only.
Smooth ATC in cells next to a set of patches supplied by type.
const Time & time() const
Return the top-level database.
Volume to surface and surface to volume mapping.
virtual const volScalarField & rho() const =0
Return the film density [kg/m3].
#define forAll(list, i)
Loop across all elements in list.
dimensionedScalar pos(const dimensionedScalar &ds)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
void toPrimary(const label regionPatchi, List< Type > ®ionField) const
Convert a local region field to the primary region.
UPtrList< const labelUList > faceCells() const
Return a list of faceCells for each patch.
const regionFaModel & region() const noexcept
Access to this region.
#define Log_
Report write to Foam::Info if the class log switch is true.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
A cloud is a registry collection of lagrangian particles.
const areaScalarField & h() const noexcept
Access const reference h.
virtual const volScalarField & delta() const =0
Return the film thickness [m].
const faMesh & regionMesh() const
Return the region mesh database.
constexpr scalar pi(M_PI)
void inject(TrackCloudType &cloud)
Inject parcels into the cloud.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
const uniformDimensionedVectorField & g
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
virtual void info()
Write surface film info.
Templated wall surface film model class.
virtual void setParcelProperties(parcelType &p, const label filmFacei) const
Set the individual parcel properties.
const labelList & primaryPatchIDs() const
List of patch IDs on the primary region coupled to this region.
dimensionedScalar pow3(const dimensionedScalar &ds)
virtual void cacheFilmFields(const label filmPatchi, const label primaryPatchi, const regionFilm &)
Cache the film fields in preparation for injection.
Foam::KinematicCloud< Cloud< basicKinematicCollidingParcel > > ::parcelType parcelType
Convenience typedef to the cloud's parcel type.
Mesh data needed to do the Finite Volume discretisation.
virtual const areaScalarField & rho() const =0
Access const reference rho.
return returnReduce(nRefine-oldNRefine, sumOp< label >())
const areaVectorField & Uf() const noexcept
Access const reference Uf.
SurfaceFilmModel(CloudType &owner)
Construct null from owner.
const List< labelPair > & whichPatchFaces() const
The polyPatch/local-face for each faceLabels()
const volVectorField & C() const
Return cell centres as volVectorField.
const T & second() const noexcept
Access the second element.
Templated base class for dsmc cloud.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
virtual const volScalarField & cloudDiameterTrans() const =0
Return the parcel diameters originating from film to cloud.
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.
static constexpr const zero Zero
Global zero (0)
virtual void addSources(const label patchi, const label facei, const scalar massSource, const vector &momentumSource, const scalar pressureSource, const scalar energySource=0)
Add sources.