drum-PeriodictBoundary tutorial added

This commit is contained in:
HRN 2025-02-25 22:37:19 +03:30
parent a33ec7d8e0
commit 1cbeb1c963
11 changed files with 398 additions and 0 deletions

View File

@ -0,0 +1,86 @@
# Simulating a Rotating Drum with Periodic Boundary Type (v-1.0)
## Problem Definition
The problem is to simulate a rotating drum with a diameter of 0.24 m and a length of 0.1 m, rotating at 11.6 rpm. It is filled with 4-mm spherical particles at a rate of 10,000 particles/s for 2 seconds (a total of 20,000 particles). The timestep for integration is 0.00001 s. We use the `periodic` boundary type in the z-direction to replicate the same drum on both sides (a drum with an infinite length).
<div align="center">
<b>
<img src="./drumPeriodic.jpeg" alt="Rotating Drum with Periodic Boundary" style="width: 600px;">
</b>
<b>
A View of Rotating Drum with Periodic Boundary
</b></div>
***
## Setting Up the Case
Everything is similar to the tutorial on [simulating a small rotating drum](../rotatingDrumSmall), except that the drum does not have the two end plates (it is open from both sides), and we use particle insertion for inserting particles. So, if you don't know how to simulate a rotating drum, first review that tutorial.
Since the goal here is to show you how to use the periodic boundary type, we only review the `domainDict` here.
<div align="center">
in <b>settings/domainDict</b> file
</div>
```C++
// Simulation domain: every particle that goes outside this domain will be deleted
globalBox
{
min (-0.12 -0.12 0.0); // lower corner point of the box
max (0.12 0.12 0.1); // upper corner point of the box
}
boundaries
{
left // x-
{
type exit;
}
right // x+
{
type exit;
}
bottom // y-
{
type exit;
}
top // y+
{
type exit;
}
rear // z-
{
type periodic; // this boundary type should be defined on both z+ and z- sides
}
front // z+
{
type periodic; // this boundary type should be defined on both z+ and z- sides
}
}
```
`globalBox` defines a cuboid with two corner points `min` and `max`. If a particle falls out of this box, it is automatically deleted. So, this box should contain everything in the simulation and should be as small as possible.
`front` and `rear` boundaries represent the front and rear planes of this `globalBox`. If we want to have a periodic boundary in the z direction, we should set the type of boundary to `periodic` for both `front` and `rear` boundaries.
## Running the Case
The solver for this simulation is `sphereGranFlow`. Enter the following commands in the terminal. Depending on the computational power, it may take a few minutes to a few hours to complete.
```sh
geometryPhasicFlow
particlesPhasicFlow
sphereGranFlow
```
## Post Processing
After finishing the simulation, you can render the results in ParaView. To convert the results to VTK format, just enter the following command in the terminal. This will convert all the results (particles and geometry) to VTK format and store them in the `VTK/` folder.
```sh
pFlowToVTK --binary
```

View File

@ -0,0 +1,49 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName interaction;
objectType dicrionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
materials (prop1); // a list of materials names
densities (1000.0); // density of materials [kg/m3]
contactListType sortedContactList;
contactSearch
{
method NBS; // method for broad search
updateInterval 10;
sizeRatio 1.1;
cellExtent 0.55;
adjustableBox Yes;
}
model
{
contactForceModel nonLinearNonLimited;
rollingFrictionModel normal;
Yeff (1.0e6); // Young modulus [Pa]
Geff (0.8e6); // Shear modulus [Pa]
nu (0.25); // Poisson's ratio [-]
en (0.7); // coefficient of normal restitution
mu (0.3); // dynamic friction
mur (0.1); // rolling friction
}

View File

@ -0,0 +1,42 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particleInsertion;
objectType dicrionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
active Yes; // is insertion active -> yes or no
partInsertion
{
timeControl simulationTime; // Time control method
rate 10000; // insertion rate (particles/s)
startTime 0; // Start time for insertion (s)
endTime 2; // End time for insertion (s)
insertionInterval 0.025; // Time interval between insertions (s)
regionType box; // type of insertion region
boxInfo
{
min (-0.07 0.05 0.05); // Minimum coordinates of the box (m,m,m)
max ( 0.07 0.06 0.09); // Maximum coordinates of the box (m,m,m)
}
setFields
{
velocity realx3 (0.0 -0.4 -0.3); // initial velocity of inserted particles
}
mixture
{
sphere1 1; // mixture composition of inserted particles
}
}

View File

