From ad35fea763980f02bac075883552436ab91ea7ec Mon Sep 17 00:00:00 2001 From: sergio <s.ferraris@opencfd.co.uk> Date: Mon, 15 Feb 2021 12:37:32 -0800 Subject: [PATCH] ENH: new solvers: overCompressibleInterDyMFoam and overInterPhaseChangeDyMFoam - overCompressibleInterDyMFoam: Overset solver for two compressible, non-isothermal, immiscible fluids using a VOF (i.e. volume of fluid) phase-fraction based interface capturing approach. - overInterPhaseChangeDyMFoam: Overset solver for two incompressible, isothermal, immiscible fluids with phase-change (e.g. cavitation) using VoF (i.e. volume of fluid) phase-fraction based interface capturing approach. - adds new tutorials: - multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors - multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com> --- .../multiphase/compressibleInterFoam/Allwmake | 1 + .../overCompressibleInterDyMFoam/Make/files | 3 + .../overCompressibleInterDyMFoam/Make/options | 40 +++ .../overCompressibleInterDyMFoam/TEqn.H | 28 ++ .../overCompressibleInterDyMFoam/UEqn.H | 36 +++ .../overCompressibleInterDyMFoam/alphaSuSp.H | 43 +++ .../createFields.H | 138 ++++++++++ .../overCompressibleInterDyMFoam.C | 240 +++++++++++++++++ .../overCompressibleInterDyMFoam/pEqn.H | 177 +++++++++++++ .../multiphase/interPhaseChangeFoam/Allwmake | 2 + .../overInterPhaseChangeDyMFoam/Make/files | 3 + .../overInterPhaseChangeDyMFoam/Make/options | 35 +++ .../overInterPhaseChangeDyMFoam/UEqn.H | 31 +++ .../overInterPhaseChangeDyMFoam/correctPhi.H | 11 + .../createFields.H | 158 +++++++++++ .../overInterPhaseChangeDyMFoam.C | 250 ++++++++++++++++++ .../overInterPhaseChangeDyMFoam/pEqn.H | 101 +++++++ .../compressibleTwoSimpleRotors/0.orig/T | 44 +++ .../compressibleTwoSimpleRotors/0.orig/U | 56 ++++ .../0.orig/alpha.water | 37 +++ .../compressibleTwoSimpleRotors/0.orig/alphat | 44 +++ .../0.orig/epsilon | 38 +++ .../compressibleTwoSimpleRotors/0.orig/k | 38 +++ .../compressibleTwoSimpleRotors/0.orig/nut | 38 +++ .../compressibleTwoSimpleRotors/0.orig/p | 38 +++ .../compressibleTwoSimpleRotors/0.orig/p_rgh | 37 +++ .../0.orig/pointDisplacement | 42 +++ .../compressibleTwoSimpleRotors/0.orig/zoneID | 37 +++ .../compressibleTwoSimpleRotors/Allclean | 10 + .../compressibleTwoSimpleRotors/Allrun | 17 ++ .../compressibleTwoSimpleRotors/Allrun.pre | 21 ++ .../constant/dynamicMeshDict | 52 ++++ .../compressibleTwoSimpleRotors/constant/g | 21 ++ .../constant/thermophysicalProperties | 28 ++ .../constant/thermophysicalProperties.air | 47 ++++ .../constant/thermophysicalProperties.water | 52 ++++ .../constant/turbulenceProperties | 29 ++ .../system/blockMeshDict | 149 +++++++++++ .../system/controlDict | 111 ++++++++ .../system/decomposeParDict | 27 ++ .../system/fvSchemes | 85 ++++++ .../system/fvSolution | 115 ++++++++ .../system/setFieldsDict | 68 +++++ .../system/topoSetDict | 95 +++++++ .../twoSimpleRotors/0.orig/U | 56 ++++ .../twoSimpleRotors/0.orig/alpha.water | 37 +++ .../twoSimpleRotors/0.orig/alphat | 44 +++ .../twoSimpleRotors/0.orig/epsilon | 38 +++ .../twoSimpleRotors/0.orig/k | 38 +++ .../twoSimpleRotors/0.orig/nut | 38 +++ .../twoSimpleRotors/0.orig/p | 38 +++ .../twoSimpleRotors/0.orig/p_rgh | 37 +++ .../twoSimpleRotors/0.orig/pointDisplacement | 42 +++ .../twoSimpleRotors/0.orig/zoneID | 37 +++ .../twoSimpleRotors/Allclean | 10 + .../twoSimpleRotors/Allrun | 17 ++ .../twoSimpleRotors/Allrun.pre | 21 ++ .../twoSimpleRotors/constant/dynamicMeshDict | 52 ++++ .../twoSimpleRotors/constant/g | 21 ++ .../constant/transportProperties | 64 +++++ .../constant/turbulenceProperties | 29 ++ .../twoSimpleRotors/system/blockMeshDict | 149 +++++++++++ .../twoSimpleRotors/system/controlDict | 110 ++++++++ .../twoSimpleRotors/system/decomposeParDict | 27 ++ .../twoSimpleRotors/system/fvSchemes | 84 ++++++ .../twoSimpleRotors/system/fvSolution | 119 +++++++++ .../twoSimpleRotors/system/setFieldsDict | 68 +++++ .../twoSimpleRotors/system/topoSetDict | 95 +++++++ 68 files changed, 3944 insertions(+) create mode 100644 applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/Make/files create mode 100644 applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/Make/options create mode 100644 applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/TEqn.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/UEqn.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/alphaSuSp.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/createFields.H create mode 100644 applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/overCompressibleInterDyMFoam.C create mode 100644 applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/pEqn.H create mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/Make/files create mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/Make/options create mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/UEqn.H create mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/correctPhi.H create mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/createFields.H create mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/overInterPhaseChangeDyMFoam.C create mode 100644 applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/pEqn.H create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/T create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/U create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/alpha.water create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/alphat create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/epsilon create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/k create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/nut create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/p create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/p_rgh create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/pointDisplacement create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/zoneID create mode 100755 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/Allclean create mode 100755 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/Allrun create mode 100755 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/Allrun.pre create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/dynamicMeshDict create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/g create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/thermophysicalProperties create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/thermophysicalProperties.air create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/thermophysicalProperties.water create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/turbulenceProperties create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/blockMeshDict create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/controlDict create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/decomposeParDict create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/fvSchemes create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/fvSolution create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/setFieldsDict create mode 100644 tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/topoSetDict create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/U create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/alpha.water create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/alphat create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/epsilon create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/k create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/nut create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/p create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/p_rgh create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/pointDisplacement create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/zoneID create mode 100755 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/Allclean create mode 100755 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/Allrun create mode 100755 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/Allrun.pre create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/dynamicMeshDict create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/g create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/transportProperties create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/turbulenceProperties create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/blockMeshDict create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/controlDict create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/decomposeParDict create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/fvSchemes create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/fvSolution create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/setFieldsDict create mode 100644 tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/topoSetDict diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake index 2140d45eb38..01cdf8258b3 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake @@ -11,5 +11,6 @@ wmake $targetType wmake $targetType compressibleInterDyMFoam wmake $targetType compressibleInterFilmFoam wmake $targetType compressibleInterIsoFoam +wmake $targetType overCompressibleInterDyMFoam #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/Make/files b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/Make/files new file mode 100644 index 00000000000..32be66d8aa5 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/Make/files @@ -0,0 +1,3 @@ +overCompressibleInterDyMFoam.C + +EXE = $(FOAM_APPBIN)/overCompressibleInterDyMFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/Make/options new file mode 100644 index 00000000000..58a1577a9c9 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/Make/options @@ -0,0 +1,40 @@ +EXE_INC = \ + -I.. \ + -I../../VoF \ + -I../../interFoam/overInterDyMFoam \ + -I../twoPhaseMixtureThermo \ + -I../VoFphaseCompressibleTurbulenceModels/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/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)/dynamicFvMesh/lnInclude \ + -I$(FOAM_SOLVERS)/incompressible/pimpleFoam/overPimpleDyMFoam \ + -I$(LIB_SRC)/overset/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lfvOptions \ + -lmeshTools \ + -ltwoPhaseMixtureThermo \ + -ltwoPhaseSurfaceTension \ + -lcompressibleTransportModels \ + -lfluidThermophysicalModels \ + -lspecie \ + -ltwoPhaseMixture \ + -ltwoPhaseProperties \ + -linterfaceProperties \ + -lturbulenceModels \ + -lcompressibleTurbulenceModels \ + -lVoFphaseCompressibleTurbulenceModels \ + -ldynamicMesh \ + -ldynamicFvMesh \ + -ltopoChangerFvMesh \ + -loverset \ + -lwaveModels diff --git a/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/TEqn.H b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/TEqn.H new file mode 100644 index 00000000000..ed933ccd236 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/TEqn.H @@ -0,0 +1,28 @@ +{ + fvScalarMatrix TEqn + ( + fvm::ddt(rho, T) + fvm::div(rhoPhi, T) - fvm::Sp(contErr, T) + - fvm::laplacian(turbulence.alphaEff(), T) + + ( + divUp()// - contErr/rho*p + + (fvc::ddt(rho, K) + fvc::div(rhoPhi, K))() - contErr*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/overCompressibleInterDyMFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/UEqn.H new file mode 100644 index 00000000000..8d334b5a448 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/UEqn.H @@ -0,0 +1,36 @@ + MRF.correctBoundaryVelocity(U); + + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + fvm::div(rhoPhi, U) + - fvm::Sp(contErr, U) + + MRF.DDt(rho, U) + + turbulence.divDevRhoReff(U) + == + fvOptions(rho, U) + ); + + UEqn.relax(); + + fvOptions.constrain(UEqn); + + if (pimple.momentumPredictor()) + { + solve + ( + UEqn + == + cellMask*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/overCompressibleInterDyMFoam/alphaSuSp.H b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/alphaSuSp.H new file mode 100644 index 00000000000..65c5750ff94 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/alphaSuSp.H @@ -0,0 +1,43 @@ +volScalarField::Internal Sp +( + IOobject + ( + "Sp", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar(dgdt.dimensions(), Zero) +); + +volScalarField::Internal Su +( + IOobject + ( + "Su", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar(dgdt.dimensions(), Zero) +); + +forAll(dgdt, celli) +{ + if (dgdt[celli] > 0.0) + { + Sp[celli] -= dgdt[celli]/max(1.0 - alpha1[celli], 1e-4); + Su[celli] += dgdt[celli]/max(1.0 - alpha1[celli], 1e-4); + } + else if (dgdt[celli] < 0.0) + { + Sp[celli] += dgdt[celli]/max(alpha1[celli], 1e-4); + } +} + +volScalarField::Internal divU +( + mesh.moving() + ? fvc::div(phi + mesh.phi()) + : fvc::div(phi) +); diff --git a/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/createFields.H new file mode 100644 index 00000000000..5fc2185ab59 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/createFields.H @@ -0,0 +1,138 @@ +#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)); + +#include "createAlphaFluxes.H" + +// Construct compressible turbulence model +compressibleInterPhaseTransportModel turbulence +( + rho, + U, + phi, + rhoPhi, + alphaPhi10, + mixture +); + +#include "createK.H" + +#include "createMRF.H" +#include "createFvOptions.H" + +// Overset specific + +// Add solver-specific interpolations +{ + wordHashSet& nonInt = + const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields()); + + nonInt.insert("HbyA"); + nonInt.insert("grad(p_rgh)"); + nonInt.insert("nHat"); + nonInt.insert("surfaceIntegrate(phi)"); + nonInt.insert("surfaceIntegrate(phiHbyA)"); + nonInt.insert("cellMask"); + nonInt.insert("cellDisplacement"); + nonInt.insert("interpolatedCells"); + nonInt.insert("cellInterpolationWeight"); + nonInt.insert("pcorr"); +} + +// Mask field for zeroing out contributions on hole cells +#include "createCellMask.H" + +surfaceScalarField faceMask +( + localMin<scalar>(mesh).interpolate(cellMask) +); + +// Create bool field with interpolated cells +#include "createInterpolatedCells.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/overCompressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/overCompressibleInterDyMFoam.C new file mode 100644 index 00000000000..4367efe6bd3 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/overCompressibleInterDyMFoam.C @@ -0,0 +1,240 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2021 OpenCFD Ltd. +------------------------------------------------------------------------------- +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 <http://www.gnu.org/licenses/>. + +Application + overCompressibleInterDyMFoam + +Group + grpMultiphaseSolvers + +Description + Solver for two compressible, non-isothermal, immiscible fluids using VOF + (i.e. volume of fluid) phase-fraction based interface capturing approach. + + This solver supports dynamic mesh motions including overset cases. + + The momentum and other fluid properties are of the "mixture" and a single + momentum equation is solved. + + 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. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "dynamicFvMesh.H" +#include "CMULES.H" +#include "EulerDdtScheme.H" +#include "CrankNicolsonDdtScheme.H" +#include "subCycle.H" +#include "compressibleInterPhaseTransportModel.H" +#include "pimpleControl.H" +#include "fvOptions.H" +#include "fvcSmooth.H" + +#include "cellCellStencilObject.H" +#include "localMin.H" +#include "interpolationCellPoint.H" +#include "transform.H" +#include "fvMeshSubset.H" +#include "oversetAdjustPhi.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + argList::addNote + ( + "Solver for two compressible, non-isothermal, immiscible fluids" + " using VOF phase-fraction based interface capturing approach.\n" + "Supports dynamic mesh motions including overset cases." + ); + + #include "postProcess.H" + + #include "addCheckCaseOptions.H" + #include "setRootCaseLists.H" + #include "createTime.H" + #include "createDynamicFvMesh.H" + pimpleControl pimple(mesh); + + #include "createTimeControls.H" + #include "createDyMControls.H" + #include "createFields.H" + + volScalarField& p = mixture.p(); + volScalarField& T = mixture.T(); + const volScalarField& psi1 = mixture.thermo1().psi(); + const volScalarField& psi2 = mixture.thermo2().psi(); + + #include "correctPhi.H" + #include "createUf.H" + + if (!LTS) + { + #include "CourantNo.H" + #include "setInitialDeltaT.H" + } + + #include "setCellMask.H" + #include "setInterpolatedCells.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readControls.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()) + { + if (pimple.firstIter() || moveMeshOuterCorrectors) + { + scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); + + mesh.update(); + + if (mesh.changing()) + { + Info<< "Execution time for mesh.update() = " + << runTime.elapsedCpuTime() - timeBeforeMeshUpdate + << " s" << endl; + + // Do not apply previous time-step mesh compression flux + // if the mesh topology changed + if (mesh.topoChanging()) + { + talphaPhi1Corr0.clear(); + } + + gh = (g & mesh.C()) - ghRef; + ghf = (g & mesh.Cf()) - ghRef; + + // Update cellMask field for blocking out hole cells + #include "setCellMask.H" + #include "setInterpolatedCells.H" + + faceMask = + localMin<scalar>(mesh).interpolate(cellMask.oldTime()); + + // Zero Uf on old faceMask (H-I) + Uf *= faceMask; + + const surfaceVectorField Uint(fvc::interpolate(U)); + // Update Uf and phi on new C-I faces + Uf += (1-faceMask)*Uint; + + // Update Uf boundary + forAll(Uf.boundaryField(), patchI) + { + Uf.boundaryFieldRef()[patchI] = + Uint.boundaryField()[patchI]; + } + + phi = mesh.Sf() & Uf; + + // Correct phi on individual regions + if (correctPhi) + { + #include "correctPhi.H" + } + + mixture.correct(); + + // Zero phi on current H-I + faceMask = localMin<scalar>(mesh).interpolate(cellMask); + + phi *= faceMask; + U *= cellMask; + + // Make the flux relative to the mesh motion + fvc::makeRelative(phi, U); + + } + + if (mesh.changing() && checkMeshCourantNo) + { + #include "meshCourantNo.H" + } + } + + #include "alphaControls.H" + #include "compressibleAlphaEqnSubCycle.H" + + const surfaceScalarField faceMask + ( + localMin<scalar>(mesh).interpolate(cellMask) + ); + rhoPhi *= faceMask; + + turbulence.correctPhasePhi(); + + #include "UEqn.H" + volScalarField divUp("divUp", fvc::div(fvc::absolute(phi, U), p)); + #include "TEqn.H" + + // --- Pressure corrector loop + while (pimple.correct()) + { + #include "pEqn.H" + } + + if (pimple.turbCorr()) + { + turbulence.correct(); + } + } + + runTime.write(); + + runTime.printExecutionTime(Info); + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/pEqn.H new file mode 100644 index 00000000000..7def40d509b --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/overCompressibleInterDyMFoam/pEqn.H @@ -0,0 +1,177 @@ +{ + volScalarField rAU("rAU", 1.0/UEqn.A()); + + surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); + + surfaceScalarField phiHbyA + ( + "phiHbyA", + fvc::flux(HbyA) + ); + + if (ddtCorr) + { + surfaceScalarField faceMaskOld + ( + localMin<scalar>(mesh).interpolate(cellMask.oldTime()) + ); + phiHbyA += + MRF.zeroFilter + ( + fvc::interpolate(rho*rAU)*faceMaskOld*fvc::ddtCorr(U, Uf) + ); + } + + MRF.makeRelative(phiHbyA); + + surfaceScalarField phig + ( + ( + mixture.surfaceTensionForce() + - ghf*fvc::snGrad(rho) + )*faceMask*rAUf*mesh.magSf() + ); + + phiHbyA += phig; + + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF); + + tmp<fvScalarMatrix> p_rghEqnComp1; + tmp<fvScalarMatrix> p_rghEqnComp2; + + if (pimple.transonic()) + { + #include "rhofs.H" + + surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi); + surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi); + + p_rghEqnComp1 = + 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) + ) + ); + p_rghEqnComp1.ref().relax(); + + p_rghEqnComp2 = + 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 + { + #include "rhofs.H" + + p_rghEqnComp1 = + pos(alpha1) + *( + ( + fvc::ddt(alpha1, rho1) + fvc::div(alphaPhi1*rho1f) + - (fvOptions(alpha1, mixture.thermo1().rho())&rho1) + )/rho1 + - fvc::ddt(alpha1) - fvc::div(alphaPhi1) + + (alpha1*psi1/rho1)*correction(fvm::ddt(p_rgh)) + ); + + p_rghEqnComp2 = + pos(alpha2) + *( + ( + fvc::ddt(alpha2, rho2) + fvc::div(alphaPhi2*rho2f) + - (fvOptions(alpha2, mixture.thermo2().rho())&rho2) + )/rho2 + - fvc::ddt(alpha2) - fvc::div(alphaPhi2) + + (alpha2*psi2/rho2)*correction(fvm::ddt(p_rgh)) + ); + } + + // Cache p_rgh prior to solve for density update + volScalarField p_rgh_0(p_rgh); + + while (pimple.correctNonOrthogonal()) + { + fvScalarMatrix p_rghEqnIncomp + ( + fvc::div(phiHbyA) + - fvm::laplacian(rAUf, p_rgh) + ); + + solve + ( + p_rghEqnComp1() + p_rghEqnComp2() + p_rghEqnIncomp, + mesh.solver(p_rgh.select(pimple.finalInnerIter())) + ); + + if (pimple.finalNonOrthogonalIter()) + { + p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin); + p_rgh = p - (alpha1*rho1 + alpha2*rho2)*gh; + + dgdt = + ( + alpha1*(p_rghEqnComp2 & p_rgh) + - alpha2*(p_rghEqnComp1 & p_rgh) + ); + + phi = phiHbyA + p_rghEqnIncomp.flux(); + + U = + cellMask* + ( + HbyA + + rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/rAUf) + ); + + U.correctBoundaryConditions(); + fvOptions.correct(U); + } + } + + { + Uf = fvc::interpolate(U); + surfaceVectorField n(mesh.Sf()/mesh.magSf()); + Uf += n*(fvc::absolute(phi, U)/mesh.magSf() - (n & Uf)); + } + + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phi, U); + + // Zero faces H-I for transport Eq after pEq + phi *= faceMask; + + // Update densities from change in p_rgh + mixture.thermo1().correctRho(psi1*(p_rgh - p_rgh_0)); + mixture.thermo2().correctRho(psi2*(p_rgh - p_rgh_0)); + + rho = alpha1*rho1 + alpha2*rho2; + + // Correct p_rgh for consistency with p and the updated densities + p_rgh = p - rho*gh; + p_rgh.correctBoundaryConditions(); + + K = 0.5*magSqr(U); +} diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake index 1728290029b..b3d54f172a0 100755 --- a/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake +++ b/applications/solvers/multiphase/interPhaseChangeFoam/Allwmake @@ -4,7 +4,9 @@ cd "${0%/*}" || exit # Run from this directory #------------------------------------------------------------------------------ wmake $targetType phaseChangeTwoPhaseMixtures + wmake $targetType wmake $targetType interPhaseChangeDyMFoam +wmake $targetType overInterPhaseChangeDyMFoam #------------------------------------------------------------------------------ diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/Make/files b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/Make/files new file mode 100644 index 00000000000..18f38675dab --- /dev/null +++ b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/Make/files @@ -0,0 +1,3 @@ +overInterPhaseChangeDyMFoam.C + +EXE = $(FOAM_APPBIN)/overInterPhaseChangeDyMFoam diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/Make/options b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/Make/options new file mode 100644 index 00000000000..c7c01f96e69 --- /dev/null +++ b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/Make/options @@ -0,0 +1,35 @@ +EXE_INC = \ + -I.. \ + -I../../interFoam/overInterDyMFoam \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ + -I../phaseChangeTwoPhaseMixtures/lnInclude \ + -I$(FOAM_SOLVERS)/incompressible/pimpleFoam/overPimpleDyMFoam \ + -I$(LIB_SRC)/overset/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lfvOptions \ + -lmeshTools \ + -lsampling \ + -lphaseChangeTwoPhaseMixtures \ + -ltwoPhaseMixture \ + -linterfaceProperties \ + -ltwoPhaseProperties \ + -lincompressibleTransportModels \ + -lturbulenceModels \ + -lincompressibleTurbulenceModels \ + -ldynamicMesh \ + -ldynamicFvMesh \ + -ltopoChangerFvMesh \ + -loverset \ + -lwaveModels diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/UEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/UEqn.H new file mode 100644 index 00000000000..9f5d791b44e --- /dev/null +++ b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/UEqn.H @@ -0,0 +1,31 @@ + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + fvm::div(rhoPhi, U) + - fvm::Sp(fvc::ddt(rho) + fvc::div(rhoPhi), U) + + turbulence->divDevRhoReff(rho, U) + == + fvOptions(rho, U) + ); + + UEqn.relax(); + + fvOptions.constrain(UEqn); + + if (pimple.momentumPredictor()) + { + solve + ( + UEqn + == + cellMask*fvc::reconstruct + ( + ( + interface.surfaceTensionForce() + - ghf*fvc::snGrad(rho) + - fvc::snGrad(p_rgh) + ) * mesh.magSf() + ) + ); + + fvOptions.correct(U); + } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/correctPhi.H b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/correctPhi.H new file mode 100644 index 00000000000..6c85d967a4c --- /dev/null +++ b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/correctPhi.H @@ -0,0 +1,11 @@ +CorrectPhi +( + U, + phi, + p_rgh, + surfaceScalarField("rAUf", fvc::interpolate(rAU)), + divU, + pimple +); + +#include "continuityErrs.H" diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/createFields.H b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/createFields.H new file mode 100644 index 00000000000..476a2780afc --- /dev/null +++ b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/createFields.H @@ -0,0 +1,158 @@ +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<< "Creating phaseChangeTwoPhaseMixture\n" << endl; +autoPtr<phaseChangeTwoPhaseMixture> mixture = + phaseChangeTwoPhaseMixture::New(U, phi); + +volScalarField& alpha1(mixture->alpha1()); +volScalarField& alpha2(mixture->alpha2()); + +const dimensionedScalar& rho1 = mixture->rho1(); +const dimensionedScalar& rho2 = mixture->rho2(); + + +// Need to store rho for ddt(rho, U) +volScalarField rho +( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT + ), + alpha1*rho1 + alpha2*rho2 +); +rho.oldTime(); + + +// Construct interface from alpha1 distribution +interfaceProperties interface(alpha1, U, mixture()); + +// Construct incompressible turbulence model +autoPtr<incompressible::turbulenceModel> turbulence +( + incompressible::turbulenceModel::New(U, phi, mixture()) +); + + +#include "readGravitationalAcceleration.H" +#include "readhRef.H" +#include "gh.H" + + +volScalarField p +( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + p_rgh + rho*gh +); + +label pRefCell = 0; +scalar pRefValue = 0.0; +setRefCell +( + p, + p_rgh, + pimple.dict(), + pRefCell, + pRefValue +); + +if (p_rgh.needReference()) +{ + p += dimensionedScalar + ( + "p", + p.dimensions(), + pRefValue - getRefCellValue(p, pRefCell) + ); + p_rgh = p - rho*gh; +} + +mesh.setFluxRequired(p_rgh.name()); +mesh.setFluxRequired(alpha1.name()); + +#include "createFvOptions.H" + +IOobject alphaPhi10Header +( + IOobject::groupName("alphaPhi0", alpha1.group()), + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE +); + +// MULES flux from previous time-step +surfaceScalarField alphaPhi10 +( + alphaPhi10Header, + phi*fvc::interpolate(alpha1) +); + + +// Overset specific + +// Add solver-specific interpolations +{ + wordHashSet& nonInt = + const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields()); + + nonInt.insert("HbyA"); + nonInt.insert("grad(p_rgh)"); + nonInt.insert("nHat"); + nonInt.insert("surfaceIntegrate(phi)"); + nonInt.insert("surfaceIntegrate(phiHbyA)"); + nonInt.insert("cellMask"); + nonInt.insert("cellDisplacement"); + nonInt.insert("interpolatedCells"); + nonInt.insert("cellInterpolationWeight"); + nonInt.insert("pcorr"); +} + +// Mask field for zeroing out contributions on hole cells +#include "createCellMask.H" + +surfaceScalarField faceMask +( + localMin<scalar>(mesh).interpolate(cellMask) +); + +// Create bool field with interpolated cells +#include "createInterpolatedCells.H" diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/overInterPhaseChangeDyMFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/overInterPhaseChangeDyMFoam.C new file mode 100644 index 00000000000..ab83f493e0b --- /dev/null +++ b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/overInterPhaseChangeDyMFoam.C @@ -0,0 +1,250 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2021 OpenCFD OpenCFD Ltd. +------------------------------------------------------------------------------- +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 <http://www.gnu.org/licenses/>. + +Application + overInterPhaseChangeDyMFoam + +Group + grpMultiphaseSolvers grpMovingMeshSolvers + +Description + Solver for two incompressible, isothermal, immiscible fluids with + phase-change (e.g. cavitation) using VOF (i.e. volume of fluid) + phase-fraction based interface capturing, with optional dynamic mesh + motion (including overset) and mesh topology changes including adaptive + re-meshing. + + The momentum and other fluid properties are of the "mixture" and a + single momentum equation is solved. + + The set of phase-change models provided are designed to simulate cavitation + but other mechanisms of phase-change are supported within this solver + framework. + + Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "dynamicFvMesh.H" +#include "CMULES.H" +#include "subCycle.H" +#include "interfaceProperties.H" +#include "phaseChangeTwoPhaseMixture.H" +#include "turbulentTransportModel.H" +#include "pimpleControl.H" +#include "fvOptions.H" +#include "CorrectPhi.H" + +#include "cellCellStencilObject.H" +#include "localMin.H" +#include "interpolationCellPoint.H" +#include "transform.H" +#include "oversetAdjustPhi.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + argList::addNote + ( + "Solver for two incompressible, isothermal, immiscible fluids with" + " phase-change\n" + "using VOF (volume of fluid) phase-fraction based interface capturing," + " with optional dynamic mesh motion (including overset)\n" + "and mesh topology changes including adaptive re-meshing." + ); + + #include "postProcess.H" + + #include "setRootCaseLists.H" + #include "createTime.H" + #include "createDynamicFvMesh.H" + pimpleControl pimple(mesh); + + #include "createTimeControls.H" + #include "createDyMControls.H" + #include "initContinuityErrs.H" + #include "createFields.H" + + volScalarField rAU + ( + IOobject + ( + "rAU", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("rAUf", dimTime/rho.dimensions(), 1.0) + ); + + #include "createUf.H" + #include "CourantNo.H" + #include "setInitialDeltaT.H" + + turbulence->validate(); + + #include "setCellMask.H" + #include "setInterpolatedCells.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readControls.H" + + // Store divU from the previous mesh so that it can be mapped + // and used in correctPhi to ensure the corrected phi has the + // same divergence + volScalarField divU("divU0", fvc::div(fvc::absolute(phi, U))); + + #include "CourantNo.H" + #include "setDeltaT.H" + + ++runTime; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + // --- Pressure-velocity PIMPLE corrector loop + while (pimple.loop()) + { + if (pimple.firstIter() || moveMeshOuterCorrectors) + { + scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime(); + + mesh.update(); + + if (mesh.changing()) + { + Info<< "Execution time for mesh.update() = " + << runTime.elapsedCpuTime() - timeBeforeMeshUpdate + << " s" << endl; + + gh = (g & mesh.C()) - ghRef; + ghf = (g & mesh.Cf()) - ghRef; + + // Update cellMask field for blocking out hole cells + #include "setCellMask.H" + #include "setInterpolatedCells.H" + + faceMask = + localMin<scalar>(mesh).interpolate(cellMask.oldTime()); + + + // Zero Uf on old faceMask (H-I) + Uf *= faceMask; + + const surfaceVectorField Uint(fvc::interpolate(U)); + // Update Uf and phi on new C-I faces + Uf += (1-faceMask)*Uint; + + // Update Uf boundary + forAll(Uf.boundaryField(), patchI) + { + Uf.boundaryFieldRef()[patchI] = + Uint.boundaryField()[patchI]; + } + + phi = mesh.Sf() & Uf; + + if (correctPhi) + { + #include "correctPhi.H" + } + + mixture->correct(); + + // Zero phi on current H-I + faceMask = localMin<scalar>(mesh).interpolate(cellMask); + + phi *= faceMask; + U *= cellMask; + + // Make the flux relative to the mesh motion + fvc::makeRelative(phi, U); + } + + if (mesh.changing() && checkMeshCourantNo) + { + #include "meshCourantNo.H" + } + } + + #include "alphaControls.H" + + surfaceScalarField rhoPhi + ( + IOobject + ( + "rhoPhi", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar(dimMass/dimTime, Zero) + ); + + mixture->correct(); + + #include "alphaEqnSubCycle.H" + const surfaceScalarField faceMask + ( + localMin<scalar>(mesh).interpolate(cellMask) + ); + rhoPhi *= faceMask; + + interface.correct(); + + #include "UEqn.H" + + // --- Pressure corrector loop + while (pimple.correct()) + { + #include "pEqn.H" + } + + if (pimple.turbCorr()) + { + turbulence->correct(); + } + } + + runTime.write(); + + runTime.printExecutionTime(Info); + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/pEqn.H new file mode 100644 index 00000000000..41a8ef3cb6d --- /dev/null +++ b/applications/solvers/multiphase/interPhaseChangeFoam/overInterPhaseChangeDyMFoam/pEqn.H @@ -0,0 +1,101 @@ +{ + rAU = 1.0/UEqn.A(); + surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); + volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); + surfaceScalarField phiHbyA + ( + "phiHbyA", + fvc::flux(HbyA) + ); + + + if (ddtCorr) + { + surfaceScalarField faceMaskOld + ( + localMin<scalar>(mesh).interpolate(cellMask.oldTime()) + ); + phiHbyA += faceMaskOld*fvc::ddtCorr(U, Uf); + } + + if (p_rgh.needReference()) + { + fvc::makeRelative(phiHbyA, U); + adjustPhi(phiHbyA, U, p_rgh); + fvc::makeAbsolute(phiHbyA, U); + } + + surfaceScalarField phig + ( + ( + interface.surfaceTensionForce() + - ghf*fvc::snGrad(rho) + )*faceMask*rAUf*mesh.magSf() + ); + + phiHbyA += phig; + + // Update the pressure BCs to ensure flux consistency + constrainPressure(p_rgh, U, phiHbyA, rAUf); + + Pair<tmp<volScalarField>> vDotP = mixture->vDotP(); + const volScalarField& vDotcP = vDotP[0](); + const volScalarField& vDotvP = vDotP[1](); + + while (pimple.correctNonOrthogonal()) + { + fvScalarMatrix p_rghEqn + ( + fvc::div(phiHbyA) - fvm::laplacian(rAUf, p_rgh) + - (vDotvP - vDotcP)*(mixture->pSat() - rho*gh) + + fvm::Sp(vDotvP - vDotcP, p_rgh) + ); + + + //p_rghEqn.setReference(pRefCell, pRefValue); + p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); + + p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter()))); + + if (pimple.finalNonOrthogonalIter()) + { + phi = phiHbyA + p_rghEqn.flux(); + + p_rgh.relax(); + + U = + cellMask + *(HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf)); + + U.correctBoundaryConditions(); + fvOptions.correct(U); + } + } + + #include "continuityErrs.H" + + { + Uf = fvc::interpolate(U); + surfaceVectorField n(mesh.Sf()/mesh.magSf()); + Uf += n*(phi/mesh.magSf() - (n & Uf)); + } + + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phi, U); + + // Zero faces H-I for transport Eq after pEq + phi *= faceMask; + + p == p_rgh + rho*gh; + + if (p_rgh.needReference()) + { + p += dimensionedScalar + ( + "p", + p.dimensions(), + pRefValue - getRefCellValue(p, pRefCell) + ); + p_rgh = p - rho*gh; + } +} diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/T b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/T new file mode 100644 index 00000000000..792cc7f1d2a --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/T @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + "(hole|outlet|inlet)" + { + type fixedValue; + value $internalField; + } + + walls + { + type fixedValue; + value uniform 400; + } + + overset + { + type overset; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/U b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/U new file mode 100644 index 00000000000..f0a47930fa9 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/U @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + walls + { + type uniformFixedValue; + uniformValue (0 0 0); + } + + hole + { + type movingWallVelocity; + value uniform (0 0 0); + } + + outlet + { + type uniformFixedValue; + uniformValue (0 0 0); + } + + inlet + { + type uniformFixedValue; + uniformValue (0 0 0); + } + + overset + { + type overset; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/alpha.water b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/alpha.water new file mode 100644 index 00000000000..fd81533db95 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/alpha.water @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ 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 +{ + #includeEtc "caseDicts/setConstraintTypes" + + "(walls|hole|inlet|outlet)" + { + type zeroGradient; + } + + overset + { + type overset; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/alphat b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/alphat new file mode 100644 index 00000000000..b3c442f5bf4 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/alphat @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + "(outlet|inlet)" + { + type calculated; + value $internalField; + } + + "(walls|hole)" + { + type compressible::alphatWallFunction; + value $internalField; + } + + overset + { + type overset; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/epsilon b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/epsilon new file mode 100644 index 00000000000..ee34e560cc3 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/epsilon @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -3 0 0 0 0 ]; + +internalField uniform 0.1; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + overset + { + type overset; + } + + "(walls|hole|inlet|outlet)" + { + type epsilonWallFunction; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/k b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/k new file mode 100644 index 00000000000..bcb8cfdf793 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/k @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 0.01; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + overset + { + type overset; + } + + "(walls|hole|inlet|outlet)" + { + type kqRWallFunction; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/nut b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/nut new file mode 100644 index 00000000000..3c53092bde9 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/nut @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -1 0 0 0 0 ]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + overset + { + type overset; + } + + "(walls|hole|inlet|outlet)" + { + type nutkWallFunction; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/p b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/p new file mode 100644 index 00000000000..88debeb7cfa --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/p @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + "(walls|hole|outlet|inlet)" + { + type calculated; + value $internalField; + } + + overset + { + type overset; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/p_rgh b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/p_rgh new file mode 100644 index 00000000000..1e1c71ce3f1 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/p_rgh @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ 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 +{ + #includeEtc "caseDicts/setConstraintTypes" + + oversetPatch + { + type overset; + } + + "(walls|hole|outlet|inlet)" + { + type fixedFluxPressure; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/pointDisplacement b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/pointDisplacement new file mode 100644 index 00000000000..198c73f06ee --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/pointDisplacement @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class pointVectorField; + object pointDisplacement; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 0 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + ".*" + { + type uniformFixedValue; + uniformValue (0 0 0); + } + + hole + { + type zeroGradient; + } + + overset + { + patchType overset; + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/zoneID b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/zoneID new file mode 100644 index 00000000000..426893f1025 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/0.orig/zoneID @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object zoneID; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + overset + { + type overset; + } + + ".*" + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/Allclean b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/Allclean new file mode 100755 index 00000000000..8f13a5fccda --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase0 + +rm -f constant/cellInterpolationWeight + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/Allrun b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/Allrun new file mode 100755 index 00000000000..85ec45dcbb8 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/Allrun @@ -0,0 +1,17 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +canCompile || exit 0 # Dynamic code + +./Allrun.pre + +# Serial +#runApplication $(getApplication) + +# Parallel +runApplication decomposePar -cellDist +runParallel $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/Allrun.pre b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/Allrun.pre new file mode 100755 index 00000000000..c0a6663fb91 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/Allrun.pre @@ -0,0 +1,21 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +runApplication blockMesh + +# Select cellSets +runApplication -s 1 topoSet + +runApplication subsetMesh box -patch hole -overwrite + +# Select cellSets +runApplication -s 2 topoSet + +restore0Dir + +# Use cellSets to write zoneID +runApplication setFields + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/dynamicMeshDict b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/dynamicMeshDict new file mode 100644 index 00000000000..09de2385cec --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/dynamicMeshDict @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh dynamicOversetFvMesh; + +dynamicOversetFvMeshCoeffs +{ +// layerRelax 0.3; +} + +solver multiSolidBodyMotionSolver; + +multiSolidBodyMotionSolverCoeffs +{ + movingZone1 + { + solidBodyMotionFunction rotatingMotion; + rotatingMotionCoeffs + { + origin (0.005 0.005 0.005); + axis (0 0 1); + omega 20.0; + } + } + + movingZone2 + { + solidBodyMotionFunction rotatingMotion; + rotatingMotionCoeffs + { + origin (0.013 0.005 0.005); + axis (0 0 1); + omega -20.0; + } + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/g b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/g new file mode 100644 index 00000000000..0a45494f3f4 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/g @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 -9.81 0); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/thermophysicalProperties b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/thermophysicalProperties new file mode 100644 index 00000000000..1d1a274e4ea --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/thermophysicalProperties @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phases (water air); + +pMin 10000; + +sigma +{ + type constant; + sigma 0.07; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/thermophysicalProperties.air b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/thermophysicalProperties.air new file mode 100644 index 00000000000..3461f00cbbb --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/thermophysicalProperties.air @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 28.9; + } + thermodynamics + { + Cp 1007; + Hf 0; + } + transport + { + mu 1.84e-05; + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/thermophysicalProperties.water b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/thermophysicalProperties.water new file mode 100644 index 00000000000..1ec6586814e --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/thermophysicalProperties.water @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectFluid; + specie specie; + energy sensibleInternalEnergy; +} + +mixture +{ + specie + { + molWeight 18.0; + } + equationOfState + { + R 3000; + rho0 1027; + } + thermodynamics + { + Cp 4195; + Hf 0; + } + transport + { + mu 3.645e-4; + Pr 2.289; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/turbulenceProperties b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/turbulenceProperties new file mode 100644 index 00000000000..d8137df73f1 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/constant/turbulenceProperties @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + + printCoeffs on; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/blockMeshDict b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/blockMeshDict new file mode 100644 index 00000000000..6d02d13bd0c --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/blockMeshDict @@ -0,0 +1,149 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 0.01; + +vertices +( + ( 0.00 0.0 0) + ( 2.00 0.0 0) + ( 2.00 1.0 0) + ( 0.00 1.0 0) + ( 0.00 0.0 1) + ( 2.00 0.0 1) + ( 2.00 1.0 1) + ( 0.00 1.0 1) + + // movingZone1 + ( 0.15 0.35 0) + ( 0.85 0.35 0) + ( 0.85 0.65 0) + ( 0.15 0.65 0) + ( 0.15 0.35 1) + ( 0.85 0.35 1) + ( 0.85 0.65 1) + ( 0.15 0.65 1) + + // movingZone2 + ( 1.15 0.15 0) + ( 1.45 0.15 0) + ( 1.45 0.85 0) + ( 1.15 0.85 0) + ( 1.15 0.15 1) + ( 1.45 0.15 1) + ( 1.45 0.85 1) + ( 1.15 0.85 1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (140 70 1) simpleGrading (1 1 1) + + hex (8 9 10 11 12 13 14 15) movingZone1 (60 24 1) simpleGrading (1 1 1) + + hex (16 17 18 19 20 21 22 23) movingZone2 (24 60 1) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + overset1 + { + type overset; + faces + ( + ( 8 12 15 11) + (10 14 13 9) + (11 15 14 10) + ( 9 13 12 8) + ); + } + overset2 + { + type overset; + faces + ( + (16 20 23 19) + (18 22 21 17) + (19 23 22 18) + (17 21 20 16) + ); + } + walls + { + type wall; + faces + ( + (3 7 6 2) + (1 5 4 0) + ); + } + inlet + { + type wall; + faces + ( + (0 4 7 3) + ); + } + outlet + { + type wall; + faces + ( + (2 6 5 1) + ); + } + // Populated by subsetMesh + hole + { + type wall; + faces (); + } + frontAndBack + { + type empty; + faces + ( + (0 3 2 1) + (4 5 6 7) + ); + } + frontAndBack1 + { + type empty; + faces + ( + ( 8 11 10 9) + (12 13 14 15) + ); + } + frontAndBack2 + { + type empty; + faces + ( + (16 19 18 17) + (20 21 22 23) + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/controlDict b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/controlDict new file mode 100644 index 00000000000..53ddffffb58 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/controlDict @@ -0,0 +1,111 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +libs (overset fvMotionSolvers); + +DebugSwitches +{ + overset 0; + dynamicOversetFvMesh 0; + cellVolumeWeight 0; +} + +application overCompressibleInterDyMFoam; + +startFrom latestTime; + +startTime 0.0; + +stopAt endTime; + +endTime 2; + +deltaT 0.001; + +writeControl adjustable; + +writeInterval 0.01; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 12; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 1.5; + +maxAlphaCo 2.0; + +maxDeltaT 1; + + +functions +{ + probes + { + type probes; + libs (sampling); + + // Name of the directory for probe data + name probes; + + // Write at same frequency as fields + writeControl timeStep; + writeInterval 1; + + // Fields to be probed + fields (p U); + + // Optional: interpolation scheme to use (default is cell) + interpolationScheme cell; + + probeLocations + ( + (0.0009999 0.0015 0.003) + ); + } + + alphaVol + { + libs (utilityFunctionObjects); + type coded; + name alphaVolume; + writeControl timeStep; + writeInterval 10; + + codeWrite + #{ + const auto& alpha = + mesh().lookupObject<volScalarField>("alpha.water"); + + Info<< "Alpha volume = " << alpha.weightedAverage(mesh().Vsc()) + << endl; + #}; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/decomposeParDict b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/decomposeParDict new file mode 100644 index 00000000000..fe3471c9966 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/decomposeParDict @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 12; + +method hierarchical; + +coeffs +{ + n (12 1 1); +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/fvSchemes b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/fvSchemes new file mode 100644 index 00000000000..bf779ad318b --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/fvSchemes @@ -0,0 +1,85 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(T) Gauss linear; +} + +divSchemes +{ + default none; + + div(rhoPhi,U) Gauss upwind; + div(rhoPhi,T) Gauss upwind; + div(rhoPhi,K) Gauss upwind; + div(U) Gauss linear; + + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss linear; + + div(phi,alpha.water) Gauss upwind; + + div(rhoPhi,epsilon) Gauss upwind; + div(rhoPhi,k) Gauss upwind; + + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; + div((nuEff*dev2(T(grad(U))))) Gauss linear; + + div((phi+meshPhi),p) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +oversetInterpolation +{ + method inverseDistance; +} + +fluxRequired +{ + default no; + pcorr ; + p ; +} + +oversetInterpolationSuppressed +{ + grad(p_rgh); + surfaceIntegrate(phiHbyA); +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/fvSolution b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/fvSolution new file mode 100644 index 00000000000..11eefb78283 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/fvSolution @@ -0,0 +1,115 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + cellDisplacement + { + solver PCG; + preconditioner DIC; + + tolerance 1e-06; + relTol 0; + maxIter 100; + } + + "alpha.water.*" + { + nAlphaCorr 3; + nAlphaSubCycles 2; + cAlpha 1; + icAlpha 0; + scAlpha 0; + + MULESCorr yes; + nLimiterIter 5; + alphaApplyPrevCorr no; + + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-8; + relTol 0; + } + + p_rgh + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-12; + relTol 0.01; + maxIter 500; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + pcorr + { + $p; + solver PCG; + preconditioner DIC; + } + + pcorrFinal + { + $pcorr; + relTol 0; + } + + "(U|k|epsilon|T)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0.01; + maxIter 200; + minIter 1; + } + + "(U|k|epsilon|T)Final" + { + $U; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + correctPhi no; + nOuterCorrectors 2; + nCorrectors 3; + nNonOrthogonalCorrectors 0; + + ddtCorr false; +} + +relaxationFactors +{ + fields + { + } + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/setFieldsDict b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/setFieldsDict new file mode 100644 index 00000000000..42f0865f671 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/setFieldsDict @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue zoneID 123 + volScalarFieldValue alpha.water 0 +); + +regions +( + // Set cell values + // (does zerogradient on boundaries) + cellToCell + { + set c0; + + fieldValues + ( + volScalarFieldValue zoneID 0 + ); + } + + cellToCell + { + set c1; + + fieldValues + ( + volScalarFieldValue zoneID 1 + ); + } + + cellToCell + { + set c2; + + fieldValues + ( + volScalarFieldValue zoneID 2 + ); + } + + boxToCell + { + box ( -100 -100 -100 ) ( 100 0.005 100 ); + fieldValues + ( + volScalarFieldValue alpha.water 1 + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/topoSetDict b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/topoSetDict new file mode 100644 index 00000000000..dcc91bceb61 --- /dev/null +++ b/tutorials/multiphase/overCompressibleInterDyMFoam/compressibleTwoSimpleRotors/system/topoSetDict @@ -0,0 +1,95 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name c0; + type cellSet; + action new; + source regionsToCell; + insidePoints ((0.001 0.001 0.001)); + } + + { + name c1; + type cellSet; + action new; + source cellToCell; + set c0; + } + + { + name c1; + type cellSet; + action invert; + } + + { + name c2; + type cellSet; + action new; + source regionsToCell; + insidePoints ((0.0116 0.00151 0.001)); + set c1; + } + + { + name c1; + type cellSet; + action subtract; + source cellToCell; + set c2; + } + + // Select box to remove from region 1 and 2 + { + name box; + type cellSet; + action new; + source cellToCell; + set c1; + } + + { + name box; + type cellSet; + action add; + source cellToCell; + set c2; + } + + { + name box; + type cellSet; + action subset; + source boxToCell; + boxes + ( + (0.0025 0.0045 -100)(0.0075 0.0055 100) + (0.0125 0.0025 -100)(0.0135 0.0075 100) + ); + } + + { + name box; + type cellSet; + action invert; + } +); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/U b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/U new file mode 100644 index 00000000000..f0a47930fa9 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/U @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + walls + { + type uniformFixedValue; + uniformValue (0 0 0); + } + + hole + { + type movingWallVelocity; + value uniform (0 0 0); + } + + outlet + { + type uniformFixedValue; + uniformValue (0 0 0); + } + + inlet + { + type uniformFixedValue; + uniformValue (0 0 0); + } + + overset + { + type overset; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/alpha.water b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/alpha.water new file mode 100644 index 00000000000..fd81533db95 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/alpha.water @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ 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 +{ + #includeEtc "caseDicts/setConstraintTypes" + + "(walls|hole|inlet|outlet)" + { + type zeroGradient; + } + + overset + { + type overset; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/alphat b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/alphat new file mode 100644 index 00000000000..b3c442f5bf4 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/alphat @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + "(outlet|inlet)" + { + type calculated; + value $internalField; + } + + "(walls|hole)" + { + type compressible::alphatWallFunction; + value $internalField; + } + + overset + { + type overset; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/epsilon b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/epsilon new file mode 100644 index 00000000000..ee34e560cc3 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/epsilon @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -3 0 0 0 0 ]; + +internalField uniform 0.1; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + overset + { + type overset; + } + + "(walls|hole|inlet|outlet)" + { + type epsilonWallFunction; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/k b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/k new file mode 100644 index 00000000000..bcb8cfdf793 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/k @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 0.01; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + overset + { + type overset; + } + + "(walls|hole|inlet|outlet)" + { + type kqRWallFunction; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/nut b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/nut new file mode 100644 index 00000000000..3c53092bde9 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/nut @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -1 0 0 0 0 ]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + overset + { + type overset; + } + + "(walls|hole|inlet|outlet)" + { + type nutkWallFunction; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/p b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/p new file mode 100644 index 00000000000..88debeb7cfa --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/p @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + "(walls|hole|outlet|inlet)" + { + type calculated; + value $internalField; + } + + overset + { + type overset; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/p_rgh b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/p_rgh new file mode 100644 index 00000000000..1e1c71ce3f1 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/p_rgh @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ 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 +{ + #includeEtc "caseDicts/setConstraintTypes" + + oversetPatch + { + type overset; + } + + "(walls|hole|outlet|inlet)" + { + type fixedFluxPressure; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/pointDisplacement b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/pointDisplacement new file mode 100644 index 00000000000..198c73f06ee --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/pointDisplacement @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class pointVectorField; + object pointDisplacement; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 0 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + ".*" + { + type uniformFixedValue; + uniformValue (0 0 0); + } + + hole + { + type zeroGradient; + } + + overset + { + patchType overset; + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/zoneID b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/zoneID new file mode 100644 index 00000000000..426893f1025 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/0.orig/zoneID @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object zoneID; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + #includeEtc "caseDicts/setConstraintTypes" + + overset + { + type overset; + } + + ".*" + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/Allclean b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/Allclean new file mode 100755 index 00000000000..8f13a5fccda --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase0 + +rm -f constant/cellInterpolationWeight + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/Allrun b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/Allrun new file mode 100755 index 00000000000..27fce6927bf --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/Allrun @@ -0,0 +1,17 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +canCompile || exit 0 # Dynamic code + +./Allrun.pre + +# Serial +#runApplication $(getApplication) + +# Parallel +runApplication decomposePar -cellDist +runParallel $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/Allrun.pre b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/Allrun.pre new file mode 100755 index 00000000000..c0a6663fb91 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/Allrun.pre @@ -0,0 +1,21 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +runApplication blockMesh + +# Select cellSets +runApplication -s 1 topoSet + +runApplication subsetMesh box -patch hole -overwrite + +# Select cellSets +runApplication -s 2 topoSet + +restore0Dir + +# Use cellSets to write zoneID +runApplication setFields + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/dynamicMeshDict b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/dynamicMeshDict new file mode 100644 index 00000000000..b24f92b611f --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/dynamicMeshDict @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh dynamicOversetFvMesh; + +dynamicOversetFvMeshCoeffs +{ +// layerRelax 0.3; +} + +solver multiSolidBodyMotionSolver; + +multiSolidBodyMotionSolverCoeffs +{ + movingZone1 + { + solidBodyMotionFunction rotatingMotion; + rotatingMotionCoeffs + { + origin (0.005 0.005 0.005); + axis (0 0 1); + omega 2000.0; + } + } + + movingZone2 + { + solidBodyMotionFunction rotatingMotion; + rotatingMotionCoeffs + { + origin (0.013 0.005 0.005); + axis (0 0 1); + omega -2000.0; + } + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/g b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/g new file mode 100644 index 00000000000..28b07d0b877 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/g @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/transportProperties b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/transportProperties new file mode 100644 index 00000000000..af7b43712b7 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/transportProperties @@ -0,0 +1,64 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phases (water vapour); + +phaseChangeTwoPhaseMixture SchnerrSauer; + +pSat 9e4; // Saturation pressure + +sigma 0.07; + +water +{ + transportModel Newtonian; + nu 9e-07; + rho 1000; +} + +vapour +{ + transportModel Newtonian; + nu 4.273e-04; + rho 0.02308; +} + +KunzCoeffs +{ + UInf 20.0; + tInf 0.005; // L = 0.1 m + Cc 1000; + Cv 1000; +} + +MerkleCoeffs +{ + UInf 20.0; + tInf 0.005; // L = 0.1 m + Cc 80; + Cv 1e-03; +} + +SchnerrSauerCoeffs +{ + n 1.6e+13; + dNuc 2.0e-06; + Cc 1; + Cv 1; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/turbulenceProperties b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/turbulenceProperties new file mode 100644 index 00000000000..d8137df73f1 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/constant/turbulenceProperties @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + + printCoeffs on; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/blockMeshDict b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/blockMeshDict new file mode 100644 index 00000000000..6d02d13bd0c --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/blockMeshDict @@ -0,0 +1,149 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 0.01; + +vertices +( + ( 0.00 0.0 0) + ( 2.00 0.0 0) + ( 2.00 1.0 0) + ( 0.00 1.0 0) + ( 0.00 0.0 1) + ( 2.00 0.0 1) + ( 2.00 1.0 1) + ( 0.00 1.0 1) + + // movingZone1 + ( 0.15 0.35 0) + ( 0.85 0.35 0) + ( 0.85 0.65 0) + ( 0.15 0.65 0) + ( 0.15 0.35 1) + ( 0.85 0.35 1) + ( 0.85 0.65 1) + ( 0.15 0.65 1) + + // movingZone2 + ( 1.15 0.15 0) + ( 1.45 0.15 0) + ( 1.45 0.85 0) + ( 1.15 0.85 0) + ( 1.15 0.15 1) + ( 1.45 0.15 1) + ( 1.45 0.85 1) + ( 1.15 0.85 1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (140 70 1) simpleGrading (1 1 1) + + hex (8 9 10 11 12 13 14 15) movingZone1 (60 24 1) simpleGrading (1 1 1) + + hex (16 17 18 19 20 21 22 23) movingZone2 (24 60 1) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + overset1 + { + type overset; + faces + ( + ( 8 12 15 11) + (10 14 13 9) + (11 15 14 10) + ( 9 13 12 8) + ); + } + overset2 + { + type overset; + faces + ( + (16 20 23 19) + (18 22 21 17) + (19 23 22 18) + (17 21 20 16) + ); + } + walls + { + type wall; + faces + ( + (3 7 6 2) + (1 5 4 0) + ); + } + inlet + { + type wall; + faces + ( + (0 4 7 3) + ); + } + outlet + { + type wall; + faces + ( + (2 6 5 1) + ); + } + // Populated by subsetMesh + hole + { + type wall; + faces (); + } + frontAndBack + { + type empty; + faces + ( + (0 3 2 1) + (4 5 6 7) + ); + } + frontAndBack1 + { + type empty; + faces + ( + ( 8 11 10 9) + (12 13 14 15) + ); + } + frontAndBack2 + { + type empty; + faces + ( + (16 19 18 17) + (20 21 22 23) + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/controlDict b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/controlDict new file mode 100644 index 00000000000..8f7e58e9bd7 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/controlDict @@ -0,0 +1,110 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +libs (overset fvMotionSolvers); + +DebugSwitches +{ + overset 0; + dynamicOversetFvMesh 0; + cellVolumeWeight 0; +} + +application overInterPhaseChangeDyMFoam; + +startFrom latestTime; + +startTime 0.0; + +stopAt endTime; + +endTime 0.2; + +deltaT 0.00001; + +writeControl adjustable; + +writeInterval 0.001; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 12; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 1.5; + +maxAlphaCo 2.0; + +maxDeltaT 1; + + +functions +{ + probes + { + type probes; + libs (sampling); + + // Name of the directory for probe data + name probes; + + // Write at same frequency as fields + writeControl timeStep; + writeInterval 1; + + // Fields to be probed + fields (p U); + + // Optional: interpolation scheme to use (default is cell) + interpolationScheme cell; + + probeLocations + ( + (0.0009999 0.0015 0.003) + ); + } + + alphaVol + { + libs (utilityFunctionObjects); + type coded; + name alphaVolume; + writeControl timeStep; + writeInterval 10; + + codeWrite + #{ + const auto& alpha = + mesh().lookupObject<volScalarField>("alpha.water"); + + Info<< "Alpha volume = " << alpha.weightedAverage(mesh().Vsc()) + << endl; + #}; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/decomposeParDict b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/decomposeParDict new file mode 100644 index 00000000000..fe3471c9966 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/decomposeParDict @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 12; + +method hierarchical; + +coeffs +{ + n (12 1 1); +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/fvSchemes b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/fvSchemes new file mode 100644 index 00000000000..97d4a6dcafb --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/fvSchemes @@ -0,0 +1,84 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(T) Gauss linear; +} + +divSchemes +{ + default none; + + div(rhoPhi,U) Gauss upwind; + + div(U) Gauss linear; + + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss linear; + + div(phi,alpha.water) Gauss upwind; + + div(phi,epsilon) Gauss upwind; + div(phi,k) Gauss upwind; + + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; + div((nuEff*dev2(T(grad(U))))) Gauss linear; + + div((phi+meshPhi),p) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +oversetInterpolation +{ + method inverseDistance; +} + +fluxRequired +{ + default no; + pcorr ; + p ; +} + +oversetInterpolationSuppressed +{ + grad(p_rgh); + surfaceIntegrate(phiHbyA); +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/fvSolution b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/fvSolution new file mode 100644 index 00000000000..ba9dba91405 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/fvSolution @@ -0,0 +1,119 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + cellDisplacement + { + solver PCG; + preconditioner DIC; + + tolerance 1e-06; + relTol 0; + maxIter 100; + } + + "alpha.water.*" + { + nAlphaCorr 3; + nAlphaSubCycles 2; + cAlpha 0; + icAlpha 0; + scAlpha 0; + + MULESCorr yes; + nLimiterIter 5; + alphaApplyPrevCorr no; + + solver smoothSolver; + smoother symGaussSeidel; + maxIter 100; + tolerance 1e-8; + relTol 0; + } + + p_rgh + { + solver PBiCGStab; + preconditioner DILU; + tolerance 1e-12; + relTol 0.01; + maxIter 500; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + pcorr + { + $p; + solver PCG; + preconditioner DIC; + } + + pcorrFinal + { + $pcorr; + relTol 0; + } + + "(U|k|epsilon|T)" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-6; + relTol 0.01; + maxIter 200; + minIter 1; + } + + "(U|k|epsilon|T)Final" + { + $U; + relTol 0; + } +} + +PIMPLE +{ + momentumPredictor no; + correctPhi no; + nOuterCorrectors 2; + nCorrectors 3; + nNonOrthogonalCorrectors 0; + + ddtCorr false; + + pRefPoint (0.0002 0.0099 0.001); + pRefValue 1e5; //Not used +} + +relaxationFactors +{ + fields + { + } + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/setFieldsDict b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/setFieldsDict new file mode 100644 index 00000000000..9c6bf206432 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/setFieldsDict @@ -0,0 +1,68 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue zoneID 123 + volScalarFieldValue alpha.water 1 +); + +regions +( + // Set cell values + // (does zerogradient on boundaries) + cellToCell + { + set c0; + + fieldValues + ( + volScalarFieldValue zoneID 0 + ); + } + + cellToCell + { + set c1; + + fieldValues + ( + volScalarFieldValue zoneID 1 + ); + } + + cellToCell + { + set c2; + + fieldValues + ( + volScalarFieldValue zoneID 2 + ); + } + + boxToCell + { + box ( -100 -100 -100 ) ( 100 0.005 100 ); + fieldValues + ( + volScalarFieldValue alpha.water 1 + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/topoSetDict b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/topoSetDict new file mode 100644 index 00000000000..dcc91bceb61 --- /dev/null +++ b/tutorials/multiphase/overInterPhaseChangeDyMFoam/twoSimpleRotors/system/topoSetDict @@ -0,0 +1,95 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2012 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name c0; + type cellSet; + action new; + source regionsToCell; + insidePoints ((0.001 0.001 0.001)); + } + + { + name c1; + type cellSet; + action new; + source cellToCell; + set c0; + } + + { + name c1; + type cellSet; + action invert; + } + + { + name c2; + type cellSet; + action new; + source regionsToCell; + insidePoints ((0.0116 0.00151 0.001)); + set c1; + } + + { + name c1; + type cellSet; + action subtract; + source cellToCell; + set c2; + } + + // Select box to remove from region 1 and 2 + { + name box; + type cellSet; + action new; + source cellToCell; + set c1; + } + + { + name box; + type cellSet; + action add; + source cellToCell; + set c2; + } + + { + name box; + type cellSet; + action subset; + source boxToCell; + boxes + ( + (0.0025 0.0045 -100)(0.0075 0.0055 100) + (0.0125 0.0025 -100)(0.0135 0.0075 100) + ); + } + + { + name box; + type cellSet; + action invert; + } +); + + +// ************************************************************************* // -- GitLab