CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Batch in CFX 12 in Windows XP

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 26, 2010, 12:19
Default Batch in CFX 12 in Windows XP
  #1
Senior Member
 
Join Date: Feb 2010
Posts: 148
Rep Power: 17
Jade M is on a distinguished road
I am fairly new to CFX. Can someone provide step-by-step instructions on submitting several runs serially in CFX 12? I am working in Windows XP.
Jade M is offline   Reply With Quote

Old   February 26, 2010, 17:27
Default
  #2
New Member
 
John
Join Date: Apr 2009
Posts: 6
Rep Power: 17
Jinx is on a distinguished road
This question has been discussed in various posts already. I use a .bat file in my project directory which contains the following commands:

cd .\Case1
"C:\Program Files\Ansys Inc\v110\CFX\bin\cfx5solve.exe" -def .\Case1.def
cd ..
cd .\Case2
"C:\Program Files\Ansys Inc\v110\CFX\bin\cfx5solve.exe" -def .\Case2.def -ini ..\Case1\Case1_001.res
cd ..
cd .\Case3
"C:\Program Files\Ansys Inc\v110\CFX\bin\cfx5solve.exe" -def .\Case2.def -ini ..\Case2\Case2_001.res
cd ..

Obviously you need to check the path of the solver for your system.
In this situation I have already created the various .def files for each case in it's own sub-directory. The batch file commands change the working directory, run the case and then return to the main directory.
Jinx is offline   Reply With Quote

Old   March 3, 2010, 15:35
Default Recognizing results in workbench
  #3
Senior Member
 
Join Date: Feb 2010
Posts: 148
Rep Power: 17
Jade M is on a distinguished road
I think it worked. However, workbench does not recognize the results. I will compare the directory structure to a case that I ran in workbench. If you have any further suggestions, they are most welcome!

Thanks so much.
Jade M is offline   Reply With Quote

Old   March 3, 2010, 19:28
Default
  #4
Senior Member
 
Rikio
Join Date: Mar 2009
Location: SH, China
Posts: 182
Blog Entries: 1
Rep Power: 17
rikio is on a distinguished road
Send a message via Skype™ to rikio
Before run the .bat file, add the path of the cfx5solve into the environment variable list will eliminate the directory change command. No matter where you store the .bat file, the command can be simply as,
cfx5solve -def [name.def]
rikio is offline   Reply With Quote

Old   March 3, 2010, 19:56
Default
  #5
New Member
 
John
Join Date: Apr 2009
Posts: 6
Rep Power: 17
Jinx is on a distinguished road
I'm not sure about the workbench commands so sorry! Obviously the commands I had given were for cfx11, but they should carry over to v12 OK. Can you be more specific on the workbench problem you have or the error message you get?

Regarding the use of the environment variable to define the path - it simplifies the start command but with the command I have given it still doesn't matter where the .bat file is stored. What is important is the working directory and unless this is specified in the .bat file, it will default to the location of the .bat file.
I had used the directory change commands simply to keep each different case in its own sub-folder. I just find this cleaner than having all case files in the one folder.
Jinx is offline   Reply With Quote

Old   March 4, 2010, 00:27
Default
  #6
Senior Member
 
Rikio
Join Date: Mar 2009
Location: SH, China
Posts: 182
Blog Entries: 1
Rep Power: 17
rikio is on a distinguished road
Send a message via Skype™ to rikio
Do not worry, John.
If the path was set to the environment variable, the .res file and .out file will locate at the same folder as the .bat file are.
rikio is offline   Reply With Quote

Old   March 8, 2010, 16:04
Default Thanks everyone
  #7
Senior Member
 
Join Date: Feb 2010
Posts: 148
Rep Power: 17
Jade M is on a distinguished road
12.1 says something about the information having been updated since last time. When I submitted my question to ANSYS tech support, the response was

I should have clarified that you can't really run CFX in batch using Workbench, or get Workbench to recognize the results afterwards. You can copy the results into the project directory and then drag a "Results" component to the project schematic, double click to load CFD-Post, and then manually load one of your RES files into CFD-Post. This Results component will then remember the RES file loaded as well as the state the next time you edit it.

