From 8a8c6d2bc20005567cecfcd12351bf7513a19eea Mon Sep 17 00:00:00 2001 From: BehradEsg Date: Tue, 22 Aug 2023 11:09:04 +0200 Subject: [PATCH] periodic box simulation tutorial --- .../cfdemSolverPimple/PeriodicBox/Allrun.sh | 31 ++++ .../cfdemSolverPimple/PeriodicBox/CFD/0/Ksl | 54 ++++++ .../cfdemSolverPimple/PeriodicBox/CFD/0/T | 54 ++++++ .../cfdemSolverPimple/PeriodicBox/CFD/0/U | 54 ++++++ .../cfdemSolverPimple/PeriodicBox/CFD/0/Us | 54 ++++++ .../cfdemSolverPimple/PeriodicBox/CFD/0/p | 54 ++++++ .../cfdemSolverPimple/PeriodicBox/CFD/0/rho | 54 ++++++ .../PeriodicBox/CFD/0/sSmoothField | 56 +++++++ .../PeriodicBox/CFD/0/vSmoothField | 56 +++++++ .../PeriodicBox/CFD/0/voidfraction | 54 ++++++ .../CFD/constant/couplingProperties | 157 ++++++++++++++++++ .../PeriodicBox/CFD/constant/g | 22 +++ .../PeriodicBox/CFD/constant/liggghtsCommands | 31 ++++ .../CFD/constant/transportProperties | 23 +++ .../CFD/constant/turbulenceProperties | 20 +++ .../PeriodicBox/CFD/foam.foam | 0 .../PeriodicBox/CFD/system/blockMeshDict | 85 ++++++++++ .../PeriodicBox/CFD/system/controlDict | 57 +++++++ .../PeriodicBox/CFD/system/decomposeParDict | 28 ++++ .../PeriodicBox/CFD/system/fvSchemes | 60 +++++++ .../PeriodicBox/CFD/system/fvSolution | 83 +++++++++ .../PeriodicBox/DEM/in.liggghts_init | 109 ++++++++++++ .../PeriodicBox/DEM/in.liggghts_run | 92 ++++++++++ .../PeriodicBox/parCFDDEMrun.sh | 44 +++++ .../PeriodicBox/parDEMrun.sh | 30 ++++ .../cfdemSolverPimple/PeriodicBox/prerun.sh | 13 ++ 26 files changed, 1375 insertions(+) create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/Allrun.sh create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/Ksl create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/T create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/U create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/Us create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/p create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/rho create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/sSmoothField create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/vSmoothField create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/voidfraction create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/couplingProperties create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/g create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/liggghtsCommands create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/transportProperties create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/turbulenceProperties create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/foam.foam create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/blockMeshDict create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/controlDict create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/decomposeParDict create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/fvSchemes create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/fvSolution create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/DEM/in.liggghts_init create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/DEM/in.liggghts_run create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/parCFDDEMrun.sh create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/parDEMrun.sh create mode 100755 tutorials/cfdemSolverPimple/PeriodicBox/prerun.sh diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/Allrun.sh b/tutorials/cfdemSolverPimple/PeriodicBox/Allrun.sh new file mode 100755 index 00000000..1329a21a --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/Allrun.sh @@ -0,0 +1,31 @@ +#!/bin/bash +#------------------------------------------------------------------------------ +# allrun script for periodic box test case +# run periodic box +# Behrad Esgandari - August 2023 +#------------------------------------------------------------------------------ + +#- define variables +casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" + +#- include functions +source $CFDEM_PROJECT_DIR/etc/functions.sh + +# check if mesh was built +if [ -f "$casePath/CFD/constant/polyMesh/points" ]; then + echo "mesh was built before - using old mesh" +else + echo "mesh needs to be built" + cd $casePath/CFD + blockMesh +fi + +if [ -f "$casePath/DEM/post/restart/liggghts.restart" ]; then + echo "LIGGGHTS init was run before - using existing restart file" +else + #- run serial DEM + $casePath/parDEMrun.sh +fi + +#- run parallel CFD-DEM +bash $casePath/parCFDDEMrun.sh diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/Ksl b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/Ksl new file mode 100755 index 00000000..da68e074 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/Ksl @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object Ksl; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -3 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + bottom + { + type cyclic; + } + + top + { + type cyclic; + } + + lr1 + { + type cyclic; + } + + lr2 + { + type cyclic; + } + + vh1 + { + type cyclic; + } + + vh2 + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/T b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/T new file mode 100755 index 00000000..9783870d --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/T @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 293; + +boundaryField +{ + bottom + { + type cyclic; + } + + top + { + type cyclic; + } + + lr1 + { + type cyclic; + } + + lr2 + { + type cyclic; + } + + vh1 + { + type cyclic; + } + + vh2 + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/U b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/U new file mode 100755 index 00000000..885d559d --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/U @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ 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 +{ + bottom + { + type cyclic; + } + + top + { + type cyclic; + } + + lr1 + { + type cyclic; + } + + lr2 + { + type cyclic; + } + + vh1 + { + type cyclic; + } + + vh2 + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/Us b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/Us new file mode 100755 index 00000000..584bbc9a --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/Us @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object Us; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + bottom + { + type cyclic; + } + + top + { + type cyclic; + } + + lr1 + { + type cyclic; + } + + lr2 + { + type cyclic; + } + + vh1 + { + type cyclic; + } + + vh2 + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/p b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/p new file mode 100755 index 00000000..6ab594d3 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/p @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + bottom + { + type cyclic; + } + + top + { + type cyclic; + } + + lr1 + { + type cyclic; + } + + lr2 + { + type cyclic; + } + + vh1 + { + type cyclic; + } + + vh2 + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/rho b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/rho new file mode 100755 index 00000000..466c36c4 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/rho @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object rho; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -3 0 0 0 0 0]; + +internalField uniform 1.3; + +boundaryField +{ + bottom + { + type cyclic; + } + + top + { + type cyclic; + } + + lr1 + { + type cyclic; + } + + lr2 + { + type cyclic; + } + + vh1 + { + type cyclic; + } + + vh2 + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/sSmoothField b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/sSmoothField new file mode 100755 index 00000000..895f49f0 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/sSmoothField @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object sSmoothField; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 1; + +boundaryField +{ + bottom + { + type cyclic; + } + + top + { + type cyclic; + } + + lr1 + { + type cyclic; + } + + lr2 + { + type cyclic; + } + + vh1 + { + type cyclic; + } + + vh2 + { + type cyclic; + } +} + + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/vSmoothField b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/vSmoothField new file mode 100755 index 00000000..56fb9e07 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/vSmoothField @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object vSmoothField; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + bottom + { + type cyclic; + } + + top + { + type cyclic; + } + + lr1 + { + type cyclic; + } + + lr2 + { + type cyclic; + } + + vh1 + { + type cyclic; + } + + vh2 + { + type cyclic; + } +} + + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/voidfraction b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/voidfraction new file mode 100755 index 00000000..f797ffe9 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/0/voidfraction @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object voidfraction; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 1; + +boundaryField +{ + bottom + { + type cyclic; + } + + top + { + type cyclic; + } + + lr1 + { + type cyclic; + } + + lr2 + { + type cyclic; + } + + vh1 + { + type cyclic; + } + + vh2 + { + type cyclic; + } +} + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/couplingProperties b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/couplingProperties new file mode 100755 index 00000000..ea343e6a --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/couplingProperties @@ -0,0 +1,157 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object couplingProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// sub-models & settings + +syncMode false; + +modelType "A"; + +couplingInterval 50; + +voidFractionModel centre; + +locateModel engine; +//locateModel engineSearchMany2Many; + +meshMotionModel noMeshMotion; + +regionModel allRegion; + +IOModel off; + +probeModel off; + +dataExchangeModel twoWayMPI; +//dataExchangeModel twoWayOne2One; + +averagingModel dense; + +clockModel off; + +smoothingModel constDiffSmoothing; + +forceModels +( + BeetstraDrag + gradPForce + viscForce + staticPressure +); + +otherForceModels +( + gravityEff +); + +momCoupleModels +( + implicitCouple +); + +turbulenceModelType "turbulenceProperties"; + + +// sub-model properties + + +engineSearchMany2ManyProps +{ + engineProps + { + treeSearch true; + } +} + +twoWayOne2OneProps +{ + liggghtsPath "../DEM/in.liggghts_run"; + verbose true; +} + + +implicitCoupleProps +{ + velFieldName "U"; + granVelFieldName "Us"; + voidfractionFieldName "voidfraction"; +} + + +gradPForceProps +{ + pFieldName "p"; + voidfractionFieldName "voidfraction"; + velocityFieldName "U"; + interpolation true; +} + +viscForceProps +{ + velocityFieldName "U"; + interpolation true; +} + +BeetstraDragProps +{ + velFieldName "U"; + granVelFieldName "Us"; + rhoParticle 1500.; + voidfractionFieldName "voidfraction"; + interpolation true; +} + +gravityEffProps +{ + voidfractionFieldName "voidfraction"; + rhoPart 1500; +} + +staticPressureProps +{ + rhoGas 1.3; // gas density + voidfractionFieldName "voidfraction"; + rhoPart 1500; //particle density + DomainSolidVolumeFraction 0.05; // mass loading + g_DEM (0 0 -9.81); //gravity vector compatible with the gravity direction in "g" +} + +constDiffSmoothingProps +{ + lowerLimit 0.01; + upperLimit 1.0; + smoothingLength 0.00025; +} + + +engineProps +{ + treeSearch true; +} + +centreProps +{ + alphaMin 0.005; + scaleUpVol 1.0; +} + +twoWayMPIProps +{ + liggghtsPath "../DEM/in.liggghts_run"; +} + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/g b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/g new file mode 100755 index 00000000..e518a680 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 0 -9.81 ); + + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/liggghtsCommands b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/liggghtsCommands new file mode 100755 index 00000000..ad428137 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/liggghtsCommands @@ -0,0 +1,31 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object liggghtsCommands; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +liggghtsCommandModels +( + runLiggghts + writeLiggghts +); + +writeLiggghtsProps +{ + writeLast off; + writeName "post/restart/liggghts.restartCFDEM"; + overwrite on; +} + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/transportProperties b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/transportProperties new file mode 100755 index 00000000..7d4a33df --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/transportProperties @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu [0 2 -1 0 0 0 0] 1.8e-5; + + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/turbulenceProperties b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/turbulenceProperties new file mode 100755 index 00000000..0bbe2983 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/constant/turbulenceProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/foam.foam b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/foam.foam new file mode 100755 index 00000000..e69de29b diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/blockMeshDict b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/blockMeshDict new file mode 100755 index 00000000..862008f6 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/blockMeshDict @@ -0,0 +1,85 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1.0; + +vertices +( + (-0.004 -0.004 -0.016) + ( 0.004 -0.004 -0.016) + ( 0.004 0.004 -0.016) + (-0.004 0.004 -0.016) + (-0.004 -0.004 0.016) + ( 0.004 -0.004 0.016) + ( 0.004 0.004 0.016) + (-0.004 0.004 0.016) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (32 32 128) + simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + bottom + { + type cyclic; + neighbourPatch top; + faces ((0 3 2 1)); + } + top + { + type cyclic; + neighbourPatch bottom; + faces ((4 5 6 7)); + } + lr1 + { + type cyclic; + neighbourPatch lr2; + faces ((0 3 7 4)); + } + lr2 + { + type cyclic; + neighbourPatch lr1; + faces ((1 5 6 2)); + } + vh1 + { + type cyclic; + neighbourPatch vh2; + faces ((0 1 4 5)); + } + vh2 + { + type cyclic; + neighbourPatch vh1; + faces ((2 6 7 3)); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/controlDict b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/controlDict new file mode 100755 index 00000000..2d1568dc --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/controlDict @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application pisoFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 3; + +deltaT 0.00005; + +writeControl adjustableRunTime; + +writeInterval 0.01; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +adjustTimeStep no; + +maxCo 0.8; + + +functions +{ + +} +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/decomposeParDict b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/decomposeParDict new file mode 100755 index 00000000..1c30b447 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/decomposeParDict @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 32; + +method simple; + +simpleCoeffs +{ + n (8 4 1); + delta 0.001; +} + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/fvSchemes b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/fvSchemes new file mode 100755 index 00000000..5ec8a633 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/fvSchemes @@ -0,0 +1,60 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default backward;//Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default Gauss linear; + div(phi,U) Gauss limitedLinearV 1; + div(phi,k) Gauss limitedLinear 1; + div(phi,epsilon) Gauss limitedLinear 1; + div(phi,R) Gauss limitedLinear 1; + div(phi,nuTilda) Gauss limitedLinear 1; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/fvSolution b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/fvSolution new file mode 100755 index 00000000..b635d100 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/CFD/system/fvSolution @@ -0,0 +1,83 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: 6 + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "(p|rho)" + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0.1; + } + + "(p|rho)Final" + { + $p; + tolerance 1e-06; + relTol 0; + } + + "(U|k|e|epsilon|R|nuTilda)" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + } + + "(U|e|k|nuTilda)Final" + { + $U; + relTol 0; + } + + "(voidfraction|Ksl|UsNext|voidfractionNext|sSmoothField|vSmoothField|fSmooth)" + { + solver PCG; + preconditioner DIC; + tolerance 1e-05; + relTol 0; + } + +} + +PIMPLE +{ + momentumPredictor yes; + nOuterCorrectors 6; + nCorrectors 2; + periodicBoxSwitch yes; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; +} + +relaxationFactors +{ + fields + { + + } + equations + { + "p" 0.3; + "U" 0.6; + } +} + +// ************************************************************************* // diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/DEM/in.liggghts_init b/tutorials/cfdemSolverPimple/PeriodicBox/DEM/in.liggghts_init new file mode 100755 index 00000000..2dce10d5 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/DEM/in.liggghts_init @@ -0,0 +1,109 @@ +################################################################################ +# brief: Periodic box - creating particle bed # +# # +# Periodic box simulations of Geldart A particles (d=0.075mm, rho=1500kg/m3) # +# Cf. Radl, S. and Sundaresan, S., A drag model for filtered Euler–Lagrange # +# simulations of clustered gas–particle suspensions. # +# Chemical engineering science, (2014). # +# mass loading = 0.05 # +# authors: Behrad Esgandari # +# date: Aug 2023 # +# copyright: 2023- JKU Linz # +################################################################################ + +echo both + +# define the attributes associated with the particles, +# 'granular' (or 'sphere') style uses diameter, mass and angular velocity +atom_style granular + +# use an array to map particle IDs to local storage index, +atom_modify map array + +# set simulation domain to be periodic in x y z +boundary p p p + +# save communication by turning off Newton's 3rd law for pairwise interaction, +# note: this setting only influences communication between procs, Newton's +# 3rd law is still used for contact force calculations +newton off + +# use a single value for ghost particle cutoff distance and +# enable velocity to be communicated with ghost particles +communicate single vel yes + +# set unit system to SI +units si + +processors 4 2 4 + +# define the region used as simulation domain (min/max X, min/max Y, min/max Z) +region domain block -0.004 0.004 -0.004 0.004 -0.016 0.016 units box + +# create the simulation domain and 1 material types (with friction/frictionless) +create_box 1 domain + +# specify the skin distance for neighbor list generation +neighbor 0.000075 bin +neigh_modify delay 0 + + +# define the material properties required for granular pair styles +# type 1 = particles with friction +fix m1 all property/global youngsModulus peratomtype 1e6 +fix m2 all property/global poissonsRatio peratomtype 0.42 +fix m3 all property/global coefficientRestitution peratomtypepair 1 0.9 +fix m4 all property/global coefficientFriction peratomtypepair 1 0.1 + +# specify contact model to use +pair_style gran model hertz tangential incremental_history limitForce on +pair_coeff * * + +# set the time step +timestep 0.0000025 + +# apply gravity +fix gravity all gravity 9.81 vector 0.0 0.0 -1.0 + +# define walls +fix xwall1 all wall/gran model hertz tangential incremental_history primitive type 1 xplane -0.004 +fix xwall2 all wall/gran model hertz tangential incremental_history primitive type 1 xplane 0.004 +fix ywall1 all wall/gran model hertz tangential incremental_history primitive type 1 yplane -0.004 +fix ywall2 all wall/gran model hertz tangential incremental_history primitive type 1 yplane 0.004 +fix zwall1 all wall/gran model hertz tangential incremental_history primitive type 1 zplane 0.0000 + +# particle distributions and insertion +fix pts1 all particletemplate/sphere 367127 atom_type 1 volume_limit 1e-14 density constant 1500 radius constant 3.75e-5 +fix pdd1 all particledistribution/discrete 681573 1 pts1 1.0 + +# inserting particles as a pack with mass loading of 0.05 +fix ins1 all insert/pack seed 4763687 distributiontemplate pdd1 vel constant 0.0 0.0 0.0 & + insert_every once overlapcheck yes all_in yes volumefraction_region 0.05 region domain + +# use constant NVE integration to update position, velocity and angular velocity +fix integr all nve/sphere + +# output settings, include kinetic energy +thermo_style custom step atoms ke + +# set frequency of output +thermo 1000 + +# ignore particles leaving the simulation domain, +# do not normalize thermodynamic output values by the number of atoms +thermo_modify lost ignore norm no +compute_modify thermo_temp dynamic yes + +# insert the first particles so that dump is not empty +run 1 + +# output particle properties +dump dmp all custom/vtk 1000 post/liggghts_init_*.vtk id type x y z vx vy vz & + fx fy fz omegax omegay omegaz radius + +# run up to 1000 time steps +run 1000 upto + +# write the restart file +write_restart post/restart/liggghts.restart + diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/DEM/in.liggghts_run b/tutorials/cfdemSolverPimple/PeriodicBox/DEM/in.liggghts_run new file mode 100755 index 00000000..a7a9c06d --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/DEM/in.liggghts_run @@ -0,0 +1,92 @@ +################################################################################ +# brief: Periodic box - run # +# # +# Periodic box simulations of Geldart A particles (d=0.075mm, rho=1500kg/m3) # +# Cf. Radl, S. and Sundaresan, S., A drag model for filtered Euler–Lagrange # +# simulations of clustered gas–particle suspensions. # +# Chemical engineering science, (2014). # +# mass loading = 0.05 # +# authors: Behrad Esgandari # +# date: Aug 2023 # +# copyright: 2023- JKU Linz # +################################################################################ + +log ../DEM/log.liggghts +thermo_log ../DEM/post/thermo.txt + +# define the attributes associated with the particles, +# 'granular' (or 'sphere') style uses diameter, mass and angular velocity +atom_style granular + +# use an array to map particle IDs to local storage index, +atom_modify map array + +# set simulation domain to be periodic in x y z +boundary p p p + +# save communication by turning off Newton's 3rd law for pairwise interaction, +# note: this setting only influences communication between procs, Newton's +# 3rd law is still used for contact force calculations +newton off + +# use a single value for ghost particle cutoff distance and +# enable velocity to be communicated with ghost particles +communicate single vel yes + +# set unit system to SI +units si + +# specify domain decomposition for parallel execution +processors 4 2 4 + +# read the restart file +read_restart ../DEM/post/restart/liggghts.restart + +# specify the skin distance for neighbor list generation +neighbor 0.000075 bin +neigh_modify every 5 delay 0 check no + +# define the material properties required for granular pair styles +# type 1 = particles with friction +fix m1 all property/global youngsModulus peratomtype 1e6 +fix m2 all property/global poissonsRatio peratomtype 0.42 +fix m3 all property/global coefficientRestitution peratomtypepair 1 0.9 +fix m4 all property/global coefficientFriction peratomtypepair 1 0.1 + +# specify contact model to use +pair_style gran model hertz tangential incremental_history limitForce on +pair_coeff * * + +# set the time step +timestep 0.000001 + +# apply gravity +fix gravity all gravity 9.81 vector 0.0 0.0 -1.0 + +# set up coupling to CFD simulation +fix cfd all couple/cfd couple_every 50 mpi +fix cfd2 all couple/cfd/force/implicit + +# use constant NVE integration to update position, velocity and angular velocity +fix integr all nve/sphere + +# output settings, include kinetic energy +thermo_style custom step atoms ke + +# set frequency of output +thermo 1000 + +# ignore particles leaving the simulation domain, +# do not normalize thermodynamic output values by the number of atoms +thermo_modify lost ignore norm no +compute_modify thermo_temp dynamic yes + +# output particle properties (same frequency as CFD output) +dump dmp all custom/vtk 10000 ../DEM/post/liggghts_run_*.vtk id type x y z vx vy vz & + fx fy fz omegax omegay omegaz radius + +dump dmp2 all custom 10000 ../DEM/post/liggghts_run_*.run id type x y z vx vy vz & + fx fy fz omegax omegay omegaz radius + +# run 1 time step to initialize all DEM systems +run 1 diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/parCFDDEMrun.sh b/tutorials/cfdemSolverPimple/PeriodicBox/parCFDDEMrun.sh new file mode 100755 index 00000000..400808e5 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/parCFDDEMrun.sh @@ -0,0 +1,44 @@ +#!/bin/bash +#------------------------------------------------------------------------------ +# parCFDDEMrun script for periodic box test case +# run periodic box CFD-DEM +# Behrad Esgandari - August 2023 +#------------------------------------------------------------------------------ + +#- source CFDEM env vars +. ~/.bashrc + +#- include functions +source $CFDEM_PROJECT_DIR/etc/functions.sh + +#------------------------------------------------------------------------------ +#- define variables +casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" +logpath=$casePath +headerText="run_periodic_box" +logfileName="log_$headerText" +solverName="cfdemSolverPimple" +nrProcs="32" +machineFileName="none" # yourMachinefileName | none +debugMode="off" # on | off| strict +runCleanUp="false" +#------------------------------------------------------------------------------ + +#- call function to run a parallel CFD-DEM case +parCFDDEMrun $logpath $logfileName $casePath $headerText $solverName $nrProcs $machineFileName $debugMode + +if [ $runCleanUp == "true" ] + then + #- clean up case + echo "deleting data at: $casePath :\n" + source $WM_PROJECT_DIR/bin/tools/CleanFunctions + cd $casePath/CFD + cleanCase + rm $casePath/DEM/post/*.* + touch $casePath/DEM/post/.gitignore + rm $casePath/DEM/post/restart/*.* + touch $casePath/DEM/post/restart/.gitignore +fi + +echo "done" + diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/parDEMrun.sh b/tutorials/cfdemSolverPimple/PeriodicBox/parDEMrun.sh new file mode 100755 index 00000000..abbd57a6 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/parDEMrun.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +#===================================================================# +# DEM run script for periodic box testcase +# init periodic box +# Behrad Esgandari - August 2023 +#===================================================================# + +#- source CFDEM env vars +. ~/.bashrc + +#- include functions +source $CFDEM_PROJECT_DIR/etc/functions.sh + +echo "starting DEM run in parallel..." +#--------------------------------------------------------------------------------# +#- define variables +casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" +logpath="$casePath" +headerText="run_liggghts_init_DEM" +logfileName="log_$headerText" +solverName="in.liggghts_init" +nrProcs=32 +machineFileName="none" +debugMode="off" +#--------------------------------------------------------------------------------# + +#- call function to run DEM case +parDEMrun $logpath $logfileName $casePath $headerText $solverName $nrProcs $machineFileName $debugMode + diff --git a/tutorials/cfdemSolverPimple/PeriodicBox/prerun.sh b/tutorials/cfdemSolverPimple/PeriodicBox/prerun.sh new file mode 100755 index 00000000..7b370ae7 --- /dev/null +++ b/tutorials/cfdemSolverPimple/PeriodicBox/prerun.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +#- define variables +casePath="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" + +# check if mesh was built +if [ -f "$casePath/CFD/constant/polyMesh/boundary" ]; then + echo "mesh was built before - using old mesh" +else + echo "mesh needs to be built" + cd $casePath/CFD + blockMesh +fi \ No newline at end of file