42 template<
class CloudType>
50 parent->thisDb().csorted
62 template<
class CloudType>
70 const_cast<objectRegistry&>(parent->thisDb()).sorted
85 template<
class CloudType>
90 ejectedParcelType_(0),
91 injectionOffset_(1.1),
94 diameterParcelPatch_(),
98 nParcelsTransferred_(0),
100 totalMassTransferred_(0)
104 template<
class CloudType>
116 this->coeffDict().template getOrDefault<label>(
"ejectedParcelType", -1)
120 this->coeffDict().template getOrDefault<scalar>(
"injectionOffset", 1.1)
124 this->coeffDict().template getOrDefault<scalar>(
"minDiameter", -1)
127 diameterParcelPatch_(),
131 nParcelsTransferred_(0),
132 nParcelsInjected_(0),
133 totalMassTransferred_()
137 template<
class CloudType>
145 ejectedParcelType_(sfm.ejectedParcelType_),
146 injectionOffset_(sfm.injectionOffset_),
147 minDiameter_(sfm.minDiameter_),
148 massParcelPatch_(sfm.massParcelPatch_),
149 diameterParcelPatch_(sfm.diameterParcelPatch_),
150 UFilmPatch_(sfm.UFilmPatch_),
151 rhoFilmPatch_(sfm.rhoFilmPatch_),
152 deltaFilmPatch_(sfm.deltaFilmPatch_),
153 nParcelsTransferred_(sfm.nParcelsTransferred_),
154 nParcelsInjected_(sfm.nParcelsInjected_),
155 totalMassTransferred_(sfm.totalMassTransferred_)
161 template<
class CloudType>
162 template<
class CloudTrackType>
165 const label primaryPatchi,
167 CloudTrackType&
cloud 176 forAll(injectorCells, facei)
178 const label celli = injectorCells[facei];
180 if (diameterParcelPatch_[facei] > 0)
182 const scalar offset =
187 diameterParcelPatch_[facei],
188 deltaFilmPatch_[primaryPatchi][facei]
199 cloud.setParcelThermoProperties(*pPtr, 0.0);
201 setParcelProperties(*pPtr, facei);
203 if (pPtr->nParticle() > 0.001)
206 cloud.checkParcelProperties(*pPtr, 0.0,
false);
209 cloud.addParticle(pPtr);
223 template<
class CloudType>
224 template<
class CloudTrackType>
228 CloudTrackType&
cloud 237 forAll(patchFaces, filmFacei)
239 const labelPair& patchAndFace = patchFaces[filmFacei];
240 const label patchi = patchAndFace.
first();
241 const label facei = patchAndFace.
second();
243 if (patchi < 0)
continue;
247 if (diameterParcelPatch_[filmFacei] > 0)
249 const scalar offset =
250 injectionOffset_ *
max 252 diameterParcelPatch_[filmFacei],
253 deltaFilmPatch_[patchi][facei]
264 new parcelType(this->owner().pMesh(),
pos, celli);
267 cloud.setParcelThermoProperties(*pPtr, 0.0);
269 setParcelProperties(*pPtr, filmFacei);
271 if (pPtr->nParticle() > 0.001)
274 cloud.checkParcelProperties(*pPtr, 0.0,
false);
277 cloud.addParticle(pPtr);
291 template<
class CloudType>
292 template<
class TrackCloudType>
305 const auto* filmPtr =
306 mesh.
time().objectRegistry::template findObject<regionFilm>
308 "surfaceFilmProperties" 311 if (filmPtr && filmPtr->active())
313 const auto& film = *filmPtr;
314 const labelList& filmPatches = film.intCoupledPatchIDs();
319 const label filmPatchi = filmPatches[i];
320 const label primaryPatchi = primaryPatches[i];
322 cacheFilmFields(filmPatchi, primaryPatchi, film);
343 cacheFilmFields(film);
345 injectParticles(patchFaces,
cloud);
347 forAll(patchFaces, filmFacei)
349 const label patchi = patchFaces[filmFacei].
first();
350 const label facei = patchFaces[filmFacei].second();
352 if (diameterParcelPatch_[filmFacei] > 0)
358 -massParcelPatch_[filmFacei],
370 template<
class CloudType>
373 const label filmPatchi,
374 const label primaryPatchi,
379 filmModel.
toPrimary(filmPatchi, massParcelPatch_);
381 diameterParcelPatch_ =
386 filmModel.
toPrimary(filmPatchi, UFilmPatch_);
389 filmModel.
toPrimary(filmPatchi, rhoFilmPatch_);
391 deltaFilmPatch_[primaryPatchi] =
393 filmModel.
toPrimary(filmPatchi, deltaFilmPatch_[primaryPatchi]);
397 template<
class CloudType>
410 const label nFaces = film.
Uf().
size();
415 massParcelPatch_.resize(nFaces,
Zero);
418 diameterParcelPatch_.resize(nFaces,
Zero);
438 const label patchi = patchFaces[i].
first();
439 const label facei = patchFaces[i].second();
443 deltaFilmPatch_[patchi][facei] = film.
h()[i];
449 template<
class CloudType>
453 const label filmFacei
458 p.d() = diameterParcelPatch_[filmFacei];
459 p.U() = UFilmPatch_[filmFacei];
460 p.rho() = rhoFilmPatch_[filmFacei];
462 p.nParticle() = massParcelPatch_[filmFacei]/
p.rho()/vol;
464 if (minDiameter_ != -1)
466 if (
p.d() < minDiameter_)
472 if (ejectedParcelType_ >= 0)
474 p.typeId() = ejectedParcelType_;
479 template<
class CloudType>
485 this->
template getModelProperty<label>(
"nParcelsTransferred");
488 this->
template getModelProperty<label>(
"nParcelsInjected");
490 scalar massTransferred0 =
491 this->
template getModelProperty<scalar>(
"massTransferred");
499 scalar massTransferredTotal =
503 Log_<<
" Surface film:" <<
nl 504 <<
" - parcels absorbed = " << nTransTotal <<
nl 505 <<
" - mass absorbed = " << massTransferredTotal <<
nl 506 <<
" - parcels ejected = " << nInjectTotal <<
endl;
508 if (this->writeTime())
510 this->setModelProperty(
"nParcelsTransferred", nTransTotal);
511 this->setModelProperty(
"nParcelsInjected", nInjectTotal);
512 this->setModelProperty(
"massTransferred", massTransferredTotal);
514 nParcelsTransferred_ = 0;
515 nParcelsInjected_ = 0;
516 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.
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.
void resize(const label len)
Alter addressable list size, allocating new space if required while recovering old content...
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 list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Switch active() const noexcept
Return the active flag.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh...
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.
static UPtrList< const areaFilm > csorted_areaFilms(const polyMesh &)
Registry.
const labelList & primaryPatchIDs() const
List of patch IDs on the primary region coupled to this region.
static UPtrList< areaFilm > sorted_areaFilms(const polyMesh &)
Return a sorted list of area-film objects that are registered on the faMeshesRegistry.
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.
static const objectRegistry * registry(const polyMesh &pMesh)
Find the singleton parent registry (on the polyMesh) that contains all objects related to finite-area...
SurfaceFilmModel(CloudType &owner)
Construct null from owner.
Mesh consisting of general polyhedral cells.
const List< labelPair > & whichPatchFaces() const
The polyPatch/local-face for each faceLabels()
const volVectorField & C() const
Return cell centres as volVectorField.
Registry of regIOobjects.
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.