@ -0,0 +1,13 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName sphereDict;
objectType sphereShape;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
names (sphere1); // names of shapes
diameters (0.004); // diameter of shapes
materials (prop1); // material names for shapes

View File

@ -0,0 +1,7 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
ls | grep -P "^(([0-9]+\.?[0-9]*)|(\.[0-9]+))$" | xargs -d"\n" rm -rf
rm -rf VTK
#------------------------------------------------------------------------------

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

View File

@ -0,0 +1,24 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
echo "\n<--------------------------------------------------------------------->"
echo "1) Creating particles"
echo "<--------------------------------------------------------------------->\n"
particlesPhasicFlow
echo "\n<--------------------------------------------------------------------->"
echo "2) Creating geometry"
echo "<--------------------------------------------------------------------->\n"
geometryPhasicFlow
echo "\n<--------------------------------------------------------------------->"
echo "3) Running the case"
echo "<--------------------------------------------------------------------->\n"
sphereGranFlow
echo "\n<--------------------------------------------------------------------->"
echo "4) Converting to VTK"
echo "<--------------------------------------------------------------------->\n"
pFlowToVTK --binary --fields velocity diameter id
#------------------------------------------------------------------------------

View File

@ -0,0 +1,50 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName domainDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
// Simulation domain: every particles that goes outside this domain will be deleted
globalBox
{
min (-0.12 -0.12 0.0); // lower corner point of the box
max (0.12 0.12 0.1); // upper corner point of the box
}
boundaries
{
left // x-
{
type exit;
}
right // x+
{
type exit;
}
bottom // y-
{
type exit;
}
top // y+
{
type exit;
}
rear // z-
{
type periodic; // this boundary type should be defined in both z+ and z- sides
}
front // z+
{
type periodic; // this boundary type should be defined in both z+ and z- sides
}
}

View File

@ -0,0 +1,50 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName geometryDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
motionModel rotatingAxis;
rotatingAxisInfo // information for rotatingAxisMotion motion model
{
rotAxis
{
p1 (0.0 0.0 0.0); // first point for the axis of rotation
p2 (0.0 0.0 1.0); // second point for the axis of rotation
omega 1.214; // rotation speed (rad/s)
}
}
surfaces
{
/*
A cylinder with begin and end radii 0.12 m and axis points at (0 0 0) and (0 0 0.1)
*/
cylinder
{
type cylinderWall; // type of the wall
p1 (0.0 0.0 0.0); // begin point of cylinder axis
p2 (0.0 0.0 0.1); // end point of cylinder axis
radius1 0.12; // radius at p1
radius2 0.12; // radius at p2
resolution 24; // number of divisions
material prop1; // material name of this wall
motion rotAxis; // motion component name
}
}

View File

@ -0,0 +1,34 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName particlesDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
setFields
{
/*
Default value for fields defined for particles
These fields should always be defined for simulations with
spherical particles.
*/
defaultValue
{
velocity realx3 (0 0 0); // linear velocity (m/s)
acceleration realx3 (0 0 0); // linear acceleration (m/s2)
rVelocity realx3 (0 0 0); // rotational velocity (rad/s)
shapeName word sphere1; // name of the particle shape
}
selectors
{}
}
positionParticles
{
method empty; // no particle at the start of simulation
}

View File

@ -0,0 +1,43 @@
/* -------------------------------*- C++ -*--------------------------------- *\
| phasicFlow File |
| copyright: www.cemf.ir |
\* ------------------------------------------------------------------------- */
objectName settingsDict;
objectType dictionary;
fileFormat ASCII;
/*---------------------------------------------------------------------------*/
run drumPeriodic;
dt 0.00001; // time step for integration (s)
startTime 0; // start time for simulation
endTime 5; // end time for simulation
saveInterval 0.05; // time interval for saving the simulation
timePrecision 4; // maximum number of digits for time folder
g (0 -9.8 0); // gravity vector (m/s2)
includeObjects (diameter); // save necessary (i.e., required) data on disk
// exclude unnecessary data from saving on disk
excludeObjects (rVelocity.dy1
rVelocity.dy2
rVelocity.dy3
pStructPosition.dy1
pStructPosition.dy2
pStructPosition.dy3
pStructVelocity.dy1
pStructVelocity.dy2
pStructVelocity.dy3);
integrationMethod AdamsBashforth4; // integration method
writeFormat ascii; // data writting format (ascii or binary)
timersReport Yes; // report timers (Yes or No)
timersReportInterval 0.1; // time interval for reporting timers