HomeIndustriesProductsServicesPartnersAbout Us
Home arrow CFD-GEOM User Tips arrow Scripting and Journaling in CFD-GEOM V2007.2
Scripting and Journaling in CFD-GEOM V2007.2

In CFD-GEOM V2007.2, scripting and journaling are now available.  Several improvements have been made to scripting, such as fewer modules that are arranged in a more logical manner, more robust functionality, etc.  As in previous versions of CFD-GEOM, the Python scripting language is still used to create the CFD-GEOM scripting functions.  If you are interested in scripting and journaling in CFD-GEOM, please read on.

Scripting

CFD-GEOM functions are divided into a set of modules.  Each module provides functionality for solving a particular task. CFD-GEOM V2007.2 introduces a new set of scripting modules/Application Programming Interface (API) functions which are much smaller and more logically organized.

Below is a list of the Python modules available in CFD-GEOM V2007.2:

  • GGeometry: defines all geometry creation/manipulation API and transformations such as translation, scaling, etc. that can be applied to every entity type.
  • GMesh: defines all meshing API for structured, semi-structured, unstructured, and poly meshing
  • GFileIO: defines all API for geometry/mesh file I/O
  • GBCVC: defines all API for performing simple boundary and volume condition assignment
  • GUtils: defines API for miscellaneous tasks such as creating/modifying levels and user variables, deleting entities, undo/redo, etc.
  • GViz: defines API for setting entity colors. This module currently provides very limited functionality, but new capabilities for controlling CFD-GEOM visualization will be introduced in a later release.
  • CFDForm: defines all API for constructing custom graphical user interfaces (replaces the GWindow module)
CFD-GEOM scripts can be run from virtually any other application that has an embedded Python interpreter (including a stand alone Python interpreter).  Similar to running scripts in SimManager, running CFD-GEOM scripts from other applications is akin to running CFD-GEOM in batch mode (i.e., no CFD-GEOM window appears). We call this a ‘headless’ CFD-GEOM.

To run a CFD-GEOM script outside the CFD-GEOM graphical user interface, you must initialize CFD-GEOM in the script using the command GUtils.StartGeom() and the GUtils.StopGeom() command, which releases the CFD-GEOM license and frees all memory consumed by CFD-GEOM.  However, these two commands are not needed when you run the scripts through CFD-GEOM GUI as they have no effect.

Journaling Capability

Journaling can now be activated only when you create a new model or when you’ve just read a script file (to which you wish to continue journaling).  You can disable journaling at any time (via the “Deactivate Journaling” button on the toolbar).  However, once deactivated for a model, journaling can not be reactivated during the current session.  Moreover, within a CFD-GEOM session, it is not possible to journal to the same file from more than one open model.  These restrictions were introduced to help eliminate the corruption of script files by the journaling system.  Note that it is still possible to journal to a single file from 2 or more instances of CFD-GEOM.  This practice is guaranteed to produce corrupt scripts and should be avoided.

You may specify to always use journaling for new files or after running a script by checking the options under Edit --> Preferences --> Tools.  These options are shown in Figure 1.

Image

Figure 1.  Journaling options under Edit --> Preferences 

 By activating the journaling option for new files, the Journaling check box will always be checked when creating new files, as shown in Figure 2.    

Image

Figure 2.  Journaling activation on the new model dialog 

All tools in the CFD-GEOM V2007.2 geometry and meshing toolboxes journal symbolic expressions if specified for any numerical parameters.  This feature was not available for all tools in previous versions of CFD-GEOM since most expressions were evaluated to a numerical value.

If you have not explored the new Scripting and Journaling features in CFD-GEOM V2007.2, try using them the next time you use CFD-GEOM. 

Regards,
Shivakumar G.T.
ESI CFD Support Team

 

Multiple Hole Cutting in Surfaces

In the past, cutting holes in surfaces with CFD-GEOM required a two step process; 1) pick the surface 2) pick the closed set of curves that forms the hole.  Not a bad process but in the case of having to cut with multiple holes this was quite inefficient since you could only cut one hole at a time.

BC/VC Editor in CFD-GEOM V2007

Specifying Boundary and Volume Conditions (BC/VC's) in CFD-GEOM has been improved drastically in V2007. The BC/VC editor is now located on the Control Panel instead of the View Bar (which has been eliminated in V2007). This provides a very important advantage since the entity list can be much taller, i.e. you can see more entities in the list.

CFD-GEOM V2007 Viewer Hot Keys

Most of the time users deal with real world problems which are usually 3D. 3D geometries and grid generation can be difficult to mesh depending on the complexity of the geometry. Working with 3D geometry and grid generation can be made lot faster with effective use of the Hot Keys available in CFD-GEOM V2007.

Mirroring Tools in CFD-GEOM

The mirroring tools provided in CFD-GEOM can help in the construction of symmetrical geometries or geometries involving repetitive parts. Ideally, we should take advantage of geometric symmetry to model just one-half or one-fourth of the model or even a 2D axi-symmetric model to reduce the computational time by significantly reducing the size of the model.

CFD-GEOM Filters

Sometimes during the creation of a geometric model it is possible to have overlapping (duplicate) points, line, edges, and faces. This can also occur when CAD files are imported into CFD-GEOM. The user usually finds this situation when trying to do additional operations in CFD-GEOM.


© 2008 ESI Group CFD Portal