FLOW3D Reader Wizard

June 2013:

Based on updates to the EnSight Flow3D reader, I have slightly modified the FLOW3D Reader Wizard to suit. So, if you are using EnSight 10.03 or above, please use the link below.

flow3d updated June 2013

If you are using an older version of EnSight, please refer to the reader wizard from October 2011:

October 2011:

I’ve updated the FLOW3D wizard to also include the ability to read the STL information from the FLSGRF file. In the previous version, the toggle button for the “Load STL File?” was an on/off toggle which looked in the current FLSGRF directory for any “STL” files, and read them in. This works well, and is sometimes what you want. However, Bill recently updated the actual FLOW3D reader to grab the STL information straight from the FLSGRF file itself. This works great when you want to see the STL data that the solver used, or if the STL data is moving, or has been transformed into a new coordinate space. So, I added in new Option into the FLOW3D wizard which activates Bill’s new reader enhancements. Here is what the new Wizard (circa Oct 2011) looks like:

This should add some additional capability and flexibility to the wizard and take advantage of the new options in the reader. You can still use either/both option for STL data (one reads STL files from the directory, the new one the STL information from the FLSGRF file). The link below for the wizard now points to the new python file.

Updated FLOW3D Reader Wizard


————— Old Post ————


FLOW3D Import Wizard

Kevin Colburn – April 2011


Our normal readers do just that, read. There is no real difference between FLOW3D Reader Wizard Iconreading in Ansys models, or Star-CD models, or FLOW3D models. This is ok if you are constantly loading in different models, and want a common starting point. However, most people are using one or two formats, and in particular, a “plain” read of the dataset may not leave them at a valuable point. In the case of FLOW3D datasets, simply doing a read of the dataset does not “DO” anything for the user. Instead, they really need to not only read the dataset, but also perform a few basic operations before they can begin to investigate their results. As these steps MUST be done for each and every dataset, I thought it would be more helpful to create a wizard to read in model, do a few operations, and automatically put the user at a point of doing something useful; in this case just seeing his results is infinitely more useful than simply showing him the far extents of his block. So, this FLOW3D wizard was developed to do the following:

a. read in the model

b. create some initial isovolumes of ‘active’ or ‘live’ cells from which to create subsequent isosurface or for correct variable color of the subsequent isosurface.

c. create some isosurfaces of the appropriate variables so that the user is presented with his geometry/results.

d. automatically setup some alternative isovolume creation flags (simple_isovolume off).

e. automatically load in all STL files in the same directory as the dataset.

f. Color the fluid isosurfaces with appropriate variables.

g. Place time label on the screen.


The wizard has recently been updated (March 2011) after discussing typical F3D usage scenarios. In addition, the new Flow3D reader in EnSight 9.2.1 has some additional options for correctly handling wall ghosts and symmetry ghosts.




The FLOW3D wizard consists of a simple python script (flow3d_read.py), and the icon file (flow_3d.png). The python is documented, fairly straight forward, and is open to further customization. Place the two files into the UserDefinedReader section (either user or site location):


Double clicking on the tool should open the following wizard:

Here were have a few options:

a. FLOW3D dataset to Read: Specification of the flsgrf.dat file to read.

b. Particle Read Option: This is unchanged from the standard FLOW3D reader. Simply a pass through to provide the correct options for reading particles (I do nothing special with them).

c. Load STL files? If selected, the reader will attempt to read all STL (*.stl or *.STL) files in the same directory as the F3D dataset are, into EnSight as a second case.


When executed, the following EnSight operations are made:

a. The default read is with No Ghost option. Symmetry Ghosts are not used (leaving Symmetry plane values correct and not corrupted by zero ghost values).

b. First figure out what variables are available in the dataset. If “Selected” variables are available, it will use those variables to create the “Fluid_Fraction” isosurfaces from. If “Selected” are not available, the routine will look for “Restart” variables, and use them. Finally, neither “Selected” nor “Restart” variables are available, “Fixed” variables will be used.

c. Using the “Failed Element” capability of EnSight, the routine fails any element with Cell_Type < 0.0. This helps remove out the coarser regions where embedded refinement blocks have been used.

