diff --git a/applications/solvers/modules/fluid/compressibleVoF/Allwclean b/applications/solvers/modules/fluid/compressibleVoF/Allwclean index 40cf1d3704..630648b359 100755 --- a/applications/solvers/modules/fluid/compressibleVoF/Allwclean +++ b/applications/solvers/modules/fluid/compressibleVoF/Allwclean @@ -3,11 +3,13 @@ cd ${0%/*} || exit 1 # Run from this directory wclean libso compressibleTwoPhaseMixture wclean libso surfaceTensionModels -wclean libso twoPhaseChange wclean libso compressibleInterPhaseTransportModel -wclean libso VoFTurbulenceDamping -wclean libso VoFClouds -wclean libso VoFSurfaceFilm + +wclean libso fvModels/VoFTurbulenceDamping +wclean libso fvModels/VoFClouds +wclean libso fvModels/VoFSurfaceFilm +wclean libso fvModels/VoFCavitation +wclean libso fvModels/VoFSolidificationMeltingSource wclean diff --git a/applications/solvers/modules/fluid/compressibleVoF/Allwmake b/applications/solvers/modules/fluid/compressibleVoF/Allwmake index 671782c999..02c0573705 100755 --- a/applications/solvers/modules/fluid/compressibleVoF/Allwmake +++ b/applications/solvers/modules/fluid/compressibleVoF/Allwmake @@ -6,11 +6,13 @@ cd ${0%/*} || exit 1 # Run from this directory wmake $targetType compressibleTwoPhaseMixture wmake $targetType surfaceTensionModels -wmake $targetType twoPhaseChange wmake $targetType compressibleInterPhaseTransportModel -wmake $targetType VoFTurbulenceDamping -wmake $targetType VoFClouds -wmake $targetType VoFSurfaceFilm + +wmake $targetType fvModels/VoFTurbulenceDamping +wmake $targetType fvModels/VoFClouds +wmake $targetType fvModels/VoFSurfaceFilm +wmake $targetType fvModels/VoFCavitation +wmake $targetType fvModels/VoFSolidificationMeltingSource wmake $targetType diff --git a/applications/solvers/modules/fluid/compressibleVoF/Make/options b/applications/solvers/modules/fluid/compressibleVoF/Make/options index 857e2b90fe..41a7aab42e 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/Make/options +++ b/applications/solvers/modules/fluid/compressibleVoF/Make/options @@ -2,7 +2,6 @@ EXE_INC = \ -I$(FOAM_SOLVERS)/modules/fluid/fluidSolver/lnInclude \ -IcompressibleTwoPhaseMixture \ -IcompressibleInterPhaseTransportModel/lnInclude \ - -ItwoPhaseChange/lnInclude \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ @@ -21,7 +20,6 @@ LIB_LIBS = \ -ltwoPhaseMixture \ -ltwoPhaseProperties \ -linterfaceProperties \ - -lcompressibleTwoPhaseChangeModels \ -lcompressibleInterPhaseTransportModel \ -lfiniteVolume \ -lfvModels \ diff --git a/applications/solvers/modules/fluid/compressibleVoF/alphaSuSp.H b/applications/solvers/modules/fluid/compressibleVoF/alphaSuSp.H index 39966126f9..2bda78b7d9 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/alphaSuSp.H +++ b/applications/solvers/modules/fluid/compressibleVoF/alphaSuSp.H @@ -18,16 +18,13 @@ tmp Su ) ); -// Phase change alpha1 source -Pair> phaseChangeS -( - phaseChange.Salpha(alpha1) -); - -if (phaseChangeS[0].valid()) +if (fvModels().addsSupToField(alpha1.name())) { - Su = phaseChangeS[0]; - Sp = phaseChangeS[1]; + // Phase change alpha1 source + const fvScalarMatrix alphaSup(fvModels().source(alpha1)); + + Su = alphaSup.Su(); + Sp = alphaSup.Sp(); } volScalarField::Internal& SpRef = Sp.ref(); diff --git a/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.C b/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.C index bba8065dd7..c6edf95658 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.C +++ b/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.C @@ -188,13 +188,6 @@ Foam::solvers::compressibleVoF::compressibleVoF(fvMesh& mesh) mixture ), - phaseChangePtr - ( - compressible::twoPhaseChangeModel::New(mixture) - ), - - phaseChange(*phaseChangePtr), - MRF(mesh) { // Read the controls diff --git a/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.H b/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.H index 256f378e9c..15747a9ce3 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.H +++ b/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.H @@ -59,7 +59,6 @@ See also #include "fluidSolver.H" #include "compressibleInterPhaseTransportModel.H" -#include "twoPhaseChangeModel.H" #include "buoyancy.H" #include "pressureReference.H" @@ -147,10 +146,6 @@ protected: //- Momentum transport model compressibleInterPhaseTransportModel turbulence; - autoPtr phaseChangePtr; - - compressible::twoPhaseChangeModel& phaseChange; - // Optional models diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/files b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/files new file mode 100644 index 0000000000..09ae4132a0 --- /dev/null +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/files @@ -0,0 +1,9 @@ +cavitation/cavitationModel/cavitationModel.C +cavitation/cavitationModel/cavitationModelNew.C +cavitation/Kunz/Kunz.C +cavitation/Merkle/Merkle.C +cavitation/SchnerrSauer/SchnerrSauer.C + +VoFCavitation.C + +LIB = $(FOAM_LIBBIN)/libcompressibleVoFCavitation diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/Make/options b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/options similarity index 64% rename from applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/Make/options rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/options index 09f0467175..a77b3c5b1f 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/Make/options +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/options @@ -1,17 +1,19 @@ EXE_INC = \ - -I../compressibleTwoPhaseMixture/lnInclude \ + -I../../compressibleTwoPhaseMixture \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ + -lcompressibleTwoPhaseMixture \ -lfluidThermophysicalModels \ -lspecie \ + -lphysicalProperties \ -ltwoPhaseMixture \ + -ltwoPhaseProperties \ -linterfaceProperties \ - -lcompressibleTwoPhaseMixture \ - -lmeshTools \ - -lfiniteVolume + -lfiniteVolume \ + -lmeshTools diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/VoFCavitation.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/VoFCavitation.C new file mode 100644 index 0000000000..f022446b7d --- /dev/null +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/VoFCavitation.C @@ -0,0 +1,185 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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 . + +\*---------------------------------------------------------------------------*/ + +#include "VoFCavitation.H" +#include "compressibleTwoPhaseMixture.H" +#include "fvmSup.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +namespace Foam +{ + namespace fv + { + namespace compressible + { + defineTypeNameAndDebug(VoFCavitation, 0); + + addToRunTimeSelectionTable + ( + fvModel, + VoFCavitation, + dictionary + ); + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::fv::compressible::VoFCavitation::VoFCavitation +( + const word& sourceName, + const word& modelType, + const dictionary& dict, + const fvMesh& mesh +) +: + fvModel(sourceName, modelType, dict, mesh), + + mixture_ + ( + mesh.lookupObjectRef + ( + "phaseProperties" + ) + ), + + cavitation_(Foam::compressible::cavitationModel::New(dict, mixture_)), + + alphaName_(mixture_.alpha1().name()) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::wordList Foam::fv::compressible::VoFCavitation::addSupFields() const +{ + return {alphaName_, "p_rgh"}; +} + + +void Foam::fv::compressible::VoFCavitation::addSup +( + fvMatrix& eqn, + const word& fieldName +) const +{ + if (debug) + { + Info<< type() << ": applying source to " << eqn.psi().name() << endl; + } + + if (fieldName == alphaName_) + { + volScalarField::Internal alphalCoeff + ( + 1.0/mixture_.rho1()() + - mixture_.alpha1()()*(1.0/mixture_.rho1()() - 1.0/mixture_.rho2()()) + ); + + const Pair> mDotAlphal + ( + cavitation_->mDotAlphal() + ); + + const volScalarField::Internal vDotcAlphal(alphalCoeff*mDotAlphal[0]()); + const volScalarField::Internal vDotvAlphal(alphalCoeff*mDotAlphal[1]()); + + eqn += fvm::Sp(vDotvAlphal - vDotcAlphal, eqn.psi()) + vDotcAlphal; + } +} + + +void Foam::fv::compressible::VoFCavitation::addSup +( + const volScalarField&, + fvMatrix& eqn, + const word& fieldName +) const +{ + if (debug) + { + Info<< type() << ": applying source to " << eqn.psi().name() << endl; + } + + if (fieldName == "p_rgh") + { + const volScalarField::Internal& rho = + mesh().lookupObject("thermo:rho"); + + const volScalarField::Internal& gh = + mesh().lookupObject("gh"); + + const volScalarField::Internal pCoeff + ( + 1.0/mixture_.rho1()() - 1.0/mixture_.rho2()() + ); + + const Pair> mDotP + ( + cavitation_->mDotP() + ); + + const volScalarField::Internal vDotcP(pCoeff*mDotP[0]); + const volScalarField::Internal vDotvP(pCoeff*mDotP[1]); + + eqn += + (vDotvP - vDotcP)*(cavitation_->pSat() - rho*gh) + - fvm::Sp(vDotvP - vDotcP, eqn.psi()); + } +} + + +void Foam::fv::compressible::VoFCavitation::topoChange(const polyTopoChangeMap&) +{} + + +void Foam::fv::compressible::VoFCavitation::mapMesh(const polyMeshMap& map) +{} + + +void Foam::fv::compressible::VoFCavitation::distribute +( + const polyDistributionMap& +) +{} + + +bool Foam::fv::compressible::VoFCavitation::movePoints() +{ + return true; +} + + +void Foam::fv::compressible::VoFCavitation::correct() +{ + cavitation_->correct(); +} + + +// ************************************************************************* // diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/VoFCavitation.H b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/VoFCavitation.H new file mode 100644 index 0000000000..ad1c30a3b7 --- /dev/null +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/VoFCavitation.H @@ -0,0 +1,197 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 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::fv::compressible::VoFCavitation + +Description + Cavitation fvModel + +Usage + Example usage: + \verbatim + VoFCavitation + { + type VoFCavitation; + + libs ("libcompressibleVoFCavitation.so"); + + model SchnerrSauer; + + KunzCoeffs + { + pSat 2300; // Saturation pressure + + UInf 20.0; + tInf 0.005; // L = 0.1 m + Cc 1000; + Cv 1000; + } + + MerkleCoeffs + { + pSat 2300; // Saturation pressure + + UInf 20.0; + tInf 0.005; // L = 0.1 m + Cc 80; + Cv 1e-03; + } + + SchnerrSauerCoeffs + { + pSat 2300; // Saturation pressure + + n 1.6e+13; + dNuc 2.0e-06; + Cc 1; + Cv 1; + } + } + \endverbatim + +SourceFiles + VoFCavitation.C + +\*---------------------------------------------------------------------------*/ + +#ifndef VoFCavitation_H +#define VoFCavitation_H + +#include "fvModel.H" +#include "cavitationModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class compressibleTwoPhaseMixture; + +namespace fv +{ +namespace compressible +{ + +/*---------------------------------------------------------------------------*\ + Class VoFCavitation Declaration +\*---------------------------------------------------------------------------*/ + +class VoFCavitation +: + public fvModel +{ + // Private Data + + //- Reference to the mixture properties + const compressibleTwoPhaseMixture& mixture_; + + autoPtr cavitation_; + + //- The name of the VoF phase-fraction + word alphaName_; + + +public: + + //- Runtime type information + TypeName("VoFCavitation"); + + + // Constructors + + //- Construct from explicit source name and mesh + VoFCavitation + ( + const word& sourceName, + const word& modelType, + const dictionary& dict, + const fvMesh& mesh + ); + + //- Disallow default bitwise copy construction + VoFCavitation + ( + const VoFCavitation& + ) = delete; + + + // Member Functions + + //- Return the list of fields for which the option adds source term + // to the transport equation + virtual wordList addSupFields() const; + + //- Add implicit/explicit contributions to VoF phase-fraction equation + virtual void addSup + ( + fvMatrix& eqn, + const word& fieldName + ) const; + + //- Add implicit/explicit contributions to p_rgh equation + virtual void addSup + ( + const volScalarField& psi, + 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(); + + + //- Correct the cavitation model + virtual void correct(); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const VoFCavitation&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace compressible +} // End namespace fv +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/Kunz/Kunz.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Kunz/Kunz.C similarity index 71% rename from applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/Kunz/Kunz.C rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Kunz/Kunz.C index cbe95629fd..14832866fb 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/Kunz/Kunz.C +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Kunz/Kunz.C @@ -32,7 +32,7 @@ namespace Foam { namespace compressible { -namespace twoPhaseChangeModels +namespace cavitationModels { defineTypeNameAndDebug(Kunz, 0); addToRunTimeSelectionTable(cavitationModel, Kunz, dictionary); @@ -43,17 +43,18 @@ namespace twoPhaseChangeModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::compressible::twoPhaseChangeModels::Kunz::Kunz +Foam::compressible::cavitationModels::Kunz::Kunz ( + const dictionary& dict, const compressibleTwoPhaseMixture& mixture ) : - cavitationModel(typeName, mixture), + cavitationModel(dict, mixture), - UInf_("UInf", dimVelocity, twoPhaseChangeModelCoeffs_), - tInf_("tInf", dimTime, twoPhaseChangeModelCoeffs_), - Cc_("Cc", dimless, twoPhaseChangeModelCoeffs_), - Cv_("Cv", dimless, twoPhaseChangeModelCoeffs_), + UInf_("UInf", dimVelocity, dict), + tInf_("tInf", dimTime, dict), + Cc_("Cc", dimless, dict), + Cv_("Cv", dimless, dict), p0_("0", pSat().dimensions(), 0.0) { @@ -64,15 +65,15 @@ Foam::compressible::twoPhaseChangeModels::Kunz::Kunz // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // Foam::Pair> -Foam::compressible::twoPhaseChangeModels::Kunz::mDotAlphal() const +Foam::compressible::cavitationModels::Kunz::mDotAlphal() const { const volScalarField::Internal& p = mixture_.alpha1().db().lookupObject("p"); - const volScalarField::Internal mcCoeff_(Cc_*rho2()/tInf_); + const volScalarField::Internal mcCoeff_(Cc_*mixture_.rho2()()/tInf_); const volScalarField::Internal mvCoeff_ ( - Cv_*rho2()/(0.5*rho1()*sqr(UInf_)*tInf_) + Cv_*mixture_.rho2()()/(0.5*mixture_.rho1()()*sqr(UInf_)*tInf_) ); const volScalarField::Internal limitedAlpha1 @@ -91,15 +92,15 @@ Foam::compressible::twoPhaseChangeModels::Kunz::mDotAlphal() const Foam::Pair> -Foam::compressible::twoPhaseChangeModels::Kunz::mDotP() const +Foam::compressible::cavitationModels::Kunz::mDotP() const { const volScalarField::Internal& p = mixture_.alpha1().db().lookupObject("p"); - const volScalarField::Internal mcCoeff_(Cc_*rho2()/tInf_); + const volScalarField::Internal mcCoeff_(Cc_*mixture_.rho2()()/tInf_); const volScalarField::Internal mvCoeff_ ( - Cv_*rho2()/(0.5*rho1()*sqr(UInf_)*tInf_) + Cv_*mixture_.rho2()()/(0.5*mixture_.rho1()()*sqr(UInf_)*tInf_) ); const volScalarField::Internal limitedAlpha1 @@ -117,22 +118,21 @@ Foam::compressible::twoPhaseChangeModels::Kunz::mDotP() const } -void Foam::compressible::twoPhaseChangeModels::Kunz::correct() -{ - cavitationModel::correct(); -} +void Foam::compressible::cavitationModels::Kunz::correct() +{} -bool Foam::compressible::twoPhaseChangeModels::Kunz::read() +bool Foam::compressible::cavitationModels::Kunz::read +( + const dictionary& dict +) { - if (cavitationModel::read()) + if (cavitationModel::read(dict)) { - twoPhaseChangeModelCoeffs_ = optionalSubDict(type() + "Coeffs"); - - twoPhaseChangeModelCoeffs_.lookup("UInf") >> UInf_; - twoPhaseChangeModelCoeffs_.lookup("tInf") >> tInf_; - twoPhaseChangeModelCoeffs_.lookup("Cc") >> Cc_; - twoPhaseChangeModelCoeffs_.lookup("Cv") >> Cv_; + dict.lookup("UInf") >> UInf_; + dict.lookup("tInf") >> tInf_; + dict.lookup("Cc") >> Cc_; + dict.lookup("Cv") >> Cv_; return true; } diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/Kunz/Kunz.H b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Kunz/Kunz.H similarity index 93% rename from applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/Kunz/Kunz.H rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Kunz/Kunz.H index e9715b1fe2..6033f84f77 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/Kunz/Kunz.H +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Kunz/Kunz.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::twoPhaseChangeModels::Kunz + Foam::compressible::cavitationModels::Kunz Description Kunz cavitation model slightly modified so that the condensation term @@ -57,7 +57,7 @@ namespace Foam { namespace compressible { -namespace twoPhaseChangeModels +namespace cavitationModels { /*---------------------------------------------------------------------------*\ @@ -89,6 +89,7 @@ public: //- Construct for mixture Kunz ( + const dictionary& dict, const compressibleTwoPhaseMixture& mixture ); @@ -112,14 +113,14 @@ public: //- Correct the Kunz phaseChange model virtual void correct(); - //- Read the phaseProperties dictionary and update - virtual bool read(); + //- Read the dictionary and update + virtual bool read(const dictionary& dict); }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace twoPhaseChangeModels +} // End namespace cavitationModels } // End namespace compressible } // End namespace Foam diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/Merkle/Merkle.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Merkle/Merkle.C similarity index 72% rename from applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/Merkle/Merkle.C rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Merkle/Merkle.C index aa10e43aab..74c5af3c72 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/Merkle/Merkle.C +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Merkle/Merkle.C @@ -32,7 +32,7 @@ namespace Foam { namespace compressible { -namespace twoPhaseChangeModels +namespace cavitationModels { defineTypeNameAndDebug(Merkle, 0); addToRunTimeSelectionTable(cavitationModel, Merkle, dictionary); @@ -43,17 +43,18 @@ namespace twoPhaseChangeModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::compressible::twoPhaseChangeModels::Merkle::Merkle +Foam::compressible::cavitationModels::Merkle::Merkle ( + const dictionary& dict, const compressibleTwoPhaseMixture& mixture ) : - cavitationModel(typeName, mixture), + cavitationModel(dict, mixture), - UInf_("UInf", dimVelocity, twoPhaseChangeModelCoeffs_), - tInf_("tInf", dimTime, twoPhaseChangeModelCoeffs_), - Cc_("Cc", dimless, twoPhaseChangeModelCoeffs_), - Cv_("Cv", dimless, twoPhaseChangeModelCoeffs_), + UInf_("UInf", dimVelocity, dict), + tInf_("tInf", dimTime, dict), + Cc_("Cc", dimless, dict), + Cv_("Cv", dimless, dict), p0_("0", pSat().dimensions(), 0.0), @@ -66,14 +67,14 @@ Foam::compressible::twoPhaseChangeModels::Merkle::Merkle // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // Foam::Pair> -Foam::compressible::twoPhaseChangeModels::Merkle::mDotAlphal() const +Foam::compressible::cavitationModels::Merkle::mDotAlphal() const { const volScalarField::Internal& p = mixture_.alpha1().db().lookupObject("p"); const volScalarField::Internal mvCoeff_ ( - Cv_*rho1()/(0.5*sqr(UInf_)*tInf_*rho2()) + Cv_*mixture_.rho1()()/(0.5*sqr(UInf_)*tInf_*mixture_.rho2()()) ); return Pair> @@ -85,7 +86,7 @@ Foam::compressible::twoPhaseChangeModels::Merkle::mDotAlphal() const Foam::Pair> -Foam::compressible::twoPhaseChangeModels::Merkle::mDotP() const +Foam::compressible::cavitationModels::Merkle::mDotP() const { const volScalarField::Internal& p = mixture_.alpha1().db().lookupObject("p"); @@ -97,7 +98,7 @@ Foam::compressible::twoPhaseChangeModels::Merkle::mDotP() const const volScalarField::Internal mvCoeff_ ( - Cv_*rho1()/(0.5*sqr(UInf_)*tInf_*rho2()) + Cv_*mixture_.rho1()()/(0.5*sqr(UInf_)*tInf_*mixture_.rho2()()) ); return Pair> @@ -109,22 +110,21 @@ Foam::compressible::twoPhaseChangeModels::Merkle::mDotP() const } -void Foam::compressible::twoPhaseChangeModels::Merkle::correct() -{ - cavitationModel::correct(); -} +void Foam::compressible::cavitationModels::Merkle::correct() +{} -bool Foam::compressible::twoPhaseChangeModels::Merkle::read() +bool Foam::compressible::cavitationModels::Merkle::read +( + const dictionary& dict +) { - if (cavitationModel::read()) + if (cavitationModel::read(dict)) { - twoPhaseChangeModelCoeffs_ = optionalSubDict(type() + "Coeffs"); - - twoPhaseChangeModelCoeffs_.lookup("UInf") >> UInf_; - twoPhaseChangeModelCoeffs_.lookup("tInf") >> tInf_; - twoPhaseChangeModelCoeffs_.lookup("Cc") >> Cc_; - twoPhaseChangeModelCoeffs_.lookup("Cv") >> Cv_; + dict.lookup("UInf") >> UInf_; + dict.lookup("tInf") >> tInf_; + dict.lookup("Cc") >> Cc_; + dict.lookup("Cv") >> Cv_; return true; } diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/Merkle/Merkle.H b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Merkle/Merkle.H similarity index 93% rename from applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/Merkle/Merkle.H rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Merkle/Merkle.H index 918618e057..05714406af 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/Merkle/Merkle.H +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Merkle/Merkle.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::twoPhaseChangeModels::Merkle + Foam::compressible::cavitationModels::Merkle Description Merkle cavitation model. @@ -51,7 +51,7 @@ namespace Foam { namespace compressible { -namespace twoPhaseChangeModels +namespace cavitationModels { /*---------------------------------------------------------------------------*\ @@ -85,6 +85,7 @@ public: //- Construct for mixture Merkle ( + const dictionary& dict, const compressibleTwoPhaseMixture& mixture ); @@ -108,14 +109,14 @@ public: //- Correct the Merkle phaseChange model virtual void correct(); - //- Read the phaseProperties dictionary and update - virtual bool read(); + //- Read the dictionary and update + virtual bool read(const dictionary& dict); }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace twoPhaseChangeModels +} // End namespace cavitationModels } // End namespace compressible } // End namespace Foam diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/SchnerrSauer/SchnerrSauer.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/SchnerrSauer/SchnerrSauer.C similarity index 74% rename from applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/SchnerrSauer/SchnerrSauer.C rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/SchnerrSauer/SchnerrSauer.C index 6ce1e1abce..b69d248b50 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/SchnerrSauer/SchnerrSauer.C +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/SchnerrSauer/SchnerrSauer.C @@ -33,7 +33,7 @@ namespace Foam { namespace compressible { -namespace twoPhaseChangeModels +namespace cavitationModels { defineTypeNameAndDebug(SchnerrSauer, 0); addToRunTimeSelectionTable @@ -49,17 +49,18 @@ namespace twoPhaseChangeModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::compressible::twoPhaseChangeModels::SchnerrSauer::SchnerrSauer +Foam::compressible::cavitationModels::SchnerrSauer::SchnerrSauer ( + const dictionary& dict, const compressibleTwoPhaseMixture& mixture ) : - cavitationModel(typeName, mixture), + cavitationModel(dict, mixture), - n_("n", dimless/dimVolume, twoPhaseChangeModelCoeffs_), - dNuc_("dNuc", dimLength, twoPhaseChangeModelCoeffs_), - Cc_("Cc", dimless, twoPhaseChangeModelCoeffs_), - Cv_("Cv", dimless, twoPhaseChangeModelCoeffs_), + n_("n", dimless/dimVolume, dict), + dNuc_("dNuc", dimLength, dict), + Cc_("Cc", dimless, dict), + Cv_("Cv", dimless, dict), p0_("0", pSat().dimensions(), 0.0) { @@ -70,7 +71,7 @@ Foam::compressible::twoPhaseChangeModels::SchnerrSauer::SchnerrSauer // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // Foam::tmp -Foam::compressible::twoPhaseChangeModels::SchnerrSauer::rRb +Foam::compressible::cavitationModels::SchnerrSauer::rRb ( const volScalarField::Internal& limitedAlpha1 ) const @@ -85,7 +86,7 @@ Foam::compressible::twoPhaseChangeModels::SchnerrSauer::rRb Foam::dimensionedScalar -Foam::compressible::twoPhaseChangeModels::SchnerrSauer::alphaNuc() const +Foam::compressible::cavitationModels::SchnerrSauer::alphaNuc() const { dimensionedScalar Vnuc = n_*constant::mathematical::pi*pow3(dNuc_)/6; return Vnuc/(1 + Vnuc); @@ -93,7 +94,7 @@ Foam::compressible::twoPhaseChangeModels::SchnerrSauer::alphaNuc() const Foam::tmp -Foam::compressible::twoPhaseChangeModels::SchnerrSauer::pCoeff +Foam::compressible::cavitationModels::SchnerrSauer::pCoeff ( const volScalarField::Internal& p ) const @@ -105,18 +106,18 @@ Foam::compressible::twoPhaseChangeModels::SchnerrSauer::pCoeff const volScalarField::Internal rho ( - limitedAlpha1*rho1() - + (scalar(1) - limitedAlpha1)*rho2() + limitedAlpha1*mixture_.rho1()() + + (scalar(1) - limitedAlpha1)*mixture_.rho2()() ); return - (3*rho1()*rho2())*sqrt(2/(3*rho1())) + (3*mixture_.rho1()()*mixture_.rho2()())*sqrt(2/(3*mixture_.rho1()())) *rRb(limitedAlpha1)/(rho*sqrt(mag(p - pSat()) + 0.01*pSat())); } Foam::Pair> -Foam::compressible::twoPhaseChangeModels::SchnerrSauer::mDotAlphal() const +Foam::compressible::cavitationModels::SchnerrSauer::mDotAlphal() const { const volScalarField::Internal& p = mixture_.alpha1().db().lookupObject("p"); @@ -138,7 +139,7 @@ Foam::compressible::twoPhaseChangeModels::SchnerrSauer::mDotAlphal() const Foam::Pair> -Foam::compressible::twoPhaseChangeModels::SchnerrSauer::mDotP() const +Foam::compressible::cavitationModels::SchnerrSauer::mDotP() const { const volScalarField::Internal& p = mixture_.alpha1().db().lookupObject("p"); @@ -161,22 +162,21 @@ Foam::compressible::twoPhaseChangeModels::SchnerrSauer::mDotP() const } -void Foam::compressible::twoPhaseChangeModels::SchnerrSauer::correct() -{ - cavitationModel::correct(); -} +void Foam::compressible::cavitationModels::SchnerrSauer::correct() +{} -bool Foam::compressible::twoPhaseChangeModels::SchnerrSauer::read() +bool Foam::compressible::cavitationModels::SchnerrSauer::read +( + const dictionary& dict +) { - if (cavitationModel::read()) + if (cavitationModel::read(dict)) { - twoPhaseChangeModelCoeffs_ = optionalSubDict(type() + "Coeffs"); - - twoPhaseChangeModelCoeffs_.lookup("n") >> n_; - twoPhaseChangeModelCoeffs_.lookup("dNuc") >> dNuc_; - twoPhaseChangeModelCoeffs_.lookup("Cc") >> Cc_; - twoPhaseChangeModelCoeffs_.lookup("Cv") >> Cv_; + dict.lookup("n") >> n_; + dict.lookup("dNuc") >> dNuc_; + dict.lookup("Cc") >> Cc_; + dict.lookup("Cv") >> Cv_; return true; } diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/SchnerrSauer/SchnerrSauer.H b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/SchnerrSauer/SchnerrSauer.H similarity index 94% rename from applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/SchnerrSauer/SchnerrSauer.H rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/SchnerrSauer/SchnerrSauer.H index 381f2d9097..25db8bbf12 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/SchnerrSauer/SchnerrSauer.H +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/SchnerrSauer/SchnerrSauer.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::twoPhaseChangeModels::SchnerrSauer + Foam::compressible::cavitationModels::SchnerrSauer Description SchnerrSauer cavitation model. @@ -51,7 +51,7 @@ namespace Foam { namespace compressible { -namespace twoPhaseChangeModels +namespace cavitationModels { /*---------------------------------------------------------------------------*\ @@ -105,6 +105,7 @@ public: //- Construct for mixture SchnerrSauer ( + const dictionary& dict, const compressibleTwoPhaseMixture& mixture ); @@ -128,14 +129,14 @@ public: //- Correct the SchnerrSauer phaseChange model virtual void correct(); - //- Read the phaseProperties dictionary and update - virtual bool read(); + //- Read the dictionary and update + virtual bool read(const dictionary& dict); }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace twoPhaseChangeModels +} // End namespace cavitationModels } // End namespace compressible } // End namespace Foam diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/twoPhaseChangeModel/twoPhaseChangeModel.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModel.C similarity index 51% rename from applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/twoPhaseChangeModel/twoPhaseChangeModel.C rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModel.C index 085963c0a8..1a37106ca8 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/twoPhaseChangeModel/twoPhaseChangeModel.C +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModel.C @@ -23,7 +23,8 @@ License \*---------------------------------------------------------------------------*/ -#include "twoPhaseChangeModel.H" +#include "cavitationModel.H" +#include "fvmSup.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -31,79 +32,30 @@ namespace Foam { namespace compressible { - defineTypeNameAndDebug(twoPhaseChangeModel, 0); - defineRunTimeSelectionTable(twoPhaseChangeModel, dictionary); + defineTypeNameAndDebug(cavitationModel, 0); + defineRunTimeSelectionTable(cavitationModel, dictionary); } } -const Foam::word -Foam::compressible::twoPhaseChangeModel::phaseChangePropertiesName -( - "phaseChangeProperties" -); - - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -Foam::IOobject Foam::compressible::twoPhaseChangeModel::createIOobject -( - const compressibleTwoPhaseMixture& mixture -) const -{ - typeIOobject io - ( - phaseChangePropertiesName, - mixture.alpha1().mesh().time().constant(), - mixture.alpha1().mesh(), - IOobject::MUST_READ, - IOobject::NO_WRITE - ); - - if (io.headerOk()) - { - io.readOpt() = IOobject::MUST_READ_IF_MODIFIED; - return io; - } - else - { - io.readOpt() = IOobject::NO_READ; - return io; - } -} - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::compressible::twoPhaseChangeModel::twoPhaseChangeModel +Foam::compressible::cavitationModel::cavitationModel ( - const word& type, + const dictionary& dict, const compressibleTwoPhaseMixture& mixture ) : - IOdictionary(createIOobject(mixture)), mixture_(mixture), - twoPhaseChangeModelCoeffs_(optionalSubDict(type + "Coeffs")) + pSat_("pSat", dimPressure, dict.lookup("pSat")) {} -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::compressible::twoPhaseChangeModel::correct() -{} - - -bool Foam::compressible::twoPhaseChangeModel::read() +bool Foam::compressible::cavitationModel::read(const dictionary& dict) { - if (regIOobject::read()) - { - twoPhaseChangeModelCoeffs_ = optionalSubDict(type() + "Coeffs"); + dict.lookup("pSat") >> pSat_; - return true; - } - else - { - return false; - } + return true; } diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/cavitationModel/cavitationModel.H b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModel.H similarity index 74% rename from applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/cavitationModel/cavitationModel.H rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModel.H index 81dc8d48f4..0f0b6f6180 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/cavitationModel/cavitationModel.H +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModel.H @@ -35,7 +35,9 @@ SourceFiles #ifndef cavitationModel_H #define cavitationModel_H -#include "twoPhaseChangeModel.H" +#include "compressibleTwoPhaseMixture.H" +#include "fvMatricesFwd.H" +#include "Pair.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,18 +45,19 @@ namespace Foam { namespace compressible { -namespace twoPhaseChangeModels -{ /*---------------------------------------------------------------------------*\ - Class cavitationModel + Class cavitationModel \*---------------------------------------------------------------------------*/ class cavitationModel -: - public twoPhaseChangeModel { - // Private data +protected: + + // Protected data + + //- Mixture properties + const compressibleTwoPhaseMixture& mixture_; //- Saturation vapour pressure dimensionedScalar pSat_; @@ -66,16 +69,39 @@ public: TypeName("cavitation"); + // Declare run-time constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + cavitationModel, + dictionary, + ( + const dictionary& dict, + const compressibleTwoPhaseMixture& mixture + ), + (dict, mixture) + ); + + // Constructors //- Construct for mixture cavitationModel ( - const word& type, + const dictionary& dict, const compressibleTwoPhaseMixture& mixture ); + // Selector + static autoPtr New + ( + const dictionary& dict, + const compressibleTwoPhaseMixture& mixture + ); + + //- Destructor virtual ~cavitationModel() {} @@ -98,38 +124,16 @@ public: // to multiply (p - pSat) virtual Pair> mDotP() const = 0; - //- Return the cavitation explicit and implicit sources - // for the phase-fraction equation - virtual Pair> Salpha - ( - volScalarField& alpha - ) const; + //- Correct the cavitation model + virtual void correct() = 0; - //- Return the cavitation source matrix - // for the p_rgh pressure equation - virtual tmp Sp_rgh - ( - const volScalarField& rho, - const volScalarField& gh, - volScalarField& p_rgh - ) const; - - //- Return the cavitation source matrix for the momentum equation - virtual tmp SU - ( - const volScalarField& rho, - const surfaceScalarField& rhoPhi, - volVectorField& U - ) const; - - //- Read the phaseProperties dictionary and update - virtual bool read(); + //- Read the dictionary and update + virtual bool read(const dictionary& dict) = 0; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace twoPhaseChangeModels } // End namespace compressible } // End namespace Foam diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/twoPhaseChangeModel/twoPhaseChangeModelNew.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModelNew.C similarity index 59% rename from applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/twoPhaseChangeModel/twoPhaseChangeModelNew.C rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModelNew.C index 3618d92506..c01d09ee57 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/twoPhaseChangeModel/twoPhaseChangeModelNew.C +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModelNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,46 +23,20 @@ License \*---------------------------------------------------------------------------*/ -#include "noPhaseChange.H" +#include "cavitationModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::autoPtr -Foam::compressible::twoPhaseChangeModel::New +Foam::autoPtr +Foam::compressible::cavitationModel::New ( + const dictionary& dict, const compressibleTwoPhaseMixture& mixture ) { - typeIOobject twoPhaseChangeModelIO - ( - IOobject - ( - phaseChangePropertiesName, - mixture.alpha1().time().constant(), - mixture.alpha1().db(), - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ); + const word modelType(dict.lookup("model")); - word modelType(twoPhaseChangeModels::noPhaseChange::typeName); - - if (twoPhaseChangeModelIO.headerOk()) - { - IOdictionary(twoPhaseChangeModelIO).lookup - ( - twoPhaseChangeModel::typeName - ) >> modelType; - } - else - { - Info<< "No phase change: " - << twoPhaseChangeModelIO.name() - << " not found" << endl; - } - - Info<< "Selecting phaseChange model " << modelType << endl; + Info<< "Selecting cavitation model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); @@ -70,14 +44,17 @@ Foam::compressible::twoPhaseChangeModel::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown " << twoPhaseChangeModel::typeName<< " type " + << "Unknown cavitation model " << modelType << nl << nl - << "Valid twoPhaseChangeModels are : " << endl + << "Valid cavitationModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } - return autoPtr(cstrIter()(mixture)); + return autoPtr + ( + cstrIter()(dict.optionalSubDict(modelType + "Coeffs"), mixture) + ); } diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFClouds/Make/files b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/Make/files similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/VoFClouds/Make/files rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/Make/files diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFClouds/Make/options b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/Make/options similarity index 94% rename from applications/solvers/modules/fluid/compressibleVoF/VoFClouds/Make/options rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/Make/options index 37ac942c2d..87e98927d5 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/VoFClouds/Make/options +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I../compressibleTwoPhaseMixture \ + -I../../compressibleTwoPhaseMixture \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFClouds/VoFClouds.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/VoFClouds.C similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/VoFClouds/VoFClouds.C rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/VoFClouds.C diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFClouds/VoFClouds.H b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/VoFClouds.H similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/VoFClouds/VoFClouds.H rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/VoFClouds.H diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/Make/files b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/Make/files new file mode 100644 index 0000000000..01cf8ad2c7 --- /dev/null +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/Make/files @@ -0,0 +1,3 @@ +VoFSolidificationMeltingSource.C + +LIB = $(FOAM_LIBBIN)/libVoFSolidificationMeltingSource diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/Make/options b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/Make/options new file mode 100644 index 0000000000..a77b3c5b1f --- /dev/null +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/Make/options @@ -0,0 +1,19 @@ +EXE_INC = \ + -I../../compressibleTwoPhaseMixture \ + -I$(LIB_SRC)/physicalProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +LIB_LIBS = \ + -lcompressibleTwoPhaseMixture \ + -lfluidThermophysicalModels \ + -lspecie \ + -lphysicalProperties \ + -ltwoPhaseMixture \ + -ltwoPhaseProperties \ + -linterfaceProperties \ + -lfiniteVolume \ + -lmeshTools diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.C similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.C rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.C diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.H b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.H similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.H rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/VoFSolidificationMeltingSource.H diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/Make/files b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/Make/files similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/Make/files rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/Make/files diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/Make/options b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/Make/options similarity index 94% rename from applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/Make/options rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/Make/options index 149a87947b..1033dbb79e 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/Make/options +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I../compressibleTwoPhaseMixture \ + -I../../compressibleTwoPhaseMixture \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.C similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.C rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.C diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.H b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.H similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.H rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/VoFPatchTransfer/VoFPatchTransfer.H diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/VoFSurfaceFilm.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/VoFSurfaceFilm.C similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/VoFSurfaceFilm.C rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/VoFSurfaceFilm.C diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/VoFSurfaceFilm.H b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/VoFSurfaceFilm.H similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/VoFSurfaceFilm/VoFSurfaceFilm.H rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/VoFSurfaceFilm.H diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFTurbulenceDamping/Make/files b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/Make/files similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/VoFTurbulenceDamping/Make/files rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/Make/files diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFTurbulenceDamping/Make/options b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/Make/options similarity index 95% rename from applications/solvers/modules/fluid/compressibleVoF/VoFTurbulenceDamping/Make/options rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/Make/options index 4dd98b61af..75a5cff41f 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/VoFTurbulenceDamping/Make/options +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I../compressibleTwoPhaseMixture \ + -I../../compressibleTwoPhaseMixture \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFTurbulenceDamping/VoFTurbulenceDamping.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C similarity index 86% rename from applications/solvers/modules/fluid/compressibleVoF/VoFTurbulenceDamping/VoFTurbulenceDamping.C rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C index 98a6d2d1e8..831e3eae9c 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/VoFTurbulenceDamping/VoFTurbulenceDamping.C +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C @@ -36,21 +36,24 @@ namespace Foam { namespace fv { - defineTypeNameAndDebug(VoFTurbulenceDamping, 0); + namespace compressible + { + defineTypeNameAndDebug(VoFTurbulenceDamping, 0); - addToRunTimeSelectionTable - ( - fvModel, - VoFTurbulenceDamping, - dictionary - ); + addToRunTimeSelectionTable + ( + fvModel, + VoFTurbulenceDamping, + dictionary + ); + } } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::fv::VoFTurbulenceDamping::VoFTurbulenceDamping +Foam::fv::compressible::VoFTurbulenceDamping::VoFTurbulenceDamping ( const word& sourceName, const word& modelType, @@ -113,13 +116,14 @@ Foam::fv::VoFTurbulenceDamping::VoFTurbulenceDamping // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::wordList Foam::fv::VoFTurbulenceDamping::addSupFields() const +Foam::wordList +Foam::fv::compressible::VoFTurbulenceDamping::addSupFields() const { return wordList(1, fieldName_); } -void Foam::fv::VoFTurbulenceDamping::addSup +void Foam::fv::compressible::VoFTurbulenceDamping::addSup ( const volScalarField& rho, fvMatrix& eqn, @@ -156,7 +160,7 @@ void Foam::fv::VoFTurbulenceDamping::addSup } -void Foam::fv::VoFTurbulenceDamping::addSup +void Foam::fv::compressible::VoFTurbulenceDamping::addSup ( const volScalarField& alpha, const volScalarField&, @@ -207,19 +211,28 @@ void Foam::fv::VoFTurbulenceDamping::addSup } -void Foam::fv::VoFTurbulenceDamping::topoChange(const polyTopoChangeMap&) +void Foam::fv::compressible::VoFTurbulenceDamping::topoChange +( + const polyTopoChangeMap& +) {} -void Foam::fv::VoFTurbulenceDamping::mapMesh(const polyMeshMap& map) +void Foam::fv::compressible::VoFTurbulenceDamping::mapMesh +( + const polyMeshMap& map +) {} -void Foam::fv::VoFTurbulenceDamping::distribute(const polyDistributionMap&) +void Foam::fv::compressible::VoFTurbulenceDamping::distribute +( + const polyDistributionMap& +) {} -bool Foam::fv::VoFTurbulenceDamping::movePoints() +bool Foam::fv::compressible::VoFTurbulenceDamping::movePoints() { return true; } diff --git a/applications/solvers/modules/fluid/compressibleVoF/VoFTurbulenceDamping/VoFTurbulenceDamping.H b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.H similarity index 98% rename from applications/solvers/modules/fluid/compressibleVoF/VoFTurbulenceDamping/VoFTurbulenceDamping.H rename to applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.H index ae3b83cba1..cd92dab5b0 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/VoFTurbulenceDamping/VoFTurbulenceDamping.H +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::fv::VoFTurbulenceDamping + Foam::fv::compressible::VoFTurbulenceDamping Description Free-surface turbulence damping function @@ -87,6 +87,8 @@ class compressibleMomentumTransportModel; namespace fv { +namespace compressible +{ /*---------------------------------------------------------------------------*\ Class VoFTurbulenceDamping Declaration @@ -196,6 +198,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} // End namespace compressible } // End namespace fv } // End namespace Foam diff --git a/applications/solvers/modules/fluid/compressibleVoF/pressureCorrector.C b/applications/solvers/modules/fluid/compressibleVoF/pressureCorrector.C index 95db6cc076..14b3169a84 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/pressureCorrector.C +++ b/applications/solvers/modules/fluid/compressibleVoF/pressureCorrector.C @@ -83,7 +83,19 @@ void Foam::solvers::compressibleVoF::pressureCorrector() constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF); // Cache the phase change pressure source - fvScalarMatrix Sp_rgh(phaseChange.Sp_rgh(rho, buoyancy.gh, p_rgh)); + fvScalarMatrix Sp_rgh + ( + fvModels().source + ( + volScalarField::New + ( + "1", + mesh, + dimensionedScalar(dimless/dimPressure, 1) + ), + p_rgh + ) + ); // Make the fluxes relative to the mesh motion fvc::makeRelative(phiHbyA, U); diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/Make/files b/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/Make/files deleted file mode 100644 index 99db8c4b8a..0000000000 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/Make/files +++ /dev/null @@ -1,9 +0,0 @@ -twoPhaseChangeModel/twoPhaseChangeModel.C -twoPhaseChangeModel/twoPhaseChangeModelNew.C -noPhaseChange/noPhaseChange.C -cavitation/cavitationModel/cavitationModel.C -cavitation/Kunz/Kunz.C -cavitation/Merkle/Merkle.C -cavitation/SchnerrSauer/SchnerrSauer.C - -LIB = $(FOAM_LIBBIN)/libcompressibleTwoPhaseChangeModels diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/cavitationModel/cavitationModel.C b/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/cavitationModel/cavitationModel.C deleted file mode 100644 index 40b59dba74..0000000000 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/cavitation/cavitationModel/cavitationModel.C +++ /dev/null @@ -1,131 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021-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 . - -\*---------------------------------------------------------------------------*/ - -#include "cavitationModel.H" -#include "fvcDdt.H" -#include "fvcDiv.H" -#include "fvmSup.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ -namespace twoPhaseChangeModels -{ - defineTypeNameAndDebug(cavitationModel, 0); -} -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::compressible::twoPhaseChangeModels::cavitationModel::cavitationModel -( - const word& type, - const compressibleTwoPhaseMixture& mixture -) -: - twoPhaseChangeModel(type, mixture), - pSat_("pSat", dimPressure, lookup("pSat")) -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -Foam::Pair> -Foam::compressible::twoPhaseChangeModels::cavitationModel::Salpha -( - volScalarField& alpha -) const -{ - const volScalarField::Internal alphalCoeff - ( - 1.0/rho1() - - mixture_.alpha1()()*(1.0/rho1() - 1.0/rho2()) - ); - const Pair> mDotAlphal = this->mDotAlphal(); - - const volScalarField::Internal vDotcAlphal(alphalCoeff*mDotAlphal[0]()); - const volScalarField::Internal vDotvAlphal(alphalCoeff*mDotAlphal[1]()); - - return Pair> - ( - 1.0*vDotcAlphal, - vDotvAlphal - vDotcAlphal - ); -} - - -Foam::tmp -Foam::compressible::twoPhaseChangeModels::cavitationModel::Sp_rgh -( - const volScalarField& rho, - const volScalarField& gh, - volScalarField& p_rgh -) const -{ - const volScalarField::Internal pCoeff(1.0/rho1() - 1.0/rho2()); - const Pair> mDotP = this->mDotP(); - - const volScalarField::Internal vDotcP(pCoeff*mDotP[0]); - const volScalarField::Internal vDotvP(pCoeff*mDotP[1]); - - return - (vDotvP - vDotcP)*(pSat() - rho()*gh()) - - fvm::Sp(vDotvP - vDotcP, p_rgh); -} - - -Foam::tmp -Foam::compressible::twoPhaseChangeModels::cavitationModel::SU -( - const volScalarField& rho, - const surfaceScalarField& rhoPhi, - volVectorField& U -) const -{ - return fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U); -} - - -bool Foam::compressible::twoPhaseChangeModels::cavitationModel::read() -{ - if (twoPhaseChangeModel::read()) - { - lookup("pSat") >> pSat_; - - return true; - } - else - { - return false; - } -} - - -// ************************************************************************* // diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/noPhaseChange/noPhaseChange.C b/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/noPhaseChange/noPhaseChange.C deleted file mode 100644 index 1e0151550e..0000000000 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/noPhaseChange/noPhaseChange.C +++ /dev/null @@ -1,133 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021-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 . - -\*---------------------------------------------------------------------------*/ - -#include "noPhaseChange.H" -#include "fvScalarMatrix.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ -namespace twoPhaseChangeModels -{ - defineTypeNameAndDebug(noPhaseChange, 0); - addToRunTimeSelectionTable(twoPhaseChangeModel, noPhaseChange, dictionary); -} -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::compressible::twoPhaseChangeModels::noPhaseChange::noPhaseChange -( - const compressibleTwoPhaseMixture& mixture -) -: - twoPhaseChangeModel(typeName, mixture) -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -Foam::Pair> -Foam::compressible::twoPhaseChangeModels::noPhaseChange::mDotAlphal() const -{ - return Pair> - ( - volScalarField::null(), - volScalarField::null() - ); -} - - -Foam::Pair> -Foam::compressible::twoPhaseChangeModels::noPhaseChange::mDotP() const -{ - return Pair> - ( - volScalarField::null(), - volScalarField::null() - ); -} - - -Foam::Pair> -Foam::compressible::twoPhaseChangeModels::noPhaseChange::Salpha -( - volScalarField& alpha -) const -{ - return Pair> - ( - tmp(nullptr), - tmp(nullptr) - ); -} - - -Foam::tmp -Foam::compressible::twoPhaseChangeModels::noPhaseChange::Sp_rgh -( - const volScalarField& rho, - const volScalarField& gh, - volScalarField& p_rgh -) const -{ - return tmp(new fvScalarMatrix(p_rgh, dimVolume/dimTime)); -} - - -Foam::tmp -Foam::compressible::twoPhaseChangeModels::noPhaseChange::SU -( - const volScalarField& rho, - const surfaceScalarField& rhoPhi, - volVectorField& U -) const -{ - return tmp - ( - new fvVectorMatrix(U, dimMass*dimVelocity/dimTime) - ); -} - - -void Foam::compressible::twoPhaseChangeModels::noPhaseChange::correct() -{ - twoPhaseChangeModel::correct(); -} - - -bool Foam::compressible::twoPhaseChangeModels::noPhaseChange::read() -{ - return twoPhaseChangeModel::read(); -} - - -// ************************************************************************* // diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/noPhaseChange/noPhaseChange.H b/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/noPhaseChange/noPhaseChange.H deleted file mode 100644 index f94a782830..0000000000 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/noPhaseChange/noPhaseChange.H +++ /dev/null @@ -1,131 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021-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::twoPhaseChangeModels::noPhaseChange - -Description - Dummy phase change model for 'no phase change' - -SourceFiles - noPhaseChange.C - -\*---------------------------------------------------------------------------*/ - -#ifndef noPhaseChange_H -#define noPhaseChange_H - -#include "twoPhaseChangeModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ -namespace twoPhaseChangeModels -{ - -/*---------------------------------------------------------------------------*\ - Class noPhaseChange -\*---------------------------------------------------------------------------*/ - -class noPhaseChange -: - public twoPhaseChangeModel -{ - -public: - - //- Runtime type information - TypeName("none"); - - - // Constructors - - //- Construct for mixture - noPhaseChange - ( - const compressibleTwoPhaseMixture& mixture - ); - - - //- Destructor - virtual ~noPhaseChange() - {} - - - // Member Functions - - //- Return the mass condensation and vaporisation rates as a - // coefficient to multiply (1 - alphal) for the condensation rate - // and a coefficient to multiply alphal for the vaporisation rate - virtual Pair> mDotAlphal() const; - - //- Return the mass condensation and vaporisation rates as coefficients - // to multiply (p - pSat) - virtual Pair> mDotP() const; - - //- Return unallocated explicit and implicit sources - // for the phase-fraction equation - virtual Pair> Salpha - ( - volScalarField& - ) const; - - //- Return the zero source matrix - // for the p_rgh pressure equation - virtual tmp Sp_rgh - ( - const volScalarField& rho, - const volScalarField& gh, - volScalarField& p_rgh - ) const; - - //- Return the zero source matrix for the momentum equation - virtual tmp SU - ( - const volScalarField& rho, - const surfaceScalarField& rhoPhi, - volVectorField& U - ) const; - - //- Correct the noPhaseChange phaseChange model - virtual void correct(); - - //- Read the phaseProperties dictionary and update - virtual bool read(); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace twoPhaseChangeModels -} // End namespace compressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/twoPhaseChangeModel/twoPhaseChangeModel.H b/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/twoPhaseChangeModel/twoPhaseChangeModel.H deleted file mode 100644 index c0412e1d23..0000000000 --- a/applications/solvers/modules/fluid/compressibleVoF/twoPhaseChange/twoPhaseChangeModel/twoPhaseChangeModel.H +++ /dev/null @@ -1,188 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021-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::twoPhaseChangeModel - -Description - -SourceFiles - twoPhaseChangeModel.C - phaseChangeModelNew.C - -\*---------------------------------------------------------------------------*/ - -#ifndef twoPhaseChangeModel_H -#define twoPhaseChangeModel_H - -#include "compressibleTwoPhaseMixture.H" -#include "fvMatricesFwd.H" -#include "Pair.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace compressible -{ - -/*---------------------------------------------------------------------------*\ - Class twoPhaseChangeModel Declaration -\*---------------------------------------------------------------------------*/ - -class twoPhaseChangeModel -: - public IOdictionary -{ - // Private Member Functions - - //- Construct the base IO object - IOobject createIOobject - ( - const compressibleTwoPhaseMixture& mixture - ) const; - - -protected: - - // Protected data - - //- Reference to the two-phase mixture - const compressibleTwoPhaseMixture& mixture_; - - //- Model coefficient dictionary - dictionary twoPhaseChangeModelCoeffs_; - - -public: - - //- Runtime type information - TypeName("phaseChangeModel"); - - //- Default phaseChangeProperties dictionary name - static const word phaseChangePropertiesName; - - - // Declare run-time constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - twoPhaseChangeModel, - dictionary, - ( - const compressibleTwoPhaseMixture& mixture - ), - (mixture) - ); - - - // Constructors - - //- Construct from dictionary - twoPhaseChangeModel - ( - const word& type, - const compressibleTwoPhaseMixture& mixture - ); - - //- Disallow default bitwise copy construction - twoPhaseChangeModel(const twoPhaseChangeModel&); - - - // Selectors - - //- Return a reference to the selected phaseChange model - static autoPtr New - ( - const compressibleTwoPhaseMixture& mixture - ); - - - //- Destructor - virtual ~twoPhaseChangeModel() - {} - - - // Member Functions - - //- Return the internal field of the density of phase 1 - const volScalarField::Internal& rho1() const - { - return mixture_.rho1(); - } - - //- Return the internal field of the density of phase 2 - const volScalarField::Internal& rho2() const - { - return mixture_.rho2(); - } - - //- Return the phase-change explicit and implicit sources - // for the phase-fraction equation - virtual Pair> Salpha - ( - volScalarField& alpha - ) const = 0; - - //- Return the phase-change source matrix - // for the p_rgh pressure equation - virtual tmp Sp_rgh - ( - const volScalarField& rho, - const volScalarField& gh, - volScalarField& p_rgh - ) const = 0; - - //- Return the phase-change source matrix for the momentum equation - virtual tmp SU - ( - const volScalarField& rho, - const surfaceScalarField& rhoPhi, - volVectorField& U - ) const = 0; - - //- Correct the phaseChange model - virtual void correct() = 0; - - //- Read the phaseProperties dictionary and update - virtual bool read() = 0; - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const twoPhaseChangeModel&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace compressible -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/interFoam/Allwclean b/applications/solvers/multiphase/interFoam/Allwclean index 98aee12c18..93fa3820cb 100755 --- a/applications/solvers/multiphase/interFoam/Allwclean +++ b/applications/solvers/multiphase/interFoam/Allwclean @@ -2,8 +2,9 @@ cd ${0%/*} || exit 1 # Run from this directory wclean libso incompressibleInterPhaseTransportModel -wclean libso VoFTurbulenceDamping -wclean libso VoFCavitation + +wclean libso fvModels/VoFTurbulenceDamping +wclean libso fvModels/VoFCavitation wclean wclean interMixingFoam diff --git a/applications/solvers/multiphase/interFoam/Allwmake b/applications/solvers/multiphase/interFoam/Allwmake index 3eb1eaced9..8866acde31 100755 --- a/applications/solvers/multiphase/interFoam/Allwmake +++ b/applications/solvers/multiphase/interFoam/Allwmake @@ -5,8 +5,9 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments wmake $targetType incompressibleInterPhaseTransportModel -wmake $targetType VoFTurbulenceDamping -wmake $targetType VoFCavitation + +wmake $targetType fvModels/VoFTurbulenceDamping +wmake $targetType fvModels/VoFCavitation wmake $targetType wmake $targetType interMixingFoam diff --git a/applications/solvers/multiphase/interFoam/VoFCavitation/Make/files b/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/Make/files similarity index 100% rename from applications/solvers/multiphase/interFoam/VoFCavitation/Make/files rename to applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/Make/files diff --git a/applications/solvers/multiphase/interFoam/VoFCavitation/Make/options b/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/Make/options similarity index 100% rename from applications/solvers/multiphase/interFoam/VoFCavitation/Make/options rename to applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/Make/options diff --git a/applications/solvers/multiphase/interFoam/VoFCavitation/VoFCavitation.C b/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.C similarity index 100% rename from applications/solvers/multiphase/interFoam/VoFCavitation/VoFCavitation.C rename to applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.C diff --git a/applications/solvers/multiphase/interFoam/VoFCavitation/VoFCavitation.H b/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.H similarity index 98% rename from applications/solvers/multiphase/interFoam/VoFCavitation/VoFCavitation.H rename to applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.H index 8b2d19094c..ed5f956f96 100644 --- a/applications/solvers/multiphase/interFoam/VoFCavitation/VoFCavitation.H +++ b/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.H @@ -87,8 +87,6 @@ namespace Foam { class immiscibleIncompressibleTwoPhaseMixture; -class interfaceProperties; -class incompressibleMomentumTransportModel; namespace fv { diff --git a/applications/solvers/multiphase/interFoam/VoFTurbulenceDamping/Make/files b/applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/Make/files similarity index 100% rename from applications/solvers/multiphase/interFoam/VoFTurbulenceDamping/Make/files rename to applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/Make/files diff --git a/applications/solvers/multiphase/interFoam/VoFTurbulenceDamping/Make/options b/applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/Make/options similarity index 100% rename from applications/solvers/multiphase/interFoam/VoFTurbulenceDamping/Make/options rename to applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/Make/options diff --git a/applications/solvers/multiphase/interFoam/VoFTurbulenceDamping/VoFTurbulenceDamping.C b/applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C similarity index 100% rename from applications/solvers/multiphase/interFoam/VoFTurbulenceDamping/VoFTurbulenceDamping.C rename to applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C diff --git a/applications/solvers/multiphase/interFoam/VoFTurbulenceDamping/VoFTurbulenceDamping.H b/applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.H similarity index 100% rename from applications/solvers/multiphase/interFoam/VoFTurbulenceDamping/VoFTurbulenceDamping.H rename to applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.H diff --git a/src/twoPhaseModels/cavitation/Kunz/Kunz.H b/src/twoPhaseModels/cavitation/Kunz/Kunz.H index 08d38df7e1..7af08904b0 100644 --- a/src/twoPhaseModels/cavitation/Kunz/Kunz.H +++ b/src/twoPhaseModels/cavitation/Kunz/Kunz.H @@ -114,7 +114,7 @@ public: //- Correct the Kunz phaseChange model virtual void correct(); - //- Read the phaseProperties dictionary and update + //- Read the dictionary and update virtual bool read(const dictionary& dict); }; diff --git a/src/twoPhaseModels/cavitation/Merkle/Merkle.H b/src/twoPhaseModels/cavitation/Merkle/Merkle.H index 75c23960a3..e17ed7a8c3 100644 --- a/src/twoPhaseModels/cavitation/Merkle/Merkle.H +++ b/src/twoPhaseModels/cavitation/Merkle/Merkle.H @@ -108,7 +108,7 @@ public: //- Correct the Merkle phaseChange model virtual void correct(); - //- Read the phaseProperties dictionary and update + //- Read the dictionary and update virtual bool read(const dictionary& dict); }; diff --git a/src/twoPhaseModels/cavitation/SchnerrSauer/SchnerrSauer.H b/src/twoPhaseModels/cavitation/SchnerrSauer/SchnerrSauer.H index 7f7758401a..f5087de7da 100644 --- a/src/twoPhaseModels/cavitation/SchnerrSauer/SchnerrSauer.H +++ b/src/twoPhaseModels/cavitation/SchnerrSauer/SchnerrSauer.H @@ -127,7 +127,7 @@ public: //- Correct the SchnerrSauer phaseChange model virtual void correct(); - //- Read the phaseProperties dictionary and update + //- Read the dictionary and update virtual bool read(const dictionary& dict); }; diff --git a/src/twoPhaseModels/cavitation/cavitationModel/cavitationModel.H b/src/twoPhaseModels/cavitation/cavitationModel/cavitationModel.H index a13f301ae4..ec7fa86414 100644 --- a/src/twoPhaseModels/cavitation/cavitationModel/cavitationModel.H +++ b/src/twoPhaseModels/cavitation/cavitationModel/cavitationModel.H @@ -125,7 +125,7 @@ public: //- Correct the cavitation model virtual void correct() = 0; - //- Read the phaseProperties dictionary and update + //- Read the dictionary and update virtual bool read(const dictionary& dict) = 0; }; diff --git a/tutorials/modules/compressibleVoF/ballValve/constant/phaseChangeProperties b/tutorials/modules/compressibleVoF/ballValve/constant/fvModels similarity index 61% rename from tutorials/modules/compressibleVoF/ballValve/constant/phaseChangeProperties rename to tutorials/modules/compressibleVoF/ballValve/constant/fvModels index 7eea6be7f1..e4daa01fa8 100644 --- a/tutorials/modules/compressibleVoF/ballValve/constant/phaseChangeProperties +++ b/tutorials/modules/compressibleVoF/ballValve/constant/fvModels @@ -9,21 +9,26 @@ FoamFile { format ascii; class dictionary; - object phaseChangeProperties; + location "constant"; + object fvModels; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -phaseChangeModel SchnerrSauer; - -pSat 2364; - -SchnerrSauerCoeffs +VoFCavitation { - n 1.6E+13; - dNuc 2.0E-06; - Cc 1.0; - Cv 1.0; + type VoFCavitation; + + libs ("libcompressibleVoFCavitation.so"); + + model SchnerrSauer; + + pSat 2300; + + n 1.6e+13; + dNuc 2.0e-06; + Cc 1; + Cv 1; } -// ************************************************************************* // +//************************************************************************* //