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