diff --git a/applications/solvers/modules/compressibleVoF/Allwclean b/applications/solvers/modules/compressibleVoF/Allwclean index 6080e40894..238131457d 100755 --- a/applications/solvers/modules/compressibleVoF/Allwclean +++ b/applications/solvers/modules/compressibleVoF/Allwclean @@ -5,7 +5,6 @@ wclean wclean libso fvModels/VoFTurbulenceDamping wclean libso fvModels/VoFClouds -wclean libso fvModels/VoFSurfaceFilm wclean libso fvModels/VoFCavitation wclean libso fvModels/VoFSolidificationMeltingSource diff --git a/applications/solvers/modules/compressibleVoF/Allwmake b/applications/solvers/modules/compressibleVoF/Allwmake index a1b0ad6cb8..b62e4363b4 100755 --- a/applications/solvers/modules/compressibleVoF/Allwmake +++ b/applications/solvers/modules/compressibleVoF/Allwmake @@ -8,7 +8,6 @@ wmake $targetType wmake $targetType fvModels/VoFTurbulenceDamping wmake $targetType fvModels/VoFClouds -wmake $targetType fvModels/VoFSurfaceFilm wmake $targetType fvModels/VoFCavitation wmake $targetType fvModels/VoFSolidificationMeltingSource diff --git a/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/Make/files b/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/Make/files deleted file mode 100644 index 2556bea36c..0000000000 --- a/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/Make/files +++ /dev/null @@ -1,4 +0,0 @@ -VoFSurfaceFilm.C -VoFPatchTransfer/VoFPatchTransfer.C - -LIB = $(FOAM_LIBBIN)/libVoFSurfaceFilm diff --git a/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/Make/options b/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/Make/options deleted file mode 100644 index 3eec46f817..0000000000 --- a/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/Make/options +++ /dev/null @@ -1,15 +0,0 @@ -EXE_INC = \ - -I$(FOAM_SOLVERS)/modules/twoPhaseVoFSolver/lnInclude \ - -I$(FOAM_SOLVERS)/modules/twoPhaseSolver/lnInclude \ - -I$(FOAM_SOLVERS)/modules/VoFSolver/lnInclude \ - -I$(FOAM_SOLVERS)/modules/compressibleVoF/lnInclude \ - -I$(LIB_SRC)/physicalProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhases/lnInclude \ - -I$(LIB_SRC)/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -LIB_LIBS = \ - -lsurfaceFilmModels diff --git a/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.C b/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.C deleted file mode 100644 index 116cfd92ca..0000000000 --- a/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.C +++ /dev/null @@ -1,357 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-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 "VoFPatchTransfer.H" -#include "compressibleTwoPhaseVoFMixture.H" -#include "thermoSurfaceFilm.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(VoFPatchTransfer, 0); -addToRunTimeSelectionTable(transferModel, VoFPatchTransfer, dictionary); - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -VoFPatchTransfer::VoFPatchTransfer -( - surfaceFilm& film, - const dictionary& dict -) -: - transferModel(type(), film, dict), - deltaFactorToVoF_ - ( - coeffDict_.lookupOrDefault("deltaFactorToVoF", 1.0) - ), - deltaFactorToFilm_ - ( - coeffDict_.lookupOrDefault("deltaFactorToFilm", 0.5) - ), - alphaToVoF_ - ( - coeffDict_.lookupOrDefault("alphaToVoF", 0.5) - ), - alphaToFilm_ - ( - coeffDict_.lookupOrDefault("alphaToFilm", 0.1) - ), - transferRateCoeff_ - ( - coeffDict_.lookupOrDefault("transferRateCoeff", 0.1) - ) -{ - const polyBoundaryMesh& pbm = film.mesh().boundaryMesh(); - patchIDs_.setSize - ( - pbm.size() - film.mesh().globalData().processorPatches().size() - ); - - if (coeffDict_.found("patches")) - { - const wordReList patchNames(coeffDict_.lookup("patches")); - const labelHashSet patchSet = pbm.patchSet(patchNames); - - Info<< " applying to patches:" << nl; - - label pidi = 0; - forAllConstIter(labelHashSet, patchSet, iter) - { - const label patchi = iter.key(); - patchIDs_[pidi++] = patchi; - Info<< " " << pbm[patchi].name() << endl; - } - patchIDs_.setSize(pidi); - patchTransferredMasses_.setSize(pidi, 0); - } - else - { - Info<< " applying to all patches" << endl; - - forAll(patchIDs_, patchi) - { - patchIDs_[patchi] = patchi; - } - - patchTransferredMasses_.setSize(patchIDs_.size(), 0); - } - - if (!patchIDs_.size()) - { - FatalErrorInFunction - << "No patches selected" - << exit(FatalError); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -VoFPatchTransfer::~VoFPatchTransfer() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void VoFPatchTransfer::correct -( - scalarField& availableMass, - scalarField& massToTransfer, - vectorField& momentumToTransfer -) -{ - NotImplemented; -} - - -void VoFPatchTransfer::correct -( - scalarField& availableMass, - scalarField& massToTransfer, - vectorField& momentumToTransfer, - scalarField& energyToTransfer -) -{ - // Do not correct if no patches selected - if (!patchIDs_.size()) return; - - // Film properties - - const thermoSurfaceFilm& film = filmType(); - - const scalarField& delta = film.delta(); - const scalarField& rho = film.rho(); - const vectorField& U = film.U(); - const scalarField& he = film.thermo().he(); - - const scalarField& magSf = film.magSf(); - - const polyBoundaryMesh& pbm = film.mesh().boundaryMesh(); - - - // Primary region properties - - const fvMesh& primaryMesh = film.primaryMesh(); - - const compressibleTwoPhaseVoFMixture& thermo - ( - primaryMesh.lookupObject - ( - "phaseProperties" - ) - ); - - const volScalarField& alphaVoF = thermo.alpha1(); - const volScalarField& rhoVoF = thermo.thermo1().rho()(); - const volScalarField& heVoF = thermo.thermo1().he(); - - const volVectorField& UVoF - ( - primaryMesh.lookupObject("U") - ); - - forAll(patchIDs_, pidi) - { - const label patchi = patchIDs_[pidi]; - label primaryPatchi = -1; - - forAll(film.intCoupledPatchIDs(), i) - { - const label filmPatchi = film.intCoupledPatchIDs()[i]; - - if (filmPatchi == patchi) - { - primaryPatchi = film.primaryPatchIDs()[i]; - } - } - - if (primaryPatchi != -1) - { - const scalarField deltaCoeffsVoF - ( - film.toFilm - ( - patchi, - primaryMesh.boundary()[primaryPatchi].deltaCoeffs() - ) - ); - - const scalarField alphaVoFp - ( - film.toFilm(patchi, alphaVoF.boundaryField()[primaryPatchi]) - ); - - const scalarField rhoVoFp - ( - film.toFilm(patchi, rhoVoF.boundaryField()[primaryPatchi]) - ); - - const vectorField UVoFp - ( - film.toFilm(patchi, UVoF.boundaryField()[primaryPatchi]) - ); - - const scalarField heVoFp - ( - film.toFilm(patchi, heVoF.boundaryField()[primaryPatchi]) - ); - - const scalarField VVoFp - ( - film.toFilm - ( - patchi, - primaryMesh.boundary()[primaryPatchi] - .patchInternalField(primaryMesh.V()) - ) - ); - - const polyPatch& pp = pbm[patchi]; - const labelList& faceCells = pp.faceCells(); - - // Accumulate the total mass removed from patch - scalar dMassPatch = 0; - - forAll(faceCells, facei) - { - const label celli = faceCells[facei]; - - scalar dMass = 0; - - // Film->VoF transfer - if - ( - delta[celli] > 2*deltaFactorToVoF_/deltaCoeffsVoF[facei] - || alphaVoFp[facei] > alphaToVoF_ - ) - { - dMass = - transferRateCoeff_*delta[celli]*rho[celli]*magSf[celli]; - - massToTransfer[celli] += dMass; - momentumToTransfer[celli] += dMass*U[celli]; - energyToTransfer[celli] += dMass*he[celli]; - } - - // VoF->film transfer - if - ( - alphaVoFp[facei] > 0 - && delta[celli] < 2*deltaFactorToFilm_/deltaCoeffsVoF[facei] - && alphaVoFp[facei] < alphaToFilm_ - ) - { - dMass = - -transferRateCoeff_ - *alphaVoFp[facei]*rhoVoFp[facei]*VVoFp[facei]; - - massToTransfer[celli] += dMass; - momentumToTransfer[celli] += dMass*UVoFp[facei]; - energyToTransfer[celli] += dMass*heVoFp[facei]; - } - - availableMass[celli] -= dMass; - dMassPatch += dMass; - } - - patchTransferredMasses_[pidi] += dMassPatch; - addToTransferredMass(dMassPatch); - } - } - - transferModel::correct(); - - if (writeTime()) - { - scalarField patchTransferredMasses0 - ( - getModelProperty - ( - "patchTransferredMasses", - scalarField(patchTransferredMasses_.size(), 0) - ) - ); - - scalarField patchTransferredMassTotals(patchTransferredMasses_); - Pstream::listCombineGather - ( - patchTransferredMassTotals, - plusEqOp() - ); - patchTransferredMasses0 += patchTransferredMassTotals; - - setModelProperty - ( - "patchTransferredMasses", - patchTransferredMasses0 - ); - - patchTransferredMasses_ = 0; - } -} - - -void VoFPatchTransfer::patchTransferredMassTotals -( - scalarField& patchMasses -) const -{ - // Do not correct if no patches selected - if (!patchIDs_.size()) return; - - scalarField patchTransferredMasses - ( - getModelProperty - ( - "patchTransferredMasses", - scalarField(patchTransferredMasses_.size(), 0) - ) - ); - - scalarField patchTransferredMassTotals(patchTransferredMasses_); - Pstream::listCombineGather(patchTransferredMassTotals, plusEqOp()); - - forAll(patchIDs_, pidi) - { - const label patchi = patchIDs_[pidi]; - patchMasses[patchi] += - patchTransferredMasses[pidi] + patchTransferredMassTotals[pidi]; - } -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// ************************************************************************* // diff --git a/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.H b/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.H deleted file mode 100644 index 55951afbd3..0000000000 --- a/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.H +++ /dev/null @@ -1,143 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2022 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::surfaceFilmModels::VoFPatchTransfer - -Description - Transfer mass between the film and the VoF in the continuous phase. - -SourceFiles - VoFPatchTransfer.C - -\*---------------------------------------------------------------------------*/ - -#ifndef VoFPatchTransfer_H -#define VoFPatchTransfer_H - -#include "transferModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class VoFPatchTransfer Declaration -\*---------------------------------------------------------------------------*/ - -class VoFPatchTransfer -: - public transferModel -{ -protected: - - //- Factor of the cell height above which the film is transferred - // to the VoF - scalar deltaFactorToVoF_; - - //- Factor of the cell height below which the VoF may be transferred - // to the film - scalar deltaFactorToFilm_; - - //- VoF limit above which all of the film is transferred to the VoF - scalar alphaToVoF_; - - //- VoF limit below which the VoF may be transferred to the film - scalar alphaToFilm_; - - //- Transfer rate coefficient - scalar transferRateCoeff_; - - //- List of patch IDs at which the film is removed - labelList patchIDs_; - - //- Transferred mass for each patch at which the film is removed - scalarField patchTransferredMasses_; - - -public: - - //- Runtime type information - TypeName("VoFPatchTransfer"); - - - // Constructors - - //- Construct from surface film model - VoFPatchTransfer(surfaceFilm& film, const dictionary& dict); - - //- Disallow default bitwise copy construction - VoFPatchTransfer(const VoFPatchTransfer&) = delete; - - - //- Destructor - virtual ~VoFPatchTransfer(); - - - // Member Functions - - //- Correct - virtual void correct - ( - scalarField& availableMass, - scalarField& massToTransfer, - vectorField& momentumToTransfer - ); - - //- Correct kinematic and thermodynamic transfers - virtual void correct - ( - scalarField& availableMass, - scalarField& massToTransfer, - vectorField& momentumToTransfer, - scalarField& energyToTransfer - ); - - //- Accumulate the total mass injected for the patches into the - // scalarField provided - virtual void patchTransferredMassTotals - ( - scalarField& patchMasses - ) const; - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const VoFPatchTransfer&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/VoFSurfaceFilm.C b/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/VoFSurfaceFilm.C deleted file mode 100644 index 96a2fbd58c..0000000000 --- a/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/VoFSurfaceFilm.C +++ /dev/null @@ -1,197 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021-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 "VoFSurfaceFilm.H" -#include "compressibleTwoPhaseVoFMixture.H" -#include "fvmSup.H" -#include "uniformDimensionedFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // - -namespace Foam -{ - namespace fv - { - defineTypeNameAndDebug(VoFSurfaceFilm, 0); - - addToRunTimeSelectionTable - ( - fvModel, - VoFSurfaceFilm, - dictionary - ); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::fv::VoFSurfaceFilm::VoFSurfaceFilm -( - const word& sourceName, - const word& modelType, - const fvMesh& mesh, - const dictionary& dict -) -: - fvModel(sourceName, modelType, mesh, dict), - surfaceFilm_ - ( - thermoSurfaceFilm::typeName, - mesh, - mesh.lookupObject("g"), - surfaceFilm::typeName - ), - curTimeIndex_(-1) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::wordList Foam::fv::VoFSurfaceFilm::addSupFields() const -{ - return wordList - ( - { - surfaceFilm_.rhoPrimary().name(), - surfaceFilm_.UPrimary().name(), - surfaceFilm_.primaryThermo().he().name() - } - ); -} - - -Foam::scalar Foam::fv::VoFSurfaceFilm::maxDeltaT() const -{ - return surfaceFilm_.maxDeltaT(); -} - - -void Foam::fv::VoFSurfaceFilm::correct() -{ - if (curTimeIndex_ == mesh().time().timeIndex()) - { - return; - } - - surfaceFilm_.evolve(); - - curTimeIndex_ = mesh().time().timeIndex(); -} - - -void Foam::fv::VoFSurfaceFilm::addSup -( - const volScalarField& alpha, - fvMatrix& eqn, - const word& fieldName -) const -{ - if (debug) - { - Info<< type() << ": applying source to " << eqn.psi().name() << endl; - } - - if (fieldName == surfaceFilm_.rhoPrimary().name()) - { - eqn += surfaceFilm_.Srho(); - } - else - { - FatalErrorInFunction - << "Support for field " << fieldName << " is not implemented" - << exit(FatalError); - } -} - - -void Foam::fv::VoFSurfaceFilm::addSup -( - const volScalarField& alpha, - const volScalarField& rho, - fvMatrix& eqn, - const word& fieldName -) const -{ - if (debug) - { - Info<< type() << ": applying source to " << eqn.psi().name() << endl; - } - - if (fieldName == surfaceFilm_.primaryThermo().he().name()) - { - eqn += surfaceFilm_.Sh(); - } - else - { - FatalErrorInFunction - << "Support for field " << fieldName << " is not implemented" - << exit(FatalError); - } -} - - -void Foam::fv::VoFSurfaceFilm::addSup -( - const volScalarField& rho, - fvMatrix& eqn, - const word& fieldName -) const -{ - if (debug) - { - Info<< type() << ": applying source to " << eqn.psi().name() << endl; - } - - eqn += surfaceFilm_.SU(); -} - - -void Foam::fv::VoFSurfaceFilm::topoChange(const polyTopoChangeMap&) -{ - NotImplemented; -} - - -void Foam::fv::VoFSurfaceFilm::mapMesh(const polyMeshMap& map) -{ - NotImplemented; -} - - -void Foam::fv::VoFSurfaceFilm::distribute(const polyDistributionMap&) -{ - NotImplemented; -} - - -bool Foam::fv::VoFSurfaceFilm::movePoints() -{ - return true; -} - - -// ************************************************************************* // diff --git a/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/VoFSurfaceFilm.H b/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/VoFSurfaceFilm.H deleted file mode 100644 index f29b327ff3..0000000000 --- a/applications/solvers/modules/compressibleVoF/fvModels/VoFSurfaceFilm/VoFSurfaceFilm.H +++ /dev/null @@ -1,176 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021-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::fv::VoFSurfaceFilm - -Description - Surface film model for VoF simulations. - -Usage - Example usage: - \verbatim - VoFSurfaceFilm - { - type VoFSurfaceFilm; - phase water; - } - \endverbatim - -SourceFiles - VoFSurfaceFilm.C - -\*---------------------------------------------------------------------------*/ - -#ifndef VoFSurfaceFilm_H -#define VoFSurfaceFilm_H - -#include "fvModel.H" -#include "thermoSurfaceFilm.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace fv -{ - -/*---------------------------------------------------------------------------*\ - Class VoFSurfaceFilm Declaration -\*---------------------------------------------------------------------------*/ - -class VoFSurfaceFilm -: - public fvModel -{ - // Private Data - - //- The surface film model - thermoSurfaceFilm surfaceFilm_; - - //- Current time index (used for updating) - mutable label curTimeIndex_; - - -public: - - //- Runtime type information - TypeName("VoFSurfaceFilm"); - - - // Constructors - - //- Construct from explicit source name and mesh - VoFSurfaceFilm - ( - const word& sourceName, - const word& modelType, - const fvMesh& mesh, - const dictionary& dict - ); - - //- Disallow default bitwise copy construction - VoFSurfaceFilm - ( - const VoFSurfaceFilm& - ) = delete; - - - // Member Functions - - // Checks - - //- Return the list of fields for which the option adds source term - // to the transport equation - virtual wordList addSupFields() const; - - //- Return the maximum time-step for stable operation - virtual scalar maxDeltaT() const; - - - // Correct - - //- Solve the film and update the sources - virtual void correct(); - - - // Add explicit and implicit contributions to compressible equation - - //- Add explicit contribution to phase continuity - virtual void addSup - ( - const volScalarField& alpha, - fvMatrix& eqn, - const word& fieldName - ) const; - - //- Add explicit contribution to phase energy equation - virtual void addSup - ( - const volScalarField& alpha, - const volScalarField& rho, - fvMatrix& eqn, - const word& fieldName - ) const; - - //- Add implicit contribution to mixture momentum equation - virtual void addSup - ( - const volScalarField& rho, - fvMatrix& eqn, - const word& fieldName - ) const; - - - // 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 VoFSurfaceFilm&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace fv -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/bin/foamInfo b/bin/foamInfo index f403dc7251..5a051484e6 100755 --- a/bin/foamInfo +++ b/bin/foamInfo @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | Website: https://openfoam.org -# \\ / A nd | Copyright (C) 2018-2022 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2018-2023 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -206,7 +206,6 @@ modelsInFamily () { _modelDirs="\ $(findModelDirs "$_familyDir" 2) \ $(findModelDirs "$FOAM_SRC/lagrangian/parcel/fvModels") \ - $(findModelDirs "$FOAM_SRC/surfaceFilmModels/fvModels") \ $(findModelDirs "$FOAM_SRC/radiationModels/fvModels/radiation")" [ "$_modelDirs" ] || return 0 diff --git a/etc/caseDicts/fvModels/surfaceFilms b/etc/caseDicts/fvModels/surfaceFilms deleted file mode 100644 index c8e7b87c3d..0000000000 --- a/etc/caseDicts/fvModels/surfaceFilms +++ /dev/null @@ -1,20 +0,0 @@ -/*--------------------------------*- 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 surfaceFilms; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -type surfaceFilms; - -libs ("libsurfaceFilmModels.so"); - -// ************************************************************************* // diff --git a/src/Allwmake b/src/Allwmake index 300af5b91c..ef84db2f16 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -77,9 +77,6 @@ functionObjects/Allwmake $targetType $* lagrangian/Allwmake $targetType $* -wmake $targetType surfaceFilmModels -wmake $targetType parcelSurfaceFilmModels - wmake $targetType sixDoFRigidBodyMotion wmake $targetType sixDoFRigidBodyState wmake $targetType rigidBodyDynamics diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C index 90bb34bae0..47c6a49f61 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C @@ -66,7 +66,7 @@ void Foam::MomentumCloud::setModels() ).ptr() ); - surfaceFilmModel_.reset + filmModel_.reset ( SurfaceFilmModel>::New ( @@ -250,7 +250,7 @@ void Foam::MomentumCloud::cloudReset(MomentumCloud& c) dispersionModel_.reset(c.dispersionModel_.ptr()); patchInteractionModel_.reset(c.patchInteractionModel_.ptr()); stochasticCollisionModel_.reset(c.stochasticCollisionModel_.ptr()); - surfaceFilmModel_.reset(c.surfaceFilmModel_.ptr()); + filmModel_.reset(c.filmModel_.ptr()); UIntegrator_.reset(c.UIntegrator_.ptr()); } @@ -333,7 +333,7 @@ Foam::MomentumCloud::MomentumCloud dispersionModel_(nullptr), patchInteractionModel_(nullptr), stochasticCollisionModel_(nullptr), - surfaceFilmModel_(nullptr), + filmModel_(nullptr), UIntegrator_(nullptr), UTrans_ ( @@ -426,7 +426,7 @@ Foam::MomentumCloud::MomentumCloud dispersionModel_(c.dispersionModel_->clone()), patchInteractionModel_(c.patchInteractionModel_->clone()), stochasticCollisionModel_(c.stochasticCollisionModel_->clone()), - surfaceFilmModel_(c.surfaceFilmModel_->clone()), + filmModel_(c.filmModel_->clone()), UIntegrator_(c.UIntegrator_->clone()), UTrans_ ( @@ -515,7 +515,7 @@ Foam::MomentumCloud::MomentumCloud dispersionModel_(nullptr), patchInteractionModel_(nullptr), stochasticCollisionModel_(nullptr), - surfaceFilmModel_(nullptr), + filmModel_(nullptr), UIntegrator_(nullptr), UTrans_(nullptr), UCoeff_(nullptr) diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H index 3e2e2a00c5..374da570cc 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H @@ -210,9 +210,8 @@ protected: autoPtr>> stochasticCollisionModel_; - //- Surface film model - autoPtr>> - surfaceFilmModel_; + //- Optional film model + autoPtr>> filmModel_; // Reference to the particle integration schemes diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloudI.H b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloudI.H index 4b851b6e65..05eb75344a 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloudI.H +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloudI.H @@ -232,7 +232,7 @@ template inline const Foam::SurfaceFilmModel>& Foam::MomentumCloud::surfaceFilm() const { - return surfaceFilmModel_(); + return filmModel_(); } @@ -240,7 +240,7 @@ template inline Foam::SurfaceFilmModel>& Foam::MomentumCloud::surfaceFilm() { - return surfaceFilmModel_(); + return filmModel_(); } diff --git a/src/parcelSurfaceFilmModels/Make/files b/src/parcelSurfaceFilmModels/Make/files deleted file mode 100644 index ba13723233..0000000000 --- a/src/parcelSurfaceFilmModels/Make/files +++ /dev/null @@ -1,7 +0,0 @@ -ThermoSurfaceFilm/ThermoSurfaceFilmBase.C -makeThermoParcelSurfaceFilmModels.C -makeReactingParcelSurfaceFilmModels.C -makeReactingMultiphaseParcelSurfaceFilmModels.C -makeSprayParcelSurfaceFilmModels.C - -LIB = $(FOAM_LIBBIN)/libparcelSurfaceFilmModels diff --git a/src/parcelSurfaceFilmModels/Make/options b/src/parcelSurfaceFilmModels/Make/options deleted file mode 100644 index c102700810..0000000000 --- a/src/parcelSurfaceFilmModels/Make/options +++ /dev/null @@ -1,23 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I$(LIB_SRC)/lagrangian/parcel/lnInclude \ - -I$(LIB_SRC)/physicalProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/multicomponentThermo/lnInclude \ - -I$(LIB_SRC)/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude - -LIB_LIBS = \ - -llagrangian \ - -llagrangianParcel \ - -lphysicalProperties \ - -lspecie \ - -lfluidThermophysicalModels \ - -lthermophysicalProperties \ - -lmulticomponentThermophysicalModels \ - -lsurfaceFilmModels \ - -lfiniteVolume \ - -lmeshTools diff --git a/src/parcelSurfaceFilmModels/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/parcelSurfaceFilmModels/ThermoSurfaceFilm/ThermoSurfaceFilm.C deleted file mode 100644 index 45e20f1c92..0000000000 --- a/src/parcelSurfaceFilmModels/ThermoSurfaceFilm/ThermoSurfaceFilm.C +++ /dev/null @@ -1,752 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / 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 "ThermoSurfaceFilm.H" -#include "thermoSurfaceFilm.H" -#include "ThermoCloud.H" -#include "meshTools.H" -#include "mathematicalConstants.H" -#include "addToRunTimeSelectionTable.H" - -using namespace Foam::constant::mathematical; - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -template -Foam::vector Foam::ThermoSurfaceFilm::splashDirection -( - const vector& tanVec1, - const vector& tanVec2, - const vector& nf -) const -{ - // Azimuthal angle [rad] - const scalar phiSi = twoPi*rndGen_.sample01(); - - // Ejection angle [rad] - const scalar thetaSi = pi/180.0*(rndGen_.sample01()*(50 - 5) + 5); - - // Direction vector of new parcel - const scalar alpha = sin(thetaSi); - const scalar dcorr = cos(thetaSi); - const vector normal = alpha*(tanVec1*cos(phiSi) + tanVec2*sin(phiSi)); - vector dirVec = dcorr*nf; - dirVec += normal; - - return dirVec/mag(dirVec); -} - - -template -void Foam::ThermoSurfaceFilm::absorbInteraction -( - thermoSurfaceFilm& filmModel, - const parcelType& p, - const polyPatch& pp, - const label facei, - const scalar mass, - bool& keepParticle -) -{ - if (debug) - { - Info<< "Parcel " << p.origId() << " absorbInteraction" << endl; - } - - const fluidThermo& carrierThermo = - static_cast&>(this->owner()) - .carrierThermo(); - - const parcelThermo& thermo = - static_cast&>(this->owner()).thermo(); - - // Patch face normal - const vector& nf = pp.faceNormals()[facei]; - - // Patch velocity - const vector& Up = this->owner().U().boundaryField()[pp.index()][facei]; - - // Relative parcel velocity - const vector Urel = p.U() - Up; - - // Parcel normal velocity - const vector Un = nf*(Urel & nf); - - // Parcel tangential velocity - const vector Ut = Urel - Un; - - const liquidProperties& liq = thermo.liquids().properties()[0]; - - // Local pressure - const scalar pc = carrierThermo.p()[p.cell()]; - - filmModel.addSources - ( - pp.index(), - facei, - mass, // mass - mass*Ut, // tangential momentum - mass*mag(Un), // impingement pressure - mass*liq.Hs(pc, p.T()) // energy - ); - - this->nParcelsTransferred()++; - - keepParticle = false; -} - - -template -void Foam::ThermoSurfaceFilm::bounceInteraction -( - parcelType& p, - const polyPatch& pp, - const label facei, - bool& keepParticle -) const -{ - if (debug) - { - Info<< "Parcel " << p.origId() << " bounceInteraction" << endl; - } - - // Patch face normal - const vector& nf = pp.faceNormals()[facei]; - - // Patch velocity - const vector& Up = this->owner().U().boundaryField()[pp.index()][facei]; - - // Relative parcel velocity - const vector Urel = p.U() - Up; - - // Flip parcel normal velocity component - p.U() -= 2.0*nf*(Urel & nf); - - keepParticle = true; -} - - -template -void Foam::ThermoSurfaceFilm::drySplashInteraction -( - thermoSurfaceFilm& filmModel, - const parcelType& p, - const polyPatch& pp, - const label facei, - bool& keepParticle -) -{ - if (debug) - { - Info<< "Parcel " << p.origId() << " drySplashInteraction" << endl; - } - - const fluidThermo& carrierThermo = - static_cast&>(this->owner()) - .carrierThermo(); - - const parcelThermo& thermo = - static_cast&>(this->owner()).thermo(); - - const liquidProperties& liq = thermo.liquids().properties()[0]; - - // Patch face velocity and normal - const vector& Up = this->owner().U().boundaryField()[pp.index()][facei]; - const vector& nf = pp.faceNormals()[facei]; - - // Local pressure - const scalar pc = carrierThermo.p()[p.cell()]; - - // Retrieve parcel properties - const scalar m = p.mass()*p.nParticle(); - const scalar rho = p.rho(); - const scalar d = p.d(); - const scalar sigma = liq.sigma(pc, p.T()); - const scalar mu = liq.mu(pc, p.T()); - const vector Urel = p.U() - Up; - const vector Un = nf*(Urel & nf); - - // Laplace number - const scalar La = rho*sigma*d/sqr(mu); - - // Weber number - const scalar We = rho*magSqr(Un)*d/sigma; - - // Critical Weber number - const scalar Wec = Adry_*pow(La, -0.183); - - if (We < Wec) // Adhesion - assume absorb - { - absorbInteraction(filmModel, p, pp, facei, m, keepParticle); - } - else // Splash - { - // Ratio of incident mass to splashing mass - const scalar mRatio = 0.2 + 0.6*rndGen_.sample01(); - splashInteraction - (filmModel, p, pp, facei, mRatio, We, Wec, sigma, keepParticle); - } -} - - -template -void Foam::ThermoSurfaceFilm::wetSplashInteraction -( - thermoSurfaceFilm& filmModel, - parcelType& p, - const polyPatch& pp, - const label facei, - bool& keepParticle -) -{ - if (debug) - { - Info<< "Parcel " << p.origId() << " wetSplashInteraction" << endl; - } - - const fluidThermo& carrierThermo = - static_cast&>(this->owner()) - .carrierThermo(); - - const parcelThermo& thermo = - static_cast&>(this->owner()).thermo(); - - const liquidProperties& liq = thermo.liquids().properties()[0]; - - // Patch face velocity and normal - const vector& Up = this->owner().U().boundaryField()[pp.index()][facei]; - const vector& nf = pp.faceNormals()[facei]; - - // Local pressure - const scalar pc = carrierThermo.p()[p.cell()]; - - // Retrieve parcel properties - const scalar m = p.mass()*p.nParticle(); - const scalar rho = p.rho(); - const scalar d = p.d(); - vector& U = p.U(); - const scalar sigma = liq.sigma(pc, p.T()); - const scalar mu = liq.mu(pc, p.T()); - const vector Urel = p.U() - Up; - const vector Un = nf*(Urel & nf); - const vector Ut = Urel - Un; - - // Laplace number - const scalar La = rho*sigma*d/sqr(mu); - - // Weber number - const scalar We = rho*magSqr(Un)*d/sigma; - - // Critical Weber number - const scalar Wec = Awet_*pow(La, -0.183); - - if (We < 2) // Adhesion - assume absorb - { - absorbInteraction(filmModel, p, pp, facei, m, keepParticle); - } - else if ((We >= 2) && (We < 20)) // Bounce - { - // Incident angle of impingement - const scalar theta = pi/2 - acos(U/mag(U) & nf); - - // Restitution coefficient - const scalar epsilon = 0.993 - theta*(1.76 - theta*(1.56 - theta*0.49)); - - // Update parcel velocity - U = -epsilon*(Un) + 5.0/7.0*(Ut); - - keepParticle = true; - return; - } - else if ((We >= 20) && (We < Wec)) // Spread - assume absorb - { - absorbInteraction(filmModel, p, pp, facei, m, keepParticle); - } - else // Splash - { - // Ratio of incident mass to splashing mass - // splash mass can be > incident mass due to film entrainment - const scalar mRatio = 0.2 + 0.9*rndGen_.sample01(); - splashInteraction - (filmModel, p, pp, facei, mRatio, We, Wec, sigma, keepParticle); - } -} - - -template -void Foam::ThermoSurfaceFilm::splashInteraction -( - thermoSurfaceFilm& filmModel, - const parcelType& p, - const polyPatch& pp, - const label facei, - const scalar mRatio, - const scalar We, - const scalar Wec, - const scalar sigma, - bool& keepParticle -) -{ - // Patch face velocity and normal - const fvMesh& mesh = this->owner().mesh(); - const vector& Up = this->owner().U().boundaryField()[pp.index()][facei]; - const vector& nf = pp.faceNormals()[facei]; - - // Determine direction vectors tangential to patch normal - const vector tanVec1 = normalised(perpendicular(nf)); - const vector tanVec2 = nf^tanVec1; - - // Retrieve parcel properties - const scalar np = p.nParticle(); - const scalar m = p.mass()*np; - const scalar d = p.d(); - const vector Urel = p.U() - Up; - const vector Un = nf*(Urel & nf); - const vector Ut = Urel - Un; - const vector& posC = mesh.C()[p.cell()]; - const vector& posCf = mesh.Cf().boundaryField()[pp.index()][facei]; - - // Total mass of (all) splashed parcels - const scalar mSplash = m*mRatio; - - // Number of splashed particles per incoming particle - const scalar Ns = 5.0*(We/Wec - 1.0); - - // Average diameter of splashed particles - const scalar dBarSplash = 1/cbrt(6.0)*cbrt(mRatio/Ns)*d + rootVSmall; - - // Cumulative diameter splash distribution - const scalar dMax = 0.9*cbrt(mRatio)*d; - const scalar dMin = 0.1*dMax; - const scalar K = exp(-dMin/dBarSplash) - exp(-dMax/dBarSplash); - - // Surface energy of secondary parcels [J] - scalar ESigmaSec = 0; - - // Sample splash distribution to determine secondary parcel diameters - scalarList dNew(parcelsPerSplash_); - scalarList npNew(parcelsPerSplash_); - forAll(dNew, i) - { - const scalar y = rndGen_.sample01(); - dNew[i] = -dBarSplash*log(exp(-dMin/dBarSplash) - y*K); - npNew[i] = mRatio*np*pow3(d)/pow3(dNew[i])/parcelsPerSplash_; - ESigmaSec += npNew[i]*sigma*p.areaS(dNew[i]); - } - - // Incident kinetic energy [J] - const scalar EKIn = 0.5*m*magSqr(Un); - - // Incident surface energy [J] - const scalar ESigmaIn = np*sigma*p.areaS(d); - - // Dissipative energy - const scalar Ed = max(0.8*EKIn, np*Wec/12*pi*sigma*sqr(d)); - - // Total energy [J] - const scalar EKs = EKIn + ESigmaIn - ESigmaSec - Ed; - - // Switch to absorb if insufficient energy for splash - if (EKs <= 0) - { - absorbInteraction(filmModel, p, pp, facei, m, keepParticle); - return; - } - - // Helper variables to calculate magUns0 - const scalar logD = log(d); - const scalar coeff2 = log(dNew[0]) - logD + rootVSmall; - scalar coeff1 = 0.0; - forAll(dNew, i) - { - coeff1 += sqr(log(dNew[i]) - logD); - } - - // Magnitude of the normal velocity of the first splashed parcel - const scalar magUns0 = - sqrt(2.0*parcelsPerSplash_*EKs/mSplash/(1.0 + coeff1/sqr(coeff2))); - - // Set splashed parcel properties - forAll(dNew, i) - { - const vector dirVec = splashDirection(tanVec1, tanVec2, -nf); - - // Create a new parcel by copying source parcel - parcelType* pPtr = new parcelType(p); - - pPtr->origId() = pPtr->getNewParticleID(); - - pPtr->origProc() = Pstream::myProcNo(); - - if (splashParcelType_ >= 0) - { - pPtr->typeId() = splashParcelType_; - } - - // Perturb new parcels towards the owner cell centre - pPtr->track(mesh, 0.5*rndGen_.sample01()*(posC - posCf), 0); - - pPtr->nParticle() = npNew[i]; - - pPtr->d() = dNew[i]; - - pPtr->U() = dirVec*(mag(Cf_*Ut) + magUns0*(log(dNew[i]) - logD)/coeff2); - - // Apply correction to velocity for 2-D cases - meshTools::constrainDirection(mesh, mesh.solutionD(), pPtr->U()); - - // Add the new parcel - this->owner().addParticle(pPtr); - - nParcelsSplashed_++; - } - - // Transfer remaining part of parcel to film 0 - splashMass can be -ve - // if entraining from the film - const scalar mDash = m - mSplash; - absorbInteraction(filmModel, p, pp, facei, mDash, keepParticle); -} - - -template -Foam::UPtrList& -Foam::ThermoSurfaceFilm::filmPtrs() const -{ - const objectRegistry& db = this->owner().mesh().time(); - - if (!filmNames_.empty() && films_.empty()) - { - // If there are multiple surface films and/or surface films with - // non-default names, then require the films entry to have been - // specified - { - HashTable filmPtrs = - db.lookupClass(); - - const word defaultName = surfaceFilm::typeName + "Properties"; - - if - ( - ( - filmPtrs.size() == 1 - && filmPtrs.begin().key() != defaultName - ) - || (filmPtrs.size() > 1) - ) - { - Info << filmPtrs.begin().key() << " " << defaultName << endl; - this->coeffDict().lookup("surfaceFilms"); - } - } - - // Cache pointers to the surface film models - films_.resize(filmNames_.size()); - filmPatches_.setSize(films_.size()); - - forAll(films_, filmi) - { - films_.set - ( - filmi, - &db.template lookupObjectRef - ( - filmNames_[filmi] + "Properties" - ) - ); - - if (films_[filmi].primaryPatchIDs().size() > 1) - { - FatalErrorInFunction - << "Number of film primary patch IDs > 1 for film " - << films_[filmi].name() - << exit(FatalError); - } - - filmPatches_[filmi] = films_[filmi].primaryPatchIDs()[0]; - } - } - - return films_; -} - - -template -const Foam::labelList& Foam::ThermoSurfaceFilm::filmPatches() const -{ - // Ensure filmPatches_ has been initialise - filmPtrs(); - - return filmPatches_; -} - - -template -void Foam::ThermoSurfaceFilm::cacheFilmFields(const label filmi) -{ - const thermoSurfaceFilm& filmModel = this->filmPtrs()[filmi]; - const label filmPatchi = filmModel.intCoupledPatchIDs()[0]; - - this->massParcelPatch_ = - filmModel.cloudMassTrans().boundaryField()[filmPatchi]; - filmModel.toPrimary(filmPatchi, this->massParcelPatch_); - - this->diameterParcelPatch_ = - filmModel.cloudDiameterTrans().boundaryField()[filmPatchi]; - filmModel.toPrimary(filmPatchi, this->diameterParcelPatch_); - - UFilmPatch_ = filmModel.U().boundaryField()[filmPatchi]; - filmModel.toPrimary(filmPatchi, UFilmPatch_); - - rhoFilmPatch_ = filmModel.rho().boundaryField()[filmPatchi]; - filmModel.toPrimary(filmPatchi, rhoFilmPatch_); - - this->deltaFilmPatch_ = - filmModel.delta().boundaryField()[filmPatchi]; - filmModel.toPrimary(filmPatchi, this->deltaFilmPatch_); - - TFilmPatch_ = filmModel.thermo().T().boundaryField()[filmPatchi]; - filmModel.toPrimary(filmPatchi, TFilmPatch_); - - CpFilmPatch_ = filmModel.thermo().Cpv().boundaryField()[filmPatchi]; - filmModel.toPrimary(filmPatchi, CpFilmPatch_); -} - - -template -void Foam::ThermoSurfaceFilm::setParcelProperties -( - parcelType& p, - const label filmFacei -) const -{ - // Set parcel properties - const scalar vol = - mathematical::pi/6.0*pow3(this->diameterParcelPatch_[filmFacei]); - p.d() = this->diameterParcelPatch_[filmFacei]; - p.U() = UFilmPatch_[filmFacei]; - p.rho() = rhoFilmPatch_[filmFacei]; - - p.nParticle() = this->massParcelPatch_[filmFacei]/p.rho()/vol; - - if (this->ejectedParcelType_ >= 0) - { - p.typeId() = this->ejectedParcelType_; - } - - // Set parcel properties - p.T() = TFilmPatch_[filmFacei]; - p.Cp() = CpFilmPatch_[filmFacei]; -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::ThermoSurfaceFilm::ThermoSurfaceFilm -( - const dictionary& dict, - CloudType& owner -) -: - SurfaceFilmModel(dict, owner, typeName), - rndGen_(owner.rndGen()), - filmNames_ - ( - this->coeffDict().lookupOrDefault - ( - "surfaceFilms", - wordList(1, surfaceFilm::typeName) - ) - ), - films_(), - UFilmPatch_(0), - rhoFilmPatch_(0), - TFilmPatch_(0), - CpFilmPatch_(0), - interactionType_ - ( - interactionTypeNames_.read(this->coeffDict().lookup("interactionType")) - ), - deltaWet_(0.0), - splashParcelType_(0), - parcelsPerSplash_(0), - Adry_(0.0), - Awet_(0.0), - Cf_(0.0), - nParcelsSplashed_(0) -{ - Info<< " Applying " << interactionTypeNames_[interactionType_] - << " interaction model" << endl; - - if (interactionType_ == interactionType::splashBai) - { - this->coeffDict().lookup("deltaWet") >> deltaWet_; - splashParcelType_ = - this->coeffDict().lookupOrDefault("splashParcelType", -1); - parcelsPerSplash_ = - this->coeffDict().lookupOrDefault("parcelsPerSplash", 2); - this->coeffDict().lookup("Adry") >> Adry_; - this->coeffDict().lookup("Awet") >> Awet_; - this->coeffDict().lookup("Cf") >> Cf_; - } -} - - -template -Foam::ThermoSurfaceFilm::ThermoSurfaceFilm -( - const ThermoSurfaceFilm& sfm -) -: - SurfaceFilmModel(sfm), - rndGen_(sfm.rndGen_), - filmNames_(sfm.filmNames_), - films_(), - UFilmPatch_(sfm.UFilmPatch_), - rhoFilmPatch_(sfm.rhoFilmPatch_), - TFilmPatch_(sfm.TFilmPatch_), - CpFilmPatch_(sfm.CpFilmPatch_), - interactionType_(sfm.interactionType_), - deltaWet_(sfm.deltaWet_), - splashParcelType_(sfm.splashParcelType_), - parcelsPerSplash_(sfm.parcelsPerSplash_), - Adry_(sfm.Adry_), - Awet_(sfm.Awet_), - Cf_(sfm.Cf_), - nParcelsSplashed_(sfm.nParcelsSplashed_) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::ThermoSurfaceFilm::~ThermoSurfaceFilm() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -bool Foam::ThermoSurfaceFilm::transferParcel -( - parcelType& p, - const polyPatch& pp, - bool& keepParticle -) -{ - const label patchi = pp.index(); - - forAll(this->filmPtrs(), filmi) - { - thermoSurfaceFilm& filmModel = this->filmPtrs()[filmi]; - - if (filmModel.isFilmPatch(patchi)) - { - const label facei = pp.whichFace(p.face()); - - switch (interactionType_) - { - case interactionType::bounce: - { - bounceInteraction(p, pp, facei, keepParticle); - break; - } - case interactionType::absorb: - { - absorbInteraction - ( - filmModel, - p, - pp, - facei, - p.nParticle()*p.mass(), - keepParticle - ); - break; - } - case interactionType::splashBai: - { - if (this->deltaFilmPatch_[facei] < deltaWet_) - { - drySplashInteraction - ( - filmModel, - p, - pp, - facei, - keepParticle - ); - } - else - { - wetSplashInteraction - ( - filmModel, - p, - pp, - facei, - keepParticle - ); - } - break; - } - default: - { - FatalErrorInFunction - << "Unknown interaction type enumeration" - << abort(FatalError); - } - } - - // Transfer parcel/parcel interactions complete - return true; - } - } - - // Parcel not interacting with film - return false; -} - - -template -void Foam::ThermoSurfaceFilm::info(Ostream& os) -{ - SurfaceFilmModel::info(os); - - label nSplash0 = this->template getModelProperty