Automation of Mesh Creation Process

For this research project, flocculation tank with different geometric properties will be evaluated. Before we can achieve an optimal geometry, we would probably going through a lot of repetitive process of creating meshes using Gambit. In order to prevent the tedious process of generating mesh from scratch, use of journal script for automating the mesh creation process is inevitable. 

In general, every time we use Gambit for creating mesh, it logs every single action that you do when you are using the program into a journal file.   This journal file is very useful as it enables the user to  troubleshoots the code if the problem arise. 

By changing the appropriate geometry parameters of the journal files into variables,  we would then be able to create mesh with different geometries by changing the value of the variables.

For flocculation tank with 5 baffles turning, the script file can be accessed here.


Figure above shows flocculation tank with 5 turning. 

Using the script provided, the users can investigate the necessary geometry by just changing the parameter of baffle spacings, clearance height and flocculation tank height in the script. Upon changing those parameter,users just have to run the script in Gambit and the finalized mesh is ready for implementation in FLUENT.

Similarly, a script in FLUENT can process a completed mesh, and automatically set up the solver, initial conditions, fluid properties, convergence criteria, and save the convergence solution data file to be analyzed later. The incomplete script can be accessed here.

Modifying the Journal Files

Following is the sample of the heading of the journal file that was added to declare the value of different parameters.

/clearance height
$ch = 0.1

/flocculator height
$fh = 0.5

/create baffle spacing
$bs1 = 0.1

/create x-coordinate
$w0 = 0        
$b1 = $w0+$bs1       
 

/create y-coordinate
$y1 = $ch
$y2 = $fh-$ch

Note that  '/' means commenting on the code.

Note also that the parameters that we added are ch = 0.1, fh = 0.5, bs = 0.1.

Note also that a '$' is added in front of those parameters to make it as variables recognizable by Gambit.

Note also Gambit recognize mathematical operators.

By relating different coordinates of the flocculation tank to the declared parameters, we can generate meshes with different geometry by just changing the heading of the journal file.

Do look at the complete script here for further understanding. 

  • No labels