From 72b876e566d2e9671bbf986b00ad4ba41f36930d Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 15 Mar 2023 11:05:00 +0000 Subject: [PATCH] fvModels::filmToVoFTransfer,VoFtoFilmTransfer: New collaborating fvModels to transfer phase between VoF and film These two new fvModels operate between a film and a VoF region to transfer film to the corresponding VoF phase when the film is thick enough to be resolved by the VoF solver or from the VoF phase to the film when the near-wall resolution is too low and it is better to treat it as a wall film. This functionality is equivalent to the VoFPatchTransfer fvModel developed for the old film implementation but coded in a much more general manner with implicit treatment of the mass loss from the film or VoF region for better numerical stability and robustness. The simple tutorials/modules/CHT/VoFToFilm case is provided to demonstrate a film being deposited on a surface as the plate is withdrawn from a liquid. It is an updated version of the tutorials/modules/compressibleVoF/plateFilm case. --- .../solvers/modules/isothermalFilm/Allwclean | 1 + .../solvers/modules/isothermalFilm/Allwmake | 1 + .../modules/isothermalFilm/Make/options | 2 - .../fvModels/filmVoFTransfer/Make/files | 4 + .../fvModels/filmVoFTransfer/Make/options | 29 ++ .../filmVoFTransfer/VoFtoFilmTransfer.C | 428 ++++++++++++++++++ .../filmVoFTransfer/VoFtoFilmTransfer.H | 244 ++++++++++ .../filmVoFTransfer/filmToVoFTransfer.C | 399 ++++++++++++++++ .../filmVoFTransfer/filmToVoFTransfer.H | 216 +++++++++ tutorials/modules/CHT/VoFToFilm/0/VoF/T | 43 ++ tutorials/modules/CHT/VoFToFilm/0/VoF/T.air | 53 +++ .../modules/CHT/VoFToFilm/0/VoF/T.liquid | 53 +++ tutorials/modules/CHT/VoFToFilm/0/VoF/U | 46 ++ .../CHT/VoFToFilm/0/VoF/alpha.liquid.orig | 41 ++ tutorials/modules/CHT/VoFToFilm/0/VoF/p | 43 ++ tutorials/modules/CHT/VoFToFilm/0/VoF/p_rgh | 41 ++ tutorials/modules/CHT/VoFToFilm/0/film/T | 50 ++ tutorials/modules/CHT/VoFToFilm/0/film/U | 48 ++ tutorials/modules/CHT/VoFToFilm/0/film/delta | 48 ++ tutorials/modules/CHT/VoFToFilm/0/film/p | 47 ++ tutorials/modules/CHT/VoFToFilm/Allclean | 12 + tutorials/modules/CHT/VoFToFilm/Allrun | 18 + .../CHT/VoFToFilm/constant/VoF/fvModels | 32 ++ .../modules/CHT/VoFToFilm/constant/VoF/g | 21 + .../VoFToFilm/constant/VoF/momentumTransport | 20 + .../VoFToFilm/constant/VoF/phaseProperties | 23 + .../constant/VoF/physicalProperties.air | 51 +++ .../constant/VoF/physicalProperties.liquid | 31 ++ .../CHT/VoFToFilm/constant/film/fvModels | 29 ++ .../modules/CHT/VoFToFilm/constant/film/g | 21 + .../VoFToFilm/constant/film/momentumTransport | 20 + .../constant/film/physicalProperties | 39 ++ .../VoFToFilm/constant/surfaceFilmProperties | 71 +++ .../CHT/VoFToFilm/system/VoF/blockMeshDict | 113 +++++ .../system/VoF/extrudeToRegionMeshDict | 49 ++ .../CHT/VoFToFilm/system/VoF/fvSchemes | 58 +++ .../CHT/VoFToFilm/system/VoF/fvSolution | 89 ++++ .../CHT/VoFToFilm/system/VoF/setFieldsDict | 35 ++ .../modules/CHT/VoFToFilm/system/controlDict | 60 +++ .../CHT/VoFToFilm/system/film/blockMeshDict | 115 +++++ .../CHT/VoFToFilm/system/film/fvSchemes | 47 ++ .../CHT/VoFToFilm/system/film/fvSolution | 55 +++ .../modules/CHT/VoFToFilm/system/fvSolution | 21 + 43 files changed, 2865 insertions(+), 2 deletions(-) create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/Make/files create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/Make/options create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/VoFtoFilmTransfer.C create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/VoFtoFilmTransfer.H create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/filmToVoFTransfer.C create mode 100644 applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/filmToVoFTransfer.H create mode 100644 tutorials/modules/CHT/VoFToFilm/0/VoF/T create mode 100644 tutorials/modules/CHT/VoFToFilm/0/VoF/T.air create mode 100644 tutorials/modules/CHT/VoFToFilm/0/VoF/T.liquid create mode 100644 tutorials/modules/CHT/VoFToFilm/0/VoF/U create mode 100644 tutorials/modules/CHT/VoFToFilm/0/VoF/alpha.liquid.orig create mode 100644 tutorials/modules/CHT/VoFToFilm/0/VoF/p create mode 100644 tutorials/modules/CHT/VoFToFilm/0/VoF/p_rgh create mode 100644 tutorials/modules/CHT/VoFToFilm/0/film/T create mode 100644 tutorials/modules/CHT/VoFToFilm/0/film/U create mode 100644 tutorials/modules/CHT/VoFToFilm/0/film/delta create mode 100644 tutorials/modules/CHT/VoFToFilm/0/film/p create mode 100755 tutorials/modules/CHT/VoFToFilm/Allclean create mode 100755 tutorials/modules/CHT/VoFToFilm/Allrun create mode 100644 tutorials/modules/CHT/VoFToFilm/constant/VoF/fvModels create mode 100644 tutorials/modules/CHT/VoFToFilm/constant/VoF/g create mode 100644 tutorials/modules/CHT/VoFToFilm/constant/VoF/momentumTransport create mode 100644 tutorials/modules/CHT/VoFToFilm/constant/VoF/phaseProperties create mode 100644 tutorials/modules/CHT/VoFToFilm/constant/VoF/physicalProperties.air create mode 100644 tutorials/modules/CHT/VoFToFilm/constant/VoF/physicalProperties.liquid create mode 100644 tutorials/modules/CHT/VoFToFilm/constant/film/fvModels create mode 100644 tutorials/modules/CHT/VoFToFilm/constant/film/g create mode 100644 tutorials/modules/CHT/VoFToFilm/constant/film/momentumTransport create mode 100644 tutorials/modules/CHT/VoFToFilm/constant/film/physicalProperties create mode 100644 tutorials/modules/CHT/VoFToFilm/constant/surfaceFilmProperties create mode 100644 tutorials/modules/CHT/VoFToFilm/system/VoF/blockMeshDict create mode 100644 tutorials/modules/CHT/VoFToFilm/system/VoF/extrudeToRegionMeshDict create mode 100644 tutorials/modules/CHT/VoFToFilm/system/VoF/fvSchemes create mode 100644 tutorials/modules/CHT/VoFToFilm/system/VoF/fvSolution create mode 100644 tutorials/modules/CHT/VoFToFilm/system/VoF/setFieldsDict create mode 100644 tutorials/modules/CHT/VoFToFilm/system/controlDict create mode 100644 tutorials/modules/CHT/VoFToFilm/system/film/blockMeshDict create mode 100644 tutorials/modules/CHT/VoFToFilm/system/film/fvSchemes create mode 100644 tutorials/modules/CHT/VoFToFilm/system/film/fvSolution create mode 100644 tutorials/modules/CHT/VoFToFilm/system/fvSolution diff --git a/applications/solvers/modules/isothermalFilm/Allwclean b/applications/solvers/modules/isothermalFilm/Allwclean index e533300cc8..632cade7c1 100755 --- a/applications/solvers/modules/isothermalFilm/Allwclean +++ b/applications/solvers/modules/isothermalFilm/Allwclean @@ -3,5 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory wclean libso filmCompressibleMomentumTransportModels wclean +wclean libso fvModels/filmVoFTransfer #------------------------------------------------------------------------------ diff --git a/applications/solvers/modules/isothermalFilm/Allwmake b/applications/solvers/modules/isothermalFilm/Allwmake index d53d5cd901..ebeddb9bb4 100755 --- a/applications/solvers/modules/isothermalFilm/Allwmake +++ b/applications/solvers/modules/isothermalFilm/Allwmake @@ -6,5 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory wmake $targetType filmCompressibleMomentumTransportModels wmake $targetType +wmake $targetType fvModels/filmVoFTransfer #------------------------------------------------------------------------------ diff --git a/applications/solvers/modules/isothermalFilm/Make/options b/applications/solvers/modules/isothermalFilm/Make/options index 2f7950a8e4..a6e885b01c 100644 --- a/applications/solvers/modules/isothermalFilm/Make/options +++ b/applications/solvers/modules/isothermalFilm/Make/options @@ -5,8 +5,6 @@ EXE_INC = \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ - -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ - -I$(LIB_SRC)/finiteVolume/cfdTools \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/Make/files b/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/Make/files new file mode 100644 index 0000000000..f8529a6b4e --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/Make/files @@ -0,0 +1,4 @@ +filmToVoFTransfer.C +VoFtoFilmTransfer.C + +LIB = $(FOAM_LIBBIN)/libfilmVoFTransfer diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/Make/options b/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/Make/options new file mode 100644 index 0000000000..13fc074e1a --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/Make/options @@ -0,0 +1,29 @@ +EXE_INC = -ggdb3 \ + -I$(FOAM_SOLVERS)/modules/isothermalFilm/lnInclude \ + -I$(FOAM_SOLVERS)/modules/isothermalFilm/filmCompressibleMomentumTransportModels/lnInclude \ + -I$(LIB_SRC)/physicalProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ + -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ + \ + -I$(FOAM_SOLVERS)/modules/compressibleVoF/lnInclude \ + -I$(FOAM_SOLVERS)/modules/twoPhaseVoFSolver/lnInclude \ + -I$(FOAM_SOLVERS)/modules/VoFSolver/lnInclude \ + -I$(FOAM_SOLVERS)/modules/fluidSolver/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/VoF \ + -I$(LIB_SRC)/twoPhaseModels/interfaceCompression/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhases/lnInclude \ + -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ + -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ + -I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \ + -I$(LIB_SRC)/ThermophysicalTransportModels/thermophysicalTransportModel/lnInclude \ + \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + +LIB_LIBS = \ + -lisothermalFilm \ + -lcompressibleVoF diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/VoFtoFilmTransfer.C b/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/VoFtoFilmTransfer.C new file mode 100644 index 0000000000..ffb9d058d5 --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/VoFtoFilmTransfer.C @@ -0,0 +1,428 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "VoFtoFilmTransfer.H" +#include "filmToVoFTransfer.H" +#include "mappedPatchBase.H" +#include "fvmSup.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +namespace Foam +{ + namespace fv + { + defineTypeNameAndDebug(VoFtoFilmTransfer, 0); + + addToRunTimeSelectionTable + ( + fvModel, + VoFtoFilmTransfer, + dictionary + ); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::fv::VoFtoFilmTransfer::VoFtoFilmTransfer +( + const word& sourceName, + const word& modelType, + const fvMesh& mesh, + const dictionary& dict +) +: + fvModel(sourceName, modelType, mesh, dict), + VoF_(mesh.lookupObject(solver::typeName)), + filmPatchName_(dict.lookup("filmPatch")), + filmPatchi_(mesh.boundaryMesh().findPatchID(filmPatchName_)), + phaseName_(dict.lookup("phase")), + thermo_ + ( + phaseName_ == VoF_.mixture.phase1Name() + ? VoF_.mixture.thermo1() + : VoF_.mixture.thermo2() + ), + alpha_ + ( + phaseName_ == VoF_.mixture.phase1Name() + ? VoF_.mixture.alpha1() + : VoF_.mixture.alpha2() + ), + curTimeIndex_(-1), + deltaFactorToFilm_ + ( + dict.lookupOrDefault("deltaFactorToFilm", 0.5) + ), + alphaToFilm_ + ( + dict.lookupOrDefault("alphaToFilm", 0.1) + ), + transferRateCoeff_ + ( + dict.lookupOrDefault("transferRateCoeff", 0.1) + ), + transferRate_ + ( + volScalarField::Internal::New + ( + "transferRate", + mesh, + dimensionedScalar(dimless/dimTime, 0) + ) + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::wordList Foam::fv::VoFtoFilmTransfer::addSupFields() const +{ + return wordList + ( + { + alpha_.name(), + thermo_.rho()().name(), + thermo_.he().name(), + VoF_.U.name() + } + ); +} + + +void Foam::fv::VoFtoFilmTransfer::correct() +{ + if (curTimeIndex_ == mesh().time().timeIndex()) + { + return; + } + + curTimeIndex_ = mesh().time().timeIndex(); + + + const scalar deltaT = mesh().time().deltaTValue(); + + const polyPatch& VoFFilmPatch = mesh().boundaryMesh()[filmPatchi_]; + + + // VoF properties + + const scalarField& alpha = alpha_.boundaryField()[filmPatchi_]; + + const scalarField& deltaCoeffs = + mesh().boundary()[filmPatchi_].deltaCoeffs(); + + const labelList& faceCells = mesh().boundary()[filmPatchi_].faceCells(); + + + // Film properties + + const mappedPatchBase& VoFFilmPatchMap = refCast + ( + VoFFilmPatch + ); + + const solvers::isothermalFilm& film_ + ( + VoFFilmPatchMap.nbrMesh().lookupObject + ( + solver::typeName + ) + ); + + const label filmVoFPatchi = VoFFilmPatchMap.nbrPolyPatch().index(); + + const scalarField delta + ( + VoFFilmPatchMap.fromNeigbour + ( + film_.delta.boundaryField()[filmVoFPatchi] + ) + ); + + transferRate_ = Zero; + + forAll(faceCells, facei) + { + const label celli = faceCells[facei]; + + if + ( + alpha[facei] > 0 + && delta[facei] < 2*deltaFactorToFilm_/deltaCoeffs[facei] + && alpha[facei] < alphaToFilm_ + ) + { + transferRate_[celli] = -transferRateCoeff_/deltaT; + } + } +} + + +template +Foam::tmp> +inline Foam::fv::VoFtoFilmTransfer::filmToVoFTransferRate +( + TransferRateFunc transferRateFunc, + const dimensionSet& dimProp +) const +{ + const mappedPatchBase& VoFFilmPatchMap = refCast + ( + mesh().boundaryMesh()[filmPatchi_] + ); + + const Foam::fvModels& fvModels + ( + fvModels::New + ( + refCast(VoFFilmPatchMap.nbrMesh()) + ) + ); + + const filmToVoFTransfer* filmToVoFPtr = nullptr; + + forAll(fvModels, i) + { + if (isType(fvModels[i])) + { + filmToVoFPtr = &refCast(fvModels[i]); + } + } + + if (!filmToVoFPtr) + { + FatalErrorInFunction + << "Cannot find filmToVoFTransfer fvModel for the film region " + << VoFFilmPatchMap.nbrMesh().name() + << exit(FatalError); + } + + tmp> tSu + ( + VolInternalField::New + ( + "Su", + mesh(), + dimensioned(dimProp/dimTime, Zero) + ) + ); + + UIndirectList(tSu.ref(), mesh().boundary()[filmPatchi_].faceCells()) = + VoFFilmPatchMap.fromNeigbour + ( + (filmToVoFPtr->*transferRateFunc)() + ); + + return tSu/mesh().V(); +} + + +void Foam::fv::VoFtoFilmTransfer::addSup +( + fvMatrix& eqn, + const word& fieldName +) const +{ + if (debug) + { + Info<< type() << ": applying source to " << eqn.psi().name() << endl; + } + + if (fieldName == alpha_.name()) + { + eqn += + filmToVoFTransferRate + ( + &filmToVoFTransfer::transferRate, + dimVolume + ) + + fvm::Sp(transferRate_, eqn.psi()); + } + else + { + FatalErrorInFunction + << "Support for field " << fieldName << " is not implemented" + << exit(FatalError); + } +} + + +void Foam::fv::VoFtoFilmTransfer::addSup +( + const volScalarField& alpha, + fvMatrix& eqn, + const word& fieldName +) const +{ + if (debug) + { + Info<< type() << ": applying source to " << eqn.psi().name() << endl; + } + + if (fieldName == thermo_.rho()().name()) + { + eqn += + filmToVoFTransferRate + ( + &filmToVoFTransfer::rhoTransferRate, + dimMass + ) + + fvm::Sp(alpha()*transferRate_, eqn.psi()); + } + else + { + FatalErrorInFunction + << "Support for field " << fieldName << " is not implemented" + << exit(FatalError); + } +} + + +void Foam::fv::VoFtoFilmTransfer::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 == thermo_.he().name()) + { + eqn += + filmToVoFTransferRate + ( + &filmToVoFTransfer::heTransferRate, + dimEnergy + ) + + fvm::Sp(alpha()*rho()*transferRate_, eqn.psi()); + } + else + { + FatalErrorInFunction + << "Support for field " << fieldName << " is not implemented" + << exit(FatalError); + } +} + + +void Foam::fv::VoFtoFilmTransfer::addSup +( + const volScalarField& rho, + fvMatrix& eqn, + const word& fieldName +) const +{ + if (debug) + { + Info<< type() << ": applying source to " << eqn.psi().name() << endl; + } + + eqn += + filmToVoFTransferRate + ( + &filmToVoFTransfer::UTransferRate, + dimMass*dimVelocity + ) + + fvm::Sp(alpha_()*thermo_.rho()()*transferRate_, eqn.psi()); +} + + +template +inline Foam::tmp> Foam::fv::VoFtoFilmTransfer::TransferRate +( + const FieldType& f +) const +{ + const labelList& faceCells = mesh().boundary()[filmPatchi_].faceCells(); + + return tmp> + ( + new Field + ( + UIndirectList + ( + -alpha_()*transferRate_*mesh().V()*f, + faceCells + ) + ) + ); +} + + +Foam::tmp +Foam::fv::VoFtoFilmTransfer::rhoTransferRate() const +{ + return TransferRate(thermo_.rho()()); +} + + +Foam::tmp +Foam::fv::VoFtoFilmTransfer::heTransferRate() const +{ + return TransferRate(thermo_.rho()()*thermo_.he()()); +} + + +Foam::tmp +Foam::fv::VoFtoFilmTransfer::UTransferRate() const +{ + return TransferRate(thermo_.rho()()*VoF_.U()); +} + + +void Foam::fv::VoFtoFilmTransfer::topoChange(const polyTopoChangeMap&) +{ + transferRate_.setSize(mesh().nCells()); +} + + +void Foam::fv::VoFtoFilmTransfer::mapMesh(const polyMeshMap& map) +{ + transferRate_.setSize(mesh().nCells()); +} + + +void Foam::fv::VoFtoFilmTransfer::distribute(const polyDistributionMap&) +{ + transferRate_.setSize(mesh().nCells()); +} + + +bool Foam::fv::VoFtoFilmTransfer::movePoints() +{ + return true; +} + + +// ************************************************************************* // diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/VoFtoFilmTransfer.H b/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/VoFtoFilmTransfer.H new file mode 100644 index 0000000000..a6218d0878 --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/VoFtoFilmTransfer.H @@ -0,0 +1,244 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::fv::VoFtoFilmTransfer + +Description + Film<->VoF transfer model + +Usage + Example usage: + \verbatim + VoFtoFilmTransfer + { + type VoFtoFilmTransfer; + phase water; + } + \endverbatim + +SourceFiles + VoFtoFilmTransfer.C + +\*---------------------------------------------------------------------------*/ + +#ifndef VoFtoFilmTransfer_H +#define VoFtoFilmTransfer_H + +#include "fvModel.H" +#include "compressibleVoF.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace fv +{ + +/*---------------------------------------------------------------------------*\ + Class VoFtoFilmTransfer Declaration +\*---------------------------------------------------------------------------*/ + +class VoFtoFilmTransfer +: + public fvModel +{ + // Private Data + + //- The VoF model + const solvers::compressibleVoF& VoF_; + + //- Film patch name + word filmPatchName_; + + const label filmPatchi_; + + //- The name of the transferred phase + word phaseName_; + + //- Reference to the transferred phase thermo + const rhoThermo& thermo_; + + //- Reference to the transferred phase volume fraction + const volScalarField& alpha_; + + //- Current time index (used for updating) + mutable label curTimeIndex_; + + //- Factor of the cell height below which the VoF may be transferred + // to the film + scalar deltaFactorToFilm_; + + //- VoF limit below which the VoF may be transferred to the film + scalar alphaToFilm_; + + //- Transfer rate coefficient + scalar transferRateCoeff_; + + volScalarField::Internal transferRate_; + + + // Private Member Functions + + //- Return the transfer rate from the film transferRateFunc + template + inline tmp> filmToVoFTransferRate + ( + TransferRateFunc transferRateFunc, + const dimensionSet& dimProp + ) const; + + //- Return the transfer rate of field f + template + inline tmp> TransferRate(const FieldType& f) const; + + +public: + + //- Runtime type information + TypeName("VoFtoFilmTransfer"); + + + // Constructors + + //- Construct from explicit source name and mesh + VoFtoFilmTransfer + ( + const word& sourceName, + const word& modelType, + const fvMesh& mesh, + const dictionary& dict + ); + + //- Disallow default bitwise copy construction + VoFtoFilmTransfer + ( + const VoFtoFilmTransfer& + ) = delete; + + + // Member Functions + + label filmPatchIndex() const + { + return filmPatchi_; + } + + const volScalarField& alpha() const + { + return alpha_; + } + + + // Checks + + //- Return the list of fields for which the option adds source term + // to the transport equation + virtual wordList addSupFields() const; + + + // Correct + + //- Solve the film and update the sources + virtual void correct(); + + + // Add explicit and implicit contributions to compressible equation + + //- Add implicit contribution to phase-fraction equation + virtual void addSup + ( + fvMatrix& eqn, + const word& fieldName + ) const; + + //- Add implicit contribution to phase density equation + virtual void addSup + ( + const volScalarField& alpha, + fvMatrix& eqn, + const word& fieldName + ) const; + + //- Add implicit 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; + + + // Transfer to film + + //- Return the mass transfer rate + tmp rhoTransferRate() const; + + //- Return the energy transfer rate + tmp heTransferRate() const; + + //- Return the momentum transfer rate + tmp UTransferRate() 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 VoFtoFilmTransfer&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace fv +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/filmToVoFTransfer.C b/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/filmToVoFTransfer.C new file mode 100644 index 0000000000..f2475583d8 --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/filmToVoFTransfer.C @@ -0,0 +1,399 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "filmToVoFTransfer.H" +#include "VoFtoFilmTransfer.H" +#include "mappedPatchBase.H" +#include "compressibleVoF.H" +#include "fvmSup.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +namespace Foam +{ + namespace fv + { + defineTypeNameAndDebug(filmToVoFTransfer, 0); + + addToRunTimeSelectionTable + ( + fvModel, + filmToVoFTransfer, + dictionary + ); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::fv::filmToVoFTransfer::filmToVoFTransfer +( + const word& sourceName, + const word& modelType, + const fvMesh& mesh, + const dictionary& dict +) +: + fvModel(sourceName, modelType, mesh, dict), + film_(mesh.lookupObject(solver::typeName)), + curTimeIndex_(-1), + deltaFactorToVoF_ + ( + dict.lookupOrDefault("deltaFactorToVoF", 1.0) + ), + alphaToVoF_ + ( + dict.lookupOrDefault("alphaToVoF", 0.5) + ), + transferRateCoeff_ + ( + dict.lookupOrDefault("transferRateCoeff", 0.1) + ), + transferRate_ + ( + volScalarField::Internal::New + ( + "transferRate", + mesh, + dimensionedScalar(dimless/dimTime, 0) + ) + ) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::wordList Foam::fv::filmToVoFTransfer::addSupFields() const +{ + return wordList + ( + { + film_.alpha.name(), + film_.thermo.he().name(), + film_.U.name() + } + ); +} + + +void Foam::fv::filmToVoFTransfer::correct() +{ + if (curTimeIndex_ == mesh().time().timeIndex()) + { + return; + } + + curTimeIndex_ = mesh().time().timeIndex(); + + const scalar deltaT = mesh().time().deltaTValue(); + + + // Film properties + + const labelList& faceCells = film_.surfacePatch().faceCells(); + const scalarField& delta = film_.delta(); + + + // VoF properties + + const solvers::compressibleVoF& VoF_ + ( + film_.surfacePatchMap().nbrMesh().lookupObject + ( + solver::typeName + ) + ); + + const label patchiVoF = film_.surfacePatchMap().nbrPolyPatch().index(); + + const VoFtoFilmTransfer& VoFtoFilm + ( + refCast(VoF_.fvModels()[0]) + ); + + const scalarField alphaVoF + ( + film_.surfacePatchMap().fromNeigbour + ( + VoFtoFilm.alpha().boundaryField()[patchiVoF] + ) + ); + + const scalarField deltaCoeffsVoF + ( + film_.surfacePatchMap().fromNeigbour + ( + VoF_.mesh.boundary()[patchiVoF].deltaCoeffs() + ) + ); + + // Reset the transfer rate + transferRate_ = Zero; + + forAll(faceCells, facei) + { + const label celli = faceCells[facei]; + + if + ( + delta[celli] > 2*deltaFactorToVoF_/deltaCoeffsVoF[facei] + || alphaVoF[facei] > alphaToVoF_ + ) + { + transferRate_[celli] = -transferRateCoeff_/deltaT; + } + } +} + + +template +Foam::tmp> +inline Foam::fv::filmToVoFTransfer::VoFToFilmTransferRate +( + TransferRateFunc transferRateFunc, + const dimensionSet& dimProp +) const +{ + const Foam::fvModels& fvModels + ( + fvModels::New + ( + refCast(film_.surfacePatchMap().nbrMesh()) + ) + ); + + const VoFtoFilmTransfer* VoFtoFilmPtr = nullptr; + + forAll(fvModels, i) + { + if (isType(fvModels[i])) + { + const VoFtoFilmTransfer& VoFtoFilm + ( + refCast(fvModels[i]) + ); + + if + ( + VoFtoFilm.filmPatchIndex() + == film_.surfacePatchMap().nbrPolyPatch().index() + ) + { + VoFtoFilmPtr = &VoFtoFilm; + } + } + } + + if (!VoFtoFilmPtr) + { + FatalErrorInFunction + << "Cannot find VoFtoFilmTransfer fvModel for this film " + "in VoF region " << film_.surfacePatchMap().nbrMesh().name() + << exit(FatalError); + } + + tmp> tSu + ( + VolInternalField::New + ( + "Su", + mesh(), + dimensioned(dimProp/dimTime, Zero) + ) + ); + + UIndirectList(tSu.ref(), film_.surfacePatch().faceCells()) = + film_.surfacePatchMap().fromNeigbour + ( + (VoFtoFilmPtr->*transferRateFunc)() + ); + + return tSu/mesh().V(); +} + + +void Foam::fv::filmToVoFTransfer::addSup +( + const volScalarField& rho, + fvMatrix& eqn, + const word& fieldName +) const +{ + if (debug) + { + Info<< type() << ": applying source to " << eqn.psi().name() << endl; + } + + if (fieldName == film_.alpha.name()) + { + eqn += + VoFToFilmTransferRate + ( + &VoFtoFilmTransfer::rhoTransferRate, + dimMass + ) + + fvm::Sp(transferRate_*rho(), eqn.psi()); + } + else + { + FatalErrorInFunction + << "Support for field " << fieldName << " is not implemented" + << exit(FatalError); + } +} + + +void Foam::fv::filmToVoFTransfer::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 == film_.thermo.he().name()) + { + eqn += + VoFToFilmTransferRate + ( + &VoFtoFilmTransfer::heTransferRate, + dimEnergy + ) + + fvm::Sp(alpha()*rho()*transferRate_, eqn.psi()); + } + else + { + FatalErrorInFunction + << "Support for field " << fieldName << " is not implemented" + << exit(FatalError); + } +} + + +void Foam::fv::filmToVoFTransfer::addSup +( + const volScalarField& alpha, + const volScalarField& rho, + fvMatrix& eqn, + const word& fieldName +) const +{ + if (debug) + { + Info<< type() << ": applying source to " << eqn.psi().name() << endl; + } + + eqn += + VoFToFilmTransferRate + ( + &VoFtoFilmTransfer::UTransferRate, + dimMass*dimVelocity + ) + + fvm::Sp(alpha()*rho()*transferRate_, eqn.psi()); +} + + +template +inline Foam::tmp> Foam::fv::filmToVoFTransfer::TransferRate +( + const FieldType& f +) const +{ + const labelList& faceCells = film_.surfacePatch().faceCells(); + + return tmp> + ( + new Field + ( + UIndirectList + ( + -film_.alpha()*transferRate_*mesh().V()*f, + faceCells + ) + ) + ); +} + + +Foam::tmp +Foam::fv::filmToVoFTransfer::transferRate() const +{ + return TransferRate(oneField()); +} + + +Foam::tmp +Foam::fv::filmToVoFTransfer::rhoTransferRate() const +{ + return TransferRate(film_.thermo.rho()()); +} + + +Foam::tmp +Foam::fv::filmToVoFTransfer::heTransferRate() const +{ + return TransferRate(film_.thermo.rho()()*film_.thermo.he()()); +} + + +Foam::tmp +Foam::fv::filmToVoFTransfer::UTransferRate() const +{ + return TransferRate(film_.thermo.rho()()*film_.U()); +} + + +void Foam::fv::filmToVoFTransfer::topoChange(const polyTopoChangeMap&) +{ + transferRate_.setSize(mesh().nCells()); +} + + +void Foam::fv::filmToVoFTransfer::mapMesh(const polyMeshMap& map) +{ + transferRate_.setSize(mesh().nCells()); +} + + +void Foam::fv::filmToVoFTransfer::distribute(const polyDistributionMap&) +{ + transferRate_.setSize(mesh().nCells()); +} + + +bool Foam::fv::filmToVoFTransfer::movePoints() +{ + return true; +} + + +// ************************************************************************* // diff --git a/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/filmToVoFTransfer.H b/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/filmToVoFTransfer.H new file mode 100644 index 0000000000..3edbed5a94 --- /dev/null +++ b/applications/solvers/modules/isothermalFilm/fvModels/filmVoFTransfer/filmToVoFTransfer.H @@ -0,0 +1,216 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::fv::filmToVoFTransfer + +Description + Film<->VoF transfer model + +Usage + Example usage: + \verbatim + filmToVoFTransfer + { + type filmToVoFTransfer; + } + \endverbatim + +SourceFiles + filmToVoFTransfer.C + +\*---------------------------------------------------------------------------*/ + +#ifndef filmToVoFTransfer_H +#define filmToVoFTransfer_H + +#include "fvModel.H" +#include "isothermalFilm.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace fv +{ + +/*---------------------------------------------------------------------------*\ + Class filmToVoFTransfer Declaration +\*---------------------------------------------------------------------------*/ + +class filmToVoFTransfer +: + public fvModel +{ + // Private Data + + //- The film model + const solvers::isothermalFilm& film_; + + //- Current time index (used for updating) + mutable label curTimeIndex_; + + //- Factor of the cell height above which the film is transferred + // to the VoF + scalar deltaFactorToVoF_; + + //- VoF limit above which all of the film is transferred to the VoF + scalar alphaToVoF_; + + //- Transfer rate coefficient + scalar transferRateCoeff_; + + //- Cached transfer rate + volScalarField::Internal transferRate_; + + + // Private Member Functions + + //- Return the transfer rate from the VoF transferRateFunc + template + inline tmp> VoFToFilmTransferRate + ( + TransferRateFunc transferRateFunc, + const dimensionSet& dimProp + ) const; + + //- Return the transfer rate of field f + template + inline tmp> TransferRate(const FieldType& f) const; + + +public: + + //- Runtime type information + TypeName("filmToVoFTransfer"); + + + // Constructors + + //- Construct from explicit source name and mesh + filmToVoFTransfer + ( + const word& sourceName, + const word& modelType, + const fvMesh& mesh, + const dictionary& dict + ); + + //- Disallow default bitwise copy construction + filmToVoFTransfer + ( + const filmToVoFTransfer& + ) = delete; + + + // Member Functions + + // Checks + + //- Return the list of fields for which the option adds source term + // to the transport equation + virtual wordList addSupFields() 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& alpha, + const volScalarField& rho, + fvMatrix& eqn, + const word& fieldName + ) const; + + + // Transfer to VoF + + //- Return the volume transfer rate + tmp transferRate() const; + + //- Return the mass transfer rate + tmp rhoTransferRate() const; + + //- Return the energy transfer rate + tmp heTransferRate() const; + + //- Return the momentum transfer rate + tmp UTransferRate() 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 filmToVoFTransfer&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace fv +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/0/VoF/T b/tutorials/modules/CHT/VoFToFilm/0/VoF/T new file mode 100644 index 0000000000..a03ccd04f2 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/0/VoF/T @@ -0,0 +1,43 @@ +/*--------------------------------*- 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 T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + film + { + type coupledTemperature; + value $internalField; + } + + bottom + { + type inletOutlet; + inletValue $internalField; + } + + atmosphere + { + type inletOutlet; + inletValue $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/0/VoF/T.air b/tutorials/modules/CHT/VoFToFilm/0/VoF/T.air new file mode 100644 index 0000000000..e02f9229b6 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/0/VoF/T.air @@ -0,0 +1,53 @@ +/*--------------------------------*- 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/VoF"; + object T.air; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + film + { + type calculated; + value uniform 300; + } + vessel + { + type symmetryPlane; + } + bottom + { + type calculated; + value uniform 300; + } + atmosphere + { + type calculated; + value uniform 300; + } + back + { + type empty; + } + front + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/0/VoF/T.liquid b/tutorials/modules/CHT/VoFToFilm/0/VoF/T.liquid new file mode 100644 index 0000000000..d538b4c2e3 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/0/VoF/T.liquid @@ -0,0 +1,53 @@ +/*--------------------------------*- 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/VoF"; + object T.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + film + { + type calculated; + value uniform 300; + } + vessel + { + type symmetryPlane; + } + bottom + { + type calculated; + value uniform 300; + } + atmosphere + { + type calculated; + value uniform 300; + } + back + { + type empty; + } + front + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/0/VoF/U b/tutorials/modules/CHT/VoFToFilm/0/VoF/U new file mode 100644 index 0000000000..40f7e9ee5a --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/0/VoF/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"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + film + { + type mappedValue; + value $internalField; + } + + bottom + { + type flowRateOutletVelocity; + volumetricFlowRate 2e-6; + value $internalField; + } + + atmosphere + { + type pressureInletOutletVelocity; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/0/VoF/alpha.liquid.orig b/tutorials/modules/CHT/VoFToFilm/0/VoF/alpha.liquid.orig new file mode 100644 index 0000000000..982f2bf062 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/0/VoF/alpha.liquid.orig @@ -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; + object alpha.liquid; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + film + { + type zeroGradient; + } + + bottom + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/0/VoF/p b/tutorials/modules/CHT/VoFToFilm/0/VoF/p new file mode 100644 index 0000000000..0a80a6941c --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/0/VoF/p @@ -0,0 +1,43 @@ +/*--------------------------------*- 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 +{ + film + { + type calculated; + value $internalField; + } + + bottom + { + type calculated; + value $internalField; + } + + atmosphere + { + type calculated; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/0/VoF/p_rgh b/tutorials/modules/CHT/VoFToFilm/0/VoF/p_rgh new file mode 100644 index 0000000000..f5bb813d8e --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/0/VoF/p_rgh @@ -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; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + film + { + type fixedFluxPressure; + } + + bottom + { + type fixedFluxPressure; + } + + atmosphere + { + type prghTotalPressure; + p0 $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/0/film/T b/tutorials/modules/CHT/VoFToFilm/0/film/T new file mode 100644 index 0000000000..1a86948b03 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/0/film/T @@ -0,0 +1,50 @@ +/*--------------------------------*- 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 T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + wall + { + type fixedValue; + value $internalField; + } + + surface + { + type coupledTemperature; + value $internalField; + } + + bottom + { + type inletOutlet; + inletValue $internalField; + } + + atmosphere + { + type inletOutlet; + inletValue $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/0/film/U b/tutorials/modules/CHT/VoFToFilm/0/film/U new file mode 100644 index 0000000000..d05ec8fb96 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/0/film/U @@ -0,0 +1,48 @@ +/*--------------------------------*- 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; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + wall + { + type noSlip; + } + + surface + { + type filmSurfaceVelocity; + value $internalField; + } + + bottom + { + type zeroGradient; + } + + atmosphere + { + type fixedValue; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/0/film/delta b/tutorials/modules/CHT/VoFToFilm/0/film/delta new file mode 100644 index 0000000000..8d347ca4a0 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/0/film/delta @@ -0,0 +1,48 @@ +/*--------------------------------*- 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 delta; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + wall + { + type zeroGradient; + } + + surface + { + type zeroGradient; + } + + bottom + { + type inletOutlet; + inletValue $internalField; + } + + atmosphere + { + type inletOutlet; + inletValue $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/0/film/p b/tutorials/modules/CHT/VoFToFilm/0/film/p new file mode 100644 index 0000000000..05d9b2fe8d --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/0/film/p @@ -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 volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + wall + { + type zeroGradient; + } + + surface + { + type mappedFilmPressure; + value $internalField; + } + + bottom + { + type zeroGradient; + } + + atmosphere + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/Allclean b/tutorials/modules/CHT/VoFToFilm/Allclean new file mode 100755 index 0000000000..657ecefef2 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/Allclean @@ -0,0 +1,12 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase + +rm -rf constant/VoF/polyMesh +rm -rf constant/film/polyMesh + +#------------------------------------------------------------------------------ diff --git a/tutorials/modules/CHT/VoFToFilm/Allrun b/tutorials/modules/CHT/VoFToFilm/Allrun new file mode 100755 index 0000000000..49d0a02db4 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/Allrun @@ -0,0 +1,18 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication -s VoF blockMesh -region VoF +runApplication -s film blockMesh -region film + +runApplication setFields -region VoF + +printf "\n%s\n" "Creating files for paraview post-processing" +paraFoam -touchAll +echo + +runApplication $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/modules/CHT/VoFToFilm/constant/VoF/fvModels b/tutorials/modules/CHT/VoFToFilm/constant/VoF/fvModels new file mode 100644 index 0000000000..6d82eabeb4 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/constant/VoF/fvModels @@ -0,0 +1,32 @@ +/*--------------------------------*- 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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +VoFToFilmTransfer +{ + type VoFtoFilmTransfer; + + libs ("libfilmVoFTransfer.so"); + + filmPatch film; + phase liquid; + + deltaFactorToFilm 0.9; + alphaToFilm 0.86; + + transferRateCoeff 0.1; +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/constant/VoF/g b/tutorials/modules/CHT/VoFToFilm/constant/VoF/g new file mode 100644 index 0000000000..770a56192e --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/constant/VoF/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/CHT/VoFToFilm/constant/VoF/momentumTransport b/tutorials/modules/CHT/VoFToFilm/constant/VoF/momentumTransport new file mode 100644 index 0000000000..8278c989ec --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/constant/VoF/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/CHT/VoFToFilm/constant/VoF/phaseProperties b/tutorials/modules/CHT/VoFToFilm/constant/VoF/phaseProperties new file mode 100644 index 0000000000..d1d9770ced --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/constant/VoF/phaseProperties @@ -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 phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phases (liquid air); + +pMin 10000; + +sigma 0.0309; + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/constant/VoF/physicalProperties.air b/tutorials/modules/CHT/VoFToFilm/constant/VoF/physicalProperties.air new file mode 100644 index 0000000000..38b4a41461 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/constant/VoF/physicalProperties.air @@ -0,0 +1,51 @@ +/*--------------------------------*- 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; + transport const; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 28.9; + } + equationOfState + { + rho 1.2; + } + thermodynamics + { + Cp 1007; + Hf 0; + } + transport + { + mu 1.84e-05; + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/constant/VoF/physicalProperties.liquid b/tutorials/modules/CHT/VoFToFilm/constant/VoF/physicalProperties.liquid new file mode 100644 index 0000000000..33ee248244 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/constant/VoF/physicalProperties.liquid @@ -0,0 +1,31 @@ +/*--------------------------------*- 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; +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/constant/film/fvModels b/tutorials/modules/CHT/VoFToFilm/constant/film/fvModels new file mode 100644 index 0000000000..773c0fea4a --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/constant/film/fvModels @@ -0,0 +1,29 @@ +/*--------------------------------*- 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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +filmToVoFTransfer +{ + type filmToVoFTransfer; + + libs ("libfilmVoFTransfer.so"); + + deltaFactorToVoF 1.5; + alphaToVoF 0.9; + + transferRateCoeff 0.1; +} + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/constant/film/g b/tutorials/modules/CHT/VoFToFilm/constant/film/g new file mode 100644 index 0000000000..770a56192e --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/constant/film/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/CHT/VoFToFilm/constant/film/momentumTransport b/tutorials/modules/CHT/VoFToFilm/constant/film/momentumTransport new file mode 100644 index 0000000000..8278c989ec --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/constant/film/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/CHT/VoFToFilm/constant/film/physicalProperties b/tutorials/modules/CHT/VoFToFilm/constant/film/physicalProperties new file mode 100644 index 0000000000..e131771292 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/constant/film/physicalProperties @@ -0,0 +1,39 @@ +/*--------------------------------*- 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-8; + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/constant/surfaceFilmProperties b/tutorials/modules/CHT/VoFToFilm/constant/surfaceFilmProperties new file mode 100644 index 0000000000..d56f951895 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/constant/surfaceFilmProperties @@ -0,0 +1,71 @@ +/*--------------------------------*- 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 SurfaceFilmProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +regionName plate; + +phase liquid; + +viscosity +{ + model Newtonian; +} + +sigma 0.07; + +deltaWet 1e-12; + +hydrophilic no; + +transfer +{ + VoFPatchTransfer + { + deltaFactorToVoF 1.5; + alphaToVoF 0.9; + + deltaFactorToFilm 0.9; + alphaToFilm 0.86; + + transferRateCoeff 0.1; + } +} + +momentumTransport +{ + model laminar; + Cf 0.001; +} + +upperSurfaceModels +{ + heatTransfer + { + model constant; + c0 1; + } +} + +lowerSurfaceModels +{ + heatTransfer + { + model constant; + c0 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/system/VoF/blockMeshDict b/tutorials/modules/CHT/VoFToFilm/system/VoF/blockMeshDict new file mode 100644 index 0000000000..6b10612459 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/system/VoF/blockMeshDict @@ -0,0 +1,113 @@ +/*--------------------------------*- 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.001; + +w 50; +h 100; + +wCells 80; +hCells 80; + +wGrading +( + (0.1 1 1) + (0.9 2.25 10) +); + +vertices +( + (0 0 -1) + ($w 0 -1) + (0 $h -1) + ($w $h -1) + + (0 0 0) + ($w 0 0) + (0 $h 0) + ($w $h 0) + +); + +blocks +( + hex (0 1 3 2 4 5 7 6) + ($wCells $hCells 1) + simpleGrading ($wGrading 1 1) +); + +boundary +( + film + { + type mappedExtrudedWall; + neighbourRegion film; + neighbourPatch surface; + transformType none; + + faces + ( + (0 2 6 4) + ); + } + + vessel + { + type symmetryPlane; + faces + ( + (1 3 7 5) + ); + } + + bottom + { + type patch; + faces + ( + (0 1 5 4) + ); + } + + atmosphere + { + type patch; + faces + ( + (2 3 7 6) + ); + } + + back + { + type empty; + faces + ( + (0 2 3 1) + ); + } + + front + { + type empty; + faces + ( + (4 5 7 6) + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/system/VoF/extrudeToRegionMeshDict b/tutorials/modules/CHT/VoFToFilm/system/VoF/extrudeToRegionMeshDict new file mode 100644 index 0000000000..35b6160c55 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/system/VoF/extrudeToRegionMeshDict @@ -0,0 +1,49 @@ +/*--------------------------------*- 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 linearDirection; + +adaptMesh no; + +patchTypes (mappedExtrudedWall); +patchNames (film); + +regionPatchTypes (filmWall); +regionPatchNames (wall); + +regionOppositePatchTypes (mappedFilmSurface); +regionOppositePatchNames (surface); + +nLayers 1; + +expansionRatio 1; + +linearNormalCoeffs +{ + thickness 0.001; +} + +linearDirectionCoeffs +{ + direction (1 0 0); + thickness 0.001; +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/system/VoF/fvSchemes b/tutorials/modules/CHT/VoFToFilm/system/VoF/fvSchemes new file mode 100644 index 0000000000..76856d7176 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/system/VoF/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; +} + +divSchemes +{ + div(phi,alpha) Gauss interfaceCompression vanLeer 1; + + div(rhoPhi,U) Gauss linearUpwindV grad(U); + + div(alphaRhoPhi,e) Gauss linearUpwind grad(e); + div(alphaRhoPhi,T) Gauss upwind; + + div(phi,p) Gauss upwind; + div(rhoPhi,K) Gauss upwind; + + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/system/VoF/fvSolution b/tutorials/modules/CHT/VoFToFilm/system/VoF/fvSolution new file mode 100644 index 0000000000..6373124736 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/system/VoF/fvSolution @@ -0,0 +1,89 @@ +/*--------------------------------*- 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 +{ + "alpha.liquid.*" + { + nAlphaCorr 2; + nAlphaSubCycles 1; + + MULESCorr yes; + nLimiterIter 5; + + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-8; + relTol 0; + } + + "pcorr.*" + { + solver PCG; + preconditioner DIC; + tolerance 1e-5; + relTol 0; + } + + p_rgh + { + solver PCG; + preconditioner DIC; + tolerance 1e-9; + relTol 0.05; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "U.*" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } + + "(T|k|B|nuTilda|sigma).*" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-8; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/system/VoF/setFieldsDict b/tutorials/modules/CHT/VoFToFilm/system/VoF/setFieldsDict new file mode 100644 index 0000000000..de2b3b91a8 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/system/VoF/setFieldsDict @@ -0,0 +1,35 @@ +/*--------------------------------*- 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 setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha.liquid 0 +); + +regions +( + boxToCell + { + box (0 0 -1) (1 0.08 1); + fieldValues + ( + volScalarFieldValue alpha.liquid 1 + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/system/controlDict b/tutorials/modules/CHT/VoFToFilm/system/controlDict new file mode 100644 index 0000000000..1d23dd0ce8 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/system/controlDict @@ -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 "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application foamMultiRun; + +regionSolvers +{ + film film; + VoF compressibleVoF; +} + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 5; + +deltaT 1e-3; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 10; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep no; + +maxCo 1; +maxAlphaCo 1; + +maxDeltaT 1; + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/system/film/blockMeshDict b/tutorials/modules/CHT/VoFToFilm/system/film/blockMeshDict new file mode 100644 index 0000000000..e108eb0f91 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/system/film/blockMeshDict @@ -0,0 +1,115 @@ +/*--------------------------------*- 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.001; + +w 1; +h 100; + +wCells 1; +hCells 80; + +wGrading 1; + +vertices +( + (0 0 -1) + ($w 0 -1) + (0 $h -1) + ($w $h -1) + + (0 0 0) + ($w 0 0) + (0 $h 0) + ($w $h 0) + +); + +blocks +( + hex (0 1 3 2 4 5 7 6) + ($wCells $hCells 1) + simpleGrading ($wGrading 1 1) +); + +boundary +( + wall + { + type filmWall; + + neighbourRegion VoF; + neighbourPatch film; + + faces + ( + (0 2 6 4) + ); + } + + surface + { + type mappedFilmSurface; + + neighbourRegion VoF; + neighbourPatch film; + oppositePatch wall; + transformType none; + + faces + ( + (1 3 7 5) + ); + } + + bottom + { + type patch; + faces + ( + (0 1 5 4) + ); + } + + atmosphere + { + type patch; + faces + ( + (2 3 7 6) + ); + } + + back + { + type empty; + faces + ( + (0 2 3 1) + ); + } + + front + { + type empty; + faces + ( + (4 5 7 6) + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/system/film/fvSchemes b/tutorials/modules/CHT/VoFToFilm/system/film/fvSchemes new file mode 100644 index 0000000000..10a28677c0 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/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"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default filmGauss linear; +} + +divSchemes +{ + default none; + + div(phid,alpha) Gauss upwind; // vanLeer; + div(alphaRhoPhi,U) Gauss upwind; + div(alphaRhoPhi,e) Gauss upwind; +} + +laplacianSchemes +{ + default Gauss linear orthogonal; +} + +snGradSchemes +{ + default orthogonal; +} + + +// ************************************************************************* // diff --git a/tutorials/modules/CHT/VoFToFilm/system/film/fvSolution b/tutorials/modules/CHT/VoFToFilm/system/film/fvSolution new file mode 100644 index 0000000000..2b66db28a9 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/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"; + 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/CHT/VoFToFilm/system/fvSolution b/tutorials/modules/CHT/VoFToFilm/system/fvSolution new file mode 100644 index 0000000000..f1497eb3b5 --- /dev/null +++ b/tutorials/modules/CHT/VoFToFilm/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; +} + +// ************************************************************************* //