|
In some cases, you might have to perform the same task several times to post-process your results
in CFD-VIEW. This can happen for example when you are running a parametric study and need to extract
the same information from all the solution files. In this case, it might be time-saving to use
the Macro option of CFD-VIEW, especially if obtaining the information necessitates many operations.
For example, assume that to post process the results, you have to create a temperature iso-surface,
clip it for a given range of pressure, create several plane cuts at various locations (which results
in curves), plot the values of velocity on these curves, and finally export the plot data. One can
see that this may take a long time to process if this has to be done manually for many simulations.
Instead, it can be advantageous to use the scripting capability of CFD-VIEW to script this entire
process, and then make the script available as a macro. The Macro option allows the user faster and
easier access to Python scripts, thus reducing post-processing time and increasing ease of use.
To use this option, simply put your script (e.g. Velocity.py) in the desired directory, and make
macros point to that directory. To do that, go to ‘Edit -> Preferences’ from the Menu bar
(see figure 1 below).
Figure 1. Menu bar - Preferences
Then, in the window that opens, go to the ‘Scripting’ tab and change the Macro Directory to where
the Python script is (see figure 2). Click “OK” to save the changes and close the window.
Your script will now appear in the Macro drop down menu (see figure 3). Click on the "run" button
to run the script on the currently loaded model.
Figure 2. Changing the Macro Directory
Figure 3. Running a macro
For more information on scripting and macros, please refer to the ‘Scripting’ and
‘Tools Menu -> Macros’ sections of the CFD-VIEW User Manual.
If you have any questions about this tip or would like us to discuss other topics in the future,
please let us know.
Regards,
Olivier Demaneuf
ESI CFD Support Team
|