diff --git a/applications/solvers/multiphase/VoF/createAlphaFluxes.H b/applications/solvers/multiphase/VoF/createAlphaFluxes.H index 9c1004951b..596eaf3f6c 100644 --- a/applications/solvers/multiphase/VoF/createAlphaFluxes.H +++ b/applications/solvers/multiphase/VoF/createAlphaFluxes.H @@ -10,6 +10,11 @@ IOobject alphaPhi10Header const bool alphaRestart = alphaPhi10Header.typeHeaderOk(true); +if (alphaRestart) +{ + Info << "Restarting alpha" << endl; +} + // MULES flux from previous time-step surfaceScalarField alphaPhi10 ( diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/Allwclean index f06d2f228d..773096f8bb 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwclean +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwclean @@ -3,6 +3,8 @@ cd ${0%/*} || exit 1 # Run from this directory wclean libso twoPhaseMixtureThermo wclean libso surfaceTensionModels +wclean libso VoFphaseCompressibleTurbulenceModels + wclean wclean compressibleInterDyMFoam wclean compressibleInterFilmFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake index 89be748128..7a7a4e7180 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake @@ -6,10 +6,10 @@ cd ${0%/*} || exit 1 # Run from this directory wmake $targetType twoPhaseMixtureThermo wmake $targetType surfaceTensionModels +wmake $targetType VoFphaseCompressibleTurbulenceModels wmake $targetType wmake $targetType compressibleInterDyMFoam wmake $targetType compressibleInterFilmFoam -compressibleInterPhaseTransportFoam/Allwmake $targetType $* #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options index 29b12f3114..57c4b80dce 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options @@ -8,6 +8,8 @@ EXE_INC = \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ + -IVoFphaseCompressibleTurbulenceModels/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude @@ -22,6 +24,7 @@ EXE_LIBS = \ -linterfaceProperties \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lVoFphaseCompressibleTurbulenceModels \ -lfiniteVolume \ -lfvOptions \ -lmeshTools diff --git a/applications/solvers/multiphase/compressibleInterFoam/TEqn.H b/applications/solvers/multiphase/compressibleInterFoam/TEqn.H index 9f9e64d199..26f046545e 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/TEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/TEqn.H @@ -3,7 +3,7 @@ ( fvm::ddt(rho, T) + fvm::div(rhoPhi, T) - fvm::Sp(contErr, T) - - fvm::laplacian(mixture.alphaEff(turbulence->mut()), T) + - fvm::laplacian(turbulence.alphaEff(), T) + ( divU*p + fvc::ddt(rho, K) + fvc::div(rhoPhi, K) diff --git a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H index d5424cc72f..899d1140df 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/UEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H @@ -3,7 +3,7 @@ fvm::ddt(rho, U) + fvm::div(rhoPhi, U) - fvm::Sp(contErr, U) + MRF.DDt(rho, U) - + turbulence->divDevRhoReff(U) + + turbulence.divDevRhoReff(U) == fvOptions(rho, U) ); diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/files b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/Make/files similarity index 72% rename from applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/files rename to applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/Make/files index 7442bf38ad..b7835bde20 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/files +++ b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/Make/files @@ -1,3 +1,4 @@ VoFphaseCompressibleTurbulenceModels.C +compressibleInterPhaseTransportModel.C LIB = $(FOAM_LIBBIN)/libVoFphaseCompressibleTurbulenceModels diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/options b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/Make/options similarity index 70% rename from applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/options rename to applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/Make/options index df993c9ba1..d6736fe7c8 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/Make/options @@ -1,7 +1,9 @@ EXE_INC = \ + -I../twoPhaseMixtureThermo \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/transportModels/incompressible/transportModel \ + -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ @@ -9,12 +11,15 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ + -ltwoPhaseMixtureThermo \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ -lspecie \ + -ltwoPhaseMixture \ + -ltwoPhaseProperties \ + -linterfaceProperties \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ -lincompressibleTransportModels \ -lfiniteVolume \ - -lfvOptions \ -lmeshTools diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModel.H b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModel.H similarity index 100% rename from applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModel.H rename to applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModel.H diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModelFwd.H b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModelFwd.H similarity index 100% rename from applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModelFwd.H rename to applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModelFwd.H diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModels.C b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModels.C similarity index 100% rename from applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModels.C rename to applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModels.C diff --git a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C new file mode 100644 index 0000000000..52089420b8 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C @@ -0,0 +1,200 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 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 "compressibleInterPhaseTransportModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::compressibleInterPhaseTransportModel::compressibleInterPhaseTransportModel +( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const surfaceScalarField& rhoPhi, + const surfaceScalarField& alphaPhi10, + const twoPhaseMixtureThermo& mixture +) +: + twoPhaseTransport_(false), + mixture_(mixture), + phi_(phi), + alphaPhi10_(alphaPhi10) +{ + { + IOdictionary turbulenceProperties + ( + IOobject + ( + turbulenceModel::propertiesName, + U.time().constant(), + U.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + word simulationType + ( + turbulenceProperties.lookup("simulationType") + ); + + if (simulationType == "twoPhaseTransport") + { + twoPhaseTransport_ = true; + } + } + + if (twoPhaseTransport_) + { + const volScalarField& alpha1(mixture_.alpha1()); + const volScalarField& alpha2(mixture_.alpha2()); + + const volScalarField& rho1 = mixture_.thermo1().rho(); + const volScalarField& rho2 = mixture_.thermo2().rho(); + + alphaRhoPhi1_ = + ( + new surfaceScalarField + ( + IOobject::groupName("alphaRhoPhi", alpha1.group()), + fvc::interpolate(rho1)*alphaPhi10_ + ) + ); + + alphaRhoPhi2_ = + ( + new surfaceScalarField + ( + IOobject::groupName("alphaRhoPhi", alpha2.group()), + fvc::interpolate(rho2)*(phi_ - alphaPhi10_) + ) + ); + + turbulence1_ = + ( + PhaseCompressibleTurbulenceModel::New + ( + alpha1, + rho1, + U, + alphaRhoPhi1_(), + phi, + mixture.thermo1() + ) + ); + + turbulence2_ = + ( + PhaseCompressibleTurbulenceModel::New + ( + alpha2, + rho2, + U, + alphaRhoPhi2_(), + phi, + mixture.thermo2() + ) + ); + } + else + { + turbulence_ = compressible::turbulenceModel::New + ( + rho, + U, + rhoPhi, + mixture + ); + + turbulence_->validate(); + } +} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp +Foam::compressibleInterPhaseTransportModel::alphaEff() const +{ + if (twoPhaseTransport_) + { + return + mixture_.alpha1()*mixture_.thermo1().alphaEff(turbulence1_->mut()) + + mixture_.alpha2()*mixture_.thermo2().alphaEff(turbulence2_->mut()); + } + else + { + return turbulence_->mut(); + } +} + + +Foam::tmp +Foam::compressibleInterPhaseTransportModel::divDevRhoReff +( + volVectorField& U +) const +{ + if (twoPhaseTransport_) + { + return + turbulence1_->divDevRhoReff(U) + + turbulence2_->divDevRhoReff(U); + } + else + { + return turbulence_->divDevRhoReff(U); + } +} + + +void Foam::compressibleInterPhaseTransportModel::correctPhasePhi() +{ + if (twoPhaseTransport_) + { + const volScalarField& rho1 = mixture_.thermo1().rho(); + const volScalarField& rho2 = mixture_.thermo2().rho(); + + alphaRhoPhi1_.ref() = fvc::interpolate(rho1)*alphaPhi10_; + alphaRhoPhi2_.ref() = fvc::interpolate(rho2)*(phi_ - alphaPhi10_); + } +} + + +void Foam::compressibleInterPhaseTransportModel::correct() +{ + if (twoPhaseTransport_) + { + turbulence1_->correct(); + turbulence2_->correct(); + } + else + { + turbulence_->correct(); + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H new file mode 100644 index 0000000000..b758ce3f9a --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H @@ -0,0 +1,146 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 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::compressibleInterPhaseTransportModel + +Description + Transport model selection class for the compressibleInterFoam family of + solvers. + + By default the standard mixture transport modelling approach is used in + which a single momentum stress model (laminar, non-Newtonian, LES or RAS) is + constructed for the mixture. However if the \c simulationType in + constant/turbulenceProperties is set to \c twoPhaseTransport the alternative + Euler-Euler two-phase transport modelling approach is used in which separate + stress models (laminar, non-Newtonian, LES or RAS) are instantiated for each + of the two phases allowing for different modeling for the phases. + +SourceFiles + compressibleInterPhaseTransportModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleInterPhaseTransportModel_H +#define compressibleInterPhaseTransportModel_H + +#include "twoPhaseMixture.H" +#include "twoPhaseMixtureThermo.H" +#include "turbulentFluidThermoModel.H" +#include "VoFphaseCompressibleTurbulenceModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class compressibleInterPhaseTransportModel Declaration +\*---------------------------------------------------------------------------*/ + +class compressibleInterPhaseTransportModel +{ + // Private data + + //- Switch to select two-phase or mixture transport modelling + Switch twoPhaseTransport_; + + //- Two-phase mixture + const twoPhaseMixtureThermo& mixture_; + + //- Mixture volumetric flux + const surfaceScalarField& phi_; + + //- Phase volumetric flux + const surfaceScalarField& alphaPhi10_; + + //- Phase-1 mass-flux (constructed for two-phase transport) + tmp alphaRhoPhi1_; + + //- Phase-2 mass-flux (constructed for two-phase transport) + tmp alphaRhoPhi2_; + + //- Mixture transport model (constructed for mixture transport) + autoPtr turbulence_; + + //- Phase-1 transport model (constructed for two-phase transport) + autoPtr> turbulence1_; + + //- Phase-2 transport model (constructed for two-phase transport) + autoPtr> turbulence2_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + compressibleInterPhaseTransportModel + ( + const compressibleInterPhaseTransportModel& + ); + + //- Disallow default bitwise assignment + void operator=(const compressibleInterPhaseTransportModel&); + + +public: + + // Constructors + + //- Construct from components + compressibleInterPhaseTransportModel + ( + const volScalarField& rho, + const volVectorField& U, + const surfaceScalarField& phi, + const surfaceScalarField& rhoPhi, + const surfaceScalarField& alphaPhi10, + const twoPhaseMixtureThermo& mixture + ); + + + // Member Functions + + //- Return the effective temperature transport coefficient + tmp alphaEff() const; + + //- Return the effective momentum stress divergence + tmp divDevRhoReff(volVectorField& U) const; + + //- Correct the phase mass-fluxes + // (required for the two-phase transport option) + void correctPhasePhi(); + + //- Correct the phase or mixture transport models + void correct(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options index 4de8fd2713..53bc21eada 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options @@ -3,12 +3,14 @@ EXE_INC = \ -I.. \ -I../../VoF \ -I../twoPhaseMixtureThermo \ + -I../VoFphaseCompressibleTurbulenceModels/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ @@ -25,6 +27,7 @@ EXE_LIBS = \ -linterfaceProperties \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lVoFphaseCompressibleTurbulenceModels \ -ldynamicMesh \ -lmeshTools \ -ldynamicFvMesh \ diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C index 116c4ec00e..2a91b5996a 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C @@ -44,9 +44,7 @@ Description #include "localEulerDdtScheme.H" #include "CrankNicolsonDdtScheme.H" #include "subCycle.H" -#include "twoPhaseMixture.H" -#include "twoPhaseMixtureThermo.H" -#include "turbulentFluidThermoModel.H" +#include "compressibleInterPhaseTransportModel.H" #include "pimpleControl.H" #include "fvOptions.H" #include "CorrectPhi.H" @@ -64,7 +62,6 @@ int main(int argc, char *argv[]) #include "initContinuityErrs.H" #include "createControl.H" #include "createFields.H" - #include "createAlphaFluxes.H" #include "createUf.H" #include "createControls.H" #include "CourantNo.H" @@ -75,8 +72,6 @@ int main(int argc, char *argv[]) const volScalarField& psi1 = mixture.thermo1().psi(); const volScalarField& psi2 = mixture.thermo2().psi(); - turbulence->validate(); - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -149,6 +144,8 @@ int main(int argc, char *argv[]) #include "alphaControls.H" #include "compressibleAlphaEqnSubCycle.H" + turbulence.correctPhasePhi(); + #include "UEqn.H" #include "TEqn.H" @@ -160,7 +157,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { - turbulence->correct(); + turbulence.correct(); } } diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H index dd6c345b85..c34676157a 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/pEqn.H @@ -31,27 +31,43 @@ if (pimple.transonic()) { + #include "rhofs.H" + surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi); surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi); p_rghEqnComp1 = - fvc::ddt(rho1) + fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1) - + correction - ( - psi1*fvm::ddt(p_rgh) - + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + pos(alpha1) + *( + ( + fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f) + - (fvOptions(alpha1, mixture.thermo1().rho())&rho1) + )/rho1 + - fvc::ddt(alpha1) - fvc::div(alphaPhi1) + + (alpha1/rho1) + *correction + ( + psi1*fvm::ddt(p_rgh) + + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + ) ); - deleteDemandDrivenData(p_rghEqnComp1.ref().faceFluxCorrectionPtr()); p_rghEqnComp1.ref().relax(); p_rghEqnComp2 = - fvc::ddt(rho2) + fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2) - + correction - ( - psi2*fvm::ddt(p_rgh) - + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) - ); - deleteDemandDrivenData(p_rghEqnComp2.ref().faceFluxCorrectionPtr()); + pos(alpha2) + *( + ( + fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f) + - (fvOptions(alpha2, mixture.thermo2().rho())&rho2) + )/rho2 + - fvc::ddt(alpha2) - fvc::div(alphaPhi2) + + (alpha2/rho2) + *correction + ( + psi2*fvm::ddt(p_rgh) + + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) + ) + ); p_rghEqnComp2.ref().relax(); } else diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/Make/options index 5827d0b9fd..c4ba110bb3 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/Make/options @@ -3,12 +3,14 @@ EXE_INC = \ -I.. \ -I../../VoF \ -I../twoPhaseMixtureThermo \ + -I../VoFphaseCompressibleTurbulenceModels/lnInclude \ -I$(LIB_SRC)/transportModels/compressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ @@ -34,6 +36,7 @@ EXE_LIBS = \ -linterfaceProperties \ -lturbulenceModels \ -lcompressibleTurbulenceModels \ + -lVoFphaseCompressibleTurbulenceModels \ -lSLGThermo \ -lsurfaceFilmModels \ -lsurfaceFilmDerivedFvPatchFields \ diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/TEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/TEqn.H index 11475fa4bb..9faa68d3dc 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/TEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/TEqn.H @@ -3,7 +3,7 @@ ( fvm::ddt(rho, T) + fvm::div(rhoPhi, T) - fvm::Sp(contErr, T) - - fvm::laplacian(mixture.alphaEff(turbulence->mut()), T) + - fvm::laplacian(turbulence.alphaEff(), T) + ( ( fvc::div(fvc::absolute(phi, U), p) diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/compressibleInterFilmFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/compressibleInterFilmFoam.C index 70a714a46b..b598cc3109 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/compressibleInterFilmFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/compressibleInterFilmFoam.C @@ -41,10 +41,8 @@ Description #include "localEulerDdtScheme.H" #include "CrankNicolsonDdtScheme.H" #include "subCycle.H" -#include "rhoThermo.H" -#include "twoPhaseMixture.H" -#include "twoPhaseMixtureThermo.H" -#include "turbulentFluidThermoModel.H" +#include "compressibleInterPhaseTransportModel.H" +#include "pimpleControl.H" #include "SLGThermo.H" #include "surfaceFilmModel.H" #include "pimpleControl.H" @@ -63,7 +61,6 @@ int main(int argc, char *argv[]) #include "createControl.H" #include "createTimeControls.H" #include "createFields.H" - #include "createAlphaFluxes.H" #include "createSurfaceFilmModel.H" volScalarField& p = mixture.p(); @@ -73,8 +70,6 @@ int main(int argc, char *argv[]) regionModels::surfaceFilmModel& surfaceFilm = tsurfaceFilm(); - turbulence->validate(); - if (!LTS) { #include "readTimeControls.H" @@ -113,6 +108,8 @@ int main(int argc, char *argv[]) #include "alphaControls.H" #include "compressibleAlphaEqnSubCycle.H" + turbulence.correctPhasePhi(); + volScalarField::Internal Srho(surfaceFilm.Srho()); contErr -= posPart(Srho); @@ -127,7 +124,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { - turbulence->correct(); + turbulence.correct(); } } diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/pEqn.H index 27196f0eec..7867727f86 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFilmFoam/pEqn.H @@ -28,27 +28,43 @@ if (pimple.transonic()) { + #include "rhofs.H" + surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi); surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi); p_rghEqnComp1 = - fvc::ddt(rho1) + fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1) - + correction - ( - psi1*fvm::ddt(p_rgh) - + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + pos(alpha1) + *( + ( + fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f) + - (fvOptions(alpha1, mixture.thermo1().rho())&rho1) + )/rho1 + - fvc::ddt(alpha1) - fvc::div(alphaPhi1) + + (alpha1/rho1) + *correction + ( + psi1*fvm::ddt(p_rgh) + + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + ) ); - deleteDemandDrivenData(p_rghEqnComp1.ref().faceFluxCorrectionPtr()); p_rghEqnComp1.ref().relax(); p_rghEqnComp2 = - fvc::ddt(rho2) + fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2) - + correction - ( - psi2*fvm::ddt(p_rgh) - + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) - ); - deleteDemandDrivenData(p_rghEqnComp2.ref().faceFluxCorrectionPtr()); + pos(alpha2) + *( + ( + fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f) + - (fvOptions(alpha2, mixture.thermo2().rho())&rho2) + )/rho2 + - fvc::ddt(alpha2) - fvc::div(alphaPhi2) + + (alpha2/rho2) + *correction + ( + psi2*fvm::ddt(p_rgh) + + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) + ) + ); p_rghEqnComp2.ref().relax(); } else diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C index 4f61ee9841..6a8a92a5b5 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C @@ -34,7 +34,10 @@ Description The momentum and other fluid properties are of the "mixture" and a single momentum equation is solved. - Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. + Either mixture or two-phase transport modelling may be selected. In the + mixture approach a single laminar, RAS or LES model is selected to model the + momentum stress. In the Euler-Euler two-phase approach separate laminar, + RAS or LES selected models are selected for each of the phases. \*---------------------------------------------------------------------------*/ @@ -44,10 +47,7 @@ Description #include "localEulerDdtScheme.H" #include "CrankNicolsonDdtScheme.H" #include "subCycle.H" -#include "rhoThermo.H" -#include "twoPhaseMixture.H" -#include "twoPhaseMixtureThermo.H" -#include "turbulentFluidThermoModel.H" +#include "compressibleInterPhaseTransportModel.H" #include "pimpleControl.H" #include "fvOptions.H" #include "fvcSmooth.H" @@ -64,15 +64,12 @@ int main(int argc, char *argv[]) #include "createControl.H" #include "createTimeControls.H" #include "createFields.H" - #include "createAlphaFluxes.H" volScalarField& p = mixture.p(); volScalarField& T = mixture.T(); const volScalarField& psi1 = mixture.thermo1().psi(); const volScalarField& psi2 = mixture.thermo2().psi(); - turbulence->validate(); - if (!LTS) { #include "readTimeControls.H" @@ -109,6 +106,8 @@ int main(int argc, char *argv[]) #include "alphaControls.H" #include "compressibleAlphaEqnSubCycle.H" + turbulence.correctPhasePhi(); + #include "UEqn.H" volScalarField divU(fvc::div(fvc::absolute(phi, U))); #include "TEqn.H" @@ -121,7 +120,7 @@ int main(int argc, char *argv[]) if (pimple.turbCorr()) { - turbulence->correct(); + turbulence.correct(); } } diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwclean deleted file mode 100755 index 1a0905bd5f..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwclean +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -wclean libso VoFphaseCompressibleTurbulenceModels -wclean - -#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwmake deleted file mode 100755 index cc23fb0ef9..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwmake +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Parse arguments for library compilation -. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments - -wmake $targetType VoFphaseCompressibleTurbulenceModels -wmake $targetType - -#------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/files b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/files deleted file mode 100644 index 0b8f6c19f0..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -compressibleInterPhaseTransportFoam.C - -EXE = $(FOAM_APPBIN)/compressibleInterPhaseTransportFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/options deleted file mode 100644 index 765d6c5768..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/options +++ /dev/null @@ -1,31 +0,0 @@ -EXE_INC = \ - -I. \ - -I$(FOAM_SOLVERS)/multiphase/VoF \ - -I$(FOAM_SOLVERS)/multiphase/compressibleInterFoam/twoPhaseMixtureThermo \ - -I$(FOAM_SOLVERS)/multiphase/compressibleInterFoam \ - -I$(LIB_SRC)/transportModels/compressible/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ - -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ - -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ - -IVoFphaseCompressibleTurbulenceModels/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude - -EXE_LIBS = \ - -ltwoPhaseMixtureThermo \ - -ltwoPhaseSurfaceTension \ - -lcompressibleTransportModels \ - -lfluidThermophysicalModels \ - -lspecie \ - -ltwoPhaseMixture \ - -ltwoPhaseProperties \ - -linterfaceProperties \ - -lturbulenceModels \ - -lcompressibleTurbulenceModels \ - -lVoFphaseCompressibleTurbulenceModels \ - -lfiniteVolume \ - -lfvOptions \ - -lmeshTools diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/TEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/TEqn.H deleted file mode 100644 index 8f64a90584..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/TEqn.H +++ /dev/null @@ -1,37 +0,0 @@ -{ - fvScalarMatrix TEqn - ( - fvm::ddt(rho, T) + fvm::div(rhoPhi, T) - - fvm::Sp(contErr, T) - - fvm::laplacian - ( - mixture.alphaEff - ( - alpha1*turbulence1->mut() - + alpha2*turbulence2->mut() - ), - T - ) - + ( - fvc::div(fvc::absolute(phi, U), p) - + fvc::ddt(rho, K) + fvc::div(rhoPhi, K) - ) - *( - alpha1/mixture.thermo1().Cv() - + alpha2/mixture.thermo2().Cv() - ) - == - fvOptions(rho, T) - ); - - TEqn.relax(); - - fvOptions.constrain(TEqn); - - TEqn.solve(); - - fvOptions.correct(T); - - mixture.correctThermo(); - mixture.correct(); -} diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/UEqn.H deleted file mode 100644 index 15f39cf523..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/UEqn.H +++ /dev/null @@ -1,35 +0,0 @@ - fvVectorMatrix UEqn - ( - fvm::ddt(rho, U) + fvm::div(rhoPhi, U) - - fvm::Sp(contErr, U) - + MRF.DDt(rho, U) - + turbulence1->divDevRhoReff(U) - + turbulence2->divDevRhoReff(U) - == - fvOptions(rho, U) - ); - - UEqn.relax(); - - fvOptions.constrain(UEqn); - - if (pimple.momentumPredictor()) - { - solve - ( - UEqn - == - fvc::reconstruct - ( - ( - mixture.surfaceTensionForce() - - ghf*fvc::snGrad(rho) - - fvc::snGrad(p_rgh) - ) * mesh.magSf() - ) - ); - - fvOptions.correct(U); - - K = 0.5*magSqr(U); - } diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/compressibleInterPhaseTransportFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/compressibleInterPhaseTransportFoam.C deleted file mode 100644 index 81d03d31e5..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/compressibleInterPhaseTransportFoam.C +++ /dev/null @@ -1,180 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2017 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 . - -Application - compressibleInterPhaseTransportFoam - -Description - Solver for 2 compressible, non-isothermal immiscible fluids using a VOF - (volume of fluid) phase-fraction based interface capturing approach. - - The momentum and other fluid properties are of the "mixture" and a single - momentum equation is solved. - - The fluid stress modelling is generic Euler-Euler two-phase in which - separate laminar, RAS or LES are selected for each of the phases. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "CMULES.H" -#include "EulerDdtScheme.H" -#include "localEulerDdtScheme.H" -#include "CrankNicolsonDdtScheme.H" -#include "subCycle.H" -#include "rhoThermo.H" -#include "twoPhaseMixture.H" -#include "twoPhaseMixtureThermo.H" -#include "turbulentFluidThermoModel.H" -#include "pimpleControl.H" -#include "fvOptions.H" -#include "fvcSmooth.H" -#include "VoFphaseCompressibleTurbulenceModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "postProcess.H" - - #include "setRootCase.H" - #include "createTime.H" - #include "createMesh.H" - #include "createControl.H" - #include "createTimeControls.H" - #include "createFields.H" - #include "createAlphaFluxes.H" - - volScalarField& p = mixture.p(); - volScalarField& T = mixture.T(); - const volScalarField& psi1 = mixture.thermo1().psi(); - const volScalarField& psi2 = mixture.thermo2().psi(); - - - surfaceScalarField alphaRhoPhi1 - ( - IOobject::groupName("alphaRhoPhi", alpha1.group()), - fvc::interpolate(rho1)*alphaPhi10 - ); - - autoPtr> turbulence1 - ( - PhaseCompressibleTurbulenceModel::New - ( - alpha1, - rho1, - U, - alphaRhoPhi1, - phi, - mixture.thermo1() - ) - ); - - surfaceScalarField alphaRhoPhi2 - ( - IOobject::groupName("alphaRhoPhi", alpha2.group()), - fvc::interpolate(rho2)*(phi - alphaPhi10) - ); - - autoPtr> turbulence2 - ( - PhaseCompressibleTurbulenceModel::New - ( - alpha2, - rho2, - U, - alphaRhoPhi2, - phi, - mixture.thermo2() - ) - ); - - if (!LTS) - { - #include "readTimeControls.H" - #include "CourantNo.H" - #include "setInitialDeltaT.H" - } - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (runTime.run()) - { - #include "readTimeControls.H" - - if (LTS) - { - #include "setRDeltaT.H" - } - else - { - #include "CourantNo.H" - #include "alphaCourantNo.H" - #include "setDeltaT.H" - } - - runTime++; - - Info<< "Time = " << runTime.timeName() << nl << endl; - - // --- Pressure-velocity PIMPLE corrector loop - while (pimple.loop()) - { - #include "alphaControls.H" - #include "compressibleAlphaEqnSubCycle.H" - - alphaRhoPhi1 = fvc::interpolate(rho1)*alphaPhi10; - alphaRhoPhi2 = fvc::interpolate(rho2)*(phi - alphaPhi10); - - #include "UEqn.H" - #include "TEqn.H" - - // --- Pressure corrector loop - while (pimple.correct()) - { - #include "pEqn.H" - } - - if (pimple.turbCorr()) - { - turbulence1->correct(); - turbulence2->correct(); - } - } - - runTime.write(); - - Info<< "ExecutionTime = " - << runTime.elapsedCpuTime() - << " s\n\n" << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/createFields.H deleted file mode 100644 index 4052a10b2f..0000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/createFields.H +++ /dev/null @@ -1,96 +0,0 @@ -#include "createRDeltaT.H" - -Info<< "Reading field p_rgh\n" << endl; -volScalarField p_rgh -( - IOobject - ( - "p_rgh", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -Info<< "Reading field U\n" << endl; -volVectorField U -( - IOobject - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -#include "createPhi.H" - -Info<< "Constructing twoPhaseMixtureThermo\n" << endl; -twoPhaseMixtureThermo mixture(U, phi); - -volScalarField& alpha1(mixture.alpha1()); -volScalarField& alpha2(mixture.alpha2()); - -Info<< "Reading thermophysical properties\n" << endl; - -const volScalarField& rho1 = mixture.thermo1().rho(); -const volScalarField& rho2 = mixture.thermo2().rho(); - -volScalarField rho -( - IOobject - ( - "rho", - runTime.timeName(), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE - ), - alpha1*rho1 + alpha2*rho2 -); - - -dimensionedScalar pMin -( - "pMin", - dimPressure, - mixture -); - -mesh.setFluxRequired(p_rgh.name()); -mesh.setFluxRequired(alpha1.name()); - - -#include "readGravitationalAcceleration.H" -#include "readhRef.H" -#include "gh.H" - - -// Mass flux -// Initialisation does not matter because rhoPhi is reset after the -// alpha1 solution before it is used in the U equation. -surfaceScalarField rhoPhi -( - IOobject - ( - "rhoPhi", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - fvc::interpolate(rho)*phi -); - -volScalarField dgdt(alpha1*fvc::div(phi)); - -Info<< "Creating field kinetic energy K\n" << endl; -volScalarField K("K", 0.5*magSqr(U)); - -#include "createMRF.H" -#include "createFvOptions.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/createFields.H index 9100429be0..9ac2034129 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleInterFoam/createFields.H @@ -89,10 +89,17 @@ surfaceScalarField rhoPhi volScalarField dgdt(alpha1*fvc::div(phi)); +#include "createAlphaFluxes.H" + // Construct compressible turbulence model -autoPtr turbulence +compressibleInterPhaseTransportModel turbulence ( - compressible::turbulenceModel::New(rho, U, rhoPhi, mixture) + rho, + U, + phi, + rhoPhi, + alphaPhi10, + mixture ); #include "createK.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H index 54bbcc5e4d..e7f00b91a1 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H @@ -28,27 +28,43 @@ if (pimple.transonic()) { + #include "rhofs.H" + surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi); surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi); p_rghEqnComp1 = - fvc::ddt(rho1) + fvc::div(phi, rho1) - fvc::Sp(fvc::div(phi), rho1) - + correction - ( - psi1*fvm::ddt(p_rgh) - + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + pos(alpha1) + *( + ( + fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f) + - (fvOptions(alpha1, mixture.thermo1().rho())&rho1) + )/rho1 + - fvc::ddt(alpha1) - fvc::div(alphaPhi1) + + (alpha1/rho1) + *correction + ( + psi1*fvm::ddt(p_rgh) + + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) + ) ); - deleteDemandDrivenData(p_rghEqnComp1.ref().faceFluxCorrectionPtr()); p_rghEqnComp1.ref().relax(); p_rghEqnComp2 = - fvc::ddt(rho2) + fvc::div(phi, rho2) - fvc::Sp(fvc::div(phi), rho2) - + correction - ( - psi2*fvm::ddt(p_rgh) - + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) - ); - deleteDemandDrivenData(p_rghEqnComp2.ref().faceFluxCorrectionPtr()); + pos(alpha2) + *( + ( + fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f) + - (fvOptions(alpha2, mixture.thermo2().rho())&rho2) + )/rho2 + - fvc::ddt(alpha2) - fvc::div(alphaPhi2) + + (alpha2/rho2) + *correction + ( + psi2*fvm::ddt(p_rgh) + + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) + ) + ); p_rghEqnComp2.ref().relax(); } else diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H index 2b0c178f14..91e574bcd6 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/pU/pEqn.H @@ -326,10 +326,6 @@ while (pimple.correct()) ).ptr() ); - deleteDemandDrivenData - ( - pEqnComps[phasei].faceFluxCorrectionPtr() - ); pEqnComps[phasei].relax(); } else diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H index c30d4f1465..93c6e3b589 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pU/pEqn.H @@ -255,7 +255,6 @@ while (pimple.correct()) ) ); - deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr()); pEqnComp1.ref().relax(); } else @@ -297,7 +296,6 @@ while (pimple.correct()) ) ); - deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr()); pEqnComp2.ref().relax(); } else diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H index d2202eb890..b0c8e46b1c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/pUf/pEqn.H @@ -241,7 +241,6 @@ while (pimple.correct()) ) ); - deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr()); pEqnComp1.ref().relax(); } else @@ -283,7 +282,6 @@ while (pimple.correct()) ) ); - deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr()); pEqnComp2.ref().relax(); } else diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H index eabc3961df..71d75bd26e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H @@ -262,7 +262,6 @@ while (pimple.correct()) + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) ) ); - deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr()); pEqnComp1.ref().relax(); pEqnComp2 = @@ -278,7 +277,6 @@ while (pimple.correct()) + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) ) ); - deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr()); pEqnComp2.ref().relax(); } else diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/pEqn.H index f8388b2d45..0e1b3b7ff6 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pUf/pEqn.H @@ -243,7 +243,6 @@ while (pimple.correct()) + fvm::div(phid1, p_rgh) - fvm::Sp(fvc::div(phid1), p_rgh) ) ); - deleteDemandDrivenData(pEqnComp1.ref().faceFluxCorrectionPtr()); pEqnComp1.ref().relax(); pEqnComp2 = @@ -259,7 +258,6 @@ while (pimple.correct()) + fvm::div(phid2, p_rgh) - fvm::Sp(fvc::div(phid2), p_rgh) ) ); - deleteDemandDrivenData(pEqnComp2.ref().faceFluxCorrectionPtr()); pEqnComp2.ref().relax(); } else diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C index a312cd97f9..d1e941c534 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -1450,14 +1450,9 @@ Foam::tmp> Foam::correction { tmp> tAcorr = A - (A & A.psi()); - if - ( - (A.hasUpper() || A.hasLower()) - && A.psi().mesh().fluxRequired(A.psi().name()) - ) - { - tAcorr().faceFluxCorrectionPtr() = (-A.flux()).ptr(); - } + // Delete the faceFluxCorrection from the correction matrix + // as it does not have a clear meaning or purpose + deleteDemandDrivenData(tAcorr.ref().faceFluxCorrectionPtr()); return tAcorr; } @@ -1471,17 +1466,9 @@ Foam::tmp> Foam::correction { tmp> tAcorr = tA - (tA() & tA().psi()); - // Note the matrix coefficients are still that of matrix A - const fvMatrix& A = tAcorr(); - - if - ( - (A.hasUpper() || A.hasLower()) - && A.psi().mesh().fluxRequired(A.psi().name()) - ) - { - tAcorr.ref().faceFluxCorrectionPtr() = (-A.flux()).ptr(); - } + // Delete the faceFluxCorrection from the correction matrix + // as it does not have a clear meaning or purpose + deleteDemandDrivenData(tAcorr.ref().faceFluxCorrectionPtr()); return tAcorr; } diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/T b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0.orig/T similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/T rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0.orig/T diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/U b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0.orig/U similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/U rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0.orig/U diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/alpha.liquid b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0.orig/alpha.liquid similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/alpha.liquid rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0.orig/alpha.liquid diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0.orig/p similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0.orig/p diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p_rgh b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0.orig/p_rgh similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p_rgh rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0.orig/p_rgh diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/sigma.liquid b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0.orig/sigma.liquid similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/sigma.liquid rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/0.orig/sigma.liquid diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allclean b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/Allclean similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allclean rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/Allclean diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allrun b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/Allrun similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allrun rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/Allrun diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/README b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/README similarity index 71% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/README rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/README index 35bf18558d..7d86d1f62f 100644 --- a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/README +++ b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/README @@ -5,9 +5,10 @@ Reference: A two-phase solver for complex fluids: Studies of the Weissenberg effect. International Journal of Multiphase Flow, 84, 98-115. -In compressibleInterPhaseTransportFoam, separate stress models -(laminar, non-Newtonian, LES or RAS) are instantiated for each of the -two phases allowing for different modeling for the phases. +In compressibleInterFoam with turbulenceProperties simulationType set to +twoPhaseTransport separate stress models (laminar, non-Newtonian, LES or RAS) +are instantiated for each of the two phases allowing for different modeling for +the phases. This example case uses: - phases "air" and "liquid" @@ -35,6 +36,6 @@ Liquid phase properties were calculated from the relations given in the paper: => mu_{s} = 14.6/10 = 1.46 Pa.s => nu_{p} = nuM = (9/10)*14.6/890 = 0.01476 m^2/s -compressibleInterPhaseTransportFoam solves the energy equation, despite not -being needed in this example. The case is simply initialised at a uniform -temperature of 300K throughout the domain and at the atmosphere boundary. \ No newline at end of file +compressibleInterFoam solves the energy equation, despite not being needed in +this example. The case is simply initialised at a uniform temperature of 300K +throughout the domain and at the atmosphere boundary. diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/fvOptions b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/fvOptions similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/fvOptions rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/fvOptions diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/g b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/g similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/g rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/g diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/thermophysicalProperties similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/thermophysicalProperties diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.air b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/thermophysicalProperties.air similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.air rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/thermophysicalProperties.air diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.liquid b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/thermophysicalProperties.liquid similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.liquid rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/thermophysicalProperties.liquid diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/turbulenceProperties b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/turbulenceProperties new file mode 100644 index 0000000000..a7ca412294 --- /dev/null +++ b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType twoPhaseTransport; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.air b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/turbulenceProperties.air similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.air rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/turbulenceProperties.air diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.liquid b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/turbulenceProperties.liquid similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.liquid rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/constant/turbulenceProperties.liquid diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/blockMeshDict b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/blockMeshDict similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/blockMeshDict rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/blockMeshDict diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/controlDict b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/controlDict similarity index 96% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/controlDict rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/controlDict index 69d4146a96..5205a899ca 100644 --- a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/controlDict +++ b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application compressibleInterPhaseTransportFoam; +application compressibleInterFoam; startFrom latestTime; diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/extrudeMeshDict b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/extrudeMeshDict similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/extrudeMeshDict rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/extrudeMeshDict diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/fvSchemes similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSchemes rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/fvSchemes diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSolution b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/fvSolution similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSolution rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/fvSolution diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/setFieldsDict b/tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/setFieldsDict similarity index 100% rename from tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/setFieldsDict rename to tutorials/multiphase/compressibleInterFoam/laminar/climbingRod/system/setFieldsDict