Mixing Tank¶
Watch the associated training video – Mixing Tank Example
The purpose of this script is to do all steps of a CFD workflow: pre-processing, solving, and post processing. This example is a simple agitated vessel that predicts blend time. The basic idea here is that you can quickly change out different geometries or operating conditions in order to predict blend time. The outputs from the script are a set of plots showing the blend time results.

Mixing tank pre-processed system generated by the script¶
Setup¶
The script is available here – mixingtank.py
Your python library search path will require both the M-Star installation directory, as well as the data/Scripts
sub-directory. If you are using a .pth file on windows, this might look like the following. You can also use the python method sys.path.insert(0, r"C:\Program Files\M-Star CFD")
or the python path environment variable to setup the required library search paths.
C:\Program Files\M-Star CFD
C:\Program Files\M-Star CFD\data\Scripts
Usage¶
This script has a simple command line interface to specify gpus, run, and force overwrite. An example execution is
python mixingtank.py --gpus 0 --run
How it works¶
This will do the following:
Pre-processing
Create tank with baffles
Create Rushton impeller
Setup blend time global variable
Setup early termination stop condition
Save .msb file
Solving
Export solver files to “run” sub-directory
Run solver with specified GPUs
Post-process
the blend time metric (relative standard deviation of injected scalar)
impeller forces, torques, power number
visualizations of the injected scalar
Example Stat Plots¶




Example Visualizations¶
This script outputs image frames from VTK processing pipeline. You can use ffmpeg to construct a video of the animated frames. For more information on using ffmpeg, see Ffmpeg
Note that the scalar is not injected until t=10s. The volume output interval was 1s.