HomeIndustriesProductsServicesPartnersAbout Us

Customer Login

Home arrow CFD-VIEW User Tips arrow Using CFD-VIEW Scripting for Transient Simulations
Using CFD-VIEW Scripting for Transient Simulations

With the Python scripting capabilities of CFD-VIEW, you can quickly and easily perform the repetitive tasks you encounter when post-processing transient simulations.

In this user tip, we present the scripting commands and functions that can be utilized for transient simulation post-processing. A Free Surface (VOF) simulation example is used to illustrate the procedure.

As shown in figure 1 below, the transient simulation models a bubble of air entering a tube filled with water.

Image

Figure 1. Simulation example - Air bubble entering a water-filled tube.


The Python script will create a Point Probe (see figure 1 above) and write to a text file the values of the transient time, the X-direction velocity (U), and the static pressure (P).

To start, launch CFD-VIEW, but do not import any DTF file nor open any MDL file. Open the Python Script Editor from 'Tools -> Edit Python Script', or by clicking on the "Edit Python Script" button in the toolbar. In the editor, type in the script below.


Image


Note:

  • This script shows how to create a point probe and write data to a file. This is, of course, only an example to present the structure of a script when applied to transient simulations. It is possible to perform other operations such as creating plane cuts, saving images, saving plot data, etc.

  • This script can also be run headless (i.e. from the command line) without opening the GUI. To do so, type in:
    XCFD-VIEW -nogui -script script_name.py
    Note that you also need to add the function <Quit()> at the end of the script (after <f.close()> in our example) to terminate the CFD-VIEW process.

 

If you have any questions about this feature or would like us to discuss other topics in the future, please let us know.

Regards,
Olivier Demaneuf
ESI CFD Support Team

 

Conditional Expressions in CFD-VIEW Calculator

Conditional expressions can be used in the CFD-VIEW calculator to put logic into the calculator expressions.  For example you could create new variables that have a specified range of values.  These variables can then be used to make plots and perform calculations.

File Based Animation with CFD-VIEW

The animation panel in CFD-VIEW can be used for file-based animations, where time dependent data files are loaded one by one to show the temporal aspects of the simulation.

Using CFD-VIEW Scripting for Transient Simulations

With the Python scripting capabilities of CFD-VIEW, you can quickly and easily perform the repetitive tasks you encounter when post-processing transient simulations.

Quick Access to Commonly Used Directories

When you click on the Open File icon in any of the ESI Software products, a File browser panel appears.   Look closely and you will see a red flag, a hammer and a house among the icons at the top of the panel.

Plotter Operations with CFD-VIEW

The Plotter operator in CFD-VIEW supports signal processing for Time History data. A previous user tip – Digital Signal Processing using CFD-VIEW – shows how time history date can be made available and how to perform a PSD on a periodic signal. The aim of this new user tip is to list all options supported by the Plotter Operator.


© 2012 ESI Group CFD Portal