From e96e40bb6c664e3094dbaa20043a34bd39a073ca Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 30 Oct 2017 09:36:43 +0000 Subject: [PATCH] compressibleInterPhaseTransportFoam: New variant of compressibleInterFoam supporting separate phase stress models In this version of compressibleInterFoam separate stress models (laminar, non-Newtonian, LES or RAS) are instantiated for each of the two phases allowing for completely different modeling for the phases. e.g. in the climbingRod tutorial case provided a Newtonian laminar model is instantiated for the air and a Maxwell non-Newtonian model is instantiated for the viscoelastic liquid. To stabilize the Maxwell model in regions where the liquid phase-fraction is 0 the new symmTensorPhaseLimitStabilization fvOption is applied. Other phase stress modeling combinations are also possible, e.g. the air may be turbulent but the liquid laminar and an RAS or LES model applied to the air only. However, to stabilize this combination a suitable fvOption would need to be applied to the turbulence properties where the air phase-fraction is 0. Henry G. Weller, Chris Greenshields CFD Direct Ltd. --- .../Allwclean | 7 + .../Allwmake | 10 + .../Make/files | 3 + .../Make/options | 32 ++++ .../TEqn.H | 37 ++++ .../UEqn.H | 35 ++++ .../Make/files | 3 + .../Make/options | 24 +++ .../VoFphaseCompressibleTurbulenceModel.H | 52 +++++ .../VoFphaseCompressibleTurbulenceModelFwd.H | 55 ++++++ .../VoFphaseCompressibleTurbulenceModels.C | 90 +++++++++ .../compressibleInterPhaseTransportFoam.C | 180 ++++++++++++++++++ .../createFields.H | 96 ++++++++++ .../climbingRod/0.orig/T | 37 ++++ .../climbingRod/0.orig/U | 47 +++++ .../climbingRod/0.orig/alpha.water | 37 ++++ .../climbingRod/0.orig/p | 38 ++++ .../climbingRod/0.orig/p_rgh | 38 ++++ .../climbingRod/0.orig/sigma.water | 38 ++++ .../climbingRod/Allclean | 10 + .../climbingRod/Allrun | 18 ++ .../climbingRod/README | 5 + .../climbingRod/constant/fvOptions | 28 +++ .../climbingRod/constant/g | 22 +++ .../constant/thermophysicalProperties | 24 +++ .../constant/thermophysicalProperties.air | 52 +++++ .../constant/thermophysicalProperties.water | 52 +++++ .../constant/turbulenceProperties.air | 21 ++ .../constant/turbulenceProperties.water | 29 +++ .../climbingRod/system/blockMeshDict | 114 +++++++++++ .../climbingRod/system/controlDict | 56 ++++++ .../climbingRod/system/extrudeMeshDict | 35 ++++ .../climbingRod/system/fvSchemes | 65 +++++++ .../climbingRod/system/fvSolution | 91 +++++++++ .../climbingRod/system/setFieldsDict | 36 ++++ 35 files changed, 1517 insertions(+) create mode 100755 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwclean create mode 100755 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwmake create mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/files create mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/options create mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/TEqn.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/UEqn.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/files create mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/options create mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModel.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModelFwd.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModels.C create mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/compressibleInterPhaseTransportFoam.C create mode 100644 applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/createFields.H create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/T create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/U create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/alpha.water create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p_rgh create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/sigma.water create mode 100755 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allclean create mode 100755 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allrun create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/README create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/fvOptions create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/g create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.air create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.water create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.air create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.water create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/blockMeshDict create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/controlDict create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/extrudeMeshDict create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSchemes create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSolution create mode 100644 tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/setFieldsDict diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwclean new file mode 100755 index 000000000..1a0905bd5 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwclean @@ -0,0 +1,7 @@ +#!/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 new file mode 100755 index 000000000..cc23fb0ef --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Allwmake @@ -0,0 +1,10 @@ +#!/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 new file mode 100644 index 000000000..0b8f6c19f --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/files @@ -0,0 +1,3 @@ +compressibleInterPhaseTransportFoam.C + +EXE = $(FOAM_APPBIN)/compressibleInterPhaseTransportFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/options new file mode 100644 index 000000000..72ec7768f --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/Make/options @@ -0,0 +1,32 @@ +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 \ + -lphaseCompressibleTurbulenceModels \ + -L$(FOAM_USER_LIBBIN) -lVoFphaseCompressibleTurbulenceModels \ + -lfiniteVolume \ + -lfvOptions \ + -lmeshTools diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/TEqn.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/TEqn.H new file mode 100644 index 000000000..8f64a9058 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/TEqn.H @@ -0,0 +1,37 @@ +{ + 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 new file mode 100644 index 000000000..15f39cf52 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/UEqn.H @@ -0,0 +1,35 @@ + 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/VoFphaseCompressibleTurbulenceModels/Make/files b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/files new file mode 100644 index 000000000..1652afd58 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/files @@ -0,0 +1,3 @@ +VoFphaseCompressibleTurbulenceModels.C + +LIB = $(FOAM_USER_LIBBIN)/libVoFphaseCompressibleTurbulenceModels diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/options new file mode 100644 index 000000000..e18f6a8fd --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/Make/options @@ -0,0 +1,24 @@ +EXE_INC = \ + -I../twoPhaseSystem/lnInclude \ + -I../interfacialModels/lnInclude\ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/transportModels/incompressible/transportModel \ + -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +LIB_LIBS = \ + -lcompressibleTransportModels \ + -lfluidThermophysicalModels \ + -lspecie \ + -lturbulenceModels \ + -lcompressibleTurbulenceModels \ + -lincompressibleTransportModels \ + -lcompressibleTwoPhaseSystem \ + -lcompressibleEulerianInterfacialModels \ + -lfiniteVolume \ + -lfvOptions \ + -lmeshTools diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModel.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModel.H new file mode 100644 index 000000000..0f0aebf7f --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModel.H @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 . + +Typedef + Foam::VoFphaseCompressibleTurbulenceModel + +Description + Typedef for VoFphaseCompressibleTurbulenceModel + +\*---------------------------------------------------------------------------*/ + +#ifndef VoFphaseCompressibleTurbulenceModel_H +#define VoFphaseCompressibleTurbulenceModel_H + +#include "VoFphaseCompressibleTurbulenceModelFwd.H" +#include "PhaseCompressibleTurbulenceModel.H" +#include "ThermalDiffusivity.H" +#include "fluidThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef ThermalDiffusivity> + VoFphaseCompressibleTurbulenceModel; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModelFwd.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModelFwd.H new file mode 100644 index 000000000..f2b88268f --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModelFwd.H @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 . + +Typedef + Foam::VoFphaseCompressibleTurbulenceModel + +Description + Forward declaration of typedef for VoFphaseCompressibleTurbulenceModel + +\*---------------------------------------------------------------------------*/ + +#ifndef VoFphaseCompressibleTurbulenceModelFwd_H +#define VoFphaseCompressibleTurbulenceModelFwd_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + class fluidThermo; + + template + class PhaseCompressibleTurbulenceModel; + + template + class ThermalDiffusivity; + + typedef ThermalDiffusivity> + VoFphaseCompressibleTurbulenceModel; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModels.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModels.C new file mode 100644 index 000000000..bdee8e066 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/VoFphaseCompressibleTurbulenceModels/VoFphaseCompressibleTurbulenceModels.C @@ -0,0 +1,90 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "PhaseCompressibleTurbulenceModel.H" +#include "fluidThermo.H" +#include "addToRunTimeSelectionTable.H" +#include "makeTurbulenceModel.H" + +#include "ThermalDiffusivity.H" +#include "EddyDiffusivity.H" + +#include "laminarModel.H" +#include "RASModel.H" +#include "LESModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeTurbulenceModelTypes +( + volScalarField, + volScalarField, + compressibleTurbulenceModel, + PhaseCompressibleTurbulenceModel, + ThermalDiffusivity, + fluidThermo +); + +makeBaseTurbulenceModel +( + volScalarField, + volScalarField, + compressibleTurbulenceModel, + PhaseCompressibleTurbulenceModel, + ThermalDiffusivity, + fluidThermo +); + +#define makeLaminarModel(Type) \ + makeTemplatedLaminarModel \ + (fluidThermoPhaseCompressibleTurbulenceModel, laminar, Type) + +#define makeRASModel(Type) \ + makeTemplatedTurbulenceModel \ + (fluidThermoPhaseCompressibleTurbulenceModel, RAS, Type) + +#define makeLESModel(Type) \ + makeTemplatedTurbulenceModel \ + (fluidThermoPhaseCompressibleTurbulenceModel, LES, Type) + +#include "Stokes.H" +makeLaminarModel(Stokes); + +#include "Maxwell.H" +makeLaminarModel(Maxwell); + +#include "kEpsilon.H" +makeRASModel(kEpsilon); + +#include "kOmegaSST.H" +makeRASModel(kOmegaSST); + +#include "Smagorinsky.H" +makeLESModel(Smagorinsky); + +#include "kEqn.H" +makeLESModel(kEqn); + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/compressibleInterPhaseTransportFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/compressibleInterPhaseTransportFoam.C new file mode 100644 index 000000000..81d03d31e --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/compressibleInterPhaseTransportFoam.C @@ -0,0 +1,180 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 new file mode 100644 index 000000000..4052a10b2 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterPhaseTransportFoam/createFields.H @@ -0,0 +1,96 @@ +#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/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/T b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/T new file mode 100644 index 000000000..4d5be8a06 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/T @@ -0,0 +1,37 @@ +/*--------------------------------*- 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 volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + wall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/U b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/U new file mode 100644 index 000000000..d4936877e --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/U @@ -0,0 +1,47 @@ +/*--------------------------------*- 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 volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + rod + { + type rotatingWallVelocity; + axis (0 1 0); + origin (0 0 0); + omega constant 13.2; // 2.1 rev/s + value uniform (0 0 0); + } + vessel + { + type noSlip; + } + + atmosphere + { + type pressureInletOutletVelocity; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/alpha.water b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/alpha.water new file mode 100644 index 000000000..70e7c0f55 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/alpha.water @@ -0,0 +1,37 @@ +/*--------------------------------*- 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 volScalarField; + object alpha.water; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + wall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p new file mode 100644 index 000000000..bf53993b2 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p @@ -0,0 +1,38 @@ +/*--------------------------------*- 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 volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + wall + { + type calculated; + value $internalField; + } + + atmosphere + { + type calculated; + value $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p_rgh b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p_rgh new file mode 100644 index 000000000..7864dbd7e --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/p_rgh @@ -0,0 +1,38 @@ +/*--------------------------------*- 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 volScalarField; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + wall + { + type fixedFluxPressure; + value $internalField; + } + + atmosphere + { + type totalPressure; + p0 $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/sigma.water b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/sigma.water new file mode 100644 index 000000000..9794cda54 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/0.orig/sigma.water @@ -0,0 +1,38 @@ +/*--------------------------------*- 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 volSymmTensorField; + object sigma; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform (0 0 0 0 0 0); + +boundaryField +{ + wall + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue $internalField; + } + + #includeEtc "caseDicts/setConstraintTypes" +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allclean b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allclean new file mode 100755 index 000000000..7bafa2553 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm -rf 0 2> /dev/null + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allrun b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allrun new file mode 100755 index 000000000..f182e99ff --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/Allrun @@ -0,0 +1,18 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Get application name +application=`getApplication` + +runApplication blockMesh +runApplication extrudeMesh + +rm -rf 0 2> /dev/null +cp -r 0.orig 0 +runApplication setFields +runApplication $application + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/README b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/README new file mode 100644 index 000000000..2265de007 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/README @@ -0,0 +1,5 @@ +Reference: + + Figueiredo, R. A., Oishi, C. M., Afonso, A. M., Tasso, I. V. M., & Cuminato, J. A. (2016). + A two-phase solver for complex fluids: Studies of the Weissenberg effect. + International Journal of Multiphase Flow, 84, 98-115. diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/fvOptions b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/fvOptions new file mode 100644 index 000000000..276ebd3d1 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/fvOptions @@ -0,0 +1,28 @@ +/*--------------------------------*- 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 fvOptions; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +stabilization +{ + type symmTensorPhaseLimitStabilization; + + field sigma.water; + rate rLambda.water; + residualAlpha 1e-3; +} + + +//************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/g b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/g new file mode 100644 index 000000000..0cc222ca3 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- 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 uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties new file mode 100644 index 000000000..c89cd4fa6 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties @@ -0,0 +1,24 @@ +/*--------------------------------*- 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 thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phases (water air); + +pMin 10000; + +sigma 0.0309; + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.air b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.air new file mode 100644 index 000000000..382cde79f --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.air @@ -0,0 +1,52 @@ +/*--------------------------------*- 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 thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 28.9; + } + equationOfState + { + rho 1.2; + } + thermodynamics + { + Cp 1007; + Hf 0; + } + transport + { + mu 1.84e-05; + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.water b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.water new file mode 100644 index 000000000..27c9c7b8f --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/thermophysicalProperties.water @@ -0,0 +1,52 @@ +/*--------------------------------*- 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 thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18.0; + } + equationOfState + { + rho 890; + } + thermodynamics + { + Cp 4195; + Hf 0; + } + transport + { + mu 1.46; + Pr 2.289; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.air b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.air new file mode 100644 index 000000000..c2c3b28a1 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.air @@ -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 laminar; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.water b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.water new file mode 100644 index 000000000..2d83fbfd6 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/constant/turbulenceProperties.water @@ -0,0 +1,29 @@ +/*--------------------------------*- 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 laminar; + +laminar +{ + laminarModel Maxwell; + + nuM 0.01476; + lambda 0.018225; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/blockMeshDict b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/blockMeshDict new file mode 100644 index 000000000..984fcfe20 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/blockMeshDict @@ -0,0 +1,114 @@ +/*--------------------------------*- 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; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.001; + +// H 77; +R 6.35; +Rc 152.25; +hTotal 110; + +rCells 80; +hCells 80; + +rGrading +( + (0.1 1 1) + (0.9 2.25 10) +); + +hGrading +( + (0.65 2 0.1) + (0.2 2.4 1) + (0.15 1.2 2) +); + +vertices +( + ($R 0 -1) + ($Rc 0 -1) + ($R $hTotal -1) + ($Rc $hTotal -1) + + ($R 0 0) + ($Rc 0 0) + ($R $hTotal 0) + ($Rc $hTotal 0) + +); + +blocks +( + hex (0 1 3 2 4 5 7 6) + ($rCells $hCells 1) + simpleGrading ($rGrading $hGrading 1) +); + +edges +( +); + +boundary +( + rod + { + type wall; + faces + ( + (0 2 6 4) + ); + } + vessel + { + type wall; + faces + ( + (1 3 7 5) + (0 1 5 4) + ); + } + atmosphere + { + type patch; + faces + ( + (2 3 7 6) + ); + } + back + { + type symmetry; + faces + ( + (0 2 3 1) + ); + } + front + { + type symmetry; + faces + ( + (4 5 7 6) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/controlDict b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/controlDict new file mode 100644 index 000000000..69d4146a9 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/controlDict @@ -0,0 +1,56 @@ +/*--------------------------------*- 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 "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application compressibleInterPhaseTransportFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 25; + +deltaT 1e-3; + +writeControl adjustableRunTime; + +writeInterval 0.5; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 10; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 1; +maxAlphaCo 1; + +maxDeltaT 1; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/extrudeMeshDict b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/extrudeMeshDict new file mode 100644 index 000000000..2beaba7b0 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/extrudeMeshDict @@ -0,0 +1,35 @@ +/*--------------------------------*- 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; + object extrudeProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +constructFrom patch; +sourceCase "$FOAM_CASE"; + +sourcePatches (front); +exposedPatchName back; + +extrudeModel wedge; + +sectorCoeffs +{ + axisPt (0 0 0); + axis (0 -1 0); + angle 1; +} + +flipNormals false; +mergeFaces false; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSchemes b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSchemes new file mode 100644 index 000000000..c02c0e62d --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSchemes @@ -0,0 +1,65 @@ +/*--------------------------------*- 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 "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + div(rhoPhi,U) Gauss linearUpwindV grad(U); + div(rhoPhi,T) Gauss linearUpwind grad(T); + + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss linear; + + div(phi,p) Gauss upwind; + div(rhoPhi,K) Gauss upwind; + + div(alphaRhoPhi.water,sigma.water) Gauss linearUpwind grad(sigma); + + div(((alpha.water*thermo:rho.water)*sigma.water)) Gauss linear; + div((((alpha.water*thermo:rho.water)*nuM)*grad(U))) Gauss linear; + div((((alpha.water*thermo:rho.water)*(thermo:mu.water|thermo:rho.water))*dev2(T(grad(U))))) Gauss linear; + + div((((alpha.air*thermo:rho.air)*nuEff.air)*dev2(T(grad(U))))) Gauss linear; + div((((alpha.water*thermo:rho.water)*nuEff.water)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSolution b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSolution new file mode 100644 index 000000000..a31971f0f --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/fvSolution @@ -0,0 +1,91 @@ +/*--------------------------------*- 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 "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.water.*" + { + nAlphaCorr 2; + nAlphaSubCycles 1; + cAlpha 1; + + MULESCorr yes; + nLimiterIter 5; + + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-8; + relTol 0; + } + + "pcorr.*" + { + solver PCG; + preconditioner DIC; + tolerance 1e-5; + relTol 0; + } + + p_rgh + { + solver PCG; + preconditioner DIC; + tolerance 1e-9; + relTol 0.05; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "U.*" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-6; + relTol 0; + } + + "(T|k|B|nuTilda|sigma).*" + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-8; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/setFieldsDict b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/setFieldsDict new file mode 100644 index 000000000..f86515325 --- /dev/null +++ b/tutorials/multiphase/compressibleInterPhaseTransportFoam/climbingRod/system/setFieldsDict @@ -0,0 +1,36 @@ +/*--------------------------------*- 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 "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha.water 0 +); + +regions +( + boxToCell + { + box (0 0 -1) (1 0.077 1); + fieldValues + ( + volScalarFieldValue alpha.water 1 + ); + } +); + + +// ************************************************************************* //