From 9f40e04cc1b392aa45838cae10b3e3fc31a1cd60 Mon Sep 17 00:00:00 2001 From: Kutalmis Bercin Date: Wed, 11 Oct 2023 11:23:08 +0100 Subject: [PATCH] BUG: ThermoSurfaceFilm: reintroduce energy to film sources (fixes #2996) --- .../ThermoSurfaceFilm/ThermoSurfaceFilm.C | 49 ++++++++++++++++++- .../ThermoSurfaceFilm/ThermoSurfaceFilm.H | 17 ++++++- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C index 045cc208fb..9162d8a5d0 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -62,6 +62,53 @@ Foam::ThermoSurfaceFilm::ThermoSurfaceFilm // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +template +void Foam::ThermoSurfaceFilm::absorbInteraction +( + filmType& film, + const parcelType& p, + const polyPatch& pp, + const label facei, + const scalar mass, + bool& keepParticle +) +{ + DebugInfo<< "Parcel " << p.origId() << " absorbInteraction" << endl; + + // Patch face normal + const vector& nf = pp.faceNormals()[facei]; + + // Patch velocity + const vector& Up = this->owner().U().boundaryField()[pp.index()][facei]; + + // Relative parcel velocity + const vector Urel(p.U() - Up); + + // Parcel normal velocity + const vector Un(nf*(Urel & nf)); + + // Parcel tangential velocity + const vector Ut(Urel - Un); + + film.addSources + ( + pp.index(), + facei, + mass, // mass + mass*Ut, // tangential momentum + mass*mag(Un), // impingement pressure + mass*p.hs() // energy + ); + + this->nParcelsTransferred()++; + + this->totalMassTransferred() += mass; + + keepParticle = false; +} + + template bool Foam::ThermoSurfaceFilm::transferParcel ( diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H index 51eaed0d87..da748ebd8c 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -141,6 +141,21 @@ public: // Member Functions + // Interaction models + + //- Absorb parcel into film + template + void absorbInteraction + ( + filmType&, + const parcelType& p, + const polyPatch& pp, + const label facei, + const scalar mass, + bool& keepParticle + ); + + // Evaluation //- Transfer parcel from cloud to surface film