From 67ff5da438be344996754a166299e7b7fc236fe9 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 26 Apr 2023 14:22:37 +0100 Subject: [PATCH] ThermoSurfaceFilm: Rationalised names --- .../ThermoSurfaceFilm/ThermoSurfaceFilm.C | 74 +++++++++---------- .../ThermoSurfaceFilm/ThermoSurfaceFilm.H | 24 +++--- 2 files changed, 47 insertions(+), 51 deletions(-) diff --git a/src/parcelSurfaceFilmModels/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/parcelSurfaceFilmModels/ThermoSurfaceFilm/ThermoSurfaceFilm.C index fced7e8d9f..f236abfaaf 100644 --- a/src/parcelSurfaceFilmModels/ThermoSurfaceFilm/ThermoSurfaceFilm.C +++ b/src/parcelSurfaceFilmModels/ThermoSurfaceFilm/ThermoSurfaceFilm.C @@ -62,7 +62,7 @@ Foam::vector Foam::ThermoSurfaceFilm::splashDirection template void Foam::ThermoSurfaceFilm::absorbInteraction ( - surfaceFilm& filmModel, + thermoSurfaceFilm& filmModel, const parcelType& p, const polyPatch& pp, const label facei, @@ -151,7 +151,7 @@ void Foam::ThermoSurfaceFilm::bounceInteraction template void Foam::ThermoSurfaceFilm::drySplashInteraction ( - surfaceFilm& filmModel, + thermoSurfaceFilm& filmModel, const parcelType& p, const polyPatch& pp, const label facei, @@ -214,7 +214,7 @@ void Foam::ThermoSurfaceFilm::drySplashInteraction template void Foam::ThermoSurfaceFilm::wetSplashInteraction ( - surfaceFilm& filmModel, + thermoSurfaceFilm& filmModel, parcelType& p, const polyPatch& pp, const label facei, @@ -298,7 +298,7 @@ void Foam::ThermoSurfaceFilm::wetSplashInteraction template void Foam::ThermoSurfaceFilm::splashInteraction ( - surfaceFilm& filmModel, + thermoSurfaceFilm& filmModel, const parcelType& p, const polyPatch& pp, const label facei, @@ -431,30 +431,30 @@ void Foam::ThermoSurfaceFilm::splashInteraction template -Foam::UPtrList& -Foam::ThermoSurfaceFilm::surfaceFilmPtrs() const +Foam::UPtrList& +Foam::ThermoSurfaceFilm::filmPtrs() const { const objectRegistry& db = this->owner().mesh().time(); - if (!surfaceFilmNames_.empty() && surfaceFilms_.empty()) + if (!filmNames_.empty() && films_.empty()) { // If there are multiple surface films and/or surface films with - // non-default names, then require the surfaceFilms entry to have been + // non-default names, then require the films entry to have been // specified { - HashTable surfaceFilmPtrs = - db.lookupClass(); + HashTable filmPtrs = + db.lookupClass(); const word defaultName = - surfaceFilm::typeName + "Properties"; + thermoSurfaceFilm::typeName + "Properties"; if ( ( - surfaceFilmPtrs.size() == 1 - && surfaceFilmPtrs.begin().key() != defaultName + filmPtrs.size() == 1 + && filmPtrs.begin().key() != defaultName ) - || (surfaceFilmPtrs.size() > 1) + || (filmPtrs.size() > 1) ) { this->coeffDict().lookup("surfaceFilms"); @@ -462,33 +462,33 @@ Foam::ThermoSurfaceFilm::surfaceFilmPtrs() const } // Cache pointers to the surface film models - surfaceFilms_.resize(surfaceFilmNames_.size()); - filmPatches_.setSize(surfaceFilms_.size()); + films_.resize(filmNames_.size()); + filmPatches_.setSize(films_.size()); - forAll(surfaceFilms_, filmi) + forAll(films_, filmi) { - surfaceFilms_.set + films_.set ( filmi, - &db.template lookupObjectRef + &db.template lookupObjectRef ( - surfaceFilmNames_[filmi] + "Properties" + filmNames_[filmi] + "Properties" ) ); - if (surfaceFilms_[filmi].primaryPatchIDs().size() > 1) + if (films_[filmi].primaryPatchIDs().size() > 1) { FatalErrorInFunction << "Number of film primary patch IDs > 1 for film " - << surfaceFilms_[filmi].name() + << films_[filmi].name() << exit(FatalError); } - filmPatches_[filmi] = surfaceFilms_[filmi].primaryPatchIDs()[0]; + filmPatches_[filmi] = films_[filmi].primaryPatchIDs()[0]; } } - return surfaceFilms_; + return films_; } @@ -496,7 +496,7 @@ template const Foam::labelList& Foam::ThermoSurfaceFilm::filmPatches() const { // Ensure filmPatches_ has been initialise - surfaceFilmPtrs(); + filmPtrs(); return filmPatches_; } @@ -505,7 +505,7 @@ const Foam::labelList& Foam::ThermoSurfaceFilm::filmPatches() const template void Foam::ThermoSurfaceFilm::cacheFilmFields(const label filmi) { - const surfaceFilm& filmModel = this->surfaceFilmPtrs()[filmi]; + const thermoSurfaceFilm& filmModel = this->filmPtrs()[filmi]; const label filmPatchi = filmModel.intCoupledPatchIDs()[0]; this->massParcelPatch_ = @@ -526,14 +526,10 @@ void Foam::ThermoSurfaceFilm::cacheFilmFields(const label filmi) filmModel.delta().boundaryField()[filmPatchi]; filmModel.toPrimary(filmPatchi, this->deltaFilmPatch_); - const thermoSurfaceFilm& thermalFilmModel = - refCast(filmModel); - - TFilmPatch_ = thermalFilmModel.thermo().T().boundaryField()[filmPatchi]; + TFilmPatch_ = filmModel.thermo().T().boundaryField()[filmPatchi]; filmModel.toPrimary(filmPatchi, TFilmPatch_); - CpFilmPatch_ = - thermalFilmModel.thermo().Cpv().boundaryField()[filmPatchi]; + CpFilmPatch_ = filmModel.thermo().Cpv().boundaryField()[filmPatchi]; filmModel.toPrimary(filmPatchi, CpFilmPatch_); } @@ -576,15 +572,15 @@ Foam::ThermoSurfaceFilm::ThermoSurfaceFilm : SurfaceFilmModel(dict, owner, typeName), rndGen_(owner.rndGen()), - surfaceFilmNames_ + filmNames_ ( this->coeffDict().lookupOrDefault ( "surfaceFilms", - wordList(1, surfaceFilm::typeName) + wordList(1, thermoSurfaceFilm::typeName) ) ), - surfaceFilms_(), + films_(), UFilmPatch_(0), rhoFilmPatch_(0), TFilmPatch_(0), @@ -626,8 +622,8 @@ Foam::ThermoSurfaceFilm::ThermoSurfaceFilm : SurfaceFilmModel(sfm), rndGen_(sfm.rndGen_), - surfaceFilmNames_(sfm.surfaceFilmNames_), - surfaceFilms_(), + filmNames_(sfm.filmNames_), + films_(), UFilmPatch_(sfm.UFilmPatch_), rhoFilmPatch_(sfm.rhoFilmPatch_), TFilmPatch_(sfm.TFilmPatch_), @@ -662,9 +658,9 @@ bool Foam::ThermoSurfaceFilm::transferParcel { const label patchi = pp.index(); - forAll(this->surfaceFilmPtrs(), filmi) + forAll(this->filmPtrs(), filmi) { - surfaceFilm& filmModel = this->surfaceFilmPtrs()[filmi]; + thermoSurfaceFilm& filmModel = this->filmPtrs()[filmi]; if (filmModel.isFilmPatch(patchi)) { diff --git a/src/parcelSurfaceFilmModels/ThermoSurfaceFilm/ThermoSurfaceFilm.H b/src/parcelSurfaceFilmModels/ThermoSurfaceFilm/ThermoSurfaceFilm.H index 5c71a0f3a4..fa8a2bf52f 100644 --- a/src/parcelSurfaceFilmModels/ThermoSurfaceFilm/ThermoSurfaceFilm.H +++ b/src/parcelSurfaceFilmModels/ThermoSurfaceFilm/ThermoSurfaceFilm.H @@ -57,7 +57,7 @@ namespace Foam { // Forward declaration of classes -class surfaceFilm; +class thermoSurfaceFilm; class Random; @@ -95,7 +95,7 @@ class ThermoSurfaceFilm // Private Member Functions //- Return pointers to the films - UPtrList& surfaceFilmPtrs() const; + UPtrList& filmPtrs() const; protected: @@ -111,11 +111,11 @@ protected: // Film models - //- Names of the surface films - const wordList surfaceFilmNames_; + //- Names of the films + const wordList filmNames_; - //- Pointers to the surface films - mutable UPtrList surfaceFilms_; + //- Pointers to the films + mutable UPtrList films_; //- List of film patches mutable labelList filmPatches_; @@ -188,7 +188,7 @@ protected: //- Absorb parcel into film void absorbInteraction ( - surfaceFilm&, + thermoSurfaceFilm&, const parcelType& p, const polyPatch& pp, const label facei, @@ -208,7 +208,7 @@ protected: //- Parcel interaction with dry surface void drySplashInteraction ( - surfaceFilm&, + thermoSurfaceFilm&, const parcelType& p, const polyPatch& pp, const label facei, @@ -218,7 +218,7 @@ protected: //- Parcel interaction with wetted surface void wetSplashInteraction ( - surfaceFilm&, + thermoSurfaceFilm&, parcelType& p, const polyPatch& pp, const label facei, @@ -228,7 +228,7 @@ protected: //- Bai parcel splash interaction model void splashInteraction ( - surfaceFilm&, + thermoSurfaceFilm&, const parcelType& p, const polyPatch& pp, const label facei, @@ -285,7 +285,7 @@ public: // Evaluation - //- Transfer parcel from cloud to surface film + //- Transfer parcel from cloud to film // Returns true if parcel is to be transferred virtual bool transferParcel ( @@ -297,7 +297,7 @@ public: // I-O - //- Write surface film info to stream + //- Write film info to stream virtual void info(Ostream& os); };