I asked for clarification, as I'm new to CFX and don't really understand the files, the file structure, etc. yet. The response was

First, the only reason I suggest to copy the results into the project directory is so that you can archive the files as one package. There is no other real benefit in WB by keeping the files in there.

The CFX directory that you have shown is probably a good place to keep them. The WB project directory structure is pretty much designed to try to be non-intuitive and keep people out of it. FYI, You can see where your files are located if you go to the project page, View > Files. This will open a pane with a list of all of the files associated with the project. If you right click on one of the entries you can choose to "Open Containing Folder".

So I would just copy your results into this directory, and then you can go to the project page, expand the "Component Systems" section, drag in the "Results" object. Editing this cell will bring up CFD-Post, and from there you can do a File > Load Results to bring in your RES file data.

I'd love to get step-by-step instructions but so far, no go. I do not know what is meant by "copy your results into this directory." I'm not sure what the results are -- the .res file or the folder called "Fluid Flow 001"? And to what directory do I copy this file?

Any ideas? Thanks in advance for any help. Perhaps my question is very dumb but I do not know what to do here.
Jade M is offline   Reply With Quote

Old   May 14, 2010, 12:10
Default
  #8
Senior Member
 
Join Date: Feb 2010
Posts: 148
Rep Power: 17
Jade M is on a distinguished road
For any interested parties, one can get Workbench (WB) to recognize results after running in batch. In WB, in Toolbox under Component Systems, drag Results to the Project Schematic without linking to any project. Double click on Results. In Post, click File > Load Results. Browse to the directory where the batch job ran and select the .res file.
Jade M is offline   Reply With Quote

Old   May 24, 2010, 05:43
Default
  #9
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 16
claco is on a distinguished road
Dear All,

I'm currently involved in a shape optimization problem.
My question is: How can I save both residuals and some "User Point" (i.e.: mass flow rate or efficiency, that I have peviously defined) in a file (.txt etc.) that my optimizer engine can subsequently read?
Thank You in advance.
Claudio
claco is offline   Reply With Quote

Old   May 24, 2010, 06:46
Default
  #10
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You can do this easily with the solver manager and a monitor point. You can right click on a chart and export the data in the chart. If you want to automate the process you can parse a file in the CFX temp directory, I forget its name but it is easy to find.
ghorrocks is online now   Reply With Quote

Old   May 24, 2010, 07:22
Default
  #11
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 16
claco is on a distinguished road
Thank You very much.
You saved me a huge amount of time.
A last question: in which directory can I find this template file?
Thank You.
Claudio
claco is offline   Reply With Quote

Old   May 24, 2010, 07:37
Default
  #12
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
It is not a template file, it is the monitor points datafile. I think it has the filename "mon". Note it only exists when a simulation is proceeding and gets deleted when it is finished (the data is stored as part of the results file). Look in the .cfx_tempdir to find it.
ghorrocks is online now   Reply With Quote

Old   May 24, 2010, 08:05
Default
  #13
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 16
claco is on a distinguished road
Ok ok,
I noted the presence of this file.
However, I cannot automate the procedure, yet.
As a matter of fact, this file cannot be opened during the simulation, and there is no possibility to change it in order to "Export Plot data" in batch mode.
claco is offline   Reply With Quote

Old   May 24, 2010, 08:15
Default
  #14
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
That's just the windows file locking. You can get around that if you want.

I think there is also a command line to extract the monitor data, cfx5monitor or something. Check out the documentation about the command line tools to try to find it, or search the forum.
ghorrocks is online now   Reply With Quote

Old   May 25, 2010, 08:23
Default
  #15
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 16
claco is on a distinguished road
Thank You very much.
I was finally able to extract results by means of cfx5mondata.exe application.
Now I have another (final) problem: I launch cfx5solve in batch mode, but I cannot save the result file .res. How can I do it?
Thank You.
Claudio
claco is offline   Reply With Quote

Old   May 25, 2010, 19:04
Default
  #16
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,700
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
It should save the res file if it is working properly. Either you have turned saving of the res file off or the simulation has had a problem and is unable to save a res file.
ghorrocks is online now   Reply With Quote

