42template<
class CloudType>
50 parent->thisDb().csorted
62template<
class CloudType>
85template<
class CloudType>
90 ejectedParcelType_(0),
91 injectionOffset_(1.1),
94 diameterParcelPatch_(),
104template<
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_(),
137template<
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_)
161template<
class CloudType>
162template<
class CloudTrackType>
165 const label primaryPatchi,
167 CloudTrackType&
cloud
176 forAll(injectorCells, facei)
178 const label celli = injectorCells[facei];
182 const scalar offset =
199 cloud.setParcelThermoProperties(*pPtr, 0.0);
203 if (pPtr->nParticle() > 0.001)
206 cloud.checkParcelProperties(*pPtr, 0.0,
false);
209 cloud.addParticle(pPtr);
223template<
class CloudType>
224template<
class CloudTrackType>
228 CloudTrackType&
cloud
234 const auto& Cf =
mesh.C().boundaryField();
235 const auto& Sf =
mesh.Sf().boundaryField();
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;
245 const label celli =
pbm[patchi].faceCells()[facei];
249 const scalar offset =
267 cloud.setParcelThermoProperties(*pPtr, 0.0);
271 if (pPtr->nParticle() > 0.001)
274 cloud.checkParcelProperties(*pPtr, 0.0,
false);
277 cloud.addParticle(pPtr);
291template<
class CloudType>
292template<
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();
315 const labelList& primaryPatches = film.primaryPatchIDs();
319 const label filmPatchi = filmPatches[i];
320 const label primaryPatchi = primaryPatches[i];
322 cacheFilmFields(filmPatchi, primaryPatchi, film);
341 film.regionMesh().whichPatchFaces();
347 forAll(patchFaces, filmFacei)
349 const label patchi = patchFaces[filmFacei].
first();
350 const label facei = patchFaces[filmFacei].second();
370template<
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_);
397template<
class CloudType>
410 const label nFaces = film.
Uf().
size();
415 massParcelPatch_.resize(nFaces,
Zero);
418 diameterParcelPatch_.resize(nFaces,
Zero);
433 deltaFilmPatch_[patchi].resize(
pbm[patchi].size(),
Zero);
438 const label patchi = patchFaces[i].
first();
439 const label facei = patchFaces[i].second();
449template<
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)
479template<
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;
const polyBoundaryMesh & pbm
const uniformDimensionedVectorField & g
Base class for cloud sub-models.
const CloudType & owner() const
Return const access to the owner cloud.
virtual void info()
Write to info.
CloudSubModelBase(CloudType &owner)
Construct null from owner cloud.
virtual bool writeTime() const
Flag to indicate when to write a property.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const T & first() const noexcept
Access the first element.
const T & second() const noexcept
Access the second element.
Templated wall surface film model class.
static UPtrList< const areaFilm > csorted_areaFilms(const polyMesh &)
Registry.
virtual void setParcelProperties(parcelType &p, const label filmFacei) const
Field< vector > UFilmPatch_
Film velocity / patch face.
scalar minDiameter_
Minimum diameter particle injection.
scalarField rhoFilmPatch_
Film density / patch face.
scalarField massParcelPatch_
Parcel mass / patch face.
void inject(TrackCloudType &cloud)
Inject parcels into the cloud.
label nParcelsInjected_
Number of parcels injected from the film model.
const dimensionedVector & g_
Gravitational acceleration constant.
Field< scalarField > deltaFilmPatch_
Film height of all film patches / patch face.
virtual void cacheFilmFields(const label filmPatchi, const label primaryPatchi, const regionFilm &)
Cache the film fields in preparation for injection.
label ejectedParcelType_
Ejected parcel type label - id assigned to identify parcel for post-processing. If not specified,...
scalarField diameterParcelPatch_
Parcel diameter / patch face.
void injectParticles(const label primaryPatchi, const labelUList &injectorCells, CloudTrackType &cloud)
static UPtrList< areaFilm > sorted_areaFilms(const polyMesh &)
Return a sorted list of area-film objects that are registered on the faMeshesRegistry.
virtual void info()
Write surface film info.
scalar injectionOffset_
Injection offset position.
label nParcelsTransferred_
Number of parcels transferred to the film model.
const dimensionedVector & g() const noexcept
Return gravitational acceleration constant.
SurfaceFilmModel(CloudType &owner)
Construct null from owner.
Foam::KinematicCloud< Foam::DSMCCloud< dsmcParcel > >::parcelType parcelType
void injectParticles(const label primaryPatchi, const labelUList &injectorCells, TrackCloudType &cloud)
Inject particles in cloud.
scalar totalMassTransferred_
Total mass transferred to the film.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
T & first()
Access first element of the list, position [0].
void size(const label n)
Older name for setAddressableSize.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
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,...
const List< labelPair > & whichPatchFaces() const
The polyPatch/local-face for each faceLabels().
static const objectRegistry * registry(const polyMesh &pMesh)
Find the singleton parent registry (on the polyMesh) that contains all objects related to finite-area...
const labelList & whichPolyPatches() const
The polyPatches related to the areaMesh, in sorted order.
Smooth ATC in cells next to a set of patches supplied by type.
Mesh data needed to do the Finite Volume discretisation.
Registry of regIOobjects.
UPtrList< Type > sorted()
Return sorted list of objects with a class satisfying isA<Type> or isType<Type> (with Strict).
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
Mesh consisting of general polyhedral cells.
const regionFaModel & region() const noexcept
Access to this region.
virtual const areaScalarField & rho() const =0
Access const reference rho.
const areaVectorField & Uf() const noexcept
Access const reference Uf.
const areaScalarField & h() const noexcept
Access const reference h.
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.
const volSurfaceMapping & vsm() const
Return mapping between surface and volume fields.
const faMesh & regionMesh() const
Return the region mesh database.
void toPrimary(const label regionPatchi, List< Type > ®ionField) const
Convert a local region field to the primary region.
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.
bool getModelProperty(const word &entryName, Type &value) const
Retrieve generic property from the sub-model.
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
const dictionary & dict() const
Return const access to the cloud dictionary.
virtual bool active() const
Return the model 'active' status - default active = true.
void setModelProperty(const word &entryName, const Type &value)
Add generic property to the sub-model.
Volume to surface and surface to volume mapping.
void mapToSurface(const GeometricBoundaryField< Type, fvPatchField, volMesh > &, Field< Type > &result) const
Map volume boundary fields as area field.
A class for handling words, derived from Foam::string.
#define Log_
Report write to Foam::Info if the class log switch is true.
constexpr scalar pi(M_PI)
Different types of constants.
dimensionedScalar pos(const dimensionedScalar &ds)
Pair< label > labelPair
A pair of labels.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
DSMCCloud< dsmcParcel > CloudType
List< label > labelList
A List of labels.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
dimensionedScalar pow3(const dimensionedScalar &ds)
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
static constexpr const zero Zero
Global zero (0).
UList< label > labelUList
A UList of labels.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.