From 2cf8f66852bfb8562f87382b7f3f982798416830 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 15 May 2023 17:59:31 +0100 Subject: [PATCH] isothermalFilm/fvModels/filmCloudTransfer/ejectionModels: New film->cloud transfer sub-models The filmCloudTransfer fvModel now supports an optional ejection model which provides transfer of film to cloud by dripping from an inverted surface or curvature separation: Class Foam::filmEjectionModels::dripping Description Dripping film to cloud ejection transfer model On an inverted surface if the film thickness is sufficient to generate a valid parcel the equivalent mass is removed from the film and transfered to the cloud as a parcel containing droplets with a diameter obtained from the specified parcelDistribution. Usage Example usage: \verbatim filmCloudTransfer { type filmCloudTransfer; libs ("libfilmCloudTransfer.so"); ejection { model dripping; deltaStable 5e-4; minParticlesPerParcel 10; parcelDistribution { type RosinRammler; Q 0; min 1e-3; max 2e-3; d 7.5e-05; n 0.5; } } } \endverbatim Class Foam::filmEjectionModels::BrunDripping Description Brun dripping film to cloud ejection transfer model If the film thickness exceeds the critical value needed to generate one or more drops, the equivalent mass is removed from the film. The critical film thickness is calculated from the Rayleigh-Taylor stability analysis of film flow on an inclined plane by Brun et.al. Reference: \verbatim Brun, P. T., Damiano, A., Rieu, P., Balestra, G., & Gallaire, F. (2015). Rayleigh-Taylor instability under an inclined plane. Physics of Fluids (1994-present), 27(8), 084107. \endverbatim The diameter of the drops formed are obtained from the local capillary length multiplied by the \c dCoeff coefficient which defaults to 3.3. Reference: \verbatim Lefebvre, A. (1988). Atomisation and sprays (Vol. 1040, No. 2756). CRC press. \endverbatim Usage Example usage: \verbatim filmCloudTransfer { type filmCloudTransfer; libs ("libfilmCloudTransfer.so"); ejection { model BrunDripping; deltaStable 5e-4; } } \endverbatim Class Foam::filmEjectionModels::curvatureSeparation Description Curvature induced separation film to cloud ejection transfer model Assesses film curvature via the mesh geometry and calculates a force balance of the form: F_sum = F_inertial + F_body + F_surface_tension If F_sum < 0, the film separates and is transferred to the cloud if F_sum >= 0 the film remains attached. Reference: \verbatim Owen, I., & Ryley, D. J. (1985). The flow of thin liquid films around corners. International journal of multiphase flow, 11(1), 51-62. \endverbatim Usage Example usage: \verbatim filmCloudTransfer { type filmCloudTransfer; libs ("libfilmCloudTransfer.so"); ejection { model curvatureSeparation; deltaStable 5e-4; } } \endverbatim The new tutorials/modules/multiRegion/film/cylinderDripping tutorial case demonstrates a film dripping into the cloud. The standard cylinder case is turned upside-down (by changing the orientation of gravity) with an initial 0.2mm film of water over the surface which drips when the thickness is greater than 0.5mm. Settings for all three ejection models are provided in the constant/film/fvModels dictionary with the standard dripping model selected. --- .../modules/isothermalFilm/correctAlpha.C | 15 +- .../fvModels/filmCloudTransfer/Make/files | 5 + .../CloudFilmTransfer/CloudFilmTransfer.C | 27 +- .../CloudFilmTransfer/CloudFilmTransfer.H | 18 +- .../BrunDripping/BrunDripping.C | 147 +++++++++ .../BrunDripping/BrunDripping.H | 160 +++++++++ .../curvatureSeparation/curvatureSeparation.C | 309 ++++++++++++++++++ .../curvatureSeparation/curvatureSeparation.H | 175 ++++++++++ .../ejectionModels/dripping/dripping.C | 128 ++++++++ .../ejectionModels/dripping/dripping.H | 155 +++++++++ .../ejectionModel/ejectionModel.C | 105 ++++++ .../ejectionModel/ejectionModel.H | 161 +++++++++ .../ejectionModel/ejectionModelNew.C | 60 ++++ .../filmCloudTransfer/filmCloudTransfer.C | 121 ++++++- .../filmCloudTransfer/filmCloudTransfer.H | 37 ++- .../modules/isothermalFilm/isothermalFilm.C | 50 +-- .../modules/isothermalFilm/isothermalFilm.H | 36 +- .../isothermalFilm/momentumPredictor.C | 9 +- .../SurfaceFilmModel/SurfaceFilmModel.C | 52 +-- .../cavitationModel/cavitationModelNew.C | 4 +- .../multiRegion/film/cylinder/0/film/T | 3 +- .../film/cylinderDripping/0/film/T | 46 +++ .../film/cylinderDripping/0/film/U | 46 +++ .../film/cylinderDripping/0/film/delta | 52 +++ .../film/cylinderDripping/0/film/p | 45 +++ .../film/cylinderDripping/0/fluid/H2O | 40 +++ .../film/cylinderDripping/0/fluid/N2 | 41 +++ .../film/cylinderDripping/0/fluid/O2 | 40 +++ .../film/cylinderDripping/0/fluid/T | 42 +++ .../film/cylinderDripping/0/fluid/U | 41 +++ .../film/cylinderDripping/0/fluid/p | 42 +++ .../film/cylinderDripping/0/fluid/p_rgh | 40 +++ .../multiRegion/film/cylinderDripping/Allrun | 16 + .../cylinderDripping/constant/film/fvModels | 60 ++++ .../film/cylinderDripping/constant/film/g | 20 ++ .../constant/film/momentumTransport | 19 ++ .../constant/film/physicalProperties | 38 +++ .../constant/fluid/cloudProperties | 121 +++++++ .../cylinderDripping/constant/fluid/fvModels | 23 ++ .../film/cylinderDripping/constant/fluid/g | 21 ++ .../constant/fluid/momentumTransport | 20 ++ .../film/cylinderDripping/constant/fluid/pRef | 20 ++ .../constant/fluid/parcelInjectionProperties | 24 ++ .../constant/fluid/physicalProperties | 41 +++ .../constant/fluid/speciesThermo | 72 ++++ .../film/cylinderDripping/system/controlDict | 59 ++++ .../cylinderDripping/system/film/fvSchemes | 47 +++ .../cylinderDripping/system/film/fvSolution | 55 ++++ .../system/fluid/blockMeshDict | 149 +++++++++ .../system/fluid/decomposeParDict | 22 ++ .../system/fluid/extrudeToRegionMeshDict | 44 +++ .../cylinderDripping/system/fluid/fvSchemes | 58 ++++ .../cylinderDripping/system/fluid/fvSolution | 99 ++++++ .../film/cylinderDripping/system/fvSolution | 21 ++ .../multiRegion/film/cylinderVoF/0/film/T | 3 +- 55 files changed, 3200 insertions(+), 104 deletions(-) create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/BrunDripping/BrunDripping.C create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/BrunDripping/BrunDripping.H create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/curvatureSeparation/curvatureSeparation.C create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/curvatureSeparation/curvatureSeparation.H create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/dripping/dripping.C create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/dripping/dripping.H create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/ejectionModel/ejectionModel.C create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/ejectionModel/ejectionModel.H create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/ejectionModel/ejectionModelNew.C create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/0/film/T create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/0/film/U create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/0/film/delta create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/0/film/p create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/H2O create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/N2 create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/O2 create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/T create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/U create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/p create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/p_rgh create mode 100755 tutorials/modules/multiRegion/film/cylinderDripping/Allrun create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/constant/film/fvModels create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/constant/film/g create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/constant/film/momentumTransport create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/constant/film/physicalProperties create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/cloudProperties create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/fvModels create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/g create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/momentumTransport create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/pRef create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/parcelInjectionProperties create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/physicalProperties create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/speciesThermo create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/system/controlDict create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/system/film/fvSchemes create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/system/film/fvSolution create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/blockMeshDict create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/decomposeParDict create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/extrudeToRegionMeshDict create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/fvSchemes create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/fvSolution create mode 100644 tutorials/modules/multiRegion/film/cylinderDripping/system/fvSolution diff --git a/applications/solvers/modules/isothermalFilm/correctAlpha.C b/applications/solvers/modules/isothermalFilm/correctAlpha.C index 0b7121e9e5..0fc8dd010e 100644 --- a/applications/solvers/modules/isothermalFilm/correctAlpha.C +++ b/applications/solvers/modules/isothermalFilm/correctAlpha.C @@ -37,7 +37,6 @@ License void Foam::solvers::isothermalFilm::correctAlpha() { volScalarField& alpha = alpha_; - volVectorField& U = U_; fvVectorMatrix& UEqn = tUEqn.ref(); @@ -76,7 +75,7 @@ void Foam::solvers::isothermalFilm::correctAlpha() const surfaceScalarField phig("phig", phip + pbByAlphaGradRhof*alphaf); - phi = constrainedField(fvc::flux(HbyA) - alpharAUf*phig); + phi_ = constrainedField(fvc::flux(HbyA) - alpharAUf*phig); const surfaceScalarField phid("phid", rhof*phi); @@ -102,7 +101,7 @@ void Foam::solvers::isothermalFilm::correctAlpha() if (pimple.finalNonOrthogonalIter()) { - alphaRhoPhi = alphaEqn.flux(); + alphaRhoPhi_ = alphaEqn.flux(); } } @@ -111,16 +110,16 @@ void Foam::solvers::isothermalFilm::correctAlpha() constrainedField(pbByAlphaf*fvc::snGrad(alpha)*mesh.magSf()) ); - phi -= alpharAUf*phiGradAlpha; + phi_ -= alpharAUf*phiGradAlpha; - U = HbyA - rAU*fvc::reconstruct(alphaf*(phig + phiGradAlpha)); + U_ = HbyA - rAU*fvc::reconstruct(alphaf*(phig + phiGradAlpha)); // Remove film-normal component of velocity - U -= nHat*(nHat & U); + U_ -= nHat*(nHat & U); - U.correctBoundaryConditions(); + U_.correctBoundaryConditions(); - fvConstraints().constrain(U); + fvConstraints().constrain(U_); fvConstraints().constrain(alpha); diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/Make/files b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/Make/files index 5ce92efe65..48eaf3f599 100644 --- a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/Make/files +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/Make/files @@ -1,4 +1,9 @@ filmCloudTransfer.C +ejectionModels/ejectionModel/ejectionModel.C +ejectionModels/ejectionModel/ejectionModelNew.C +ejectionModels/dripping/dripping.C +ejectionModels/BrunDripping/BrunDripping.C +ejectionModels/curvatureSeparation/curvatureSeparation.C cloudFilmTransfer/CloudFilmTransfer/CloudFilmTransferBase.C cloudFilmTransfer/makeThermoParcelCloudFilmTransfer.C diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/cloudFilmTransfer/CloudFilmTransfer/CloudFilmTransfer.C b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/cloudFilmTransfer/CloudFilmTransfer/CloudFilmTransfer.C index d0142ba758..39fa3ea3be 100644 --- a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/cloudFilmTransfer/CloudFilmTransfer/CloudFilmTransfer.C +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/cloudFilmTransfer/CloudFilmTransfer/CloudFilmTransfer.C @@ -521,20 +521,29 @@ const Foam::labelList& Foam::CloudFilmTransfer::filmPatches() const template void Foam::CloudFilmTransfer::cacheFilmFields(const label filmi) { - // Film->Cloud transfer Not implemented yet - fv::filmCloudTransfer& filmCloudTransfer = filmTransferPtrs()[filmi]; filmCloudTransfer.resetFromCloudFields(); - // Set the mass transferred from film->cloud to 0 - this->massParcelPatch_.setSize - ( - this->owner().mesh().boundary()[filmPatches_[filmi]].size(), - 0.0 - ); - this->deltaFilmPatch_ = filmCloudTransfer.deltaToCloud(); + + // Ensure the film->cloud ejection transfer is up-to-date + filmCloudTransfer.correct(); + + if (filmCloudTransfer.ejecting()) + { + this->massParcelPatch_ = filmCloudTransfer.ejectedMassToCloud(); + this->diameterParcelPatch_ = filmCloudTransfer.ejectedDiameterToCloud(); + UFilmPatch_ = filmCloudTransfer.UToCloud(); + rhoFilmPatch_ = filmCloudTransfer.rhoToCloud(); + TFilmPatch_ = filmCloudTransfer.TToCloud(); + CpFilmPatch_ = filmCloudTransfer.CpToCloud(); + } + else + { + // Set the mass transferred from film->cloud to 0 + this->massParcelPatch_.setSize(0); + } } diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/cloudFilmTransfer/CloudFilmTransfer/CloudFilmTransfer.H b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/cloudFilmTransfer/CloudFilmTransfer/CloudFilmTransfer.H index 2abf7075c4..e309916b50 100644 --- a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/cloudFilmTransfer/CloudFilmTransfer/CloudFilmTransfer.H +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/cloudFilmTransfer/CloudFilmTransfer/CloudFilmTransfer.H @@ -25,20 +25,22 @@ Class Foam::CloudFilmTransfer Description - Thermo parcel surface film model. + Thermo parcel<->film transfer model. Responsible for: - injecting parcels from the film model into the cloud, e.g. for dripping - parcel interaction with the film, e.g absorb, bounce, splash - Splash model references: - - Bai and Gosman, `Mathematical modelling of wall films formed by - impinging sprays', SAE 960626, 1996 - - Bai et al, `Modelling of gasoline spray impingement', Atom. Sprays, - vol 12, pp 1-27, 2002 + References: + \verbatim + Bai, C., & Gosman, A. D. (1996). + Mathematical modelling of wall films formed by impinging sprays. + SAE transactions, 782-796. + Bai, C. X., Rusche, H., & Gosman, A. D. (2002). + Modeling of gasoline spray impingement. + Atomization and Sprays, 12(1-3). + \endverbatim SourceFiles CloudFilmTransfer.C diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/BrunDripping/BrunDripping.C b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/BrunDripping/BrunDripping.C new file mode 100644 index 0000000000..ee2c95cd47 --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/BrunDripping/BrunDripping.C @@ -0,0 +1,147 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "BrunDripping.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace filmEjectionModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(BrunDripping, 0); +addToRunTimeSelectionTable(ejectionModel, BrunDripping, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +BrunDripping::BrunDripping +( + const dictionary& dict, + const solvers::isothermalFilm& film +) +: + ejectionModel(dict, film), + ubarStar_ + ( + dict.optionalSubDict(typeName + "Coeffs") + .lookupOrDefault("ubarStar", 1.62208) + ), + dCoeff_ + ( + dict.optionalSubDict(typeName + "Coeffs") + .lookupOrDefault("dCoeff", 3.3) + ), + deltaStable_ + ( + dict.optionalSubDict(typeName + "Coeffs") + .lookupOrDefault("deltaStable", scalar(0)) + ), + minParticlesPerParcel_ + ( + dict.optionalSubDict(typeName + "Coeffs") + .lookupOrDefault("minParticlesPerParcel", 1) + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +BrunDripping::~BrunDripping() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void BrunDripping::correct() +{ + const scalar piBy6 = constant::mathematical::pi/6; + + const scalarField& magSf = film_.magSf; + const vectorField& nHat = film_.nHat; + const scalarField& delta = film_.delta; + const scalarField& rho = film_.rho; + + const tmp tsigma = film_.sigma(); + const volScalarField::Internal& sigma = tsigma(); + + const scalar magg = mag(film_.g.value()); + const vector gHat = -film_.g.value()/magg; + + const scalar deltaT = film_.mesh.time().deltaTValue(); + + forAll(delta, celli) + { + rate_[celli] = 0; + diameter_[celli] = 0; + + const scalar sinAlpha = nHat[celli] & gHat; + + if (sinAlpha > small && delta[celli] > deltaStable_) + { + const scalar lc = sqrt(sigma[celli]/(rho[celli]*magg)); + + const scalar deltaStable = max + ( + 3*lc*sqrt(1 - sqr(sinAlpha)) + /(ubarStar_*sqrt(sinAlpha)*sinAlpha), + deltaStable_ + ); + + if (delta[celli] > deltaStable) + { + const scalar ddelta = delta[celli] - deltaStable; + const scalar massDrip = ddelta*rho[celli]*magSf[celli]; + + // Calculate dripped droplet diameter + diameter_[celli] = dCoeff_*lc; + + // Calculate the minimum mass of a droplet parcel + const scalar minMass = + minParticlesPerParcel_ + *rho[celli]*piBy6*pow3(diameter_[celli]); + + if (massDrip > minMass) + { + // Calculate rate of dripping + rate_[celli] = ddelta/(deltaT*delta[celli]); + } + } + } + } + + ejectionModel::correct(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace filmEjectionModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/BrunDripping/BrunDripping.H b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/BrunDripping/BrunDripping.H new file mode 100644 index 0000000000..b754864dd1 --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/BrunDripping/BrunDripping.H @@ -0,0 +1,160 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2016-2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::filmEjectionModels::BrunDripping + +Description + Brun dripping film to cloud ejection transfer model + + If the film thickness exceeds the critical value needed to generate one or + more drops, the equivalent mass is removed from the film. The critical film + thickness is calculated from the Rayleigh-Taylor stability analysis of film + flow on an inclined plane by Brun et.al. + + Reference: + \verbatim + Brun, P. T., Damiano, A., Rieu, P., Balestra, G., & Gallaire, F. (2015). + Rayleigh-Taylor instability under an inclined plane. + Physics of Fluids (1994-present), 27(8), 084107. + \endverbatim + + The diameter of the drops formed are obtained from the local capillary + length multiplied by the \c dCoeff coefficient which defaults to 3.3. + + Reference: + \verbatim + Lefebvre, A. (1988). + Atomisation and sprays + (Vol. 1040, No. 2756). CRC press. + \endverbatim + +Usage + Example usage: + \verbatim + filmCloudTransfer + { + type filmCloudTransfer; + + libs ("libfilmCloudTransfer.so"); + + ejection + { + model BrunDripping; + + deltaStable 5e-4; + } + } + \endverbatim + +SourceFiles + BrunDripping.C + +\*---------------------------------------------------------------------------*/ + +#ifndef BrunDripping_H +#define BrunDripping_H + +#include "ejectionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace filmEjectionModels +{ + +/*---------------------------------------------------------------------------*\ + Class BrunDripping Declaration +\*---------------------------------------------------------------------------*/ + +class BrunDripping +: + public ejectionModel +{ + // Private Member Data + + //- Critical non-dimensional interface velocity + // Coefficient in the film angle stability function. + // Defaults to 1.62208 + scalar ubarStar_; + + //- Coefficient relating the diameter of the drops formed to + // the capillary length. + // Defaults to 3.3 + scalar dCoeff_; + + //- Stable film thickness - drips only formed if thickness + // exceeds this threshold value + scalar deltaStable_; + + //- Minimum number of droplets per parcel + scalar minParticlesPerParcel_; + + +public: + + //- Runtime type information + TypeName("BrunDripping"); + + + // Constructors + + //- Construct from dictionary and film model + BrunDripping + ( + const dictionary& dict, + const solvers::isothermalFilm& film + ); + + //- Disallow default bitwise copy construction + BrunDripping(const BrunDripping&) = delete; + + + //- Destructor + virtual ~BrunDripping(); + + + // Member Functions + + //- Correct + virtual void correct(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const BrunDripping&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace filmEjectionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/curvatureSeparation/curvatureSeparation.C b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/curvatureSeparation/curvatureSeparation.C new file mode 100644 index 0000000000..dc15f10a6a --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/curvatureSeparation/curvatureSeparation.C @@ -0,0 +1,309 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "curvatureSeparation.H" +#include "fvcGrad.H" +#include "zeroGradientFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace filmEjectionModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(curvatureSeparation, 0); +addToRunTimeSelectionTable +( + ejectionModel, + curvatureSeparation, + dictionary +); + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp curvatureSeparation::calcInvR1 +( + const volVectorField& U +) const +{ + const vectorField UHat(U.field()/(mag(U.field()) + rootVSmall)); + + tmp tinvR1(-(UHat & (UHat & gradNHat_))); + scalarField& invR1 = tinvR1.ref(); + + const scalar rMin = 1e-6; + const fvMesh& mesh = film_.mesh; + const polyBoundaryMesh& pbm = mesh.boundaryMesh(); + + forAll(patchRadii_, i) + { + const label patchi = patchRadii_[i].first(); + const scalar definedInvR1 = 1/max(rMin, patchRadii_[i].second()); + UIndirectList(invR1, pbm[patchi].faceCells()) = definedInvR1; + } + + // Filter out large radii + const scalar rMax = 1e6; + + forAll(invR1, i) + { + if (mag(invR1[i]) < 1/rMax) + { + invR1[i] = -1; + } + } + + return tinvR1; +} + + +tmp curvatureSeparation::calcCosAngle +( + const surfaceScalarField& alphaRhoPhi +) const +{ + const fvMesh& mesh = film_.mesh; + + const scalar magg(mag(film_.g.value())); + const vector gHat(film_.g.value()/magg); + + const vectorField nf(mesh.Sf()/mesh.magSf()); + const labelUList& own = mesh.owner(); + const labelUList& nbr = mesh.neighbour(); + + scalarField alphaRhoPhiMax(mesh.nCells(), -great); + tmp tcosAngle + ( + new scalarField(mesh.nCells(), 0) + ); + scalarField& cosAngle = tcosAngle.ref(); + + forAll(nbr, facei) + { + const label cellO = own[facei]; + const label cellN = nbr[facei]; + + if (alphaRhoPhi[facei] > alphaRhoPhiMax[cellO]) + { + alphaRhoPhiMax[cellO] = alphaRhoPhi[facei]; + cosAngle[cellO] = -gHat & nf[facei]; + } + if (-alphaRhoPhi[facei] > alphaRhoPhiMax[cellN]) + { + alphaRhoPhiMax[cellN] = -alphaRhoPhi[facei]; + cosAngle[cellN] = -gHat & -nf[facei]; + } + } + + forAll(alphaRhoPhi.boundaryField(), patchi) + { + const fvsPatchScalarField& alphaRhoPhip = + alphaRhoPhi.boundaryField()[patchi]; + + const fvPatch& pp = alphaRhoPhip.patch(); + + if (pp.coupled()) + { + const labelList& faceCells = pp.faceCells(); + const vectorField nf(pp.nf()); + + forAll(alphaRhoPhip, i) + { + const label celli = faceCells[i]; + + if (alphaRhoPhip[i] > alphaRhoPhiMax[celli]) + { + alphaRhoPhiMax[celli] = alphaRhoPhip[i]; + cosAngle[celli] = -gHat & nf[i]; + } + } + } + } + + return tcosAngle; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +curvatureSeparation::curvatureSeparation +( + const dictionary& dict, + const solvers::isothermalFilm& film +) +: + ejectionModel(dict, film), + gradNHat_(fvc::grad(film_.nHat)), + deltaByR1Min_ + ( + dict.optionalSubDict(typeName + "Coeffs") + .lookupOrDefault("deltaByR1Min", scalar(0)) + ), + deltaStable_ + ( + dict.optionalSubDict(typeName + "Coeffs") + .lookupOrDefault("deltaStable", scalar(0)) + ) +{ + const List> prIn + ( + dict.lookupOrDefault("patchRadii", List>::null()) + ); + const wordList& allPatchNames = film_.mesh.boundaryMesh().names(); + + DynamicList> prData(allPatchNames.size()); + + labelHashSet uniquePatchIDs; + + forAllReverse(prIn, i) + { + labelList patchIDs = findStrings(prIn[i].first(), allPatchNames); + forAll(patchIDs, j) + { + const label patchi = patchIDs[j]; + + if (!uniquePatchIDs.found(patchi)) + { + const scalar radius = prIn[i].second(); + prData.append(Tuple2(patchi, radius)); + + uniquePatchIDs.insert(patchi); + } + } + } + + patchRadii_.transfer(prData); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +curvatureSeparation::~curvatureSeparation() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void curvatureSeparation::correct() +{ + const scalarField& delta = film_.delta(); + const scalarField& rho = film_.rho(); + const vectorField& U = film_.U(); + + const tmp tsigma = film_.sigma(); + const volScalarField::Internal& sigma = tsigma(); + + const scalarField invR1(calcInvR1(film_.U)); + const scalarField cosAngle(calcCosAngle(film_.alphaRhoPhi)); + + const scalar magg(mag(film_.g.value())); + + const scalar deltaT = film_.mesh.time().deltaTValue(); + + // Calculate force balance + const scalar Fthreshold = 1e-10; + + forAll(delta, celli) + { + rate_[celli] = 0; + diameter_[celli] = 0; + + if + ( + delta[celli] > deltaStable_ + && invR1[celli] > 0 + && delta[celli]*invR1[celli] > deltaByR1Min_ + ) + { + const scalar R1 = 1/(invR1[celli] + rootVSmall); + const scalar R2 = R1 + delta[celli]; + + // Inertial force + const scalar Fi = + -delta[celli]*rho[celli] + *magSqr(U[celli])*72/60*invR1[celli]; + + // Body force + const scalar Fb = + -0.5*rho[celli]*magg + *invR1[celli]*(sqr(R1) - sqr(R2))*cosAngle[celli]; + + // Surface tension force + const scalar Fs = sigma[celli]/R2; + + if (Fi + Fb + Fs + Fthreshold < 0) + { + // Calculate rate of separation + rate_[celli] = + (delta[celli] - deltaStable_)/(deltaT*delta[celli]); + + // Set the separated droplet diameter to the film thickness + diameter_[celli] = delta[celli]; + } + } + } +} + + +void curvatureSeparation::topoChange(const polyTopoChangeMap& map) +{ + ejectionModel::topoChange(map); + gradNHat_ = fvc::grad(film_.nHat); +} + + +void curvatureSeparation::mapMesh(const polyMeshMap& map) +{ + ejectionModel::mapMesh(map); + gradNHat_ = fvc::grad(film_.nHat); +} + + +void curvatureSeparation::distribute(const polyDistributionMap& map) +{ + ejectionModel::distribute(map); + gradNHat_ = fvc::grad(film_.nHat); +} + + +bool curvatureSeparation::movePoints() +{ + ejectionModel::movePoints(); + gradNHat_ = fvc::grad(film_.nHat); + + return true; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace filmEjectionModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/curvatureSeparation/curvatureSeparation.H b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/curvatureSeparation/curvatureSeparation.H new file mode 100644 index 0000000000..1c743518c9 --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/curvatureSeparation/curvatureSeparation.H @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::filmEjectionModels::curvatureSeparation + +Description + Curvature induced separation film to cloud ejection transfer model + + Assesses film curvature via the mesh geometry and calculates a force + balance of the form: + + F_sum = F_inertial + F_body + F_surface_tension + + If F_sum < 0, the film separates and is transferred to the cloud + if F_sum >= 0 the film remains attached. + + Reference: + \verbatim + Owen, I., & Ryley, D. J. (1985). + The flow of thin liquid films around corners. + International journal of multiphase flow, 11(1), 51-62. + \endverbatim + +Usage + Example usage: + \verbatim + filmCloudTransfer + { + type filmCloudTransfer; + + libs ("libfilmCloudTransfer.so"); + + ejection + { + model curvatureSeparation; + + deltaStable 5e-4; + } + } + \endverbatim + +SourceFiles + curvatureSeparation.C + +\*---------------------------------------------------------------------------*/ + +#ifndef curvatureSeparation_H +#define curvatureSeparation_H + +#include "ejectionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace filmEjectionModels +{ + +/*---------------------------------------------------------------------------*\ + Class curvatureSeparation Declaration +\*---------------------------------------------------------------------------*/ + +class curvatureSeparation +: + public ejectionModel +{ + // Private Member Data + + //- Gradient of film wall normals + tensorField gradNHat_; + + //- Minimum gravity driven film thickness (non-dimensionalised delta/R1) + scalar deltaByR1Min_; + + //- Stable film thickness - drips only formed if thickness + // exceeds this threshold value + scalar deltaStable_; + + //- List of radii for patches + // if patch not listed the radius is calculated from the face normals + List> patchRadii_; + + + // Protected Member Functions + + //- Calculate local (inverse) radius of curvature + tmp calcInvR1(const volVectorField& U) const; + + //- Calculate the cosine of the angle between gravity vector and + // cell out flow direction + tmp calcCosAngle(const surfaceScalarField& phi) const; + + +public: + + //- Runtime type information + TypeName("curvatureSeparation"); + + + // Constructors + + //- Construct from dictionary and film model + curvatureSeparation + ( + const dictionary& dict, + const solvers::isothermalFilm& film + ); + + //- Disallow default bitwise copy construction + curvatureSeparation(const curvatureSeparation&) = delete; + + + //- Destructor + virtual ~curvatureSeparation(); + + + // Member Functions + + //- Correct + virtual void correct(); + + + // Mesh changes + + //- Update topology using the given map + virtual void topoChange(const polyTopoChangeMap&); + + //- Update from another mesh using the given map + virtual void mapMesh(const polyMeshMap&); + + //- Redistribute or update using the given distribution map + virtual void distribute(const polyDistributionMap&); + + //- Update for mesh motion + virtual bool movePoints(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const curvatureSeparation&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace filmEjectionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/dripping/dripping.C b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/dripping/dripping.C new file mode 100644 index 0000000000..53fba052e5 --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/dripping/dripping.C @@ -0,0 +1,128 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "dripping.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace filmEjectionModels +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(dripping, 0); +addToRunTimeSelectionTable(ejectionModel, dripping, dictionary); + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +dripping::dripping +( + const dictionary& dict, + const solvers::isothermalFilm& film +) +: + ejectionModel(dict, film), + deltaStable_ + ( + dict.optionalSubDict(typeName + "Coeffs") + .lookup("deltaStable") + ), + minParticlesPerParcel_ + ( + dict.optionalSubDict(typeName + "Coeffs") + .lookupOrDefault("minParticlesPerParcel", 1) + ), + rndGen_(label(0)), + parcelDistribution_ + ( + distribution::New + ( + dict.optionalSubDict(typeName + "Coeffs") + .subDict("parcelDistribution"), + rndGen_, + 0 + ) + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +dripping::~dripping() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void dripping::correct() +{ + const scalar piBy6 = constant::mathematical::pi/6; + + const scalarField gnHat(film_.nHat() & (-film_.g)); + const scalarField& magSf = film_.magSf; + + const scalarField& delta = film_.delta; + const scalarField& rho = film_.rho; + + const scalar deltaT = film_.mesh.time().deltaTValue(); + + forAll(delta, celli) + { + rate_[celli] = 0; + diameter_[celli] = 0; + + // Calculate available dripping mass + if (gnHat[celli] > small && delta[celli] > deltaStable_) + { + const scalar ddelta = delta[celli] - deltaStable_; + const scalar massDrip = ddelta*rho[celli]*magSf[celli]; + + // Sample dripped droplet diameter + diameter_[celli] = parcelDistribution_->sample(); + + // Calculate the minimum mass of a parcel + const scalar minMass = + minParticlesPerParcel_ + *rho[celli]*piBy6*pow3(diameter_[celli]); + + if (massDrip > minMass) + { + // Calculate rate of dripping + rate_[celli] = ddelta/(deltaT*delta[celli]); + } + } + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace filmEjectionModels +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/dripping/dripping.H b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/dripping/dripping.H new file mode 100644 index 0000000000..566d869b0a --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/dripping/dripping.H @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::filmEjectionModels::dripping + +Description + Dripping film to cloud ejection transfer model + + On an inverted surface if the film thickness is sufficient to generate a + valid parcel the equivalent mass is removed from the film and transfered to + the cloud as a parcel containing droplets with a diameter obtained from + the specified parcelDistribution. + +Usage + Example usage: + \verbatim + filmCloudTransfer + { + type filmCloudTransfer; + + libs ("libfilmCloudTransfer.so"); + + ejection + { + model dripping; + + deltaStable 5e-4; + + minParticlesPerParcel 10; + + parcelDistribution + { + type RosinRammler; + Q 0; + min 1e-3; + max 2e-3; + d 7.5e-05; + n 0.5; + } + } + } + \endverbatim + +SourceFiles + dripping.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dripping_H +#define dripping_H + +#include "ejectionModel.H" +#include "distribution.H" +#include "Random.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace filmEjectionModels +{ + +/*---------------------------------------------------------------------------*\ + Class dripping Declaration +\*---------------------------------------------------------------------------*/ + +class dripping +: + public ejectionModel +{ + // Private Member Data + + //- Stable film thickness - drips only formed if thickness + // exceeds this threshold value + scalar deltaStable_; + + //- Minimum number of droplets per parcel + scalar minParticlesPerParcel_; + + //- Random number generator + Random rndGen_; + + //- Parcel size PDF model + const autoPtr parcelDistribution_; + + +public: + + //- Runtime type information + TypeName("dripping"); + + + // Constructors + + //- Construct from dictionary and film model + dripping + ( + const dictionary& dict, + const solvers::isothermalFilm& film + ); + + //- Disallow default bitwise copy construction + dripping(const dripping&) = delete; + + + //- Destructor + virtual ~dripping(); + + + // Member Functions + + // Evolution + + //- Correct + virtual void correct(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const dripping&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace filmEjectionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/ejectionModel/ejectionModel.C b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/ejectionModel/ejectionModel.C new file mode 100644 index 0000000000..bd6aa8087d --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/ejectionModel/ejectionModel.C @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "ejectionModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(ejectionModel, 0); + defineRunTimeSelectionTable(ejectionModel, dictionary); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::ejectionModel::ejectionModel +( + const dictionary& dict, + const solvers::isothermalFilm& film +) +: + film_(film), + rate_ + ( + volScalarField::Internal::New + ( + "ejectionRate", + film.mesh, + dimensionedScalar(dimless/dimTime, 0) + ) + ), + diameter_ + ( + volScalarField::Internal::New + ( + "ejectionDiameter", + film.mesh, + dimensionedScalar(dimLength, 0) + ) + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::ejectionModel::~ejectionModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::ejectionModel::topoChange(const polyTopoChangeMap&) +{ + // Resize in case of mesh change + rate_.setSize(film_.mesh.nCells()); + diameter_.setSize(film_.mesh.nCells()); +} + + +void Foam::ejectionModel::mapMesh(const polyMeshMap&) +{ + // Resize in case of mesh change + rate_.setSize(film_.mesh.nCells()); + diameter_.setSize(film_.mesh.nCells()); +} + + +void Foam::ejectionModel::distribute(const polyDistributionMap&) +{ + // Resize in case of mesh change + rate_.setSize(film_.mesh.nCells()); + diameter_.setSize(film_.mesh.nCells()); +} + + +bool Foam::ejectionModel::movePoints() +{ + return true; +} + + +// ************************************************************************* // diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/ejectionModel/ejectionModel.H b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/ejectionModel/ejectionModel.H new file mode 100644 index 0000000000..88de1ec8a1 --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/ejectionModel/ejectionModel.H @@ -0,0 +1,161 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::filmEjectionModels::ejectionModel + +Description + Abstract base class for film to cloud ejection transfer models + +SourceFiles + ejectionModel.C + ejectionModelNew.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ejectionModel_H +#define ejectionModel_H + +#include "isothermalFilm.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class ejectionModel Declaration +\*---------------------------------------------------------------------------*/ + +class ejectionModel +{ + +protected: + + // Protected Member Data + + //- Reference to the film + const solvers::isothermalFilm& film_; + + //- Cached ejection rate (transfer to cloud) + volScalarField::Internal rate_; + + //- Cached diameter of ejected droplets + volScalarField::Internal diameter_; + + +public: + + //- Runtime type information + TypeName("ejectionModel"); + + + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + ejectionModel, + dictionary, + ( + const dictionary& dict, + const solvers::isothermalFilm& film + ), + (dict, film) + ); + + + // Constructors + + //- Construct from dictionary and film model + ejectionModel + ( + const dictionary& dict, + const solvers::isothermalFilm& film + ); + + //- Disallow default bitwise copy construction + ejectionModel(const ejectionModel&) = delete; + + + // Selector + static autoPtr New + ( + const dictionary& dict, + const solvers::isothermalFilm& film + ); + + + //- Destructor + virtual ~ejectionModel(); + + + // Member Functions + + //- Return ejection rate (transfer to cloud) + const volScalarField::Internal& rate() const + { + return rate_; + } + + //- Return diameter of ejected droplets + const volScalarField::Internal& diameter() const + { + return diameter_; + } + + //- Correct + virtual void correct() = 0; + + + // Mesh changes + + //- Update topology using the given map + virtual void topoChange(const polyTopoChangeMap&); + + //- Update from another mesh using the given map + virtual void mapMesh(const polyMeshMap&); + + //- Redistribute or update using the given distribution map + virtual void distribute(const polyDistributionMap&); + + //- Update for mesh motion + virtual bool movePoints(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const ejectionModel&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/ejectionModel/ejectionModelNew.C b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/ejectionModel/ejectionModelNew.C new file mode 100644 index 0000000000..71deff2227 --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/ejectionModels/ejectionModel/ejectionModelNew.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2023 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "ejectionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::ejectionModel::New +( + const dictionary& dict, + const solvers::isothermalFilm& film +) +{ + const word modelType(dict.lookup("model")); + + Info<< "Selecting film ejection model " << modelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorInFunction + << "Unknown film ejection model " + << modelType << nl << nl + << "Valid film ejection models are:" << nl + << dictionaryConstructorTablePtr_->toc() + << exit(FatalError); + } + + return autoPtr + ( + cstrIter()(dict.optionalSubDict(modelType + "Coeffs"), film) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/filmCloudTransfer.C b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/filmCloudTransfer.C index 24d27fa3e7..bd91ab51a3 100644 --- a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/filmCloudTransfer.C +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/filmCloudTransfer.C @@ -58,7 +58,13 @@ Foam::fv::filmCloudTransfer::filmCloudTransfer : fvModel(sourceName, modelType, mesh, dict), film_(mesh.lookupObject(solver::typeName)), - curTimeIndex_(-1) + curTimeIndex_(-1), + ejection_ + ( + dict.found("ejection") + ? ejectionModel::New(dict.subDict("ejection"), film_) + : autoPtr(nullptr) + ) {} @@ -84,6 +90,11 @@ void Foam::fv::filmCloudTransfer::correct() } curTimeIndex_ = mesh().time().timeIndex(); + + if (ejection_.valid()) + { + ejection_->correct(); + } } @@ -172,6 +183,11 @@ void Foam::fv::filmCloudTransfer::addSup if (fieldName == film_.alpha.name()) { eqn += CloudToFilmTransferRate(massFromCloud_, dimMass); + + if (ejection_.valid()) + { + eqn -= fvm::Sp(ejection_->rate()*rho(), eqn.psi()); + } } else { @@ -198,6 +214,11 @@ void Foam::fv::filmCloudTransfer::addSup if (fieldName == film_.thermo.he().name()) { eqn += CloudToFilmTransferRate(energyFromCloud_, dimEnergy); + + if (ejection_.valid()) + { + eqn -= fvm::Sp(alpha()*rho()*ejection_->rate(), eqn.psi()); + } } else { @@ -222,6 +243,11 @@ void Foam::fv::filmCloudTransfer::addSup } eqn += CloudToFilmTransferRate(momentumFromCloud_, dimMomentum); + + if (ejection_.valid()) + { + eqn -= fvm::Sp(alpha()*rho()*ejection_->rate(), eqn.psi()); + } } @@ -267,7 +293,7 @@ template Foam::tmp> inline Foam::fv::filmCloudTransfer::filmToCloudTransfer ( - const VolField& prop + const VolInternalField& prop ) const { return film_.surfacePatchMap().toNeighbour @@ -277,27 +303,102 @@ inline Foam::fv::filmCloudTransfer::filmToCloudTransfer } -Foam::tmp> -Foam::fv::filmCloudTransfer::deltaToCloud() const +bool Foam::fv::filmCloudTransfer::ejecting() const { - return filmToCloudTransfer(film_.delta); + return ejection_.valid(); } -void Foam::fv::filmCloudTransfer::topoChange(const polyTopoChangeMap&) -{} +Foam::tmp> +Foam::fv::filmCloudTransfer::ejectedMassToCloud() const +{ + return filmToCloudTransfer + ( + ( + mesh().V() + *mesh().time().deltaTValue() + *film_.alpha()*film_.rho()*ejection_->rate() + )() + ); +} + + +Foam::tmp> +Foam::fv::filmCloudTransfer::ejectedDiameterToCloud() const +{ + return filmToCloudTransfer(ejection_->diameter()); +} + + +Foam::tmp> +Foam::fv::filmCloudTransfer::deltaToCloud() const +{ + return filmToCloudTransfer(film_.delta); +} + + +Foam::tmp> +Foam::fv::filmCloudTransfer::UToCloud() const +{ + return filmToCloudTransfer(film_.U); +} + + +Foam::tmp> +Foam::fv::filmCloudTransfer::rhoToCloud() const +{ + return filmToCloudTransfer(film_.rho); +} + + +Foam::tmp> +Foam::fv::filmCloudTransfer::TToCloud() const +{ + return filmToCloudTransfer(film_.thermo.T()); +} + + +Foam::tmp> +Foam::fv::filmCloudTransfer::CpToCloud() const +{ + return filmToCloudTransfer(film_.thermo.Cp()); +} + + +void Foam::fv::filmCloudTransfer::topoChange(const polyTopoChangeMap& map) +{ + if (ejection_.valid()) + { + ejection_->topoChange(map); + } +} void Foam::fv::filmCloudTransfer::mapMesh(const polyMeshMap& map) -{} +{ + if (ejection_.valid()) + { + ejection_->mapMesh(map); + } +} -void Foam::fv::filmCloudTransfer::distribute(const polyDistributionMap&) -{} +void Foam::fv::filmCloudTransfer::distribute(const polyDistributionMap& map) +{ + if (ejection_.valid()) + { + ejection_->distribute(map); + } +} bool Foam::fv::filmCloudTransfer::movePoints() { + if (ejection_.valid()) + { + ejection_->movePoints(); + } + return true; } diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/filmCloudTransfer.H b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/filmCloudTransfer.H index 62fe8f9532..f9ab912fb1 100644 --- a/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/filmCloudTransfer.H +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmCloudTransfer/filmCloudTransfer.H @@ -48,6 +48,7 @@ SourceFiles #include "fvModel.H" #include "isothermalFilm.H" +#include "ejectionModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -72,10 +73,15 @@ class filmCloudTransfer //- Current time index (used for updating) mutable label curTimeIndex_; - scalarField massFromCloud_; - vectorField momentumFromCloud_; - scalarField pressureFromCloud_; - scalarField energyFromCloud_; + // Transfers from cloud + + scalarField massFromCloud_; + vectorField momentumFromCloud_; + scalarField pressureFromCloud_; + scalarField energyFromCloud_; + + //- Pointer to the ejection model + autoPtr ejection_; // Private Member Functions @@ -94,7 +100,7 @@ class filmCloudTransfer tmp> inline filmToCloudTransfer ( - const VolField& prop + const VolInternalField& prop ) const; @@ -192,9 +198,30 @@ public: // Transfer to cloud + //- Return true if the film is ejecting to the cloud + bool ejecting() const; + + //- Transfer the ejected mass to the cloud + tmp> ejectedMassToCloud() const; + + //- Transfer the ejected droplet diameter to the cloud + tmp> ejectedDiameterToCloud() const; + //- Transfer the film delta field to the cloud tmp> deltaToCloud() const; + //- Transfer the film velocity field to the cloud + tmp> UToCloud() const; + + //- Transfer the film density field to the cloud + tmp> rhoToCloud() const; + + //- Transfer the film temperature field to the cloud + tmp> TToCloud() const; + + //- Transfer the film heat capacity field to the cloud + tmp> CpToCloud() const; + // Mesh changes diff --git a/applications/solvers/modules/isothermalFilm/isothermalFilm.C b/applications/solvers/modules/isothermalFilm/isothermalFilm.C index fd12201e0f..404b871c30 100644 --- a/applications/solvers/modules/isothermalFilm/isothermalFilm.C +++ b/applications/solvers/modules/isothermalFilm/isothermalFilm.C @@ -189,13 +189,13 @@ bool Foam::solvers::isothermalFilm::initFilmMesh() const polyPatch& wallp = bm[patchi]; const labelList& fCells = wallp.faceCells(); - UIndirectList(nHat, fCells) = wallp.faceNormals(); - UIndirectList(magSf, fCells) = wallp.magFaceAreas(); + UIndirectList(nHat_, fCells) = wallp.faceNormals(); + UIndirectList(magSf_, fCells) = wallp.magFaceAreas(); } - nHat.correctBoundaryConditions(); + nHat_.correctBoundaryConditions(); - VbyA_.primitiveFieldRef() = mesh.V()/magSf; + VbyA_.primitiveFieldRef() = mesh.V()/magSf_; VbyA_.correctBoundaryConditions(); return true; @@ -246,7 +246,7 @@ Foam::solvers::isothermalFilm::isothermalFilm p(thermo_.p()), - nHat + nHat_ ( IOobject ( @@ -259,7 +259,7 @@ Foam::solvers::isothermalFilm::isothermalFilm zeroGradientFvPatchField::typeName ), - magSf + magSf_ ( IOobject ( @@ -315,18 +315,6 @@ Foam::solvers::isothermalFilm::isothermalFilm deltaWet("deltaWet", dimLength, thermo_.properties()), - g - ( - IOobject - ( - "g", - runTime.constant(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ), - U_ ( IOobject @@ -340,7 +328,7 @@ Foam::solvers::isothermalFilm::isothermalFilm mesh ), - alphaRhoPhi + alphaRhoPhi_ ( IOobject ( @@ -353,7 +341,7 @@ Foam::solvers::isothermalFilm::isothermalFilm fvc::flux(alpha_*thermo_.rho()*U_) ), - phi + phi_ ( IOobject ( @@ -376,18 +364,34 @@ Foam::solvers::isothermalFilm::isothermalFilm alpha_, thermo_.rho(), U_, - alphaRhoPhi, - phi, + alphaRhoPhi_, + phi_, thermo_ ) ), + g + ( + IOobject + ( + "g", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + + nHat(nHat_), + magSf(magSf_), VbyA(VbyA_), delta(delta_), alpha(alpha_), thermo(thermo_), rho(thermo_.rho()), - U(U_) + U(U_), + alphaRhoPhi(alphaRhoPhi_), + phi(phi_) { // Read the controls readControls(); diff --git a/applications/solvers/modules/isothermalFilm/isothermalFilm.H b/applications/solvers/modules/isothermalFilm/isothermalFilm.H index 8884f67c24..f91595e944 100644 --- a/applications/solvers/modules/isothermalFilm/isothermalFilm.H +++ b/applications/solvers/modules/isothermalFilm/isothermalFilm.H @@ -112,10 +112,10 @@ protected: label surfacePatchID; //- Film wall normal - volVectorField nHat; + volVectorField nHat_; //- Film cell cross-sectional area magnitude - volScalarField::Internal magSf; + volScalarField::Internal magSf_; //- Film cell volume/wall face area volScalarField VbyA_; @@ -133,22 +133,16 @@ protected: dimensionedScalar deltaWet; - // Buoyancy - - //- Acceleration due to gravity - uniformDimensionedVectorField g; - - // Kinematic properties //- Film velocity field volVectorField U_; //- Film mass-flux field - surfaceScalarField alphaRhoPhi; + surfaceScalarField alphaRhoPhi_; //- Film volumetric-flux field - surfaceScalarField phi; + surfaceScalarField phi_; // Interface properties @@ -263,6 +257,15 @@ public: // Public Data + //- Acceleration due to gravity + const uniformDimensionedVectorField g; + + //- Film wall normal + const volVectorField& nHat; + + //- Film cell cross-sectional area magnitude + const volScalarField::Internal& magSf; + //- Film cell volume/wall face area const volScalarField& VbyA; @@ -275,12 +278,18 @@ public: //- Reference to the fluid thermophysical properties const fluidThermo& thermo; - //- The thermodynamic density field + //- Reference to the thermodynamic density field const volScalarField& rho; - //- Film velocity field + //- Reference to the film velocity field const volVectorField& U; + //- Reference to the film mass-flux field + const surfaceScalarField& alphaRhoPhi; + + //- Reference to the film volumetric-flux field + const surfaceScalarField& phi; + public: @@ -312,6 +321,9 @@ public: //- Return the film surface patch region-region map const mappedPatchBase& surfacePatchMap() const; + //- Return the film surface tension coefficient field + tmp sigma() const; + //- Return the current maximum time-step for stable solution virtual scalar maxDeltaT() const; diff --git a/applications/solvers/modules/isothermalFilm/momentumPredictor.C b/applications/solvers/modules/isothermalFilm/momentumPredictor.C index de71b803a7..0af820d6dd 100644 --- a/applications/solvers/modules/isothermalFilm/momentumPredictor.C +++ b/applications/solvers/modules/isothermalFilm/momentumPredictor.C @@ -32,6 +32,13 @@ License // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // +Foam::tmp +Foam::solvers::isothermalFilm::sigma() const +{ + return constrainedField(surfaceTension->sigma()); +} + + Foam::tmp Foam::solvers::isothermalFilm::pbByAlphaRhof() const { @@ -81,7 +88,7 @@ void Foam::solvers::isothermalFilm::momentumPredictor() volVectorField& U = U_; // Calculate the surface tension coefficient - const volScalarField sigma(constrainedField(surfaceTension->sigma())); + const volScalarField sigma(this->sigma()); tUEqn = ( diff --git a/src/lagrangian/parcel/submodels/Momentum/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C b/src/lagrangian/parcel/submodels/Momentum/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C index e4db4c4b95..d85786e198 100644 --- a/src/lagrangian/parcel/submodels/Momentum/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C +++ b/src/lagrangian/parcel/submodels/Momentum/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C @@ -106,49 +106,53 @@ void Foam::SurfaceFilmModel::inject(TrackCloudType& cloud) const labelList& injectorCellsPatch = pbm[filmPatchi].faceCells(); + // Get and cache the properties of the droplets ejected from the film cacheFilmFields(filmi); const vectorField& Cf = mesh.C().boundaryField()[filmPatchi]; const vectorField& Sf = mesh.Sf().boundaryField()[filmPatchi]; const scalarField& magSf = mesh.magSf().boundaryField()[filmPatchi]; - forAll(injectorCellsPatch, j) + if (massParcelPatch_.size()) { - if (massParcelPatch_[j] > 0) + forAll(injectorCellsPatch, j) { - const label celli = injectorCellsPatch[j]; + if (massParcelPatch_[j] > 0) + { + const label celli = injectorCellsPatch[j]; - const scalar offset = - max + const scalar offset = max ( diameterParcelPatch_[j], deltaFilmPatch_[j] ); - const point pos = Cf[j] - 1.1*offset*Sf[j]/magSf[j]; - // Create a new parcel - parcelType* pPtr = - new parcelType(this->owner().pMesh(), pos, celli); + const point pos = Cf[j] - 1.1*offset*Sf[j]/magSf[j]; - // Check/set new parcel thermo properties - cloud.setParcelThermoProperties(*pPtr); + // Create a new parcel + parcelType* pPtr = + new parcelType(this->owner().pMesh(), pos, celli); - setParcelProperties(*pPtr, j); + // Check/set new parcel thermo properties + cloud.setParcelThermoProperties(*pPtr); - if (pPtr->nParticle() > 0.001) - { - // Check new parcel properties - cloud.checkParcelProperties(*pPtr, -1); + setParcelProperties(*pPtr, j); - // Add the new parcel to the cloud - cloud.addParticle(pPtr); + if (pPtr->nParticle() > 0.001) + { + // Check new parcel properties + cloud.checkParcelProperties(*pPtr, -1); - nParcelsInjected_++; - } - else - { - // TODO: cache mass and re-distribute? - delete pPtr; + // Add the new parcel to the cloud + cloud.addParticle(pPtr); + + nParcelsInjected_++; + } + else + { + // TODO: cache mass and re-distribute? + delete pPtr; + } } } } diff --git a/src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModelNew.C b/src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModelNew.C index 3cc6100225..48bf043c73 100644 --- a/src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModelNew.C +++ b/src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,7 +45,7 @@ Foam::autoPtr Foam::cavitationModel::New FatalErrorInFunction << "Unknown cavitation model " << modelType << nl << nl - << "Valid cavitationModels are : " << endl + << "Valid cavitation models are : " << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/tutorials/modules/multiRegion/film/cylinder/0/film/T b/tutorials/modules/multiRegion/film/cylinder/0/film/T index 04fb64ed97..f0db7ba757 100644 --- a/tutorials/modules/multiRegion/film/cylinder/0/film/T +++ b/tutorials/modules/multiRegion/film/cylinder/0/film/T @@ -28,7 +28,8 @@ boundaryField wall { - type zeroGradient; + type fixedValue; + value $internalField; } sides diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/0/film/T b/tutorials/modules/multiRegion/film/cylinderDripping/0/film/T new file mode 100644 index 0000000000..f0db7ba757 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/0/film/T @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0/film"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + surface + { + type coupledTemperature; + value $internalField; + } + + wall + { + type fixedValue; + value $internalField; + } + + sides + { + type zeroGradient; + } + + frontAndBack + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/0/film/U b/tutorials/modules/multiRegion/film/cylinderDripping/0/film/U new file mode 100644 index 0000000000..bbd660637d --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/0/film/U @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volVectorField; + location "0/film"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + surface + { + type filmSurfaceVelocity; + Cs 0.005; + value $internalField; + } + + wall + { + type noSlip; + } + + sides + { + type noSlip; + } + + frontAndBack + { + type slip; + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/0/film/delta b/tutorials/modules/multiRegion/film/cylinderDripping/0/film/delta new file mode 100644 index 0000000000..e8b610d885 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/0/film/delta @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0/film"; + object delta; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 0 0 0 0 0]; + +internalField uniform 2e-4; + +boundaryField +{ + surface + { + type zeroGradient; + } + + wall + { + type filmContactAngle; + + contactAngle + { + type constant; + theta0 70; + } + + value $internalField; + } + + sides + { + type zeroGradient; + } + + frontAndBack + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/0/film/p b/tutorials/modules/multiRegion/film/cylinderDripping/0/film/p new file mode 100644 index 0000000000..c53a983d34 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/0/film/p @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + surface + { + type mappedFilmPressure; + value $internalField; + } + + wall + { + type zeroGradient; + } + + sides + { + type zeroGradient; + } + + frontAndBack + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/H2O b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/H2O new file mode 100644 index 0000000000..9f02c168b8 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/H2O @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object H2O; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + film + { + type zeroGradient; + } + + "(sides|frontAndBack)" + { + type zeroGradient; + } + + top + { + type inletOutlet; + inletValue $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/N2 b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/N2 new file mode 100644 index 0000000000..4d61cf60e5 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/N2 @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object N2; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.77; + +boundaryField +{ + film + { + type zeroGradient; + } + + "(sides|frontAndBack)" + { + type zeroGradient; + } + + top + { + type inletOutlet; + inletValue $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/O2 b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/O2 new file mode 100644 index 0000000000..d574b9dcfd --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/O2 @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object O2; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.23; + +boundaryField +{ + film + { + type zeroGradient; + } + + "(sides|frontAndBack)" + { + type zeroGradient; + } + + top + { + type inletOutlet; + inletValue $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/T b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/T new file mode 100644 index 0000000000..c4ffe96e27 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/T @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + film + { + type coupledTemperature; + value $internalField; + } + + "(sides|frontAndBack)" + { + type fixedValue; + value uniform 300; + } + + top + { + type inletOutlet; + inletValue $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/U b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/U new file mode 100644 index 0000000000..9a8640daf7 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/U @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + film + { + type mappedValue; + value $internalField; + } + + "(sides|frontAndBack)" + { + type noSlip; + } + + top + { + type pressureInletOutletVelocity; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/p b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/p new file mode 100644 index 0000000000..b501f31a9e --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/p @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + film + { + type calculated; + value $internalField; + } + + "(sides|frontAndBack)" + { + type calculated; + value $internalField; + } + + top + { + type calculated; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/p_rgh b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/p_rgh new file mode 100644 index 0000000000..d0f30c3371 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/0/fluid/p_rgh @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "0"; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + film + { + type fixedFluxPressure; + } + + "(sides|frontAndBack)" + { + type fixedFluxPressure; + } + + top + { + type prghTotalPressure; + p0 $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/Allrun b/tutorials/modules/multiRegion/film/cylinderDripping/Allrun new file mode 100755 index 0000000000..7f5d8151fe --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/Allrun @@ -0,0 +1,16 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication -s fluid blockMesh -region fluid + +runApplication extrudeToRegionMesh -region fluid -overwrite + +printf "\n%s\n" "Creating files for paraview post-processing" +paraFoam -touchAll +echo + +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/constant/film/fvModels b/tutorials/modules/multiRegion/film/cylinderDripping/constant/film/fvModels new file mode 100644 index 0000000000..d634c8544a --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/constant/film/fvModels @@ -0,0 +1,60 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object fvModels; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +filmCloudTransfer +{ + type filmCloudTransfer; + + libs ("libfilmCloudTransfer.so"); + + ejection + { + model dripping; + // model BrunDripping; + // model curvatureSeparation; + + drippingCoeffs + { + deltaStable 5e-4; + + minParticlesPerParcel 10; + + parcelDistribution + { + type RosinRammler; + Q 0; + min 1e-3; + max 2e-3; + d 7.5e-05; + n 0.5; + } + } + + BrunDrippingCoeffs + { + deltaStable 5e-4; + + dCoeff 1; + } + + curvatureSeparationCoeffs + { + deltaStable 5e-4; + } + } +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/constant/film/g b/tutorials/modules/multiRegion/film/cylinderDripping/constant/film/g new file mode 100644 index 0000000000..f9c84615fe --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/constant/film/g @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 9.81 0); + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/constant/film/momentumTransport b/tutorials/modules/multiRegion/film/cylinderDripping/constant/film/momentumTransport new file mode 100644 index 0000000000..7c2dc8837b --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/constant/film/momentumTransport @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object momentumTransport; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/constant/film/physicalProperties b/tutorials/modules/multiRegion/film/cylinderDripping/constant/film/physicalProperties new file mode 100644 index 0000000000..7c9cebb25c --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/constant/film/physicalProperties @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object physicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + properties liquid; + energy sensibleInternalEnergy; +} + +mixture +{ + H2O; +} + +sigma +{ + type constant; + sigma 0.07; +} + +deltaWet 1e-4; + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/cloudProperties b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/cloudProperties new file mode 100644 index 0000000000..722fd60c2d --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/cloudProperties @@ -0,0 +1,121 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object cloudProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type reactingCloud; + +libs ("libfilmCloudTransfer.so"); + +solution +{ + coupled no; + transient yes; + cellValueSourceCorrection no; + maxCo 0.3; + + sourceTerms + { + schemes + { + rho explicit 1; + U explicit 1; + Yi explicit 1; + h explicit 1; + radiation explicit 1; + } + } + + interpolationSchemes + { + rho cell; + U cellPoint; + mu cell; + T cell; + Cp cell; + kappa cell; + p cell; + } + + integrationSchemes + { + U Euler; + T analytical; + } +} + +constantProperties +{ + rho0 1000; + T0 300; + Cp0 4187; + + constantVolume false; +} + +subModels +{ + particleForces + { + sphereDrag; + gravity; + } + + injectionModels + {} + + dispersionModel none; + + patchInteractionModel standardWallInteraction; + + heatTransferModel none; + + compositionModel singlePhaseMixture; + + phaseChangeModel none; + + stochasticCollisionModel none; + + surfaceFilmModel cloudFilmTransfer; + + radiation off; + + standardWallInteractionCoeffs + { + type rebound; + } + + singlePhaseMixtureCoeffs + { + phases + ( + liquid + { + H2O 1; + } + ); + } + + cloudFilmTransferCoeffs + { + interactionType absorb; + } +} + + +cloudFunctions +{} + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/fvModels b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/fvModels new file mode 100644 index 0000000000..cf1e065c83 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/fvModels @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object fvModels; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +clouds +{ + type clouds; + libs ("liblagrangianParcel.so"); +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/g b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/g new file mode 100644 index 0000000000..ef3f9548e3 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/g @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 9.81 0); + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/momentumTransport b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/momentumTransport new file mode 100644 index 0000000000..8278c989ec --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/momentumTransport @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object momentumTransport; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/pRef b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/pRef new file mode 100644 index 0000000000..165e31d6fe --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/pRef @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class uniformDimensionedScalarField; + location "constant"; + object pRef; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; +value 1e5; + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/parcelInjectionProperties b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/parcelInjectionProperties new file mode 100644 index 0000000000..8d7cd1ba90 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/parcelInjectionProperties @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object scalarListList; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// (x y z) (u v w) d rho mDot T Cp (Y0..Y2) +( + (0 1.95 -0.2) (0 -5 0) 0.001 1000 0.002 300 4200 (1) + (0 1.95 0) (0 -5 0) 0.001 1000 0.002 300 4200 (1) + (0 1.95 0.2) (0 -5 0) 0.001 1000 0.002 300 4200 (1) +); + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/physicalProperties b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/physicalProperties new file mode 100644 index 0000000000..dd9a543d5b --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/physicalProperties @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object physicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture multicomponentMixture; + transport sutherland; + thermo janaf; + energy sensibleEnthalpy; + equationOfState perfectGas; + specie specie; +} + +#include "speciesThermo" + +defaultSpecie N2; + +liquids +{ + H2O; +} + +solids +{} + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/speciesThermo b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/speciesThermo new file mode 100644 index 0000000000..1c990e67a4 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/constant/fluid/speciesThermo @@ -0,0 +1,72 @@ +species +( + O2 + H2O + N2 +); + +O2 +{ + specie + { + molWeight 31.9988; + } + thermodynamics + { + Tlow 200; + Thigh 5000; + Tcommon 1000; + highCpCoeffs ( 3.69758 0.00061352 -1.25884e-07 1.77528e-11 -1.13644e-15 -1233.93 3.18917 ); + lowCpCoeffs ( 3.21294 0.00112749 -5.75615e-07 1.31388e-09 -8.76855e-13 -1005.25 6.03474 ); + } + transport + { + As 1.67212e-06; + Ts 170.672; + } +} + +H2O +{ + specie + { + molWeight 18.0153; + } + thermodynamics + { + Tlow 200; + Thigh 5000; + Tcommon 1000; + highCpCoeffs ( 2.67215 0.00305629 -8.73026e-07 1.201e-10 -6.39162e-15 -29899.2 6.86282 ); + lowCpCoeffs ( 3.38684 0.00347498 -6.3547e-06 6.96858e-09 -2.50659e-12 -30208.1 2.59023 ); + } + transport + { + As 1.67212e-06; + Ts 170.672; + } +} + +N2 +{ + specie + { + molWeight 28.0134; + } + thermodynamics + { + Tlow 200; + Thigh 5000; + Tcommon 1000; + highCpCoeffs ( 2.92664 0.00148798 -5.68476e-07 1.0097e-10 -6.75335e-15 -922.798 5.98053 ); + lowCpCoeffs ( 3.29868 0.00140824 -3.96322e-06 5.64152e-09 -2.44486e-12 -1020.9 3.95037 ); + } + transport + { + As 1.67212e-06; + Ts 170.672; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/system/controlDict b/tutorials/modules/multiRegion/film/cylinderDripping/system/controlDict new file mode 100644 index 0000000000..7474b5f0f2 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/system/controlDict @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application foamMultiRun; + +regionSolvers +{ + film film; + fluid multicomponentFluid; +} + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 1e-2; + +writeControl adjustableRunTime; + +writeInterval 0.01; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 10; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.3; + +maxDeltaT 1; + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/system/film/fvSchemes b/tutorials/modules/multiRegion/film/cylinderDripping/system/film/fvSchemes new file mode 100644 index 0000000000..ddee59f067 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/system/film/fvSchemes @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system/film"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + + div(phid,alpha) Gauss upwind; + div(alphaRhoPhi,U) Gauss upwind; + div(alphaRhoPhi,e) Gauss upwind; +} + +laplacianSchemes +{ + default Gauss linear uncorrected; +} + +snGradSchemes +{ + default uncorrected; +} + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/system/film/fvSolution b/tutorials/modules/multiRegion/film/cylinderDripping/system/film/fvSolution new file mode 100644 index 0000000000..e864f18088 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/system/film/fvSolution @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system/film"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.*" + { + solver PBiCGStab; + preconditioner DILU; + + tolerance 1e-10; + relTol 0; + } + + "(U|e).*" + { + solver PBiCGStab; + preconditioner DILU; + + tolerance 1e-10; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor yes; + nOuterCorrectors 2; + nCorrectors 1; + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/blockMeshDict b/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/blockMeshDict new file mode 100644 index 0000000000..1c1990db81 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/blockMeshDict @@ -0,0 +1,149 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.1; + +vertices +( + (0.5 0 -0.5) + (1 0 -0.5) + (2 0 -0.5) + (2 0.707107 -0.5) + (0.707107 0.707107 -0.5) + (0.353553 0.353553 -0.5) + (2 2 -0.5) + (0.707107 2 -0.5) + (0 2 -0.5) + (0 1 -0.5) + (0 0.5 -0.5) + (-0.5 0 -0.5) + (-1 0 -0.5) + (-2 0 -0.5) + (-2 0.707107 -0.5) + (-0.707107 0.707107 -0.5) + (-0.353553 0.353553 -0.5) + (-2 2 -0.5) + (-0.707107 2 -0.5) + (0.5 0 0.5) + (1 0 0.5) + (2 0 0.5) + (2 0.707107 0.5) + (0.707107 0.707107 0.5) + (0.353553 0.353553 0.5) + (2 2 0.5) + (0.707107 2 0.5) + (0 2 0.5) + (0 1 0.5) + (0 0.5 0.5) + (-0.5 0 0.5) + (-1 0 0.5) + (-2 0 0.5) + (-2 0.707107 0.5) + (-0.707107 0.707107 0.5) + (-0.353553 0.353553 0.5) + (-2 2 0.5) + (-0.707107 2 0.5) +); + +blocks +( + hex (5 4 9 10 24 23 28 29) (10 10 11) simpleGrading (1 1 1) + hex (0 1 4 5 19 20 23 24) (10 10 11) simpleGrading (1 1 1) + hex (1 2 3 4 20 21 22 23) (20 10 11) simpleGrading (1 1 1) + hex (4 3 6 7 23 22 25 26) (20 20 11) simpleGrading (1 1 1) + hex (9 4 7 8 28 23 26 27) (10 20 11) simpleGrading (1 1 1) + hex (15 16 10 9 34 35 29 28) (10 10 11) simpleGrading (1 1 1) + hex (12 11 16 15 31 30 35 34) (10 10 11) simpleGrading (1 1 1) + hex (13 12 15 14 32 31 34 33) (20 10 11) simpleGrading (1 1 1) + hex (14 15 18 17 33 34 37 36) (20 20 11) simpleGrading (1 1 1) + hex (15 9 8 18 34 28 27 37) (10 20 11) simpleGrading (1 1 1) +); + +edges +( + arc 0 5 (0.469846 0.17101 -0.5) + arc 5 10 (0.17101 0.469846 -0.5) + arc 1 4 (0.939693 0.34202 -0.5) + arc 4 9 (0.34202 0.939693 -0.5) + arc 19 24 (0.469846 0.17101 0.5) + arc 24 29 (0.17101 0.469846 0.5) + arc 20 23 (0.939693 0.34202 0.5) + arc 23 28 (0.34202 0.939693 0.5) + arc 11 16 (-0.469846 0.17101 -0.5) + arc 16 10 (-0.17101 0.469846 -0.5) + arc 12 15 (-0.939693 0.34202 -0.5) + arc 15 9 (-0.34202 0.939693 -0.5) + arc 30 35 (-0.469846 0.17101 0.5) + arc 35 29 (-0.17101 0.469846 0.5) + arc 31 34 (-0.939693 0.34202 0.5) + arc 34 28 (-0.34202 0.939693 0.5) +); + +defaultPatch +{ + name frontAndBack; + type wall; +} + +boundary +( + film + { + type mappedExtrudedWall; + neighbourRegion film; + neighbourPatch surface; + isExtrudedRegion no; + + faces + ( + (0 1 20 19) + (1 2 21 20) + (12 11 30 31) + (13 12 31 32) + + (5 0 19 24) + (10 5 24 29) + (16 10 29 35) + (11 16 35 30) + ); + } + sides + { + type patch; + + faces + ( + (2 3 22 21) + (3 6 25 22) + (14 13 32 33) + (17 14 33 36) + ); + } + top + { + type patch; + + faces + ( + (6 7 26 25) + (7 8 27 26) + (8 18 37 27) + (18 17 36 37) + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/decomposeParDict b/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/decomposeParDict new file mode 100644 index 0000000000..285afcd541 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/decomposeParDict @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/extrudeToRegionMeshDict b/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/extrudeToRegionMeshDict new file mode 100644 index 0000000000..7d979d2709 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/extrudeToRegionMeshDict @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object extrudeToRegionMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +region film; + +patches (film); + +extrudeModel linearNormal; + +intrude yes; + +adaptMesh no; + +patchTypes (mappedExtrudedWall); +patchNames (film); + +regionPatchTypes (filmWall); +regionPatchNames (wall); + +regionOppositePatchTypes (mappedFilmSurface); +regionOppositePatchNames (surface); + +nLayers 1; + +expansionRatio 1; + +linearNormalCoeffs +{ + thickness 0.001; +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/fvSchemes b/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/fvSchemes new file mode 100644 index 0000000000..acfe41c68f --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/fvSchemes @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div(phi,K) Gauss upwind; + div(phi,h) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(U) Gauss linear; + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; + div(phi,Yi_h) Gauss upwind; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/fvSolution b/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/fvSolution new file mode 100644 index 0000000000..a2121d3ae2 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/system/fluid/fvSolution @@ -0,0 +1,99 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "(rho|G)" + { + solver PCG; + preconditioner DIC; + tolerance 0; + relTol 0.1; + } + + "(rho|G)Final" + { + $rho; + tolerance 1e-05; + relTol 0; + } + + U + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 0; + relTol 0.1; + maxIter 50; + } + + UFinal + { + $U; + relTol 0; + tolerance 1e-05; + } + + "(k|epsilon).*" + { + $UFinal; + } + + p_rgh + { + solver GAMG; + tolerance 0; + relTol 0.1; + smoother GaussSeidel; + } + + p_rghFinal + { + $p_rgh; + tolerance 1e-06; + relTol 0; + } + + "(h|Yi|O2|N2|H2O).*" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } +} + + +PIMPLE +{ + nCorrectors 2; + nNonOrthogonalCorrectors 0; + momentumPredictor yes; + pRefCell 0; + pRefValue 1e5; +} + + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderDripping/system/fvSolution b/tutorials/modules/multiRegion/film/cylinderDripping/system/fvSolution new file mode 100644 index 0000000000..f1497eb3b5 --- /dev/null +++ b/tutorials/modules/multiRegion/film/cylinderDripping/system/fvSolution @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +PIMPLE +{ + nOuterCorrectors 1; +} + +// ************************************************************************* // diff --git a/tutorials/modules/multiRegion/film/cylinderVoF/0/film/T b/tutorials/modules/multiRegion/film/cylinderVoF/0/film/T index 9cceb4dde5..9145ee4efe 100644 --- a/tutorials/modules/multiRegion/film/cylinderVoF/0/film/T +++ b/tutorials/modules/multiRegion/film/cylinderVoF/0/film/T @@ -28,7 +28,8 @@ boundaryField wall { - type zeroGradient; + type fixedValue; + value $internalField; } sides