CFD Online Discussion Forums

CFD Online Discussion Forums (
-   CFX (
-   -   Automating multiple runs within pre? (

Zheng January 30, 2005 06:59

Automating multiple runs within pre?
Hi, I'm not sure if this has been answered before, but I didn't find an answer after looking through the posts from the past 2 years.

Suppose I want to create a polar plot of an aircraft/wing, or a yaw sweep of a car, etc. with say 20 data points, is there a way to define the run in CFX pre so that I don't have to start 20 runs with slightly different definition? I guess this should be possible unless the mesh needs to be modified.

I know you can do this with a batch file, but it'll get tedious if you need to change more than 1 parameter and if you need lots of data points.

Is there a simple way to define an array of evenly spaced pitch angles (like you can do in xfoil and matlab) and tell CFX to generate all the results and put them in one file?

Will it work if I made a transient simulation and defined a varying B.C. (say flow direction in my examples above) instead?

Thanks a lot.


Glenn Horrocks January 30, 2005 18:09

Re: Automating multiple runs within pre?

It is easy to create a batch/script file to change things like flow rates or temperatures. You can use the cfx5cmds and cfxsolve commandlines to do it.

If you want to run a number of geometries with different meshes and compare the results I recommend you do not try to combine the results file. Leave them as seperate results files, much easier. All the mesh generation and CFX-Pre functions can be scripted so you should be able to automate the mesh generation.

Glenn Horrocks

Zheng February 1, 2005 02:03

Re: Automating multiple runs within pre?

Thanks for your reply.

I'm not very familiar with running CFX in command line, but as I understand, to run a batch file in windows one needs to add runs like so:

cfs5solve -def FileToBeSolved.def -[paramters n'stuff]

So if one wants to find drag at 20 different angles one needs to have 20 lines of batch file code. Is there a more elegant way of doing this? Like a for loop or something?

If this is possible does one write the loop in the batch file or with some internal code in CFX?



matej February 1, 2005 04:19

Re: Automating multiple runs within pre?
I'm not a Windows user, but the 3rd google link was:

Moreover, if you change only some parameters in def file, you may have a small text files with setting the parameters -- over-writting the setting in a def file. It's all described in manuals for cfx solver run from command line and the commands in ccl manual.


Zheng February 1, 2005 04:41

Re: Automating multiple runs within pre?
I thought there's a simple way to do this in GUI, but I guess I'll have to learn to use CCL.

I guess I'm just lazy.

Thanks again.


Glenn Horrocks February 1, 2005 17:06

Re: Automating multiple runs within pre?

Assuming you are using windows you can combine the 20 command lines into a simple 20 line batch file (called doruns.bat for instance), then you can run the batch file simply as "doruns.bat" from the command line. The lines in the batch file are then executed as if you had typed them onto the command line.

There is quite a bit you can do using batch files, have a look on google or your local computer text book shop.

Glenn Horrocks

Ian February 3, 2005 15:34

Re: Automating multiple runs within pre?
We use a loop in the pre and post session files (rather than CCL and .bat files). A suggested process is:

1) Set up one run in the pre gui while recording the session (.pre) file. 2) Parameterize the session file in a text editor. Add a loop (for, while, if... however you like. It's Perl syntax). Change as necessary. We set ours to write out a .def file for each design point. 3) Write a Post session file (.cse) to read in the results files sequentially, do any necessary calcs (ours also reads in a .cst file with pre-written calcs) and write out results to a text file. Again this is Perl format. The text file can be opened in Excel. 4) Write a .bat file to execute the pre session file, solver runs and post session file.

I can run an entire centrifugal compressor stage without opening a GUI (except TurboGrid, but even then I have a template to give me a headstart).

Zheng February 3, 2005 16:33

Re: Automating multiple runs within pre?
Ok thanks guys.

I think I have enough information to get started.

Really appreciate all your replies.


All times are GMT -4. The time now is 05:40.