periodic box simulation tutorial

This commit is contained in:
BehradEsg
2023-08-22 11:09:04 +02:00
parent 93d5a842a4
commit 8a8c6d2bc2
26 changed files with 1375 additions and 0 deletions

View File

@ -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

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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";
}
// ************************************************************************* //

View File

@ -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 );
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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;
// ************************************************************************* //

View File

@ -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;
// ************************************************************************* //

View File

@ -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
(
);
// ************************************************************************* //

View File

@ -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
{
}
// ************************************************************************* //

View File

@ -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;
}
// ************************************************************************* //

View File

@ -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 ;
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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 EulerLagrange #
# simulations of clustered gasparticle 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

View File

@ -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 EulerLagrange #
# simulations of clustered gasparticle 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

View File

@ -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"

View File

@ -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

View File

@ -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