HomeIndustriesProductsServicesPartnersAbout Us

Customer Login

Home arrow CFD-VIEW User Tips arrow Using Macros in CFD-VIEW
Using Macros in CFD-VIEW

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

Image

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.

Image

Figure 2.  Changing the Macro Directory

Image

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

 

CFD-VIEW re-pick buffer feature for object selection

When post-processing complex geometries in CFD-VIEW where there are multiple objects close to each other, it is not always easy to pick the correct one, unless you zoom in a lot. To avoid having to zoom in and zoom out many times, you can use the re-pick buffer feature.

Tracking Multiple Variables with Multiple Legends

When post-processing with CFD-VIEW, one may wish to display two different variables on two different objects. This requires the use of two legends to correspond to the different color mapping of the variables. The legend tracking feature in CFD-VIEW can be used to achieve this. If this topic is of interest to you, please read on.

Plotting Multiple Variables in the CFD-VIEW Plotter

Plotting two or more variables on same plot having values of different magnitude/scale becomes difficult or many times impossible. In these cases plotting data with multiple Y-axes becomes very useful and sometimes necessary.

Updating and Animating a Developing Steady State Simulation in CFD-VIEW

Many users who are running steady-state simulations like to watch the results develop. Most of the time, users hit the "Reload the Same Data File(s)" button again and again. You will be happy to hear that there are two easier ways to do it.

Blanking Option in CFD-VIEW for Visualizing Chimera Grids

CFD-FASTRAN uses closed surfaces, such as walls or blocked regions, to create Chimera holes (or blanked regions) in a grid. By default, the number of buffer layers is set to 1. This means that a closed surface will cut a hole in any mesh that overlaps it, and the initial "blanking" of grid cells defines the hole.


© 2012 ESI Group CFD Portal