Old   August 20, 2010, 15:33
Default Batch processing in CFX 12.1
  #17
Senior Member
 
Join Date: Feb 2010
Posts: 148
Rep Power: 17
Jade M is on a distinguished road
Please find below step-by-step instructions for batch processing in Workbench 12.1

- Define the problem in Workbench (build geometry in DM, mesh in Mesh and assign BCs in Pre)
- In Workbench, double click on Solution to launch Solver Manager which generates the definition (.def) file; close Solver Manager as the Solution need not be run but needs to be launched to create the file; old .cfx and .def files are deleted and new ones are created
- Backup the project, since the cells in the CFX analysis system can no longer be opened after the proceeding changes
- Search in the files folder for the definition file which will be in the folder for the design point and then subfolder CFX and another subfolder CFX; for example, for design point 0, the directory path will end in \dp0\CFX\CFX
- Create a text batch file with the extension .bat with the following, where Fluid_Flow.def is the definition file generated by Solution and has no spaces
cd C:\your_directory_path
"C:\Program Files\Ansys Inc\V121\CFX\bin\cfx5solve" -batch -def Fluid_Flow.def
- For multiple cases, simply repeat these two lines with the appropriate director path and file name for each case
- To run, double click on the batch file
- In Workbench, under Toolbox and Component Systems, drag Results to the Project Schematic without linking to the CFX analysis system; double click on Results, click File > Load Results, and browse to the directory where the batch job ran and select the .res file; alternatively, view in CFD-Post standalone as done prior to Workbench

Jade M is offline   Reply With Quote

Old   February 8, 2012, 16:51
Default
  #18
New Member
 
Anonymous
Join Date: Feb 2012
Location: Germany
Posts: 13
Rep Power: 14
rideway is on a distinguished road
Hi,
I am trying to make different run with different initial conditions. I saved a *.ccl file with all the system parameters, and then created different variations with different temperatures.

I tried to run a batch file with the following line:
"C:\Program Files\Ansys Inc\V121\CFX\bin\cfx5solve" -batch -def Fluid_Flow.def -initial ic.ccl

and i get this error

Quote:
An error has ocurred in cfx5solve:
Error reported by IO module: iif_open: the file is not in CFX-5.x format.

An error has ocurred in cfx5solve:
Error reported by IO module: iocnt: open the primary file failed

An error has ocurred in cfx5solve:
Error from IO module while opening C:/FEM/ic.cll:
"iocnt: open the primary file failed"

IO_RAD_FILE<20>: Invalid def/res file. File could be corrupted
///////////////////////////////////////////////////

I found the answer so I edit my mesage.

I was confusing initial files with ccl files...

changed the batch code to
"C:\Program Files\Ansys Inc\V121\CFX\bin\cfx5solve" -batch -def Fluid_Flow.def -ccl ic.ccl

and seems to be working

Last edited by rideway; February 8, 2012 at 17:17.
rideway is offline   Reply With Quote

Old   February 6, 2013, 09:29
Arrow Where ???
  #19
New Member
 
hi
Join Date: Dec 2012
Posts: 19
Rep Power: 13
alikhube is on a distinguished road
Where we must type this comment for create batch file???
cd C:\your_directory_path
"C:\Program Files\Ansys Inc\V121\CFX\bin\cfx5solve" -batch -def Fluid_Flow.def
And another questin, I have ANSYS 13.0 and it creates Fluid Flow cfx.def not Fluid_Flow.def
Thanks
alikhube is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Question]About batch job fluboy FLUENT 2 August 12, 2009 11:10
Windows XP Batch file help needed DL123 Main CFD Forum 2 July 3, 2009 08:53
Running Job in Batch mode (EFD) Nick Sessions FloEFD, FloWorks & FloTHERM 0 April 16, 2008 16:44
batch run N.R. CFX 1 June 17, 2007 22:44
Prosurf in batch mode Dhruv Siemens 1 September 19, 2005 18:02


All times are GMT -4. The time now is 19:46.