Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd6b30df

Browse files
authored
Merge pull request#115 from hamidrezanorouzi/main
coarse-grain-cylinder-tutorial
2 parentse0fb6d9 +bfacef0 commitd6b30df

File tree

20 files changed

+1012
-0
lines changed

20 files changed

+1012
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/sh
2+
set -e# Exit immediately if a command exits with a non-zero status
3+
cd${0%/*}||exit 1# Run from this directory
4+
5+
# Source tutorial run functions
6+
# First run OpenFoam Aplication
7+
8+
echo"\n<--------------------------------------------------------------------->"
9+
echo"1) Running blockmesh"
10+
echo"<--------------------------------------------------------------------->\n"
11+
blockMesh
12+
13+
echo"\n<--------------------------------------------------------------------->"
14+
echo"2) Running Step 1 (DEM from 0 s to 0.25 s )"
15+
echo"<--------------------------------------------------------------------->\n"
16+
17+
echo" \n2.1) add Particle"
18+
particlesPhasicFlow
19+
echo" \n2.2) add Geometry"
20+
geometryPhasicFlow
21+
echo" \n2.3) Running DEM simulation"
22+
grainGranFlow
23+
24+
25+
echo"\n<--------------------------------------------------------------------->"
26+
echo"3) Copy Orginal Data to time folder 0.25 (P , U , Alpha )"
27+
echo"<--------------------------------------------------------------------->\n"
28+
cp ./FluidField/alpha ./0.25
29+
cp ./FluidField/p ./0.25
30+
cp ./FluidField/U ./0.25
31+
32+
echo"\n<--------------------------------------------------------------------->"
33+
echo"4) Running Step 3 (0.25-10 CFD-DEM)"
34+
echo"<--------------------------------------------------------------------->\n"
35+
unresolvedGrainPFPlus
36+
37+
echo"\n<--------------------------------------------------------------------->"
38+
echo"5) Converting to VTK Files"
39+
echo"<--------------------------------------------------------------------->\n"
40+
pFlowToVTK -t 0.25:10 --binary
41+
touch foam.foam
42+
echo"Start paraview with the command: paraview foam.foam & to visualize the results"
43+
echo"\n<--------------------------------------------------------------------->"
44+
45+
#------------------------------------------------------------------------------
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*--------------------------------*- C++ -*----------------------------------*\
2+
| ========= | |
3+
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4+
| \\ / O peration | Version: v2412 |
5+
| \\ / A nd | Website: www.openfoam.com |
6+
| \\/ M anipulation | |
7+
\*---------------------------------------------------------------------------*/
8+
FoamFile
9+
{
10+
format ascii;
11+
classvolVectorField;
12+
object U;
13+
}
14+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
15+
16+
dimensions [01 -10000];
17+
18+
internalFielduniform (000);
19+
20+
boundaryField
21+
{
22+
cylinderWall
23+
{
24+
type noSlip;
25+
valueuniform (000);
26+
}
27+
inlet
28+
{
29+
type fixedValue;
30+
valueuniform (0.00.00.6);
31+
}
32+
outlet
33+
{
34+
type zeroGradient;
35+
}
36+
}
37+
38+
// ************************************************************************* //
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*--------------------------------*- C++ -*----------------------------------*\
2+
| ========= | |
3+
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4+
| \\ / O peration | Version: v2412 |
5+
| \\ / A nd | Website: www.openfoam.com |
6+
| \\/ M anipulation | |
7+
\*---------------------------------------------------------------------------*/
8+
FoamFile
9+
{
10+
format ascii;
11+
classvolScalarField;
12+
object alpha;
13+
}
14+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
15+
16+
dimensions [0000000];
17+
18+
internalField uniform1;
19+
20+
boundaryField
21+
{
22+
inlet
23+
{
24+
type fixedValue;
25+
value uniform1;
26+
}
27+
outlet
28+
{
29+
type zeroGradient;
30+
}
31+
cylinderWall
32+
{
33+
type zeroGradient;
34+
}
35+
}
36+
37+
// ************************************************************************* //
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*--------------------------------*- C++ -*----------------------------------*\
2+
| ========= | |
3+
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4+
| \\ / O peration | Version: v2412 |
5+
| \\ / A nd | Website: www.openfoam.com |
6+
| \\/ M anipulation | |
7+
\*---------------------------------------------------------------------------*/
8+
FoamFile
9+
{
10+
format ascii;
11+
classvolScalarField;
12+
object p;
13+
}
14+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
15+
16+
dimensions [02 -20000];
17+
18+
internalField uniform0;
19+
20+
boundaryField
21+
{
22+
inlet
23+
{
24+
type zeroGradient;
25+
}
26+
outlet
27+
{
28+
type fixedValue;
29+
value uniform0;
30+
}
31+
cylinderWall
32+
{
33+
type zeroGradient;
34+
}
35+
}
36+
37+
// ************************************************************************* //
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
#Cylindrical Fluidized Bed (coarse-grained simulation)
2+
3+
- Compatibility: OpenFOAM v2406 and v2412 and PhasicFlow-v-1.0.
4+
- Solver: unresolvedGrainPFPlus
5+
6+
##0. Problem Definition
7+
8+
In this tutorial, we will simulate a gas-solid fluidized bed using the unresolved solver`unresolvedGrainPFPlus`. The cylindrical fluidized bed dimensions are 0.1 m in diameter and 0.2 m in height. We are going to use coarse-graining to simulate 400K 1-mm particles (density of 1000 kg/m³). We use 2-mm grains instead, and this reduces the number of particles to 50K grains. Initially, the particles are at rest. Gas is uniformly injected from the bottom of the bed at a superficial velocity of 0.6 m/s. The simulation runs for a total of 10 seconds, with 0.25 s dedicated to the initial packing of particles (pure DEM simulation) and the remaining 9.75 seconds to the fluidized bed simulation.
9+
10+
<divalign="center">
11+
<b>
12+
<imgsrc="./fluidized-bed-cfd-dem.jpeg"alt="Fluidized bed"style="width:400px;"/>
13+
</b>
14+
<b>
15+
16+
A visualization of a gas-solid fluidized bed with the gas field colored based on velocity.
17+
</b></div>
18+
19+
***
20+
21+
##1. Performing the Simulation Using the Allrun Script
22+
23+
The`Allrun` script is designed to automate the simulation process for the gas-solid fluidized bed using the`unresolvedGrainPFPlus` solver. It manages all essential steps, including mesh generation, DEM simulation, CFD-DEM coupling simulation, and result conversion. The first phase of the simulation is dedicated to particle settling, which is a pure DEM simulation using the`grainGranFlow` solver. Following this phase, the CFD-DEM simulation is performed for the remaining 9.75 seconds. To execute the simulation, follow these steps:
24+
25+
###Step 1: Execute the`Allrun` Script
26+
27+
1. Navigate to the`fluidizedbed` directory.
28+
2. Run the`Allrun` script by executing the following command:
29+
30+
```sh
31+
./Allrun
32+
```
33+
34+
This script automates the entire simulation workflow, including mesh generation, DEM simulation, CFD-DEM coupling, and result conversion.
35+
36+
###Step 2: Understand the Folder Structure
37+
38+
The simulation folder structure is divided into two main categories: folders containing files related to DEM parameters and folders containing files related to CFD and coupling parameters:
39+
40+
-**DEM-related folders**:
41+
-**`settings/`**: Contains configuration files for the DEM simulation.
42+
-**`caseSetup/`**: Includes files for setting up the simulation and physical parameters for particles.
43+
44+
-**CFD-DEM-related folders**:
45+
-**`FluidField/`**: Holds the initial field data (`alpha`,`p`,`U`) used for the CFD-DEM simulation.
46+
-**`constant/`**: Contains constant properties for the fluid and parameters for coupling (CFD-DEM).
47+
-**`system/`**: Contains files for setting up CFD simulation parameters.
48+
49+
###Step 3: Visualize the Results
50+
51+
Once the simulation is complete, the results are converted to VTK format for visualization. The VTK files can be found in the`./VTK` folder. To visualize the results, use the following command:
52+
53+
```sh
54+
paraview foam.foam&
55+
```
56+
57+
Open the`foam.foam` file in ParaView to view the CFD results. For DEM results, open the`./VTK/particles.vtk.series` file.
58+
59+
##2. Description of setup files
60+
61+
To learn about how to set up a DEM simulation, please refer to the[tutorial page](https://github.com/PhasicFlow/phasicFlow/wiki/Tutorials) of PhasicFlow and other online documents along side this package. Also, you can refer to OpenFOAM tutorials to learn about how to set up a CFD simulation.
62+
63+
Mesh generation for the cylinder is performed using`blockMesh` utility of OpenFOAM. Although it is possible to use third-party mesh generation tools and then convert the mesh into OpenFOAM mesh. But here, we still use`blockMesh` utility. In`blockMeshDict` file, you will find these few lines, through which you can control the parameters for mesh generation:
64+
65+
```C++
66+
// * * * User INPUTS * * * * * * * * * *
67+
68+
// Gemoetry
69+
radius0.05;
70+
height0.2;
71+
cellSize0.003;
72+
innerArc yes;// yes/no
73+
74+
// Patch information
75+
inletPatchName inlet;
76+
outletPatchName outlet;
77+
wallPatchName cylinderWall;
78+
// * * * * * * * * * * * * * * * * * * *
79+
80+
// the rest of blockMeshDict file is missing here ...
81+
```
82+
83+
The parameters`radius`,`height`, and`cellSize` are used to define radius, height and approximate edge cell size in the final mesh. You can also change the name of the patches in the final mesh through keys`inletPatchName`,`outletPatchName`, and`wallPatchName`.
84+
85+
For geometry generation in DEM side (after mesh generation), we can use the utility that converts OpenFOAM patch surfaces into actual DEM walls. In the`settings/geometryDict` file, just set the type of the surface to`foamPatchWall`. This utility reads OpenFOAM mesh and converts the patches to DEM surfaces.
86+
87+
```C++
88+
89+
surfaces
90+
{
91+
inlet
92+
{
93+
type foamPatchWall; // type of the wall
94+
95+
patch inlet;
96+
97+
material wallMaterial; // material name of this wall
98+
}
99+
100+
outlet
101+
{
102+
type foamPatchWall; // type of the wall
103+
104+
patch outlet;
105+
106+
material wallMaterial; // material name of this wall
107+
}
108+
109+
cylinder
110+
{
111+
type foamPatchWall; // type of the wall
112+
113+
patch cylinderWall;
114+
115+
material wallMaterial; // material name of this wall
116+
}
117+
}
118+
```
119+
120+
The most important setup file for CFD-DEM simulation is`constant/couplingProperties`. To learn more about this file and how to set it up, you are refered to other tutorials, in which this has been completely explained.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/* -------------------------------*- C++ -*--------------------------------- *\
2+
| phasicFlow File |
3+
| copyright: www.cemf.ir |
4+
\* -------------------------------------------------------------------------*/
5+
objectName interaction;
6+
objectType dicrionary;
7+
fileFormat ASCII;
8+
/*---------------------------------------------------------------------------*/
9+
10+
materials (sphereMaterial wallMaterial);// a list of materials names
11+
12+
densities (10002500);// density of materials [kg/m3]
13+
14+
contactListType sortedContactList;
15+
16+
model
17+
{
18+
contactForceModel cGNonLinearLimited;
19+
20+
grainDissipationModel simplified;
21+
22+
additionalDissipationModel GB;
23+
24+
rollingFrictionModel normal;
25+
26+
// Young modulus [Pa]
27+
Yeff (1.0e61.0e6
28+
1.0e6);
29+
30+
// Shear modulus [Pa]
31+
Geff (0.8e60.8e6
32+
0.8e6);
33+
34+
// Poisson's ratio [-]
35+
nu (0.250.25
36+
0.25);
37+
38+
// coefficient of normal restitution
39+
en (0.970.97
40+
0.97);
41+
42+
// dynamic friction
43+
mu (0.650.65
44+
0.65);
45+
46+
// rolling friction
47+
mur (0.10.1
48+
0.1);
49+
50+
}
51+
52+
contactSearch
53+
{
54+
method NBS;
55+
56+
updateInterval10;
57+
58+
sizeRatio1.1;
59+
60+
cellExtent0.55;
61+
62+
adjustableBox Yes;
63+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* -------------------------------*- C++ -*--------------------------------- *\
2+
| phasicFlow File |
3+
| copyright: www.cemf.ir |
4+
\* -------------------------------------------------------------------------*/
5+
objectName shapes;
6+
objectType dictionary;
7+
fileFormat ASCII;
8+
/*---------------------------------------------------------------------------*/
9+
10+
names (grainParticle);
11+
grainDiameters(0.002);
12+
sphereDiameters(0.001);
13+
materials (sphereMaterial );// material names for shapes

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp