diff --git a/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C b/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C index 327e71fd9037b6ceb0df1423424c43500e1b90ed..9e16217ae9efcfa97d0ce509158563ed0f13b1b0 100644 --- a/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C +++ b/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -139,6 +139,22 @@ Foam::dynamicMotionSolverListFvMesh::~dynamicMotionSolverListFvMesh() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::dynamicMotionSolverListFvMesh::mapFields +( + const mapPolyMesh& mpm +) +{ + dynamicFvMesh::mapFields(mpm); + + // Update the motionSolvers for any topo change ... + for (auto& ms : motionSolvers_) + { + ms.updateMesh(mpm); + } +} + + bool Foam::dynamicMotionSolverListFvMesh::update() { if (motionSolvers_.size()) diff --git a/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.H b/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.H index edefc5dc16f191d0e628d16d4cc2eb69d8704e3e..b8a89abf2cc40800237c0c89c52219b77af48ea2 100644 --- a/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.H +++ b/src/dynamicFvMesh/dynamicMotionSolverListFvMesh/dynamicMotionSolverListFvMesh.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2016 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020,2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -99,8 +99,11 @@ public: //- Initialise all non-demand-driven data virtual bool init(const bool doInit); - //- Dummy update function which does not change the mesh + //- Update the mesh for both mesh motion and topology change virtual bool update(); + + //- Map all fields in time using given map. Triggered by topo change + virtual void mapFields(const mapPolyMesh& mpm); }; diff --git a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C index 36002b44f8d032313c7c840e575bf8e9e34dbb41..8898cce35f0a7570c6f2dfd2aa5d9eaa06777694 100644 --- a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C +++ b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C @@ -196,7 +196,63 @@ void Foam::dynamicRefineFvMesh::readDict() void Foam::dynamicRefineFvMesh::mapFields(const mapPolyMesh& mpm) { - dynamicFvMesh::mapFields(mpm); + //dynamicFvMesh::mapFields(mpm); + dynamicMotionSolverListFvMesh::mapFields(mpm); + + + // Correct old-time volumes for refined/unrefined cells. We know at this + // point that the points have not moved and the cells have only been split + // or merged. We hope that dynamicMotionSolverListFvMesh::mapFields + // does not use old-time volumes ... + { + const labelList& cellMap = mpm.cellMap(); + const labelList& reverseCellMap = mpm.reverseCellMap(); + + // Each split cell becomes original + 7 additional + labelList nSubCells(mpm.nOldCells(), 0); + + forAll(cellMap, celli) + { + const label oldCelli = cellMap[celli]; + if (oldCelli >= 0 && reverseCellMap[oldCelli] >= 0) + { + // Found master cell. + nSubCells[oldCelli]++; + } + } + + // Start off from mapped old volumes + scalarField correctedV0(this->V0()); + + // Correct any split cells + const auto& V = this->V(); + forAll(cellMap, celli) + { + const label oldCelli = cellMap[celli]; + if (oldCelli >= 0 && nSubCells[oldCelli] == 8) + { + // Found split cell. Use current volume instead of mapped + // old one + correctedV0[celli] = V[celli]; + } + } + + const auto& cellsFromCells = mpm.cellsFromCellsMap(); + for (const auto& s : cellsFromCells) + { + // Reset unsplit cell + const label celli = s.index(); + correctedV0[celli] = V[celli]; + //? Or sum up old volumes? + //const labelList& oldCells = s.masterObjects(); + //for (const label oldCelli : oldCells) + //{ + //} + } + + setV0().field() = correctedV0; + } + // Correct the flux for modified/added faces. All the faces which only // have been renumbered will already have been handled by the mapping. @@ -1027,7 +1083,8 @@ Foam::dynamicRefineFvMesh::dynamicRefineFvMesh const bool doInit ) : - dynamicFvMesh(io, doInit), + //dynamicFvMesh(io, doInit), + dynamicMotionSolverListFvMesh(io, doInit), meshCutter_(*this) { if (doInit) @@ -1041,7 +1098,8 @@ bool Foam::dynamicRefineFvMesh::init(const bool doInit) { if (doInit) { - dynamicFvMesh::init(doInit); + //dynamicFvMesh::init(doInit); + dynamicMotionSolverListFvMesh::init(doInit); } protectedCell_.setSize(nCells()); @@ -1208,7 +1266,7 @@ bool Foam::dynamicRefineFvMesh::init(const bool doInit) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::dynamicRefineFvMesh::update() +bool Foam::dynamicRefineFvMesh::updateTopology() { // Re-read dictionary. Chosen since usually -small so trivial amount // of time compared to actual refinement. Also very useful to be able @@ -1413,6 +1471,15 @@ bool Foam::dynamicRefineFvMesh::update() } +bool Foam::dynamicRefineFvMesh::update() +{ + bool hasChanged = updateTopology(); + hasChanged = dynamicMotionSolverListFvMesh::update() && hasChanged; + + return hasChanged; +} + + bool Foam::dynamicRefineFvMesh::writeObject ( IOstreamOption streamOpt, @@ -1424,7 +1491,8 @@ bool Foam::dynamicRefineFvMesh::writeObject bool writeOk = ( - dynamicFvMesh::writeObject(streamOpt, valid) + //dynamicFvMesh::writeObject(streamOpt, valid) + dynamicMotionSolverListFvMesh::writeObject(streamOpt, valid) && meshCutter_.write(valid) ); diff --git a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.H b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.H index 7025f7aaada555c6922a787f091699173c7c1362..53e245f70256ed54e81b02772586a452d58f30aa 100644 --- a/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.H +++ b/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.H @@ -75,7 +75,8 @@ SourceFiles #ifndef dynamicRefineFvMesh_H #define dynamicRefineFvMesh_H -#include "dynamicFvMesh.H" +//#include "dynamicFvMesh.H" +#include "dynamicMotionSolverListFvMesh.H" #include "hexRef8.H" #include "bitSet.H" @@ -90,7 +91,8 @@ namespace Foam class dynamicRefineFvMesh : - public dynamicFvMesh + //public dynamicFvMesh + public dynamicMotionSolverListFvMesh { protected: @@ -210,6 +212,9 @@ protected: const labelList& faceMap ); + //- Update topology (refinement, unrefinement) + bool updateTopology(); + private: diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/0.orig/U b/tutorials/multiphase/interFoam/laminar/oscillatingBox/0.orig/U new file mode 100644 index 0000000000000000000000000000000000000000..2269f5af7219af30020096c2fc26fda1385e1a96 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/0.orig/U @@ -0,0 +1,37 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / 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 +{ + atmosphere + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + + "(obstacle|walls)" + { + type movingWallVelocity; + value uniform (0 0 0); + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/0.orig/alpha.water b/tutorials/multiphase/interFoam/laminar/oscillatingBox/0.orig/alpha.water new file mode 100644 index 0000000000000000000000000000000000000000..5a57bc232fc837427f53e3e656b32c4fd5a79856 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/0.orig/alpha.water @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / 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 +{ + walls + { + type zeroGradient; + } + + obstacle + { + type zeroGradient; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/0.orig/nut b/tutorials/multiphase/interFoam/laminar/oscillatingBox/0.orig/nut new file mode 100644 index 0000000000000000000000000000000000000000..81db9f777c45137657a1d854a12ef15a8e245836 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/0.orig/nut @@ -0,0 +1,38 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / 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 5e-07; + +boundaryField +{ + atmosphere + { + type zeroGradient; + } + + "(obstacle|walls)" + { + type nutkRoughWallFunction; + Ks uniform 100e-6; + Cs uniform 0.5; + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/0.orig/p_rgh b/tutorials/multiphase/interFoam/laminar/oscillatingBox/0.orig/p_rgh new file mode 100644 index 0000000000000000000000000000000000000000..25a6cb49ba58867660f3fa96327cd22d2112b2db --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/0.orig/p_rgh @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / 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 0; + +boundaryField +{ + walls + { + type fixedFluxPressure; + phi phiAbs; + value uniform 0; + } + + obstacle + { + type fixedFluxPressure; + phi phiAbs; + value uniform 0; + } + + atmosphere + { + type totalPressure; + p0 uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/Allclean b/tutorials/multiphase/interFoam/laminar/oscillatingBox/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..fb1f3847301c377e02e12439ba58cbf303af3ef9 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/Allclean @@ -0,0 +1,8 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions +#------------------------------------------------------------------------------ + +cleanCase0 + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/Allrun b/tutorials/multiphase/interFoam/laminar/oscillatingBox/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..e8c824c04ee8b8893baa3fdf547e3222b3c9cf96 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/Allrun @@ -0,0 +1,13 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +./Allrun.pre + +#runApplication $(getApplication) + +runApplication decomposePar +runParallel $(getApplication) + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/Allrun.pre b/tutorials/multiphase/interFoam/laminar/oscillatingBox/Allrun.pre new file mode 100755 index 0000000000000000000000000000000000000000..4964e25a1d37f03d0aabbf5bcec4578d57550e8a --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/Allrun.pre @@ -0,0 +1,12 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions +#------------------------------------------------------------------------------ + +restore0Dir + +runApplication blockMesh + +runApplication setFields + +#------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/6DoF.dat b/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/6DoF.dat new file mode 100644 index 0000000000000000000000000000000000000000..600305766223b2e538fe9cc1e34285f78e5a8d1b --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/6DoF.dat @@ -0,0 +1,6 @@ +( +(0 ((0 0 0) (0 0 0))) +//(1 ((1 1 0) (0 0 0))) +(10 ((1 1 0) (0 0 0))) +//(100 ((0 0 0) (0 0 0))) +) diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/dynamicMeshDict b/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/dynamicMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..c508450b4b9728b583ec7b905f5b06fc836cd4fc --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/dynamicMeshDict @@ -0,0 +1,73 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh dynamicRefineFvMesh; + +solvers +{ + VF + { + motionSolverLibs (fvMotionSolvers); + + motionSolver solidBody; + + solidBodyMotionFunction oscillatingLinearMotion; + amplitude (0.1 0 0); + omega #eval "2*pi()"; + } +} + + +// How often to refine +refineInterval 1; + +// Field to be refinement on +field alpha.water; + +// Refine field inbetween lower..upper +lowerRefineLevel 0.001; +upperRefineLevel 0.999; + +// If value < unrefineLevel unrefine +unrefineLevel 10; + +// Have slower than 2:1 refinement +nBufferLayers 1; + +// Refine cells only up to maxRefinement levels +maxRefinement 2; + +// Stop refinement if maxCells reached +maxCells 200000; + +// Flux field and corresponding velocity field. Fluxes on changed +// faces get recalculated by interpolating the velocity. Use 'none' +// on surfaceScalarFields that do not need to be reinterpolated. +correctFluxes +( + (phi none) + (nHatf none) + (rhoPhi none) + (alphaPhi0.water none) + (ghf none) + (alphaPhiUn none) +); + +// Write the refinement level as a volScalarField +dumpLevel true; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/g b/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..74e8297361048f164af012680564ae800774bc02 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/g @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / 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/interFoam/laminar/oscillatingBox/constant/transportProperties b/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..18bdc9dc016cafa5d81eea58a192805d5db9e425 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/transportProperties @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phases (water air); + +water +{ + transportModel Newtonian; + nu 1e-06; + rho 1000; +} + +air +{ + transportModel Newtonian; + nu 1.48e-05; + rho 1; +} + +sigma 0.07; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/turbulenceProperties b/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..8e51de51a21f58b9d20034c04dd3b7113e908adb --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/constant/turbulenceProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..689e50f0bc84249b9e4d647da2f13843867dbab6 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/blockMeshDict @@ -0,0 +1,64 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +scale 1; + +vertices +( + (0 0 0) + (1 0 0) + (1 1 0) + (0 1 0) + (0 0 1) + (1 0 1) + (1 1 1) + (0 1 1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (10 10 10) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + atmosphere + { + type patch; + faces + ( + (3 7 6 2) + ); + } + walls + { + type wall; + faces + ( + (0 4 7 3) + (2 6 5 1) + (1 5 4 0) + (0 3 2 1) + (4 5 6 7) + ); + } +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/controlDict b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..4d8a576ca272c147027ff033cacf31e5339a60c9 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/controlDict @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application interFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 0.00001; + +writeControl adjustable; +writeInterval 0.02; +//writeControl timeStep; +//writeInterval 1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.1; + +maxAlphaCo 0.1; + +maxDeltaT 1; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/decomposeParDict b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..134741ac33ab3f2a3f9fd97654993963b5956c99 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/decomposeParDict @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 6; + +method scotch; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..4ed603dafe5ebc6a6b8e03a06838ab61030a3fad --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/fvSchemes @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / 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; +} + +divSchemes +{ + div(rhoPhi,U) Gauss upwind; + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss linear; + div(phi,k) Gauss upwind; + div(phi,omega) Gauss upwind; + div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +wallDist +{ + method meshWave; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/fvSolution b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..bb7143ebb3f84b336b001183289b250cc00ca790 --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/fvSolution @@ -0,0 +1,78 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.water.*" + { + nAlphaCorr 1; + nAlphaSubCycles 3; + cAlpha 1; + } + + p_rgh + { + solver GAMG; + tolerance 1e-10; + relTol 0.01; + smoother DIC; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "pcorr.*" + { + $p_rghFinal; + tolerance 1e-10; + } + + "(U|UFinal)" + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-08; + relTol 0; + nSweeps 1; + } + + "(k|omega|B|nuTilda).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-08; + relTol 0; + } +} + +PIMPLE +{ + //- Solid body motion - no cell volume change + //correctPhi false; + + momentumPredictor yes; + nCorrectors 3; + nNonOrthogonalCorrectors 0; + + pRefPoint (0.51 0.51 0.51); + pRefValue 0; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/setFieldsDict b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/setFieldsDict new file mode 100644 index 0000000000000000000000000000000000000000..d4f8c46524c4b7f83b049ddcbac7a71147ecd83f --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/setFieldsDict @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha.water 0 +); + +regions +( + boxToCell + { + box (0 0 0) (1.0 0.2 1.0); + fieldValues + ( + volScalarFieldValue alpha.water 1 + ); + } + ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/topoSetDict b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/topoSetDict new file mode 100644 index 0000000000000000000000000000000000000000..0444db26635bc20dac7291d20445aa0bf60d944f --- /dev/null +++ b/tutorials/multiphase/interFoam/laminar/oscillatingBox/system/topoSetDict @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: v2112 | +| \\ / A nd | Website: www.openfoam.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object topoSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name c0; + type cellSet; + action clear; + } + { + name c0; + type cellSet; + action invert; + } + { + name c0; + type cellSet; + action subtract; + source boxToCell; + box (0.8 0 0.8) (1.0 0.2 1.0); + } +); + + +// ************************************************************************* //