d. Create an IsoVolume of Cell_Volume_Fraction from 0.001 to 1.0 to limit the domain down to the current “live” or “active” elements. This is necessary for GMO models to limit the volume down to active elements, rather than the complete domain. In addition, when EnSight colors a part by a variable, it looks at the parent to determine where to grab the variable values. This isovolume allows us to restrict the parent to active/live elements to grab valid values of variables. This part is called “Live Cell Volume”.

e. Create an IsoSurface of “Cell_Volume_Fraction” = 0.499 to show the geometry used during the simulation. I color this surface Grey, and make semi-transparent. This surface renamed “Cell Fraction Surface”.

f. Create a variable called “cell_vol_fluid_fr” which is Cell_Volume_Fraction * Fluid Fraction. This seems to give a better representation of the current fluid surface.

g. Create isosurface of “cell_vol_fluid_fr” = 0.5 to show the current surface of the fluid. I color this isosurface with Pressure, and rename this as “Fluid Surface”.


Other notes about the Wizard:

a. For isovolume operations, we have found that the non-standard “test:simple_isovolume_off” routine yields better looking and more correct isovolumes. This reader automatically turns on this setting, so that users creating isovolumes should have more correct/better isovolumes given this type of data

b. If there are STLs read in, I then turn off the visibility of the “Cell Fraction Surface” since I assume that the STL files would be better to visualize.

c. If the user requests to read STL files, but none can be found, the routine will continue without failing, and simply print out a message indicating that no STL files were found.

d. Bill modified the routine so that command language is left behind when users execute this script. This allows “save commands from this session” to be correct, as well as “recover”, context file, and session files to be properly saved.

e. Bill also corrected and fixed some arbitrariness to the selection of the “Fixed”, “Restart”, or “Selected” variables.


The goal of this wizard is to do a few basic (and always needed) steps to get the user into and already visualizing his model. The current reader only method leaves you off with loading the non-body fitted blocks, and that is it. This wizard performs a few operations to get in and start visualizing the model, hopefully getting the user that much closer to analyzing, and communicating the results.



The example above is the “transmission housing” example from 2008. This is an internal flow of a transmission housing casting. The image is from using this wizard.


The example to the above illustrates the Weir Hydrology example. (In this example, the “Cell Fraction Surface” is adjusted to be an isosurface of 0.50 rather than 0.499).




The example above illustrates the dam dataset, with reading in the all of the STL files.




select 0d, 1d, 2d, 3d parts

here’s how to select parts based on element type


Here is a link to a python file


from ensight.objs import *

def echo_part_elem_type(p):
        print p.DESCRIPTION, " has 1D line elements"
        print p.DESCRIPTION, " has 2D surface elements"
        print p.DESCRIPTION, " has 3D volume elements"
    #  Ensight 10 only
    #if p.HAS0DELEMENTS:
    #    print p.DESCRIPTION, " has 0D point elements"
    if p.PARTTYPE == ensight.PART_MODEL:
        if p.NODERANGESTEPI[0] > 0 and p.NODERANGESTEPI[1] > 0 and p.NODERANGESTEPI[2] > 0:
            print "Structured I from ", p.NODERANGESTEPI[0] , " to ", p.NODERANGESTEPI[1], " by step " , p.NODERANGESTEPI[2]
        if p.NODERANGESTEPJ[0] > 0 and p.NODERANGESTEPJ[1] > 0 and p.NODERANGESTEPJ[2] > 0:
            print "Structured J from ", p.NODERANGESTEPJ[0] , " to ", p.NODERANGESTEPJ[1], " by step " , p.NODERANGESTEPJ[2]
        if p.NODERANGESTEPK[0] > 0 and p.NODERANGESTEPK[1] > 0 and p.NODERANGESTEPK[2] > 0:
            print "Structured K from ", p.NODERANGESTEPK[0] , " to ", p.NODERANGESTEPK[1], " by step " , p.NODERANGESTEPK[2]
#  Note this methodology will work in ES10
for p in core.PARTS:
    if p.ISGROUP == True:
        if p.sources:
            for subp in p.sources: