diff --git a/applications/solvers/modules/fluid/compressibleVoF/Allwclean b/applications/solvers/modules/fluid/compressibleVoF/Allwclean index 630648b359..295d5ed136 100755 --- a/applications/solvers/modules/fluid/compressibleVoF/Allwclean +++ b/applications/solvers/modules/fluid/compressibleVoF/Allwclean @@ -1,8 +1,6 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory -wclean libso compressibleTwoPhaseMixture -wclean libso surfaceTensionModels wclean libso compressibleInterPhaseTransportModel wclean libso fvModels/VoFTurbulenceDamping diff --git a/applications/solvers/modules/fluid/compressibleVoF/Allwmake b/applications/solvers/modules/fluid/compressibleVoF/Allwmake index 02c0573705..fba0e2757d 100755 --- a/applications/solvers/modules/fluid/compressibleVoF/Allwmake +++ b/applications/solvers/modules/fluid/compressibleVoF/Allwmake @@ -4,8 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -wmake $targetType compressibleTwoPhaseMixture -wmake $targetType surfaceTensionModels wmake $targetType compressibleInterPhaseTransportModel wmake $targetType fvModels/VoFTurbulenceDamping diff --git a/applications/solvers/modules/fluid/compressibleVoF/Make/options b/applications/solvers/modules/fluid/compressibleVoF/Make/options index 41a7aab42e..9dde8453ad 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/Make/options +++ b/applications/solvers/modules/fluid/compressibleVoF/Make/options @@ -1,11 +1,14 @@ EXE_INC = \ -I$(FOAM_SOLVERS)/modules/fluid/fluidSolver/lnInclude \ - -IcompressibleTwoPhaseMixture \ -IcompressibleInterPhaseTransportModel/lnInclude \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/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/compressibleTwoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \ @@ -14,15 +17,14 @@ EXE_INC = \ LIB_LIBS = \ -lfluidSolver \ - -lcompressibleTwoPhaseMixture \ - -ltwoPhaseSurfaceTension \ - -lfluidThermophysicalModels \ - -ltwoPhaseMixture \ - -ltwoPhaseProperties \ - -linterfaceProperties \ -lcompressibleInterPhaseTransportModel \ + -lphysicalProperties \ + -lfluidThermophysicalModels \ + -linterfaceCompression \ + -lcompressibleInterfaceProperties \ + -limmiscibleCompressibleTwoPhaseMixture \ -lfiniteVolume \ + -lmeshTools \ -lfvModels \ -lfvConstraints \ - -lmeshTools \ -lsampling diff --git a/applications/solvers/modules/fluid/compressibleVoF/compressibleInterPhaseTransportModel/Make/options b/applications/solvers/modules/fluid/compressibleVoF/compressibleInterPhaseTransportModel/Make/options index 4e6aea9097..5a5bd9f0ba 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/compressibleInterPhaseTransportModel/Make/options +++ b/applications/solvers/modules/fluid/compressibleVoF/compressibleInterPhaseTransportModel/Make/options @@ -1,25 +1,22 @@ 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)/MomentumTransportModels/compressible/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ + -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -lcompressibleTwoPhaseMixture \ + -lphysicalProperties \ -lfluidThermophysicalModels \ - -lspecie \ - -ltwoPhaseMixture \ - -ltwoPhaseProperties \ - -linterfaceProperties \ + -limmiscibleCompressibleTwoPhaseMixture \ -lmomentumTransportModels \ -lcompressibleMomentumTransportModels \ -lphaseCompressibleMomentumTransportModels \ - -lphysicalProperties \ -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/modules/fluid/compressibleVoF/compressibleInterPhaseTransportModel/compressibleInterPhaseTransportModel.H b/applications/solvers/modules/fluid/compressibleVoF/compressibleInterPhaseTransportModel/compressibleInterPhaseTransportModel.H index c3bc547a83..a5f8eeadf2 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/compressibleInterPhaseTransportModel/compressibleInterPhaseTransportModel.H +++ b/applications/solvers/modules/fluid/compressibleVoF/compressibleInterPhaseTransportModel/compressibleInterPhaseTransportModel.H @@ -45,7 +45,7 @@ SourceFiles #define compressibleInterPhaseTransportModel_H #include "twoPhaseMixture.H" -#include "compressibleTwoPhaseMixture.H" +#include "immiscibleCompressibleTwoPhaseMixture.H" #include "compressibleMomentumTransportModels.H" #include "phaseCompressibleMomentumTransportModel.H" diff --git a/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.C b/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.C index bd2371b9f7..1158b13cbf 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.C +++ b/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.C @@ -93,7 +93,7 @@ Foam::solvers::compressibleVoF::compressibleVoF(fvMesh& mesh) linearInterpolate(U) & mesh.Sf() ), - mixture(U, phi), + mixture(U), alpha1(mixture.alpha1()), diff --git a/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.H b/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.H index 15747a9ce3..95c1b56acd 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.H +++ b/applications/solvers/modules/fluid/compressibleVoF/compressibleVoF.H @@ -92,7 +92,7 @@ protected: // Phase properties //- The compressible two-phase mixture - compressibleTwoPhaseMixture mixture; + immiscibleCompressibleTwoPhaseMixture mixture; //- Reference to the primary phase-fraction volScalarField& alpha1; diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/files b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/files index 09ae4132a0..b52669d49e 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/files +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/files @@ -1,9 +1,3 @@ -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/fvModels/VoFCavitation/Make/options b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/options index a77b3c5b1f..682bbd15a2 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/options +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/Make/options @@ -1,19 +1,17 @@ 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)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/compressibleCavitation/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -lcompressibleTwoPhaseMixture \ - -lfluidThermophysicalModels \ - -lspecie \ -lphysicalProperties \ - -ltwoPhaseMixture \ - -ltwoPhaseProperties \ - -linterfaceProperties \ + -lfluidThermophysicalModels \ + -lcompressibleTwoPhaseMixture \ + -lcompressibleCavitationModels \ -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/Make/options b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/Make/options index 87e98927d5..62b3d5cd0b 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/Make/options +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFClouds/Make/options @@ -1,22 +1,18 @@ 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)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/parcel/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -lcompressibleTwoPhaseMixture \ - -lfluidThermophysicalModels \ - -lspecie \ - -ltwoPhaseMixture \ - -ltwoPhaseProperties \ - -linterfaceProperties \ -lphysicalProperties \ + -lfluidThermophysicalModels \ + -lcompressibleTwoPhaseMixture \ -llagrangian \ -llagrangianParcel \ -llagrangianParcelTurbulence \ diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/Make/options b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/Make/options index a77b3c5b1f..40f5c43cb1 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/Make/options +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSolidificationMeltingSource/Make/options @@ -1,19 +1,15 @@ 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)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -lcompressibleTwoPhaseMixture \ - -lfluidThermophysicalModels \ - -lspecie \ -lphysicalProperties \ - -ltwoPhaseMixture \ - -ltwoPhaseProperties \ - -linterfaceProperties \ + -lfluidThermophysicalModels \ + -lcompressibleTwoPhaseMixture \ -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/Make/options b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/Make/options index 1033dbb79e..ca87abba16 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/Make/options +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFSurfaceFilm/Make/options @@ -1,22 +1,18 @@ 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)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -lcompressibleTwoPhaseMixture \ - -lfluidThermophysicalModels \ - -lspecie \ - -ltwoPhaseMixture \ - -ltwoPhaseProperties \ - -linterfaceProperties \ -lphysicalProperties \ + -lfluidThermophysicalModels \ + -lcompressibleTwoPhaseMixture \ -lsurfaceFilmModels \ -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/Make/options b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/Make/options index 75a5cff41f..5a5bd9f0ba 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/Make/options +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/Make/options @@ -1,9 +1,10 @@ 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)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \ @@ -11,14 +12,11 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -lcompressibleTwoPhaseMixture \ - -lfluidThermophysicalModels \ - -lspecie \ -lphysicalProperties \ - -ltwoPhaseMixture \ - -ltwoPhaseProperties \ - -linterfaceProperties \ + -lfluidThermophysicalModels \ + -limmiscibleCompressibleTwoPhaseMixture \ -lmomentumTransportModels \ -lcompressibleMomentumTransportModels \ + -lphaseCompressibleMomentumTransportModels \ -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C index c42485cbb0..93e10ae00d 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "VoFTurbulenceDamping.H" -#include "compressibleTwoPhaseMixture.H" +#include "immiscibleCompressibleTwoPhaseMixture.H" #include "interfaceProperties.H" #include "compressibleMomentumTransportModel.H" #include "fvMatrix.H" @@ -66,7 +66,7 @@ Foam::fv::compressible::VoFTurbulenceDamping::VoFTurbulenceDamping delta_("delta", dimLength, dict), mixture_ ( - mesh.lookupObject + mesh.lookupObject ( "phaseProperties" ) diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.H b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.H index cd92dab5b0..00af4dc97d 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.H +++ b/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFTurbulenceDamping/VoFTurbulenceDamping.H @@ -81,7 +81,7 @@ SourceFiles namespace Foam { -class compressibleTwoPhaseMixture; +class immiscibleCompressibleTwoPhaseMixture; class interfaceProperties; class compressibleMomentumTransportModel; @@ -111,7 +111,7 @@ class VoFTurbulenceDamping dimensionedScalar delta_; //- Reference to the mixture properties - const compressibleTwoPhaseMixture& mixture_; + const immiscibleCompressibleTwoPhaseMixture& mixture_; //- Reference to the interface properties const interfaceProperties& interface_; diff --git a/applications/solvers/modules/fluid/compressibleVoF/surfaceTensionModels/Make/files b/applications/solvers/modules/fluid/compressibleVoF/surfaceTensionModels/Make/files deleted file mode 100644 index fa34a83824..0000000000 --- a/applications/solvers/modules/fluid/compressibleVoF/surfaceTensionModels/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -liquidProperties/liquidPropertiesSurfaceTension.C - -LIB = $(FOAM_LIBBIN)/libtwoPhaseSurfaceTension diff --git a/applications/solvers/multiphase/cavitatingFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/Make/options index aa980c3790..d472ff3fd7 100644 --- a/applications/solvers/multiphase/cavitatingFoam/Make/options +++ b/applications/solvers/multiphase/cavitatingFoam/Make/options @@ -1,8 +1,10 @@ EXE_INC = \ -I$(LIB_SRC)/physicalProperties/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/incompressibleTwoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/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/incompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude \ @@ -10,11 +12,13 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ - -lmomentumTransportModels \ + -lphysicalProperties \ + -linterfaceCompression \ -lincompressibleTwoPhaseMixture \ + -lmomentumTransportModels \ -lincompressibleMomentumTransportModels \ -lbarotropicCompressibilityModel \ -lfiniteVolume \ + -lmeshTools \ -lfvModels \ - -lfvConstraints \ - -lmeshTools + -lfvConstraints diff --git a/applications/solvers/multiphase/cavitatingFoam/createFields.H b/applications/solvers/multiphase/cavitatingFoam/createFields.H index 4757e9bbb3..9c9a521fb3 100644 --- a/applications/solvers/multiphase/cavitatingFoam/createFields.H +++ b/applications/solvers/multiphase/cavitatingFoam/createFields.H @@ -61,7 +61,7 @@ surfaceScalarField rhoPhi Info<< "Reading phaseProperties\n" << endl; -incompressibleTwoPhaseMixture mixture(U, phi); +incompressibleTwoPhaseMixture mixture(mesh); volScalarField& alphav(mixture.alpha1()); alphav.oldTime(); diff --git a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Make/options b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Make/options index 7574df4830..14c0bcbb5e 100644 --- a/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Make/options +++ b/applications/solvers/multiphase/compressibleMultiphaseInterFoam/Make/options @@ -4,7 +4,8 @@ EXE_INC = \ -IcompressibleMultiphaseMixture/lnInclude \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/VoF \ + -I$(LIB_SRC)/twoPhaseModels/interfaceCompression/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ @@ -13,8 +14,10 @@ EXE_INC = \ EXE_LIBS = \ -lcompressibleMultiphaseMixture \ + -lphysicalProperties \ -lfluidThermophysicalModels \ -lspecie \ + -linterfaceCompression \ -linterfaceProperties \ -lmomentumTransportModels \ -lcompressibleMomentumTransportModels \ diff --git a/applications/solvers/multiphase/driftFluxFoam/Make/options b/applications/solvers/multiphase/driftFluxFoam/Make/options index ac1bc9f5ed..9e66acd1df 100644 --- a/applications/solvers/multiphase/driftFluxFoam/Make/options +++ b/applications/solvers/multiphase/driftFluxFoam/Make/options @@ -6,6 +6,8 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/physicalProperties/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/VoF \ + -I$(LIB_SRC)/twoPhaseModels/interfaceCompression/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude @@ -13,10 +15,13 @@ EXE_INC = \ EXE_LIBS = \ -ldriftFluxTransportModels \ -ldriftFluxRelativeVelocityModels \ + -lphysicalProperties \ + -linterfaceCompression \ + -ltwoPhaseMixture \ + -lmomentumTransportModels \ + -lcompressibleMomentumTransportModels \ -lfiniteVolume \ -lmeshTools \ -lsampling \ -lfvModels \ - -lfvConstraints \ - -lmomentumTransportModels \ - -lcompressibleMomentumTransportModels + -lfvConstraints diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/Make/options b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/Make/options index 2224518518..cbbb4837ea 100644 --- a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/Make/options +++ b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/Make/options @@ -1,13 +1,12 @@ EXE_INC = \ -I../incompressibleTwoPhaseInteractingMixture \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -ltwoPhaseMixture \ -lphysicalProperties \ + -ltwoPhaseMixture \ -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/Make/options b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/Make/options index 38e2b6e929..2007f0db1f 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/Make/options +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/Make/options @@ -8,5 +8,6 @@ EXE_INC = \ LIB_LIBS = \ -lphysicalProperties \ + -ltwoPhaseMixture \ -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/multiphase/interFoam/Make/options b/applications/solvers/multiphase/interFoam/Make/options index d8f7bb4276..be26fad33d 100644 --- a/applications/solvers/multiphase/interFoam/Make/options +++ b/applications/solvers/multiphase/interFoam/Make/options @@ -1,24 +1,29 @@ EXE_INC = \ -IincompressibleInterPhaseTransportModel/lnInclude \ -I$(LIB_SRC)/physicalProperties/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/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/incompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/phaseIncompressible/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ + -lincompressibleInterPhaseTransportModel \ + -lphysicalProperties \ + -linterfaceCompression \ -limmiscibleIncompressibleTwoPhaseMixture \ -lmomentumTransportModels \ -lincompressibleMomentumTransportModels \ - -lincompressibleInterPhaseTransportModel \ + -lphaseIncompressibleMomentumTransportModels \ -lfiniteVolume \ + -lmeshTools \ -lfvModels \ -lfvConstraints \ - -lmeshTools + -lsampling diff --git a/applications/solvers/multiphase/interFoam/createFields.H b/applications/solvers/multiphase/interFoam/createFields.H index 1f2f5f5312..115e9fda76 100644 --- a/applications/solvers/multiphase/interFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/createFields.H @@ -32,7 +32,7 @@ volVectorField U Info<< "Reading phaseProperties\n" << endl; -immiscibleIncompressibleTwoPhaseMixture mixture(U, phi); +immiscibleIncompressibleTwoPhaseMixture mixture(U); // Need to store rho for ddt(rho, U) diff --git a/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/Make/options b/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/Make/options index c7c4844682..9fcfbadd5c 100644 --- a/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/Make/options +++ b/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/Make/options @@ -3,14 +3,13 @@ EXE_INC = \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/incompressibleTwoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/cavitation/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/incompressibleCavitation/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ -lphysicalProperties \ - -limmiscibleIncompressibleTwoPhaseMixture \ - -lcavitationModels \ + -lincompressibleTwoPhaseMixture \ + -lincompressibleCavitationModels \ -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.C b/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.C index 5fa4b3b97f..7723e4362c 100644 --- a/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.C +++ b/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "VoFCavitation.H" -#include "immiscibleIncompressibleTwoPhaseMixture.H" +#include "incompressibleTwoPhaseMixture.H" #include "fvcDdt.H" #include "fvcDiv.H" #include "fvmSup.H" @@ -62,7 +62,7 @@ Foam::fv::VoFCavitation::VoFCavitation mixture_ ( - mesh.lookupObjectRef + mesh.lookupObjectRef ( "phaseProperties" ) diff --git a/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.H b/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.H index ed5f956f96..8989bd0c55 100644 --- a/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.H +++ b/applications/solvers/multiphase/interFoam/fvModels/VoFCavitation/VoFCavitation.H @@ -86,7 +86,7 @@ SourceFiles namespace Foam { -class immiscibleIncompressibleTwoPhaseMixture; +class incompressibleTwoPhaseMixture; namespace fv { @@ -102,7 +102,7 @@ class VoFCavitation // Private Data //- Reference to the mixture properties - const immiscibleIncompressibleTwoPhaseMixture& mixture_; + const incompressibleTwoPhaseMixture& mixture_; autoPtr cavitation_; diff --git a/applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/Make/options b/applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/Make/options index 8480ddb63a..298bfbd3c2 100644 --- a/applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/Make/options +++ b/applications/solvers/multiphase/interFoam/fvModels/VoFTurbulenceDamping/Make/options @@ -12,8 +12,6 @@ EXE_INC = \ LIB_LIBS = \ -lphysicalProperties \ -limmiscibleIncompressibleTwoPhaseMixture \ - -ltwoPhaseMixture \ - -linterfaceProperties \ -lmomentumTransportModels \ -lincompressibleMomentumTransportModels \ -lfiniteVolume \ diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/Make/options b/applications/solvers/multiphase/interFoam/interMixingFoam/Make/options index 2dc2547b35..13d2607a0a 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/Make/options +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/Make/options @@ -2,7 +2,8 @@ EXE_INC = \ -I. \ -I.. \ -I$(LIB_SRC)/physicalProperties/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/VoF \ + -I$(LIB_SRC)/twoPhaseModels/interfaceCompression/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle \ -IimmiscibleIncompressibleThreePhaseMixture \ @@ -15,9 +16,9 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ - -ltwoPhaseMixture \ - -ltwoPhaseProperties \ -lphysicalProperties \ + -linterfaceCompression \ + -ltwoPhaseProperties \ -lmomentumTransportModels \ -lincompressibleMomentumTransportModels \ -lfiniteVolume \ diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H b/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H index 29db185128..bf92375dc8 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H @@ -30,7 +30,7 @@ volVectorField U #include "createPhi.H" -immiscibleIncompressibleThreePhaseMixture mixture(U, phi); +immiscibleIncompressibleThreePhaseMixture mixture(U); volScalarField& alpha1(mixture.alpha1()); volScalarField& alpha2(mixture.alpha2()); diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/immiscibleIncompressibleThreePhaseMixture/immiscibleIncompressibleThreePhaseMixture.C b/applications/solvers/multiphase/interFoam/interMixingFoam/immiscibleIncompressibleThreePhaseMixture/immiscibleIncompressibleThreePhaseMixture.C index 6be46284b6..4046206289 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/immiscibleIncompressibleThreePhaseMixture/immiscibleIncompressibleThreePhaseMixture.C +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/immiscibleIncompressibleThreePhaseMixture/immiscibleIncompressibleThreePhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,15 +31,11 @@ License Foam::immiscibleIncompressibleThreePhaseMixture:: immiscibleIncompressibleThreePhaseMixture ( - const volVectorField& U, - const surfaceScalarField& phi + const volVectorField& U ) : - incompressibleThreePhaseMixture(U, phi), - threePhaseInterfaceProperties - ( - static_cast(*this) - ) + incompressibleThreePhaseMixture(U.mesh()), + threePhaseInterfaceProperties(*this, alpha1(), alpha2(), alpha3(), U) {} diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/immiscibleIncompressibleThreePhaseMixture/immiscibleIncompressibleThreePhaseMixture.H b/applications/solvers/multiphase/interFoam/interMixingFoam/immiscibleIncompressibleThreePhaseMixture/immiscibleIncompressibleThreePhaseMixture.H index 9cd561c17e..998228861e 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/immiscibleIncompressibleThreePhaseMixture/immiscibleIncompressibleThreePhaseMixture.H +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/immiscibleIncompressibleThreePhaseMixture/immiscibleIncompressibleThreePhaseMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,17 +52,12 @@ class immiscibleIncompressibleThreePhaseMixture public incompressibleThreePhaseMixture, public threePhaseInterfaceProperties { - public: // Constructors - //- Construct from components - immiscibleIncompressibleThreePhaseMixture - ( - const volVectorField& U, - const surfaceScalarField& phi - ); + //- Construct from the mixture velocity + immiscibleIncompressibleThreePhaseMixture(const volVectorField& U); //- Destructor diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C b/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C index 9544888fd9..c7c0cf8ca0 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,8 +45,7 @@ void Foam::incompressibleThreePhaseMixture::calcNu() Foam::incompressibleThreePhaseMixture::incompressibleThreePhaseMixture ( - const volVectorField& U, - const surfaceScalarField& phi + const fvMesh& mesh ) : IOdictionary @@ -54,8 +53,8 @@ Foam::incompressibleThreePhaseMixture::incompressibleThreePhaseMixture IOobject ( "phaseProperties", - U.time().constant(), - U.db(), + mesh.time().constant(), + mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) @@ -70,12 +69,12 @@ Foam::incompressibleThreePhaseMixture::incompressibleThreePhaseMixture IOobject ( IOobject::groupName("alpha", phase1Name_), - U.time().timeName(), - U.mesh(), + mesh.time().timeName(), + mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), - U.mesh() + mesh ), alpha2_ @@ -83,12 +82,12 @@ Foam::incompressibleThreePhaseMixture::incompressibleThreePhaseMixture IOobject ( IOobject::groupName("alpha", phase2Name_), - U.time().timeName(), - U.mesh(), + mesh.time().timeName(), + mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), - U.mesh() + mesh ), alpha3_ @@ -96,33 +95,30 @@ Foam::incompressibleThreePhaseMixture::incompressibleThreePhaseMixture IOobject ( IOobject::groupName("alpha", phase3Name_), - U.time().timeName(), - U.mesh(), + mesh.time().timeName(), + mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), - U.mesh() + mesh ), - U_(U), - phi_(phi), - nu_ ( IOobject ( "nu", - U.time().timeName(), - U.db() + mesh.time().timeName(), + mesh ), - U.mesh(), + mesh, dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), 0), calculatedFvPatchScalarField::typeName ), - nuModel1_(viscosityModel::New(U.mesh(), phase1Name_)), - nuModel2_(viscosityModel::New(U.mesh(), phase2Name_)), - nuModel3_(viscosityModel::New(U.mesh(), phase3Name_)), + nuModel1_(viscosityModel::New(mesh, phase1Name_)), + nuModel2_(viscosityModel::New(mesh, phase2Name_)), + nuModel3_(viscosityModel::New(mesh, phase3Name_)), rho1_("rho", dimDensity, nuModel1_()), rho2_("rho", dimDensity, nuModel2_()), diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.H b/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.H index 62315a44ef..f8321f96a0 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.H +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/incompressibleThreePhaseMixture/incompressibleThreePhaseMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,9 +64,6 @@ class incompressibleThreePhaseMixture volScalarField alpha2_; volScalarField alpha3_; - const volVectorField& U_; - const surfaceScalarField& phi_; - volScalarField nu_; autoPtr nuModel1_; @@ -88,12 +85,8 @@ public: // Constructors - //- Construct from components - incompressibleThreePhaseMixture - ( - const volVectorField& U, - const surfaceScalarField& phi - ); + //- Construct from a mesh + incompressibleThreePhaseMixture(const fvMesh& mesh); //- Destructor @@ -166,18 +159,6 @@ public: return rho3_; }; - //- Return the velocity - const volVectorField& U() const - { - return U_; - } - - //- Return the flux - const surfaceScalarField& phi() const - { - return phi_; - } - //- Return const-access to phase1 viscosityModel const viscosityModel& nuModel1() const { diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C index 21e92d01b3..a6fa9d63d5 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C @@ -38,29 +38,25 @@ void Foam::threePhaseInterfaceProperties::correctContactAngle surfaceVectorField::Boundary& nHatb ) const { - const volScalarField::Boundary& alpha1 = - mixture_.alpha1().boundaryField(); - const volScalarField::Boundary& alpha2 = - mixture_.alpha2().boundaryField(); - const volScalarField::Boundary& alpha3 = - mixture_.alpha3().boundaryField(); - const volVectorField::Boundary& U = - mixture_.U().boundaryField(); + const volScalarField::Boundary& alpha1Bf = alpha1_.boundaryField(); + const volScalarField::Boundary& alpha2Bf = alpha2_.boundaryField(); + const volScalarField::Boundary& alpha3Bf = alpha3_.boundaryField(); + const volVectorField::Boundary& UBf = U_.boundaryField(); - const fvMesh& mesh = mixture_.U().mesh(); + const fvMesh& mesh = alpha1_.mesh(); const fvBoundaryMesh& boundary = mesh.boundary(); forAll(boundary, patchi) { - if (isA(alpha1[patchi])) + if (isA(alpha1Bf[patchi])) { const alphaContactAngleFvPatchScalarField& a2cap = refCast - (alpha2[patchi]); + (alpha2Bf[patchi]); const alphaContactAngleFvPatchScalarField& a3cap = refCast - (alpha3[patchi]); + (alpha3Bf[patchi]); scalarField twoPhaseAlpha2(max(a2cap, scalar(0))); scalarField twoPhaseAlpha3(max(a3cap, scalar(0))); @@ -79,8 +75,8 @@ void Foam::threePhaseInterfaceProperties::correctContactAngle ( degToRad ( - twoPhaseAlpha2*(180 - a2cap.theta(U[patchi], nHatp)) - + twoPhaseAlpha3*(180 - a3cap.theta(U[patchi], nHatp)) + twoPhaseAlpha2*(180 - a2cap.theta(UBf[patchi], nHatp)) + + twoPhaseAlpha3*(180 - a3cap.theta(UBf[patchi], nHatp)) ) ); @@ -114,13 +110,11 @@ void Foam::threePhaseInterfaceProperties::correctContactAngle void Foam::threePhaseInterfaceProperties::calculateK() { - const volScalarField& alpha1 = mixture_.alpha1(); - - const fvMesh& mesh = alpha1.mesh(); + const fvMesh& mesh = alpha1_.mesh(); const surfaceVectorField& Sf = mesh.Sf(); // Cell gradient of alpha - volVectorField gradAlpha(fvc::grad(alpha1)); + volVectorField gradAlpha(fvc::grad(alpha1_)); // Interpolated face-gradient of alpha surfaceVectorField gradAlphaf(fvc::interpolate(gradAlpha)); @@ -148,24 +142,29 @@ void Foam::threePhaseInterfaceProperties::calculateK() Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties ( - const incompressibleThreePhaseMixture& mixture + const IOdictionary& dict, + volScalarField& alpha1, + volScalarField& alpha2, + volScalarField& alpha3, + const volVectorField& U ) : - mixture_(mixture), + alpha1_(alpha1), + alpha2_(alpha2), + alpha3_(alpha3), + U_(U), + cAlpha_ ( - mixture.U().mesh().solution().solverDict - ( - mixture_.alpha1().name() - ).lookup("cAlpha") + U.mesh().solution().solverDict(alpha1_.name()).lookup("cAlpha") ), - sigma12_("sigma12", dimensionSet(1, 0, -2, 0, 0), mixture), - sigma13_("sigma13", dimensionSet(1, 0, -2, 0, 0), mixture), + sigma12_("sigma12", dimensionSet(1, 0, -2, 0, 0), dict), + sigma13_("sigma13", dimensionSet(1, 0, -2, 0, 0), dict), deltaN_ ( "deltaN", - 1e-8/pow(average(mixture.U().mesh().V()), 1.0/3.0) + 1e-8/pow(average(U.mesh().V()), 1.0/3.0) ), nHatf_ @@ -173,10 +172,10 @@ Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties IOobject ( "nHatf", - mixture.alpha1().time().timeName(), - mixture.alpha1().mesh() + alpha1_.time().timeName(), + alpha1_.mesh() ), - mixture.alpha1().mesh(), + alpha1_.mesh(), dimensionedScalar(dimArea, 0) ), @@ -185,10 +184,10 @@ Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties IOobject ( "interfaceProperties:K", - mixture.alpha1().time().timeName(), - mixture.alpha1().mesh() + alpha1_.time().timeName(), + alpha1_.mesh() ), - mixture.alpha1().mesh(), + alpha1_.mesh(), dimensionedScalar(dimless/dimLength, 0) ) { @@ -201,7 +200,7 @@ Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties Foam::tmp Foam::threePhaseInterfaceProperties::surfaceTensionForce() const { - return fvc::interpolate(sigmaK())*fvc::snGrad(mixture_.alpha1()); + return fvc::interpolate(sigmaK())*fvc::snGrad(alpha1_); } @@ -210,8 +209,8 @@ Foam::threePhaseInterfaceProperties::nearInterface() const { return max ( - pos0(mixture_.alpha1() - 0.01)*pos0(0.99 - mixture_.alpha1()), - pos0(mixture_.alpha2() - 0.01)*pos0(0.99 - mixture_.alpha2()) + pos0(alpha1_ - 0.01)*pos0(0.99 - alpha1_), + pos0(alpha2_ - 0.01)*pos0(0.99 - alpha2_) ); } diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H index 08b478b5cd..d7d718789a 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,7 +53,17 @@ class threePhaseInterfaceProperties { // Private Data - const incompressibleThreePhaseMixture& mixture_; + //- Volume fraction of phase 1 + volScalarField& alpha1_; + + //- Volume fraction of phase 2 + volScalarField& alpha2_; + + //- Volume fraction of phase 3 + volScalarField& alpha3_; + + //- Mixture velocity + const volVectorField& U_; //- Compression coefficient scalar cAlpha_; @@ -67,7 +77,10 @@ class threePhaseInterfaceProperties //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; + //- ... surfaceScalarField nHatf_; + + //- ... volScalarField K_; @@ -89,10 +102,15 @@ public: // Constructors - //- Construct from volume fraction field alpha and IOdictionary + //- Construct from dictionary, volume fraction fields and mixture + // velocity threePhaseInterfaceProperties ( - const incompressibleThreePhaseMixture& mixture + const IOdictionary& dict, + volScalarField& alpha1, + volScalarField& alpha2, + volScalarField& alpha3, + const volVectorField& U ); //- Disallow default bitwise copy construction @@ -104,6 +122,11 @@ public: // Member Functions + inline const volVectorField& U() const + { + return U_; + } + scalar cAlpha() const { return cAlpha_; @@ -126,8 +149,8 @@ public: tmp sigma() const { - volScalarField limitedAlpha2(max(mixture_.alpha2(), scalar(0))); - volScalarField limitedAlpha3(max(mixture_.alpha3(), scalar(0))); + volScalarField limitedAlpha2(max(alpha2_, scalar(0))); + volScalarField limitedAlpha3(max(alpha3_, scalar(0))); return (limitedAlpha2*sigma12_ + limitedAlpha3*sigma13_) diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Make/options b/applications/solvers/multiphase/multiphaseInterFoam/Make/options index d1ee99db7b..08b39c670a 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/Make/options +++ b/applications/solvers/multiphase/multiphaseInterFoam/Make/options @@ -1,7 +1,8 @@ EXE_INC = \ -ImultiphaseMixture/lnInclude \ -I$(LIB_SRC)/physicalProperties/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/VoF \ + -I$(LIB_SRC)/twoPhaseModels/interfaceCompression/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \ @@ -11,8 +12,9 @@ EXE_INC = \ EXE_LIBS = \ -lmultiphaseInterFoam \ - -linterfaceProperties \ -lphysicalProperties \ + -linterfaceCompression \ + -linterfaceProperties \ -lmomentumTransportModels \ -lincompressibleMomentumTransportModels \ -lfiniteVolume \ diff --git a/src/functionObjects/solvers/Make/options b/src/functionObjects/solvers/Make/options index 06e6f834ef..20d0eb79e1 100644 --- a/src/functionObjects/solvers/Make/options +++ b/src/functionObjects/solvers/Make/options @@ -1,21 +1,21 @@ EXE_INC = \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/interfaceCompression/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -lfluidThermophysicalModels \ -lphysicalProperties \ + -lfluidThermophysicalModels \ + -lspecie \ + -linterfaceCompression \ -lmomentumTransportModels \ -lincompressibleMomentumTransportModels \ -lcompressibleMomentumTransportModels \ - -ltwoPhaseMixture \ - -lspecie \ -lfiniteVolume \ -lmeshTools \ -lfvModels \ diff --git a/src/twoPhaseModels/Allwmake b/src/twoPhaseModels/Allwmake index 37cb35f58d..c6ec56afbb 100755 --- a/src/twoPhaseModels/Allwmake +++ b/src/twoPhaseModels/Allwmake @@ -4,11 +4,19 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments -wmake $targetType twoPhaseMixture -wmake $targetType interfaceProperties +wmake $targetType interfaceCompression + wmake $targetType twoPhaseProperties +wmake $targetType interfaceProperties +wmake $targetType compressibleInterfaceProperties + +wmake $targetType twoPhaseMixture wmake $targetType incompressibleTwoPhaseMixture +wmake $targetType compressibleTwoPhaseMixture wmake $targetType immiscibleIncompressibleTwoPhaseMixture -wmake $targetType cavitation +wmake $targetType immiscibleCompressibleTwoPhaseMixture + +wmake $targetType incompressibleCavitation +wmake $targetType compressibleCavitation #------------------------------------------------------------------------------ diff --git a/src/twoPhaseModels/twoPhaseMixture/VoF/alphaControls.H b/src/twoPhaseModels/VoF/alphaControls.H similarity index 100% rename from src/twoPhaseModels/twoPhaseMixture/VoF/alphaControls.H rename to src/twoPhaseModels/VoF/alphaControls.H diff --git a/src/twoPhaseModels/twoPhaseMixture/VoF/alphaCourantNo.H b/src/twoPhaseModels/VoF/alphaCourantNo.H similarity index 100% rename from src/twoPhaseModels/twoPhaseMixture/VoF/alphaCourantNo.H rename to src/twoPhaseModels/VoF/alphaCourantNo.H diff --git a/src/twoPhaseModels/twoPhaseMixture/VoF/alphaEqn.H b/src/twoPhaseModels/VoF/alphaEqn.H similarity index 100% rename from src/twoPhaseModels/twoPhaseMixture/VoF/alphaEqn.H rename to src/twoPhaseModels/VoF/alphaEqn.H diff --git a/src/twoPhaseModels/twoPhaseMixture/VoF/alphaEqnSubCycle.H b/src/twoPhaseModels/VoF/alphaEqnSubCycle.H similarity index 100% rename from src/twoPhaseModels/twoPhaseMixture/VoF/alphaEqnSubCycle.H rename to src/twoPhaseModels/VoF/alphaEqnSubCycle.H diff --git a/src/twoPhaseModels/twoPhaseMixture/VoF/alphaScheme.H b/src/twoPhaseModels/VoF/alphaScheme.H similarity index 100% rename from src/twoPhaseModels/twoPhaseMixture/VoF/alphaScheme.H rename to src/twoPhaseModels/VoF/alphaScheme.H diff --git a/src/twoPhaseModels/twoPhaseMixture/VoF/createAlphaFluxes.H b/src/twoPhaseModels/VoF/createAlphaFluxes.H similarity index 100% rename from src/twoPhaseModels/twoPhaseMixture/VoF/createAlphaFluxes.H rename to src/twoPhaseModels/VoF/createAlphaFluxes.H diff --git a/src/twoPhaseModels/twoPhaseMixture/VoF/setDeltaT.H b/src/twoPhaseModels/VoF/setDeltaT.H similarity index 100% rename from src/twoPhaseModels/twoPhaseMixture/VoF/setDeltaT.H rename to src/twoPhaseModels/VoF/setDeltaT.H diff --git a/src/twoPhaseModels/twoPhaseMixture/VoF/setRDeltaT.H b/src/twoPhaseModels/VoF/setRDeltaT.H similarity index 100% rename from src/twoPhaseModels/twoPhaseMixture/VoF/setRDeltaT.H rename to src/twoPhaseModels/VoF/setRDeltaT.H diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Kunz/Kunz.C b/src/twoPhaseModels/compressibleCavitation/Kunz/Kunz.C similarity index 84% rename from applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Kunz/Kunz.C rename to src/twoPhaseModels/compressibleCavitation/Kunz/Kunz.C index 14832866fb..11c8b13a71 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Kunz/Kunz.C +++ b/src/twoPhaseModels/compressibleCavitation/Kunz/Kunz.C @@ -46,10 +46,10 @@ namespace cavitationModels Foam::compressible::cavitationModels::Kunz::Kunz ( const dictionary& dict, - const compressibleTwoPhaseMixture& mixture + const compressibleTwoPhases& phases ) : - cavitationModel(dict, mixture), + cavitationModel(dict, phases), UInf_("UInf", dimVelocity, dict), tInf_("tInf", dimTime, dict), @@ -68,17 +68,17 @@ Foam::Pair> Foam::compressible::cavitationModels::Kunz::mDotAlphal() const { const volScalarField::Internal& p = - mixture_.alpha1().db().lookupObject("p"); + phases_.mesh().lookupObject("p"); - const volScalarField::Internal mcCoeff_(Cc_*mixture_.rho2()()/tInf_); + const volScalarField::Internal mcCoeff_(Cc_*phases_.rho2()()/tInf_); const volScalarField::Internal mvCoeff_ ( - Cv_*mixture_.rho2()()/(0.5*mixture_.rho1()()*sqr(UInf_)*tInf_) + Cv_*phases_.rho2()()/(0.5*phases_.rho1()()*sqr(UInf_)*tInf_) ); const volScalarField::Internal limitedAlpha1 ( - min(max(mixture_.alpha1()(), scalar(0)), scalar(1)) + min(max(phases_.alpha1()(), scalar(0)), scalar(1)) ); return Pair> @@ -95,17 +95,17 @@ Foam::Pair> Foam::compressible::cavitationModels::Kunz::mDotP() const { const volScalarField::Internal& p = - mixture_.alpha1().db().lookupObject("p"); + phases_.mesh().lookupObject("p"); - const volScalarField::Internal mcCoeff_(Cc_*mixture_.rho2()()/tInf_); + const volScalarField::Internal mcCoeff_(Cc_*phases_.rho2()()/tInf_); const volScalarField::Internal mvCoeff_ ( - Cv_*mixture_.rho2()()/(0.5*mixture_.rho1()()*sqr(UInf_)*tInf_) + Cv_*phases_.rho2()()/(0.5*phases_.rho1()()*sqr(UInf_)*tInf_) ); const volScalarField::Internal limitedAlpha1 ( - min(max(mixture_.alpha1()(), scalar(0)), scalar(1)) + min(max(phases_.alpha1()(), scalar(0)), scalar(1)) ); return Pair> diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Kunz/Kunz.H b/src/twoPhaseModels/compressibleCavitation/Kunz/Kunz.H similarity index 97% rename from applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Kunz/Kunz.H rename to src/twoPhaseModels/compressibleCavitation/Kunz/Kunz.H index 6033f84f77..5525e709a3 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Kunz/Kunz.H +++ b/src/twoPhaseModels/compressibleCavitation/Kunz/Kunz.H @@ -86,11 +86,11 @@ public: // Constructors - //- Construct for mixture + //- Construct for phases Kunz ( const dictionary& dict, - const compressibleTwoPhaseMixture& mixture + const compressibleTwoPhases& phases ); diff --git a/src/twoPhaseModels/cavitation/Make/files b/src/twoPhaseModels/compressibleCavitation/Make/files similarity index 70% rename from src/twoPhaseModels/cavitation/Make/files rename to src/twoPhaseModels/compressibleCavitation/Make/files index 8d0a89b427..1f02f1b407 100644 --- a/src/twoPhaseModels/cavitation/Make/files +++ b/src/twoPhaseModels/compressibleCavitation/Make/files @@ -4,4 +4,4 @@ Kunz/Kunz.C Merkle/Merkle.C SchnerrSauer/SchnerrSauer.C -LIB = $(FOAM_LIBBIN)/libcavitationModels +LIB = $(FOAM_LIBBIN)/libcompressibleCavitationModels diff --git a/src/twoPhaseModels/compressibleCavitation/Make/options b/src/twoPhaseModels/compressibleCavitation/Make/options new file mode 100644 index 0000000000..3a9b9f8008 --- /dev/null +++ b/src/twoPhaseModels/compressibleCavitation/Make/options @@ -0,0 +1,19 @@ +EXE_INC = \ + -I$(LIB_SRC)/physicalProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/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/fvModels/VoFCavitation/cavitation/Merkle/Merkle.C b/src/twoPhaseModels/compressibleCavitation/Merkle/Merkle.C similarity index 88% rename from applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Merkle/Merkle.C rename to src/twoPhaseModels/compressibleCavitation/Merkle/Merkle.C index 74c5af3c72..2d576b9903 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Merkle/Merkle.C +++ b/src/twoPhaseModels/compressibleCavitation/Merkle/Merkle.C @@ -46,10 +46,10 @@ namespace cavitationModels Foam::compressible::cavitationModels::Merkle::Merkle ( const dictionary& dict, - const compressibleTwoPhaseMixture& mixture + const compressibleTwoPhases& phases ) : - cavitationModel(dict, mixture), + cavitationModel(dict, phases), UInf_("UInf", dimVelocity, dict), tInf_("tInf", dimTime, dict), @@ -70,11 +70,11 @@ Foam::Pair> Foam::compressible::cavitationModels::Merkle::mDotAlphal() const { const volScalarField::Internal& p = - mixture_.alpha1().db().lookupObject("p"); + phases_.mesh().lookupObject("p"); const volScalarField::Internal mvCoeff_ ( - Cv_*mixture_.rho1()()/(0.5*sqr(UInf_)*tInf_*mixture_.rho2()()) + Cv_*phases_.rho1()()/(0.5*sqr(UInf_)*tInf_*phases_.rho2()()) ); return Pair> @@ -89,16 +89,16 @@ Foam::Pair> Foam::compressible::cavitationModels::Merkle::mDotP() const { const volScalarField::Internal& p = - mixture_.alpha1().db().lookupObject("p"); + phases_.mesh().lookupObject("p"); const volScalarField::Internal limitedAlpha1 ( - min(max(mixture_.alpha1()(), scalar(0)), scalar(1)) + min(max(phases_.alpha1()(), scalar(0)), scalar(1)) ); const volScalarField::Internal mvCoeff_ ( - Cv_*mixture_.rho1()()/(0.5*sqr(UInf_)*tInf_*mixture_.rho2()()) + Cv_*phases_.rho1()()/(0.5*sqr(UInf_)*tInf_*phases_.rho2()()) ); return Pair> diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Merkle/Merkle.H b/src/twoPhaseModels/compressibleCavitation/Merkle/Merkle.H similarity index 97% rename from applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Merkle/Merkle.H rename to src/twoPhaseModels/compressibleCavitation/Merkle/Merkle.H index 05714406af..42538495c0 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/Merkle/Merkle.H +++ b/src/twoPhaseModels/compressibleCavitation/Merkle/Merkle.H @@ -82,11 +82,11 @@ public: // Constructors - //- Construct for mixture + //- Construct for phases Merkle ( const dictionary& dict, - const compressibleTwoPhaseMixture& mixture + const compressibleTwoPhases& phases ); diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/SchnerrSauer/SchnerrSauer.C b/src/twoPhaseModels/compressibleCavitation/SchnerrSauer/SchnerrSauer.C similarity index 88% rename from applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/SchnerrSauer/SchnerrSauer.C rename to src/twoPhaseModels/compressibleCavitation/SchnerrSauer/SchnerrSauer.C index b69d248b50..8056241eb8 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/SchnerrSauer/SchnerrSauer.C +++ b/src/twoPhaseModels/compressibleCavitation/SchnerrSauer/SchnerrSauer.C @@ -52,10 +52,10 @@ namespace cavitationModels Foam::compressible::cavitationModels::SchnerrSauer::SchnerrSauer ( const dictionary& dict, - const compressibleTwoPhaseMixture& mixture + const compressibleTwoPhases& phases ) : - cavitationModel(dict, mixture), + cavitationModel(dict, phases), n_("n", dimless/dimVolume, dict), dNuc_("dNuc", dimLength, dict), @@ -101,17 +101,17 @@ Foam::compressible::cavitationModels::SchnerrSauer::pCoeff { const volScalarField::Internal limitedAlpha1 ( - min(max(mixture_.alpha1()(), scalar(0)), scalar(1)) + min(max(phases_.alpha1()(), scalar(0)), scalar(1)) ); const volScalarField::Internal rho ( - limitedAlpha1*mixture_.rho1()() - + (scalar(1) - limitedAlpha1)*mixture_.rho2()() + limitedAlpha1*phases_.rho1()() + + (scalar(1) - limitedAlpha1)*phases_.rho2()() ); return - (3*mixture_.rho1()()*mixture_.rho2()())*sqrt(2/(3*mixture_.rho1()())) + (3*phases_.rho1()()*phases_.rho2()())*sqrt(2/(3*phases_.rho1()())) *rRb(limitedAlpha1)/(rho*sqrt(mag(p - pSat()) + 0.01*pSat())); } @@ -120,13 +120,13 @@ Foam::Pair> Foam::compressible::cavitationModels::SchnerrSauer::mDotAlphal() const { const volScalarField::Internal& p = - mixture_.alpha1().db().lookupObject("p"); + phases_.mesh().lookupObject("p"); const volScalarField::Internal pCoeff(this->pCoeff(p)); const volScalarField::Internal limitedAlpha1 ( - min(max(mixture_.alpha1()(), scalar(0)), scalar(1)) + min(max(phases_.alpha1()(), scalar(0)), scalar(1)) ); return Pair> @@ -142,13 +142,13 @@ Foam::Pair> Foam::compressible::cavitationModels::SchnerrSauer::mDotP() const { const volScalarField::Internal& p = - mixture_.alpha1().db().lookupObject("p"); + phases_.mesh().lookupObject("p"); const volScalarField::Internal pCoeff(this->pCoeff(p)); const volScalarField::Internal limitedAlpha1 ( - min(max(mixture_.alpha1()(), scalar(0)), scalar(1)) + min(max(phases_.alpha1()(), scalar(0)), scalar(1)) ); const volScalarField::Internal apCoeff(limitedAlpha1*pCoeff); diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/SchnerrSauer/SchnerrSauer.H b/src/twoPhaseModels/compressibleCavitation/SchnerrSauer/SchnerrSauer.H similarity index 97% rename from applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/SchnerrSauer/SchnerrSauer.H rename to src/twoPhaseModels/compressibleCavitation/SchnerrSauer/SchnerrSauer.H index 25db8bbf12..f77c5941bd 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/SchnerrSauer/SchnerrSauer.H +++ b/src/twoPhaseModels/compressibleCavitation/SchnerrSauer/SchnerrSauer.H @@ -102,11 +102,11 @@ public: // Constructors - //- Construct for mixture + //- Construct for phases SchnerrSauer ( const dictionary& dict, - const compressibleTwoPhaseMixture& mixture + const compressibleTwoPhases& phases ); diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModel.C b/src/twoPhaseModels/compressibleCavitation/cavitationModel/cavitationModel.C similarity index 96% rename from applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModel.C rename to src/twoPhaseModels/compressibleCavitation/cavitationModel/cavitationModel.C index 1a37106ca8..6b1771156d 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModel.C +++ b/src/twoPhaseModels/compressibleCavitation/cavitationModel/cavitationModel.C @@ -43,10 +43,10 @@ namespace compressible Foam::compressible::cavitationModel::cavitationModel ( const dictionary& dict, - const compressibleTwoPhaseMixture& mixture + const compressibleTwoPhases& phases ) : - mixture_(mixture), + phases_(phases), pSat_("pSat", dimPressure, dict.lookup("pSat")) {} diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModel.H b/src/twoPhaseModels/compressibleCavitation/cavitationModel/cavitationModel.H similarity index 92% rename from applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModel.H rename to src/twoPhaseModels/compressibleCavitation/cavitationModel/cavitationModel.H index 0f0b6f6180..a37a84df16 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModel.H +++ b/src/twoPhaseModels/compressibleCavitation/cavitationModel/cavitationModel.H @@ -35,7 +35,7 @@ SourceFiles #ifndef cavitationModel_H #define cavitationModel_H -#include "compressibleTwoPhaseMixture.H" +#include "compressibleTwoPhases.H" #include "fvMatricesFwd.H" #include "Pair.H" @@ -57,7 +57,7 @@ protected: // Protected data //- Mixture properties - const compressibleTwoPhaseMixture& mixture_; + const compressibleTwoPhases& phases_; //- Saturation vapour pressure dimensionedScalar pSat_; @@ -78,19 +78,19 @@ public: dictionary, ( const dictionary& dict, - const compressibleTwoPhaseMixture& mixture + const compressibleTwoPhases& phases ), - (dict, mixture) + (dict, phases) ); // Constructors - //- Construct for mixture + //- Construct for phases cavitationModel ( const dictionary& dict, - const compressibleTwoPhaseMixture& mixture + const compressibleTwoPhases& phases ); @@ -98,7 +98,7 @@ public: static autoPtr New ( const dictionary& dict, - const compressibleTwoPhaseMixture& mixture + const compressibleTwoPhases& phases ); diff --git a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModelNew.C b/src/twoPhaseModels/compressibleCavitation/cavitationModel/cavitationModelNew.C similarity index 94% rename from applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModelNew.C rename to src/twoPhaseModels/compressibleCavitation/cavitationModel/cavitationModelNew.C index c01d09ee57..788c8e71c7 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/fvModels/VoFCavitation/cavitation/cavitationModel/cavitationModelNew.C +++ b/src/twoPhaseModels/compressibleCavitation/cavitationModel/cavitationModelNew.C @@ -31,7 +31,7 @@ Foam::autoPtr Foam::compressible::cavitationModel::New ( const dictionary& dict, - const compressibleTwoPhaseMixture& mixture + const compressibleTwoPhases& phases ) { const word modelType(dict.lookup("model")); @@ -53,7 +53,7 @@ Foam::compressible::cavitationModel::New return autoPtr ( - cstrIter()(dict.optionalSubDict(modelType + "Coeffs"), mixture) + cstrIter()(dict.optionalSubDict(modelType + "Coeffs"), phases) ); } diff --git a/src/twoPhaseModels/compressibleInterfaceProperties/Make/files b/src/twoPhaseModels/compressibleInterfaceProperties/Make/files new file mode 100644 index 0000000000..e5415bb65e --- /dev/null +++ b/src/twoPhaseModels/compressibleInterfaceProperties/Make/files @@ -0,0 +1,3 @@ +surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C + +LIB = $(FOAM_LIBBIN)/libcompressibleInterfaceProperties diff --git a/applications/solvers/modules/fluid/compressibleVoF/surfaceTensionModels/Make/options b/src/twoPhaseModels/compressibleInterfaceProperties/Make/options similarity index 85% rename from applications/solvers/modules/fluid/compressibleVoF/surfaceTensionModels/Make/options rename to src/twoPhaseModels/compressibleInterfaceProperties/Make/options index f4863c9f91..e085b3534b 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/surfaceTensionModels/Make/options +++ b/src/twoPhaseModels/compressibleInterfaceProperties/Make/options @@ -3,14 +3,15 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ - -ltwoPhaseMixture \ - -ltwoPhaseProperties \ - -linterfaceProperties \ + -lphysicalProperties \ -lfluidThermophysicalModels \ -lspecie \ -lthermophysicalProperties \ + -ltwoPhaseProperties \ + -linterfaceProperties \ -lfiniteVolume diff --git a/applications/solvers/modules/fluid/compressibleVoF/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C b/src/twoPhaseModels/compressibleInterfaceProperties/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C rename to src/twoPhaseModels/compressibleInterfaceProperties/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C diff --git a/applications/solvers/modules/fluid/compressibleVoF/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H b/src/twoPhaseModels/compressibleInterfaceProperties/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H similarity index 100% rename from applications/solvers/modules/fluid/compressibleVoF/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H rename to src/twoPhaseModels/compressibleInterfaceProperties/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H diff --git a/applications/solvers/modules/fluid/compressibleVoF/compressibleTwoPhaseMixture/Make/files b/src/twoPhaseModels/compressibleTwoPhaseMixture/Make/files similarity index 77% rename from applications/solvers/modules/fluid/compressibleVoF/compressibleTwoPhaseMixture/Make/files rename to src/twoPhaseModels/compressibleTwoPhaseMixture/Make/files index 99ba9ec83d..aebd6ba7f0 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/compressibleTwoPhaseMixture/Make/files +++ b/src/twoPhaseModels/compressibleTwoPhaseMixture/Make/files @@ -1,3 +1,4 @@ +compressibleTwoPhases.C compressibleTwoPhaseMixture.C LIB = $(FOAM_LIBBIN)/libcompressibleTwoPhaseMixture diff --git a/applications/solvers/modules/fluid/compressibleVoF/compressibleTwoPhaseMixture/Make/options b/src/twoPhaseModels/compressibleTwoPhaseMixture/Make/options similarity index 79% rename from applications/solvers/modules/fluid/compressibleVoF/compressibleTwoPhaseMixture/Make/options rename to src/twoPhaseModels/compressibleTwoPhaseMixture/Make/options index 42a10221d4..215b286a23 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/compressibleTwoPhaseMixture/Make/options +++ b/src/twoPhaseModels/compressibleTwoPhaseMixture/Make/options @@ -1,14 +1,13 @@ EXE_INC = \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ + -lphysicalProperties \ -lfluidThermophysicalModels \ -lspecie \ - -lphysicalProperties \ -ltwoPhaseMixture \ - -linterfaceProperties \ -lfiniteVolume diff --git a/applications/solvers/modules/fluid/compressibleVoF/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.C b/src/twoPhaseModels/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.C similarity index 85% rename from applications/solvers/modules/fluid/compressibleVoF/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.C rename to src/twoPhaseModels/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.C index d08edb623e..73192a1b1a 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.C +++ b/src/twoPhaseModels/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.C @@ -37,12 +37,10 @@ namespace Foam Foam::compressibleTwoPhaseMixture::compressibleTwoPhaseMixture ( - const volVectorField& U, - const surfaceScalarField& phi + const fvMesh& mesh ) : - twoPhaseMixture(U.mesh()), - interfaceProperties(alpha1(), alpha2(), U, *this), + twoPhaseMixture(mesh), totalInternalEnergy_ ( @@ -54,24 +52,24 @@ Foam::compressibleTwoPhaseMixture::compressibleTwoPhaseMixture IOobject ( "p", - U.mesh().time().timeName(), - U.mesh(), + mesh.time().timeName(), + mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), - U.mesh() + mesh ), T_ ( IOobject ( "T", - U.mesh().time().timeName(), - U.mesh(), + mesh.time().timeName(), + mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), - U.mesh() + mesh ), thermo1_(nullptr), thermo2_(nullptr), @@ -80,12 +78,12 @@ Foam::compressibleTwoPhaseMixture::compressibleTwoPhaseMixture IOobject ( "rho", - U.mesh().time().timeName(), - U.mesh(), + mesh.time().timeName(), + mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), - U.mesh(), + mesh, dimensionedScalar("rho", dimDensity, 0) ), Alpha1_ @@ -93,8 +91,8 @@ Foam::compressibleTwoPhaseMixture::compressibleTwoPhaseMixture IOobject ( IOobject::groupName("Alpha", phase1Name()), - U.mesh().time().timeName(), - U.mesh() + mesh.time().timeName(), + mesh ), alpha1(), calculatedFvPatchScalarField::typeName @@ -104,8 +102,8 @@ Foam::compressibleTwoPhaseMixture::compressibleTwoPhaseMixture IOobject ( IOobject::groupName("Alpha", phase2Name()), - U.mesh().time().timeName(), - U.mesh() + mesh.time().timeName(), + mesh ), alpha2(), calculatedFvPatchScalarField::typeName @@ -117,8 +115,8 @@ Foam::compressibleTwoPhaseMixture::compressibleTwoPhaseMixture IOobject ( IOobject::groupName("T", phase1Name()), - U.mesh().time().timeName(), - U.mesh() + mesh.time().timeName(), + mesh ), T_, calculatedFvPatchScalarField::typeName @@ -132,8 +130,8 @@ Foam::compressibleTwoPhaseMixture::compressibleTwoPhaseMixture IOobject ( IOobject::groupName("T", phase2Name()), - U.mesh().time().timeName(), - U.mesh() + mesh.time().timeName(), + mesh ), T_, calculatedFvPatchScalarField::typeName @@ -145,8 +143,8 @@ Foam::compressibleTwoPhaseMixture::compressibleTwoPhaseMixture // Avoid any thread-writing problems. // fileHandler().flush(); - thermo1_ = rhoThermo::New(U.mesh(), phase1Name()); - thermo2_ = rhoThermo::New(U.mesh(), phase2Name()); + thermo1_ = rhoThermo::New(mesh, phase1Name()); + thermo2_ = rhoThermo::New(mesh, phase2Name()); // thermo1_->validate(phase1Name(), "e"); // thermo2_->validate(phase2Name(), "e"); @@ -183,8 +181,6 @@ void Foam::compressibleTwoPhaseMixture::correct() rho_ = alphaRho1 + alphaRho2; Alpha1_ = alphaRho1/rho_; Alpha2_ = alphaRho2/rho_; - - interfaceProperties::correct(); } @@ -214,7 +210,7 @@ bool Foam::compressibleTwoPhaseMixture::read() totalInternalEnergy_ = lookupOrDefault("totalInternalEnergy", true); - return interfaceProperties::read(); + return true; } else { diff --git a/applications/solvers/modules/fluid/compressibleVoF/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.H b/src/twoPhaseModels/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.H similarity index 91% rename from applications/solvers/modules/fluid/compressibleVoF/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.H rename to src/twoPhaseModels/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.H index fb5689ebcd..ba064a6d44 100644 --- a/applications/solvers/modules/fluid/compressibleVoF/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.H +++ b/src/twoPhaseModels/compressibleTwoPhaseMixture/compressibleTwoPhaseMixture.H @@ -25,22 +25,19 @@ Class Foam::compressibleTwoPhaseMixture Description - Thermophysical properties class for a mixture of two rhoThermo including - interfaceProperties for VoF for use in compressibleInterFoam. + Class to represent a mixture of two rhoThermo-based phases SourceFiles - compressibleTwoPhaseMixtureI.H compressibleTwoPhaseMixture.C - compressibleTwoPhaseMixtureIO.C \*---------------------------------------------------------------------------*/ #ifndef compressibleTwoPhaseMixture_H #define compressibleTwoPhaseMixture_H -#include "rhoThermo.H" #include "twoPhaseMixture.H" -#include "interfaceProperties.H" +#include "compressibleTwoPhases.H" +#include "rhoThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,7 +51,7 @@ namespace Foam class compressibleTwoPhaseMixture : public twoPhaseMixture, - public interfaceProperties, + virtual public compressibleTwoPhases, public viscosity { // Private Data @@ -93,12 +90,8 @@ public: // Constructors - //- Construct from components - compressibleTwoPhaseMixture - ( - const volVectorField& U, - const surfaceScalarField& phi - ); + //- Construct from a mesh + compressibleTwoPhaseMixture(const fvMesh& mesh); //- Destructor diff --git a/src/twoPhaseModels/compressibleTwoPhaseMixture/compressibleTwoPhases.C b/src/twoPhaseModels/compressibleTwoPhaseMixture/compressibleTwoPhases.C new file mode 100644 index 0000000000..bfcde58c2d --- /dev/null +++ b/src/twoPhaseModels/compressibleTwoPhaseMixture/compressibleTwoPhases.C @@ -0,0 +1,35 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "compressibleTwoPhases.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(compressibleTwoPhases, 0); +} + +// ************************************************************************* // diff --git a/src/twoPhaseModels/compressibleTwoPhaseMixture/compressibleTwoPhases.H b/src/twoPhaseModels/compressibleTwoPhaseMixture/compressibleTwoPhases.H new file mode 100644 index 0000000000..afc3072c52 --- /dev/null +++ b/src/twoPhaseModels/compressibleTwoPhaseMixture/compressibleTwoPhases.H @@ -0,0 +1,96 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::compressibleTwoPhaseMixture + +Description + Interface to two rhoThermo-based phases + +SourceFiles + compressibleTwoPhases.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleTwoPhases_H +#define compressibleTwoPhases_H + +#include "twoPhases.H" +#include "rhoThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class compressibleTwoPhases Declaration +\*---------------------------------------------------------------------------*/ + +class compressibleTwoPhases +: + virtual public twoPhases +{ +public: + + //- Runtime type information + TypeName("compressibleTwoPhases"); + + + // Constructors + + //- Default construct + compressibleTwoPhases() + {} + + + //- Destructor + virtual ~compressibleTwoPhases() + {} + + + // Member Functions + + //- Return the thermo for phase 1 + virtual const rhoThermo& thermo1() const = 0; + + //- Return the thermo for phase 2 + virtual const rhoThermo& thermo2() const = 0; + + //- Return the density of phase 1 + virtual const volScalarField& rho1() const = 0; + + //- Return the density of phase 2 + virtual const volScalarField& rho2() const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/Make/files b/src/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/Make/files new file mode 100644 index 0000000000..5eccb47e51 --- /dev/null +++ b/src/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/Make/files @@ -0,0 +1,3 @@ +immiscibleCompressibleTwoPhaseMixture.C + +LIB = $(FOAM_LIBBIN)/libimmiscibleCompressibleTwoPhaseMixture diff --git a/src/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/Make/options b/src/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/Make/options new file mode 100644 index 0000000000..6b71d7401b --- /dev/null +++ b/src/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/Make/options @@ -0,0 +1,19 @@ +EXE_INC = \ + -I$(LIB_SRC)/physicalProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/twoPhaseProperties/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/compressibleTwoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +LIB_LIBS = \ + -lphysicalProperties \ + -lfluidThermophysicalModels \ + -lspecie \ + -ltwoPhaseProperties \ + -linterfaceProperties \ + -ltwoPhaseMixture \ + -lcompressibleTwoPhaseMixture \ + -lfiniteVolume diff --git a/src/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/immiscibleCompressibleTwoPhaseMixture.C b/src/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/immiscibleCompressibleTwoPhaseMixture.C new file mode 100644 index 0000000000..d54d42cbe6 --- /dev/null +++ b/src/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/immiscibleCompressibleTwoPhaseMixture.C @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "immiscibleCompressibleTwoPhaseMixture.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::immiscibleCompressibleTwoPhaseMixture:: +immiscibleCompressibleTwoPhaseMixture(const volVectorField& U) +: + compressibleTwoPhaseMixture(U.mesh()), + interfaceProperties(*this, alpha1(), alpha2(), U) +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::immiscibleCompressibleTwoPhaseMixture::correct() +{ + compressibleTwoPhaseMixture::correct(); + interfaceProperties::correct(); +} + + +bool Foam::immiscibleCompressibleTwoPhaseMixture::read() +{ + return + compressibleTwoPhaseMixture::read() + && interfaceProperties::read(); +} + + +// ************************************************************************* // diff --git a/src/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/immiscibleCompressibleTwoPhaseMixture.H b/src/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/immiscibleCompressibleTwoPhaseMixture.H new file mode 100644 index 0000000000..5fff16e8f4 --- /dev/null +++ b/src/twoPhaseModels/immiscibleCompressibleTwoPhaseMixture/immiscibleCompressibleTwoPhaseMixture.H @@ -0,0 +1,87 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::immiscibleCompressibleTwoPhaseMixture + +Description + Class to represent a mixture of two immiscible rhoThermo-based phases + +SourceFiles + immiscibleCompressibleTwoPhaseMixture.C + +\*---------------------------------------------------------------------------*/ + +#ifndef immiscibleCompressibleTwoPhaseMixture_H +#define immiscibleCompressibleTwoPhaseMixture_H + +#include "compressibleTwoPhaseMixture.H" +#include "interfaceProperties.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class immiscibleCompressibleTwoPhaseMixture Declaration +\*---------------------------------------------------------------------------*/ + +class immiscibleCompressibleTwoPhaseMixture +: + public compressibleTwoPhaseMixture, + public interfaceProperties +{ + +public: + + // Constructors + + //- Construct from the mixture velocity + immiscibleCompressibleTwoPhaseMixture(const volVectorField& U); + + + //- Destructor + virtual ~immiscibleCompressibleTwoPhaseMixture() + {} + + + // Member Functions + + //- Correct the mixture and interface properties + virtual void correct(); + + //- Read base phaseProperties dictionary + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/Make/options b/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/Make/options index 96a087d06c..fbb0b2a7a2 100644 --- a/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/Make/options +++ b/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/Make/options @@ -1,14 +1,15 @@ EXE_INC = \ -I$(LIB_SRC)/physicalProperties/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/incompressibleTwoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/twoPhaseModels/incompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ - -lincompressibleTwoPhaseMixture \ - -ltwoPhaseMixture \ -lphysicalProperties \ - -linterfaceProperties \ -ltwoPhaseProperties \ + -linterfaceProperties \ + -ltwoPhaseMixture \ + -lincompressibleTwoPhaseMixture \ -lfiniteVolume diff --git a/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/immiscibleIncompressibleTwoPhaseMixture.C b/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/immiscibleIncompressibleTwoPhaseMixture.C index d16f3afb79..d64172c18a 100644 --- a/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/immiscibleIncompressibleTwoPhaseMixture.C +++ b/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/immiscibleIncompressibleTwoPhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,19 +28,22 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::immiscibleIncompressibleTwoPhaseMixture:: -immiscibleIncompressibleTwoPhaseMixture -( - const volVectorField& U, - const surfaceScalarField& phi -) +immiscibleIncompressibleTwoPhaseMixture(const volVectorField& U) : - incompressibleTwoPhaseMixture(U, phi), - interfaceProperties(alpha1(), alpha2(), U, *this) + incompressibleTwoPhaseMixture(U.mesh()), + interfaceProperties(*this, alpha1(), alpha2(), U) {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // +void Foam::immiscibleIncompressibleTwoPhaseMixture::correct() +{ + incompressibleTwoPhaseMixture::correct(); + interfaceProperties::correct(); +} + + bool Foam::immiscibleIncompressibleTwoPhaseMixture::read() { return diff --git a/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/immiscibleIncompressibleTwoPhaseMixture.H b/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/immiscibleIncompressibleTwoPhaseMixture.H index 497b3dd082..dfd694070a 100644 --- a/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/immiscibleIncompressibleTwoPhaseMixture.H +++ b/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/immiscibleIncompressibleTwoPhaseMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Class Foam::immiscibleIncompressibleTwoPhaseMixture Description - An immiscible incompressible two-phase mixture transport model + Class to represent a mixture of two immiscible constant density phases SourceFiles immiscibleIncompressibleTwoPhaseMixture.C @@ -57,12 +57,8 @@ public: // Constructors - //- Construct from components - immiscibleIncompressibleTwoPhaseMixture - ( - const volVectorField& U, - const surfaceScalarField& phi - ); + //- Construct from the mixture velocity + immiscibleIncompressibleTwoPhaseMixture(const volVectorField& U); //- Destructor @@ -72,12 +68,8 @@ public: // Member Functions - //- Correct the phase and interface properties - virtual void correct() - { - incompressibleTwoPhaseMixture::correct(); - interfaceProperties::correct(); - } + //- Correct the mixture and interface properties + virtual void correct(); //- Read base phaseProperties dictionary virtual bool read(); diff --git a/src/twoPhaseModels/cavitation/Kunz/Kunz.C b/src/twoPhaseModels/incompressibleCavitation/Kunz/Kunz.C similarity index 84% rename from src/twoPhaseModels/cavitation/Kunz/Kunz.C rename to src/twoPhaseModels/incompressibleCavitation/Kunz/Kunz.C index df0aea5cac..0e55c6f6be 100644 --- a/src/twoPhaseModels/cavitation/Kunz/Kunz.C +++ b/src/twoPhaseModels/incompressibleCavitation/Kunz/Kunz.C @@ -42,10 +42,10 @@ namespace cavitationModels Foam::cavitationModels::Kunz::Kunz ( const dictionary& dict, - const immiscibleIncompressibleTwoPhaseMixture& mixture + const incompressibleTwoPhases& phases ) : - cavitationModel(dict, mixture), + cavitationModel(dict, phases), UInf_("UInf", dimVelocity, dict), tInf_("tInf", dimTime, dict), @@ -54,8 +54,8 @@ Foam::cavitationModels::Kunz::Kunz p0_("0", pSat().dimensions(), 0.0), - mcCoeff_(Cc_*mixture_.rho2()/tInf_), - mvCoeff_(Cv_*mixture_.rho2()/(0.5*mixture_.rho1()*sqr(UInf_)*tInf_)) + mcCoeff_(Cc_*phases_.rho2()/tInf_), + mvCoeff_(Cv_*phases_.rho2()/(0.5*phases_.rho1()*sqr(UInf_)*tInf_)) { correct(); } @@ -67,11 +67,11 @@ Foam::Pair> Foam::cavitationModels::Kunz::mDotAlphal() const { const volScalarField::Internal& p = - mixture_.U().db().lookupObject("p"); + phases_.mesh().lookupObject("p"); const volScalarField::Internal limitedAlpha1 ( - min(max(mixture_.alpha1()(), scalar(0)), scalar(1)) + min(max(phases_.alpha1()(), scalar(0)), scalar(1)) ); return Pair> @@ -88,11 +88,11 @@ Foam::Pair> Foam::cavitationModels::Kunz::mDotP() const { const volScalarField::Internal& p = - mixture_.U().db().lookupObject("p"); + phases_.mesh().lookupObject("p"); const volScalarField::Internal limitedAlpha1 ( - min(max(mixture_.alpha1()(), scalar(0)), scalar(1)) + min(max(phases_.alpha1()(), scalar(0)), scalar(1)) ); return Pair> @@ -118,8 +118,8 @@ bool Foam::cavitationModels::Kunz::read(const dictionary& dict) dict.lookup("Cc") >> Cc_; dict.lookup("Cv") >> Cv_; - mcCoeff_ = Cc_*mixture_.rho2()/tInf_; - mvCoeff_ = Cv_*mixture_.rho2()/(0.5*mixture_.rho1()*sqr(UInf_)*tInf_); + mcCoeff_ = Cc_*phases_.rho2()/tInf_; + mvCoeff_ = Cv_*phases_.rho2()/(0.5*phases_.rho1()*sqr(UInf_)*tInf_); return true; } diff --git a/src/twoPhaseModels/cavitation/Kunz/Kunz.H b/src/twoPhaseModels/incompressibleCavitation/Kunz/Kunz.H similarity index 97% rename from src/twoPhaseModels/cavitation/Kunz/Kunz.H rename to src/twoPhaseModels/incompressibleCavitation/Kunz/Kunz.H index 7af08904b0..1853bdd066 100644 --- a/src/twoPhaseModels/cavitation/Kunz/Kunz.H +++ b/src/twoPhaseModels/incompressibleCavitation/Kunz/Kunz.H @@ -87,11 +87,11 @@ public: // Constructors - //- Construct for mixture + //- Construct for phases Kunz ( const dictionary& dict, - const immiscibleIncompressibleTwoPhaseMixture& mixture + const incompressibleTwoPhases& phases ); diff --git a/src/twoPhaseModels/incompressibleCavitation/Make/files b/src/twoPhaseModels/incompressibleCavitation/Make/files new file mode 100644 index 0000000000..3f1918a41c --- /dev/null +++ b/src/twoPhaseModels/incompressibleCavitation/Make/files @@ -0,0 +1,7 @@ +cavitationModel/cavitationModel.C +cavitationModel/cavitationModelNew.C +Kunz/Kunz.C +Merkle/Merkle.C +SchnerrSauer/SchnerrSauer.C + +LIB = $(FOAM_LIBBIN)/libincompressibleCavitationModels diff --git a/src/twoPhaseModels/cavitation/Make/options b/src/twoPhaseModels/incompressibleCavitation/Make/options similarity index 74% rename from src/twoPhaseModels/cavitation/Make/options rename to src/twoPhaseModels/incompressibleCavitation/Make/options index e1cfc6e1fa..f51d79235b 100644 --- a/src/twoPhaseModels/cavitation/Make/options +++ b/src/twoPhaseModels/incompressibleCavitation/Make/options @@ -3,11 +3,10 @@ EXE_INC = \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/incompressibleTwoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ - -limmiscibleIncompressibleTwoPhaseMixture \ + -lincompressibleTwoPhaseMixture \ -lmeshTools \ -lfiniteVolume diff --git a/src/twoPhaseModels/cavitation/Merkle/Merkle.C b/src/twoPhaseModels/incompressibleCavitation/Merkle/Merkle.C similarity index 87% rename from src/twoPhaseModels/cavitation/Merkle/Merkle.C rename to src/twoPhaseModels/incompressibleCavitation/Merkle/Merkle.C index 834f3f289e..d8a1650db8 100644 --- a/src/twoPhaseModels/cavitation/Merkle/Merkle.C +++ b/src/twoPhaseModels/incompressibleCavitation/Merkle/Merkle.C @@ -42,10 +42,10 @@ namespace cavitationModels Foam::cavitationModels::Merkle::Merkle ( const dictionary& dict, - const immiscibleIncompressibleTwoPhaseMixture& mixture + const incompressibleTwoPhases& phases ) : - cavitationModel(dict, mixture), + cavitationModel(dict, phases), UInf_("UInf", dimVelocity, dict), tInf_("tInf", dimTime, dict), @@ -55,7 +55,7 @@ Foam::cavitationModels::Merkle::Merkle p0_("0", pSat().dimensions(), 0.0), mcCoeff_(Cc_/(0.5*sqr(UInf_)*tInf_)), - mvCoeff_(Cv_*mixture_.rho1()/(0.5*sqr(UInf_)*tInf_*mixture_.rho2())) + mvCoeff_(Cv_*phases_.rho1()/(0.5*sqr(UInf_)*tInf_*phases_.rho2())) { correct(); } @@ -67,7 +67,7 @@ Foam::Pair> Foam::cavitationModels::Merkle::mDotAlphal() const { const volScalarField::Internal& p = - mixture_.U().db().lookupObject("p"); + phases_.mesh().lookupObject("p"); return Pair> ( @@ -81,11 +81,11 @@ Foam::Pair> Foam::cavitationModels::Merkle::mDotP() const { const volScalarField::Internal& p = - mixture_.U().db().lookupObject("p"); + phases_.mesh().lookupObject("p"); const volScalarField::Internal limitedAlpha1 ( - min(max(mixture_.alpha1()(), scalar(0)), scalar(1)) + min(max(phases_.alpha1()(), scalar(0)), scalar(1)) ); return Pair> @@ -110,7 +110,7 @@ bool Foam::cavitationModels::Merkle::read(const dictionary& dict) dict.lookup("Cv") >> Cv_; mcCoeff_ = Cc_/(0.5*sqr(UInf_)*tInf_); - mvCoeff_ = Cv_*mixture_.rho1()/(0.5*sqr(UInf_)*tInf_*mixture_.rho2()); + mvCoeff_ = Cv_*phases_.rho1()/(0.5*sqr(UInf_)*tInf_*phases_.rho2()); return true; } diff --git a/src/twoPhaseModels/cavitation/Merkle/Merkle.H b/src/twoPhaseModels/incompressibleCavitation/Merkle/Merkle.H similarity index 97% rename from src/twoPhaseModels/cavitation/Merkle/Merkle.H rename to src/twoPhaseModels/incompressibleCavitation/Merkle/Merkle.H index e17ed7a8c3..5a815de952 100644 --- a/src/twoPhaseModels/cavitation/Merkle/Merkle.H +++ b/src/twoPhaseModels/incompressibleCavitation/Merkle/Merkle.H @@ -81,11 +81,11 @@ public: // Constructors - //- Construct for mixture + //- Construct for phases Merkle ( const dictionary& dict, - const immiscibleIncompressibleTwoPhaseMixture& mixture + const incompressibleTwoPhases& phases ); diff --git a/src/twoPhaseModels/cavitation/SchnerrSauer/SchnerrSauer.C b/src/twoPhaseModels/incompressibleCavitation/SchnerrSauer/SchnerrSauer.C similarity index 88% rename from src/twoPhaseModels/cavitation/SchnerrSauer/SchnerrSauer.C rename to src/twoPhaseModels/incompressibleCavitation/SchnerrSauer/SchnerrSauer.C index e73613347d..76dd22c42e 100644 --- a/src/twoPhaseModels/cavitation/SchnerrSauer/SchnerrSauer.C +++ b/src/twoPhaseModels/incompressibleCavitation/SchnerrSauer/SchnerrSauer.C @@ -49,10 +49,10 @@ namespace cavitationModels Foam::cavitationModels::SchnerrSauer::SchnerrSauer ( const dictionary& dict, - const immiscibleIncompressibleTwoPhaseMixture& mixture + const incompressibleTwoPhases& phases ) : - cavitationModel(dict, mixture), + cavitationModel(dict, phases), n_("n", dimless/dimVolume, dict), dNuc_("dNuc", dimLength, dict), @@ -98,17 +98,17 @@ Foam::cavitationModels::SchnerrSauer::pCoeff { const volScalarField::Internal limitedAlpha1 ( - min(max(mixture_.alpha1()(), scalar(0)), scalar(1)) + min(max(phases_.alpha1()(), scalar(0)), scalar(1)) ); const volScalarField::Internal rho ( - limitedAlpha1*mixture_.rho1() - + (scalar(1) - limitedAlpha1)*mixture_.rho2() + limitedAlpha1*phases_.rho1() + + (scalar(1) - limitedAlpha1)*phases_.rho2() ); return - (3*mixture_.rho1()*mixture_.rho2())*sqrt(2/(3*mixture_.rho1())) + (3*phases_.rho1()*phases_.rho2())*sqrt(2/(3*phases_.rho1())) *rRb(limitedAlpha1)/(rho*sqrt(mag(p - pSat()) + 0.01*pSat())); } @@ -117,13 +117,13 @@ Foam::Pair> Foam::cavitationModels::SchnerrSauer::mDotAlphal() const { const volScalarField::Internal& p = - mixture_.U().db().lookupObject("p"); + phases_.mesh().lookupObject("p"); const volScalarField::Internal pCoeff(this->pCoeff(p)); const volScalarField::Internal limitedAlpha1 ( - min(max(mixture_.alpha1()(), scalar(0)), scalar(1)) + min(max(phases_.alpha1()(), scalar(0)), scalar(1)) ); return Pair> @@ -139,13 +139,13 @@ Foam::Pair> Foam::cavitationModels::SchnerrSauer::mDotP() const { const volScalarField::Internal& p = - mixture_.U().db().lookupObject("p"); + phases_.mesh().lookupObject("p"); const volScalarField::Internal pCoeff(this->pCoeff(p)); const volScalarField::Internal limitedAlpha1 ( - min(max(mixture_.alpha1()(), scalar(0)), scalar(1)) + min(max(phases_.alpha1()(), scalar(0)), scalar(1)) ); const volScalarField::Internal apCoeff(limitedAlpha1*pCoeff); diff --git a/src/twoPhaseModels/cavitation/SchnerrSauer/SchnerrSauer.H b/src/twoPhaseModels/incompressibleCavitation/SchnerrSauer/SchnerrSauer.H similarity index 97% rename from src/twoPhaseModels/cavitation/SchnerrSauer/SchnerrSauer.H rename to src/twoPhaseModels/incompressibleCavitation/SchnerrSauer/SchnerrSauer.H index f5087de7da..3cb70e2010 100644 --- a/src/twoPhaseModels/cavitation/SchnerrSauer/SchnerrSauer.H +++ b/src/twoPhaseModels/incompressibleCavitation/SchnerrSauer/SchnerrSauer.H @@ -100,11 +100,11 @@ public: // Constructors - //- Construct for mixture + //- Construct for phases SchnerrSauer ( const dictionary& dict, - const immiscibleIncompressibleTwoPhaseMixture& mixture + const incompressibleTwoPhases& phases ); diff --git a/src/twoPhaseModels/cavitation/cavitationModel/cavitationModel.C b/src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModel.C similarity index 95% rename from src/twoPhaseModels/cavitation/cavitationModel/cavitationModel.C rename to src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModel.C index 5613df9c26..d2804e7636 100644 --- a/src/twoPhaseModels/cavitation/cavitationModel/cavitationModel.C +++ b/src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModel.C @@ -40,10 +40,10 @@ namespace Foam Foam::cavitationModel::cavitationModel ( const dictionary& dict, - const immiscibleIncompressibleTwoPhaseMixture& mixture + const incompressibleTwoPhases& phases ) : - mixture_(mixture), + phases_(phases), pSat_("pSat", dimPressure, dict.lookup("pSat")) {} diff --git a/src/twoPhaseModels/cavitation/cavitationModel/cavitationModel.H b/src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModel.H similarity index 90% rename from src/twoPhaseModels/cavitation/cavitationModel/cavitationModel.H rename to src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModel.H index ec7fa86414..1e4bd821df 100644 --- a/src/twoPhaseModels/cavitation/cavitationModel/cavitationModel.H +++ b/src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModel.H @@ -35,7 +35,7 @@ SourceFiles #ifndef cavitationModel_H #define cavitationModel_H -#include "immiscibleIncompressibleTwoPhaseMixture.H" +#include "incompressibleTwoPhases.H" #include "fvMatricesFwd.H" #include "Pair.H" @@ -55,7 +55,7 @@ protected: // Protected data //- Mixture properties - const immiscibleIncompressibleTwoPhaseMixture& mixture_; + const incompressibleTwoPhases& phases_; //- Saturation vapour pressure dimensionedScalar pSat_; @@ -76,19 +76,19 @@ public: dictionary, ( const dictionary& dict, - const immiscibleIncompressibleTwoPhaseMixture& mixture + const incompressibleTwoPhases& phases ), - (dict, mixture) + (dict, phases) ); // Constructors - //- Construct for mixture + //- Construct for phases cavitationModel ( const dictionary& dict, - const immiscibleIncompressibleTwoPhaseMixture& mixture + const incompressibleTwoPhases& phases ); @@ -96,7 +96,7 @@ public: static autoPtr New ( const dictionary& dict, - const immiscibleIncompressibleTwoPhaseMixture& mixture + const incompressibleTwoPhases& phases ); diff --git a/src/twoPhaseModels/cavitation/cavitationModel/cavitationModelNew.C b/src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModelNew.C similarity index 94% rename from src/twoPhaseModels/cavitation/cavitationModel/cavitationModelNew.C rename to src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModelNew.C index 66a66e2b3a..3cc6100225 100644 --- a/src/twoPhaseModels/cavitation/cavitationModel/cavitationModelNew.C +++ b/src/twoPhaseModels/incompressibleCavitation/cavitationModel/cavitationModelNew.C @@ -30,7 +30,7 @@ License Foam::autoPtr Foam::cavitationModel::New ( const dictionary& dict, - const immiscibleIncompressibleTwoPhaseMixture& mixture + const incompressibleTwoPhases& phases ) { const word modelType(dict.lookup("model")); @@ -52,7 +52,7 @@ Foam::autoPtr Foam::cavitationModel::New return autoPtr ( - cstrIter()(dict.optionalSubDict(modelType + "Coeffs"), mixture) + cstrIter()(dict.optionalSubDict(modelType + "Coeffs"), phases) ); } diff --git a/src/twoPhaseModels/incompressibleTwoPhaseMixture/Make/files b/src/twoPhaseModels/incompressibleTwoPhaseMixture/Make/files index e2f6318928..8aefa45b02 100644 --- a/src/twoPhaseModels/incompressibleTwoPhaseMixture/Make/files +++ b/src/twoPhaseModels/incompressibleTwoPhaseMixture/Make/files @@ -1,3 +1,4 @@ +incompressibleTwoPhases.C incompressibleTwoPhaseMixture.C LIB = $(FOAM_LIBBIN)/libincompressibleTwoPhaseMixture diff --git a/src/twoPhaseModels/incompressibleTwoPhaseMixture/Make/options b/src/twoPhaseModels/incompressibleTwoPhaseMixture/Make/options index 5ff9569411..5ba4c12b5b 100644 --- a/src/twoPhaseModels/incompressibleTwoPhaseMixture/Make/options +++ b/src/twoPhaseModels/incompressibleTwoPhaseMixture/Make/options @@ -1,9 +1,9 @@ EXE_INC = \ -I$(LIB_SRC)/physicalProperties/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ + -lphysicalProperties \ -ltwoPhaseMixture \ -lfiniteVolume diff --git a/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C b/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C index e0712c2e9a..9b79cf4016 100644 --- a/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C +++ b/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,29 +39,26 @@ namespace Foam Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture ( - const volVectorField& U, - const surfaceScalarField& phi + const fvMesh& mesh ) : - twoPhaseMixture(U.mesh()), + twoPhaseMixture(mesh), - nuModel1_(viscosityModel::New(U.mesh(), phase1Name())), - nuModel2_(viscosityModel::New(U.mesh(), phase2Name())), + nuModel1_(viscosityModel::New(mesh, phase1Name())), + nuModel2_(viscosityModel::New(mesh, phase2Name())), rho1_("rho", dimDensity, nuModel1_()), rho2_("rho", dimDensity, nuModel2_()), - U_(U), - nu_ ( IOobject ( "nu", - U_.time().timeName(), - U_.db() + mesh.time().timeName(), + mesh ), - U_.mesh(), + mesh, dimensionedScalar(dimViscosity, 0), calculatedFvPatchScalarField::typeName ) diff --git a/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H b/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H index bf6be26d0d..478a6bb579 100644 --- a/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H +++ b/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Class Foam::incompressibleTwoPhaseMixture Description - A two-phase incompressible transportModel + Class to represent a mixture of two constant density phases SourceFiles incompressibleTwoPhaseMixture.C @@ -36,6 +36,7 @@ SourceFiles #define incompressibleTwoPhaseMixture_H #include "twoPhaseMixture.H" +#include "incompressibleTwoPhases.H" #include "viscosityModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,18 +51,24 @@ namespace Foam class incompressibleTwoPhaseMixture : public twoPhaseMixture, + virtual public incompressibleTwoPhases, public viscosity { // Private Data + //- Viscosity model for phase 1 autoPtr nuModel1_; + + //- Viscosity model for phase 2 autoPtr nuModel2_; + //- Constant density of phase 1 dimensionedScalar rho1_; + + //- Constant density of phase 2 dimensionedScalar rho2_; - const volVectorField& U_; - + //- Mixture viscosity volScalarField nu_; @@ -72,12 +79,8 @@ public: // Constructors - //- Construct from components - incompressibleTwoPhaseMixture - ( - const volVectorField& U, - const surfaceScalarField& phi - ); + //- Construct from a mesh + incompressibleTwoPhaseMixture(const fvMesh& mesh); //- Destructor @@ -111,12 +114,6 @@ public: return rho2_; }; - //- Return const-access to the mixture velocity - const volVectorField& U() const - { - return U_; - } - //- Return the mixture density tmp rho() const; diff --git a/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhases.C b/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhases.C new file mode 100644 index 0000000000..41da1e210b --- /dev/null +++ b/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhases.C @@ -0,0 +1,35 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "incompressibleTwoPhases.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(incompressibleTwoPhases, 0); +} + +// ************************************************************************* // diff --git a/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhases.H b/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhases.H new file mode 100644 index 0000000000..af92b75842 --- /dev/null +++ b/src/twoPhaseModels/incompressibleTwoPhaseMixture/incompressibleTwoPhases.H @@ -0,0 +1,88 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::incompressibleTwoPhases + +Description + Interface to two constant density phases + +SourceFiles + incompressibleTwoPhases.C + +\*---------------------------------------------------------------------------*/ + +#ifndef incompressibleTwoPhases_H +#define incompressibleTwoPhases_H + +#include "twoPhases.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class incompressibleTwoPhases Declaration +\*---------------------------------------------------------------------------*/ + +class incompressibleTwoPhases +: + virtual public twoPhases +{ +public: + + TypeName("incompressibleTwoPhases"); + + + // Constructors + + //- Default construct + incompressibleTwoPhases() + {} + + + //- Destructor + virtual ~incompressibleTwoPhases() + {} + + + // Member Functions + + //- Return const-access to phase1 density + virtual const dimensionedScalar& rho1() const = 0; + + //- Return const-access to phase2 density + virtual const dimensionedScalar& rho2() const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLIC.C b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLIC.C similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLIC.C rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLIC.C index c770415f99..d9ff197795 100644 --- a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLIC.C +++ b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLIC.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLIC.H b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLIC.H similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLIC.H rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLIC.H index 7a291a93df..584e8f6ac3 100644 --- a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLIC.H +++ b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLIC.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICU.C b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICU.C similarity index 96% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICU.C rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLICU.C index 7fc39da7a6..fb5b19a7ae 100644 --- a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICU.C +++ b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICU.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICU.H b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICU.H similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICU.H rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLICU.H index 469bd56978..f9708e0751 100644 --- a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICU.H +++ b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICU.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcell.C b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcell.C similarity index 100% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcell.C rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcell.C diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcell.H b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcell.H similarity index 99% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcell.H rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcell.H index e2be1b39f0..9842187452 100644 --- a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcell.H +++ b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcell.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellI.H b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcellI.H similarity index 99% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellI.H rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcellI.H index b82a382e91..4d97275c42 100644 --- a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellI.H +++ b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcellI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellStorage.C b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcellStorage.C similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellStorage.C rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcellStorage.C index 998f5cbc88..5b49e1a53a 100644 --- a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellStorage.C +++ b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcellStorage.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellStorage.H b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcellStorage.H similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellStorage.H rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcellStorage.H index b42f18ca5a..c5e3a5c2ef 100644 --- a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellStorage.H +++ b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcellStorage.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellStorageI.H b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcellStorageI.H similarity index 97% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellStorageI.H rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcellStorageI.H index 82ed5271bf..4ae0a57359 100644 --- a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellStorageI.H +++ b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICcellStorageI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICface.C b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICface.C similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICface.C rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLICface.C index aa0fd063eb..c23edd37f3 100644 --- a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICface.C +++ b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICface.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICface.H b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICface.H similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICface.H rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLICface.H index c00fe9e10c..ca1ac56e29 100644 --- a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICface.H +++ b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICface.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICfaceI.H b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICfaceI.H similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICfaceI.H rename to src/twoPhaseModels/interfaceCompression/MPLIC/MPLICfaceI.H index 603eaeacb7..9379f0f0fa 100644 --- a/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICfaceI.H +++ b/src/twoPhaseModels/interfaceCompression/MPLIC/MPLICfaceI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/interfaceCompression/Make/files b/src/twoPhaseModels/interfaceCompression/Make/files new file mode 100644 index 0000000000..a3008af07d --- /dev/null +++ b/src/twoPhaseModels/interfaceCompression/Make/files @@ -0,0 +1,13 @@ +interfaceCompression/interfaceCompression.C +noInterfaceCompression/noInterfaceCompression.C + +MPLIC/MPLICface.C +MPLIC/MPLICcellStorage.C +MPLIC/MPLICcell.C +MPLIC/MPLIC.C +MPLIC/MPLICU.C + +PLIC/PLIC.C +PLIC/PLICU.C + +LIB = $(FOAM_LIBBIN)/libinterfaceCompression diff --git a/src/twoPhaseModels/interfaceCompression/Make/options b/src/twoPhaseModels/interfaceCompression/Make/options new file mode 100644 index 0000000000..52053cfab2 --- /dev/null +++ b/src/twoPhaseModels/interfaceCompression/Make/options @@ -0,0 +1,6 @@ +EXE_INC = \ + -I$(LIB_SRC)/physicalProperties/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +LIB_LIBS = \ + -lfiniteVolume diff --git a/src/twoPhaseModels/twoPhaseMixture/PLIC/PLIC.C b/src/twoPhaseModels/interfaceCompression/PLIC/PLIC.C similarity index 96% rename from src/twoPhaseModels/twoPhaseMixture/PLIC/PLIC.C rename to src/twoPhaseModels/interfaceCompression/PLIC/PLIC.C index 77bef8676a..f9ddf9a3ce 100644 --- a/src/twoPhaseModels/twoPhaseMixture/PLIC/PLIC.C +++ b/src/twoPhaseModels/interfaceCompression/PLIC/PLIC.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/PLIC/PLIC.H b/src/twoPhaseModels/interfaceCompression/PLIC/PLIC.H similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/PLIC/PLIC.H rename to src/twoPhaseModels/interfaceCompression/PLIC/PLIC.H index 036558d4c1..058be6483d 100644 --- a/src/twoPhaseModels/twoPhaseMixture/PLIC/PLIC.H +++ b/src/twoPhaseModels/interfaceCompression/PLIC/PLIC.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/PLIC/PLICU.C b/src/twoPhaseModels/interfaceCompression/PLIC/PLICU.C similarity index 96% rename from src/twoPhaseModels/twoPhaseMixture/PLIC/PLICU.C rename to src/twoPhaseModels/interfaceCompression/PLIC/PLICU.C index 33570d360e..1145cfed10 100644 --- a/src/twoPhaseModels/twoPhaseMixture/PLIC/PLICU.C +++ b/src/twoPhaseModels/interfaceCompression/PLIC/PLICU.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/PLIC/PLICU.H b/src/twoPhaseModels/interfaceCompression/PLIC/PLICU.H similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/PLIC/PLICU.H rename to src/twoPhaseModels/interfaceCompression/PLIC/PLICU.H index 1c2e70a2ee..94756fe08b 100644 --- a/src/twoPhaseModels/twoPhaseMixture/PLIC/PLICU.H +++ b/src/twoPhaseModels/interfaceCompression/PLIC/PLICU.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/interfaceCompression/interfaceCompression.C b/src/twoPhaseModels/interfaceCompression/interfaceCompression/interfaceCompression.C similarity index 97% rename from src/twoPhaseModels/twoPhaseMixture/interfaceCompression/interfaceCompression.C rename to src/twoPhaseModels/interfaceCompression/interfaceCompression/interfaceCompression.C index 7956f00994..95bf01f39b 100644 --- a/src/twoPhaseModels/twoPhaseMixture/interfaceCompression/interfaceCompression.C +++ b/src/twoPhaseModels/interfaceCompression/interfaceCompression/interfaceCompression.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/interfaceCompression/interfaceCompression.H b/src/twoPhaseModels/interfaceCompression/interfaceCompression/interfaceCompression.H similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/interfaceCompression/interfaceCompression.H rename to src/twoPhaseModels/interfaceCompression/interfaceCompression/interfaceCompression.H index 671733878b..19d0a023a9 100644 --- a/src/twoPhaseModels/twoPhaseMixture/interfaceCompression/interfaceCompression.H +++ b/src/twoPhaseModels/interfaceCompression/interfaceCompression/interfaceCompression.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/noInterfaceCompression/noInterfaceCompression.C b/src/twoPhaseModels/interfaceCompression/noInterfaceCompression/noInterfaceCompression.C similarity index 95% rename from src/twoPhaseModels/twoPhaseMixture/noInterfaceCompression/noInterfaceCompression.C rename to src/twoPhaseModels/interfaceCompression/noInterfaceCompression/noInterfaceCompression.C index 61b1277112..0c680b69a8 100644 --- a/src/twoPhaseModels/twoPhaseMixture/noInterfaceCompression/noInterfaceCompression.C +++ b/src/twoPhaseModels/interfaceCompression/noInterfaceCompression/noInterfaceCompression.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/noInterfaceCompression/noInterfaceCompression.H b/src/twoPhaseModels/interfaceCompression/noInterfaceCompression/noInterfaceCompression.H similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/noInterfaceCompression/noInterfaceCompression.H rename to src/twoPhaseModels/interfaceCompression/noInterfaceCompression/noInterfaceCompression.H index d6c3ec7d67..92bdaf7eef 100644 --- a/src/twoPhaseModels/twoPhaseMixture/noInterfaceCompression/noInterfaceCompression.H +++ b/src/twoPhaseModels/interfaceCompression/noInterfaceCompression/noInterfaceCompression.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/interfaceProperties/Make/options b/src/twoPhaseModels/interfaceProperties/Make/options index c59005f7d9..30295c72da 100644 --- a/src/twoPhaseModels/interfaceProperties/Make/options +++ b/src/twoPhaseModels/interfaceProperties/Make/options @@ -1,8 +1,7 @@ EXE_INC = \ - -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/twoPhaseProperties/alphaContactAngle/alphaContactAngle \ + -I$(LIB_SRC)/twoPhaseModels/twoPhaseProperties/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ - -ltwoPhaseMixture \ + -ltwoPhaseProperties \ -lfiniteVolume diff --git a/src/twoPhaseModels/interfaceProperties/interfaceProperties.C b/src/twoPhaseModels/interfaceProperties/interfaceProperties.C index 92779553a4..12c23a88d4 100644 --- a/src/twoPhaseModels/interfaceProperties/interfaceProperties.C +++ b/src/twoPhaseModels/interfaceProperties/interfaceProperties.C @@ -148,14 +148,18 @@ void Foam::interfaceProperties::calculateK() Foam::interfaceProperties::interfaceProperties ( + const IOdictionary& dict, volScalarField& alpha1, volScalarField& alpha2, - const volVectorField& U, - const IOdictionary& dict + const volVectorField& U ) : phasePropertiesDict_(dict), + alpha1_(alpha1), + alpha2_(alpha2), + U_(U), + sigmaPtr_(surfaceTensionModel::New(dict, alpha1.mesh())), deltaN_ @@ -164,10 +168,6 @@ Foam::interfaceProperties::interfaceProperties 1e-8/pow(average(alpha1.mesh().V()), 1.0/3.0) ), - alpha1_(alpha1), - alpha2_(alpha2), - U_(U), - nHatf_ ( IOobject diff --git a/src/twoPhaseModels/interfaceProperties/interfaceProperties.H b/src/twoPhaseModels/interfaceProperties/interfaceProperties.H index af1429a85d..23e007b6f2 100644 --- a/src/twoPhaseModels/interfaceProperties/interfaceProperties.H +++ b/src/twoPhaseModels/interfaceProperties/interfaceProperties.H @@ -25,11 +25,8 @@ Class Foam::interfaceProperties Description - Contains the interface properties. - - Properties to aid interFoam: - -# Correct the alpha boundary condition for dynamic contact angle. - -# Calculate interface curvature. + Contains the interface properties. Surface tension, interface curvature, + and functionality to correct alpha contact angle boundary conditions. SourceFiles interfaceProperties.C @@ -60,16 +57,25 @@ class interfaceProperties //- Keep a reference to the phaseProperties dictionary const dictionary& phasePropertiesDict_; + //- Volume fraction of phase 1 + volScalarField& alpha1_; + + //- Volume fraction of phase 2 + volScalarField& alpha2_; + + //- Mixture velocity + const volVectorField& U_; + //- Surface tension autoPtr sigmaPtr_; //- Stabilisation for normalisation of the interface normal const dimensionedScalar deltaN_; - volScalarField& alpha1_; - volScalarField& alpha2_; - const volVectorField& U_; + //- ... surfaceScalarField nHatf_; + + //- ... volScalarField K_; @@ -92,13 +98,14 @@ public: // Constructors - //- Construct from volume fraction field gamma and IOdictionary + //- Construct from dictionary, volume fraction fields and mixture + // velocity interfaceProperties ( + const IOdictionary& dict, volScalarField& alpha1, volScalarField& alpha2, - const volVectorField& U, - const IOdictionary& + const volVectorField& U ); //- Disallow default bitwise copy construction @@ -112,18 +119,23 @@ public: // Member Functions + inline const volVectorField& U() const + { + return U_; + } + const dimensionedScalar& deltaN() const { return deltaN_; } - tmp n() const; - const surfaceScalarField& nHatf() const { return nHatf_; } + tmp n() const; + tmp sigmaK() const; tmp surfaceTensionForce() const; @@ -135,6 +147,7 @@ public: //- Interface fraction in a cell tmp fraction() const; + //- Correct the curvature void correct(); //- Read phaseProperties dictionary diff --git a/src/twoPhaseModels/twoPhaseMixture/Make/files b/src/twoPhaseModels/twoPhaseMixture/Make/files index 6cb3ae7197..adb92c3474 100644 --- a/src/twoPhaseModels/twoPhaseMixture/Make/files +++ b/src/twoPhaseModels/twoPhaseMixture/Make/files @@ -1,15 +1,4 @@ -twoPhaseMixture/twoPhaseMixture.C - -interfaceCompression/interfaceCompression.C -noInterfaceCompression/noInterfaceCompression.C - -MPLIC/MPLICface.C -MPLIC/MPLICcellStorage.C -MPLIC/MPLICcell.C -MPLIC/MPLIC.C -MPLIC/MPLICU.C - -PLIC/PLIC.C -PLIC/PLICU.C +twoPhases.C +twoPhaseMixture.C LIB = $(FOAM_LIBBIN)/libtwoPhaseMixture diff --git a/src/twoPhaseModels/twoPhaseMixture/twoPhaseMixture/twoPhaseMixture.C b/src/twoPhaseModels/twoPhaseMixture/twoPhaseMixture.C similarity index 98% rename from src/twoPhaseModels/twoPhaseMixture/twoPhaseMixture/twoPhaseMixture.C rename to src/twoPhaseModels/twoPhaseMixture/twoPhaseMixture.C index da0eae7328..da78bcf229 100644 --- a/src/twoPhaseModels/twoPhaseMixture/twoPhaseMixture/twoPhaseMixture.C +++ b/src/twoPhaseModels/twoPhaseMixture/twoPhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/twoPhaseModels/twoPhaseMixture/twoPhaseMixture/twoPhaseMixture.H b/src/twoPhaseModels/twoPhaseMixture/twoPhaseMixture.H similarity index 94% rename from src/twoPhaseModels/twoPhaseMixture/twoPhaseMixture/twoPhaseMixture.H rename to src/twoPhaseModels/twoPhaseMixture/twoPhaseMixture.H index c1292bd9b1..d1f4f5e31e 100644 --- a/src/twoPhaseModels/twoPhaseMixture/twoPhaseMixture/twoPhaseMixture.H +++ b/src/twoPhaseModels/twoPhaseMixture/twoPhaseMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Class Foam::twoPhaseMixture Description - A two-phase mixture model + Class to represent a mixture of two phases SourceFiles twoPhaseMixture.C @@ -37,6 +37,7 @@ SourceFiles #include "IOdictionary.H" #include "volFields.H" +#include "twoPhases.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,14 +50,17 @@ namespace Foam class twoPhaseMixture : - public IOdictionary + public IOdictionary, + virtual public twoPhases { // Private data word phase1Name_; + word phase2Name_; volScalarField alpha1_; + volScalarField alpha2_; diff --git a/src/twoPhaseModels/twoPhaseMixture/twoPhases.C b/src/twoPhaseModels/twoPhaseMixture/twoPhases.C new file mode 100644 index 0000000000..8662d3f5b1 --- /dev/null +++ b/src/twoPhaseModels/twoPhaseMixture/twoPhases.C @@ -0,0 +1,35 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "twoPhases.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(twoPhases, 0); +} + +// ************************************************************************* // diff --git a/src/twoPhaseModels/twoPhaseMixture/twoPhases.H b/src/twoPhaseModels/twoPhaseMixture/twoPhases.H new file mode 100644 index 0000000000..bbd71ecd42 --- /dev/null +++ b/src/twoPhaseModels/twoPhaseMixture/twoPhases.H @@ -0,0 +1,92 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::twoPhases + +Description + Interface to two phases + +SourceFiles + twoPhases.C + +\*---------------------------------------------------------------------------*/ + +#ifndef twoPhases_H +#define twoPhases_H + +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class twoPhases Declaration +\*---------------------------------------------------------------------------*/ + +class twoPhases +{ +public: + + TypeName("twoPhases"); + + + // Constructors + + //- Default construct + twoPhases() + {} + + + //- Destructor + virtual ~twoPhases() + {} + + + // Member Functions + + //- Access the mesh + const fvMesh& mesh() const + { + return alpha1().mesh(); + } + + //- Return the phase-fraction of phase 1 + virtual const volScalarField& alpha1() const = 0; + + //- Return the phase-fraction of phase 2 + virtual const volScalarField& alpha2() const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/twoPhaseModels/twoPhaseProperties/Make/options b/src/twoPhaseModels/twoPhaseProperties/Make/options index 3bff533d02..71b7873964 100644 --- a/src/twoPhaseModels/twoPhaseProperties/Make/options +++ b/src/twoPhaseModels/twoPhaseProperties/Make/options @@ -1,9 +1,5 @@ EXE_INC = \ - -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ - -ltwoPhaseMixture \ - -linterfaceProperties \ -lfiniteVolume