3.23. Procedural geometry¶
This tutorial shows how to use procedural shapes to define geometry. This capability was introduced in the 21.1 release.
Simple shapes (cylinder and bends) will be defined and combined to create the geometry. Each shape is controlled by parameters. Filters are applied to the shapes to transform (scale, translate, rotate) the geometry, or flip the normal vector orientation (internal vs external flow). Boolean operations are used to combine the shapes.
The primary focus of this tutorial is to build the geometry. This is done in SMS mode (see SMS meshing workflow tutorial for more details).
3.23.1. Create a new project¶
On the main menu click on the
New button.
Create a new project by double-clicking on “Blank” template.
Enter a project name and browse to a location for the new project.
If you have not switched to SMS workflow, you will be prompted to switch. Accept SMS mode.
3.23.2. Create the geometry¶
First, create a cylinder:
Go to the Geometry pane and click the button to add geometry:
Choose
->
Procedural > Cylinderas the geometry input (namedcylinder).
Enter the cylinder’s parameters:
Radius =
0.05m, Height =0.225m, Resolution =20Start angle=
0deg, end angle =360deg, resolution =32Check the
Bottom capandTop capcheck boxes and set the resolution to5for both caps.
Save the project by clicking the
button.
Next, create a bend:
Go to the Geometry pane:
Choose
->
Procedural > Bendas the geometry input (named “bend”).Enter the bend’s parameters:
Front section: Radius =
0.02m, Length =0.05m, Resolution =10Back section: Radius =
0.05m, Length =0.25m, Resolution =20Bend section: Major radius =
0.075m, Minor radius =0.02m, Start angle=0deg, end angle =90deg, resolution =16Circumference: Start angle=
0deg, end angle =360deg, resolution =16Check the
Bottom capandTop capcheck boxes and set the resolution to3for both caps. Leave Offset =0
Rotate and translate the bend:
Select the bend (named
bend)Add a filter:
->
transformSet a Translation of
0.025m in the X-direction,0.15m in the Y-direction, and0.05m in the Z-direction.Rotate
-90deg in the Z-direction.
Combine the cylinder and the bend (union):
Select the cylinder (named
cylinder)While holding the
ctrlkey, select the transformed bend (namedtransform)Press the
button
Save the project by clicking the
button.
Next, create another bend:
Go to the Geometry pane:
Choose
->
Procedural > Bendas the geometry input (namedbend1).Enter the bend’s parameters:
Front section: Radius =
0.02m, Length =0.1m, Resolution =10Back section: Radius =
0.02m, Length =0.1m, Resolution =10Bend section: Major radius =
0.05m, Minor radius =0.02m, Start angle=0deg, end angle =90deg, resolution =10Circumference: Start angle=
0deg, end angle =360deg, resolution =16Check the
Bottom capandTop capcheck boxes and set the resolution to3for both caps. Leave Offset =0
Rotate and translate the bend:
Select the bend (named
bend1)Add a filter:
->
transformSet a Translation of
-0.005m in the X-direction,0.25m in the Y-direction, and-0.05m in the Z-direction.Rotate
90deg in the Z-direction.
Combine the bend and the previous geometry (union):
Select the transformed bend (named
transform1)While holding the
ctrlkey, select the previous geometry (namedunion)Press the
button. This will create a new
union1geometry.
Save the project by clicking the
button.
3.23.3. Check the geometry orientation¶
Visualize and flip the orientation (normal vectors) of the geometry:
In the model window, show the Geometry, hide the Background mesh, Hide the Regions (visibility is toggled by clicking on each icon). Set the Geometry style to
edges, opacity to 1.0, check theShow normalsbox, set theScaleto 0.01, setcountto 10,000 (to show all normals).
The normal vectors must point towards the fluid region (here towards the inside of the geometry). However we see that the normals point in the opposite direction (outwards the fluid region). This means we need to flip the normals to correct the orientation.
Select the
union1geometry,Add a filter:
->
flip normals. Now the vectors point towards the fluid region. The tips of the arrows are not visible, but we can see the origin (shown as a dot at the center of each face).
Save the project by clicking the
button.
Toggle the Region visibility back on.
In
Domain extent, enter the following:X-direction: Min =
-0.055m, Max =0.055m.Y-direction: Min =
0.01m, Max =0.35m.Z-direction: Min =
-0.1m, Max =0.18m.
Note that the inlets and outlet extend beyond the domain extents. This is intentional, as it usually provides a cleaner intersection and easier way to define boundary conditions regions when they are aligned with the domain box (planes along x=xmin, x=xmax etc.).
Save the project by clicking the
button.
3.23.4. Create boundary conditions regions¶
Go to the Regions pane:
There is already a
Background ICthat is predefined in the Blank template. We can ignore it for now.Click the
(top) button to create a new region to be used by a mass inflow boundary condition.
Select
Mass inflowin the Boundary type drop down menu.Enter a name for the region in the Name field (“top inlet”).
Change the region color to red.
Click the
(bottom) button to create a new region to be used by another mass inflow boundary condition.
Select
Mass inflowin the Boundary type drop down menu.Enter a name for the region in the Name field (“bottom inlet”).
Change the region color to pink.
Click the
(back) button to create a new region to be used by pressure outlet boundary condition.
Select
Pressure outflowin theBoundary typedrop down menu.Enter a name for the region in the Name field (“outlet”).
Change the region color to yellow.
Click the
(all) button to create a new region that covers the entire domain to be used for the wall boundary condition.
Select
No-slip wallin theBoundary typedrop down menu.Enter a name for the region in the
Namefield (“wall”).Change the region color to green.
Check
Select facets (STL)andflip_normals, useallfor the selection method. You should see that there are 4003 facets selected.
Note
The pressure outlet and mass inflow boundaries are located along the domain box. They are defined as rectangular 2D regions and must overlap the actual boundary areas (intersection of the STL file with the box planes). The exact boundary area will be computed automatically when preprocessing is performed.
Click the
(all) button to create a new region that will be used as initial condition region. This is not needed to generate the mesh, but will be used later when setting up the simulation.
Leave the
Boundary typeasNone.Enter a name for the region in the
Namefield (“init bed”).Change the region color to black.
Set the Y-extent form
yminto0.15m.Save the project by clicking the
button.
3.23.5. Setup the mesh¶
Go to the Mesh pane, Background sub-pane:
Enter
15for the x cell value.Enter
35for the y cell value.Enter
30for the z cell value.
Go to the Mesh pane, Mesher sub-pane:
Set the Facet angle tolerance to
0.0deg. (The geometry unions have created elongated triangles we need to keep).Click
Generate.Look at the console output to verify the mesh generation completed successfully.
In the Model view, - hide the Geometry, Background mesh and Regions - show the Boundary_Mesh - set
Color bytobc_id, - setStyletoedgesand opacity to1.0.The Boundary_Mesh should look like a closed surface with colors matching the boundary conditions regions.
After inspection, the mesh is deemed acceptable and we can move to setting up the simulation (Solver mode). Click Accept. This will unlock the Modeler tab.
3.23.6. Model settings¶
Switch to the Modeler tab (second tab at the bottom left corner of the GUI).
On the
Modelpane, enter a descriptive text in theDescriptionfield.Select “Discrete Element Model (MFiX-DEM)” in the
Solverdrop-down menu.Keep all other settings at their default values.
3.23.7. Regions settings¶
We already have set all the regions, there is no change required in this pane.
3.23.8. Fluid settings¶
Change Density to
Ideal gas law.Keep all other settings at their default values.
3.23.9. Solids settings¶
On the Solids pane, Materials sub-pane:
Click the
button to create a new solid.
Verify the solids model is already set to “Discrete Element Model (MFiX-DEM)”.
Enter the particle diameter of
0.005m in theDiameterfield.Enter the particle density of
2700kg/m3 in theDensityfield.Select the
Solidspane,DEMsub-pane.Check the
Enable automatic particle generationcheckbox.Keep all other settings at their default values.
3.23.10. Initial conditions settings¶
On the Initial conditions pane:
There is already a
Background ICregion that initializes the entire domain as stagnant air. We only need to add solids at the bottom.Create a new initial condition region by clicking the
button.
Select the
init bedregion, go to theSolid 1tab and enter0.5for the volume fraction.
3.23.11. Boundary conditions settings¶
On the Boundary conditions pane:
Select the
top inletregion. In theSolids 1tab, enter0.2for the volume fraction and-0.2for the Y-axial velocity.Select the
bottom inletregion. Stay on theFluidtab, enter4.0for the Y-axial velocity.The outlet Boundary Conditions is already set to atmospheric pressure. No changes are needed.
The Wall Boundary Conditions is already set to No-slip wall. No changes are needed.
3.23.12. Numerics settings¶
On the Numerics pane:
On the Residual pane: set the Fluid normalization to
0.0and the fluid pressure correction scale factor to1.0On the Preconditioner tab, set the preconditioner to
Nonefor all equations.
3.23.13. Output settings¶
On the Output pane:
On the
Basicsub-pane, check theWrite VTK output files (VTU/VTP)checkbox.Select the
VTKsub-pane.Create a new output by clicking the
button.
Select “Particle Data” from the ‘Output type’ drop-down menu.
Select the “Background IC” region from the list to save all the particle data.
Click
OKto create the output.Enter a base name for the
*.vtufiles in theFilename basefield (“Particles”).Change the
Write intervalto0.01seconds.Select the
DiameterandTranslational Velocitycheckboxes.
3.23.14. Run settings¶
Save the project by clicking the button.
On the Run pane:
Set
Stop timeto1.0.Set
Time stepto0.001.Set
Maximum time stepto0.01.Keep all other settings at their default values.
3.23.15. Run the simulation¶
Run the project by clicking the
button.
On the
Rundialog, select the executable from the combo-box.Click the
Runbutton to actually start the simulation.
3.23.16. View results¶
Results can be viewed, and plotted, while the simulation is running.
Create a new visualization tab by pressing the
next to the Model tab.
Click the
3D viewbutton to view the vtk output files.On the
VTKresults tab, the visibility and representation of the*.vtkfiles can be controlled with the menu on the side.Change frames with the
,
,
, and
buttons.
Click the
button to play the available vtk files.
Change the playback speed under the
section on the sidebar.












