CFD Online Discussion Forums

CFD Online Discussion Forums (
-   CFX (
-   -   Pre in batch mode (

Kuts August 13, 2007 01:12

Pre in batch mode
Hello All,

Can any one suggest me how to do the following. I have many number of mesh files for one geometry, in which one geometrical parameter varies for each case. I have a session file to set the boundary conditions. How can I read the mesh file, use the session file to apply boundary condition and then write the def file in batch mode. I don't want to open the CFX Pre GUI at all. Is there any single command to do this?

Hope to hear from you, Kuts

hdj August 13, 2007 01:42

Re: Pre in batch mode
Hello Kuts,

To generate def file try this:

cfx5gtmconv -overwrite -icem mesh_file.msh -def def_file.def -ccl ccl_file.ccl

Hope this helps

Kuts August 13, 2007 03:08

Re: Pre in batch mode
Hello hdj,

Thanks for your response. But I have one more doubt. In fact I have more than one domains in the problem and I have them as three different meshes. How to tackle this problem. And, in the command you have suggested "-icem meshfile.msh", but can I use meshfile.cfx also, since ICEM output for CFX format is in *.cfx? Hope to hear from you..

Chao, Kuts

Kuts August 13, 2007 09:57

Re: Pre in batch mode
Hello All,

Can any one tell me please how to use cfx5gtmconvert command, if I need to import more than one mesh files and then write .def file from them using a ccl file. The help menu says only about one source and one Target files.

Thanks a ton, Regards Kuts

CycLone August 14, 2007 08:54

Re: Pre in batch mode
I wouldn't follow hdj's suggestion. Using cfx5gtmconvert in this manner will only work if the regions in your mesh file exactly correspond to your CCL state.

You can initially do the setup manually in Pre and save the physics and setup to a CCL file for re-use. Run another Pre session where you save the session file and record the actions of your script (i.e. load the grid(s), load the .ccl file, write the .def file) and quit the Pre session.

The session file (.pre) will contain the actions and the state file (.ccl) will have the physics setup. You can then run this in either line input mode or batch (line input mode allows an external script to send commands to Pre and opens a single viewer window, whereas batch mode requires a completely self contained script). If you like, you can also break the library up into snippets of physics to assemble for different cases.

If you require any additional logic, to determine what to do with non-standard boundary conditions or region names, for instance, you can add PERL programming constructs to your .pre file.


Kuts August 14, 2007 14:00

Re: Pre in batch mode
Hello Mr CycLone,

Thanks a lot for your information. Since I am bit new in using this tool, I need bit more information. I understood half what you have told and also have created .pre file.

Now my doubt is: I need to run many number of cases with different meshes (different geometries) but very same Boundary conditions. So, if I just put the new mesh in the working directory, hope while running the .pre will call the respective mesh, apply the BC and create def. And, what command I need to use if I need to run that .pre file in batch mode. I don't want to open the PRE GUI at all, since I am trying to accommodate this command in an automation loop. Hope I have made my doubt clear. Hope you can help me out here.

Thanks Kuts

CycLone August 14, 2007 14:33

Re: Pre in batch mode
Hi Kuts,

If you look through the .pre file you will see the line which includes the import command. If you use the same mesh filename each time, it will pick up your current mesh. You can modify the path and filename as necessary.

To run Pre in batch mode, just add the -batch flag and specify the session file name. For more flags and options, run "cfx5pre -help".


Kuts August 17, 2007 05:10

Re: Pre in batch mode
Hello Mr CycLone,

Thanks a lot for your help. It works well now.

Regards Kuts

All times are GMT -4. The time now is 00:52.