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

Running CFX via DOS +

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 1, 2012, 06:58
Default Running CFX via DOS +
  #1
Member
 
Shreyas Ragavan
Join Date: Feb 2012
Location: India
Posts: 37
Rep Power: 14
shreyasr is on a distinguished road
HI Everybody,

I'm in the process of writing a program (GUI based on Tkinter) which will allow the user to select multiple simulation input files for CFX.

I intend the program to work on both Windows/Linux and to be portable.

Current problem : on DOS (on Windows 7)
"<path to cfx5solve>\cfx5solve.exe -def <path to def file>.def"
doesnt work. DOS remains busy for a few minutes, and nothing happens.

NOTE:
Entering : "<path to cfx5solve>\cfx5solve.exe" does work and the CFX Solve manager starts up. But I need to provide the arguments and input files via the script.

Looking forward to your suggestions !
__________________
Shreyas
www.cfdrevolutions.weebly.com
shreyasr is offline   Reply With Quote

Old   November 1, 2012, 15:38
Default
  #2
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
Does it work if you use a command line window started from the CFX launcher? Then the path to the CFX executables is already set and you can just call "cfx5solve" with no path.

And is the def file in the current directory? If so then you can ignore the path to the def file too.

No idea what is causing your problem but you just need to play with some options to figure it out.
ghorrocks is offline   Reply With Quote

Old   November 1, 2012, 23:12
Default
  #3
Member
 
Shreyas Ragavan
Join Date: Feb 2012
Location: India
Posts: 37
Rep Power: 14
shreyasr is on a distinguished road
Hi Glenn,
Yes - typing in "cfx5solve -eg StaticMixer" in the Command Line started by the CFX launcher does work.

However, using only "cfx5solve" from a command line terminal called from outside CFX doesn't work, the paths aren't set then. I need to key in the complete path to the exe file. Is this something like the different bashrc profiles in Linux ?

I'd prefer using the compete path, for both the cfx5solve file and the working folder with the input def files - because I intend to have them stored in variables, in a 'settings' option in the program : this the user can set, thus making the program portable, and I can access input files from any folder.

No, the .def file was not in the same directory as the cfx5solve exe.

I've been using scripts with the paths explicitly defined on a RHEL OS, with arguments for the number of cores and the start method, and that has always worked fine ! I haven't tried this GUI program on it, yet, but I expect fewer hassles than on windows.

It seems quite strange that I'm unable to pass arguments to the cfx5solve launch command, via DOS.
I'm still trying to find the magic 'syntax' combination !
__________________
Shreyas
www.cfdrevolutions.weebly.com
shreyasr is offline   Reply With Quote

Old   November 3, 2012, 02:10
Default
  #4
Member
 
Shreyas Ragavan
Join Date: Feb 2012
Location: India
Posts: 37
Rep Power: 14
shreyasr is on a distinguished road
Hi,

It does work via the usual command line as well.
Procedure I followed :
1.Start > cmd
2. manually navigated to the location of the cfx5solve.exe (using cd)
3. keyed in : cfx5solve -def <path to file>\StaticMixer.def
If there are spaces in the path to the input file , then enclosing within double quotes "<path to file>\test.def"

The important thing is that : the .out and .res files are saved into the location of cfx5solve , rather than the location of the input file.
In RHEL, the output files are saved into the location of the input file.

However !
If instead of manually navigating to the location of the cfx5solve directory, I try :
"<path to cfx5solve>\cfx5solve" -def "<path to def file>\StaticMixer.def"
I get the error message :- unable to create C:\Program Files\StaticMixer_001.dir : permission denied

I don't know why it's trying to create the out file in the Program Files folder.
The location of the input file, is C:\TESTER\StaticMixer.def
__________________
Shreyas
www.cfdrevolutions.weebly.com

Last edited by shreyasr; November 3, 2012 at 02:25.
shreyasr is offline   Reply With Quote

Old   November 3, 2012, 04:34
Default
  #5
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
I think you misunderstood one of my points. I asked is the current directory the directory where the def file is located? If not then CFX will put the temporary directory somewhere else and that is not a good idea in general.

So I recommend your script be something like:
cd <directory containing def file>
<CFX PATH>cfx5solve -def <def file name, with no path>

The def file will not require a path if it is the current directory, and the temporary files will be put in this directory.
ghorrocks is offline   Reply With Quote

Old   November 3, 2012, 05:22
Default
  #6
Member
 
Shreyas Ragavan
Join Date: Feb 2012
Location: India
Posts: 37
Rep Power: 14
shreyasr is on a distinguished road
Sorry for the misunderstanding.

But, I understand your point now. That is exactly what happened.
I was thinking, CFX would use the input files path/location for the temp files.

I will try your approach, and I think that's the right way to do it too.

However, the good news for now, is that I've got the simulations running via the GUI program!

In this case : the output files were stored at the location of the python script itself.
(note : the input file is at another location and the same line of code doesnt work on the DOS terminal)
__________________
Shreyas
www.cfdrevolutions.weebly.com
shreyasr is offline   Reply With Quote

Reply

Tags
batch runs, cfx, script


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
Running a CFX simulation on the cluster saisanthoshm88 CFX 4 October 26, 2011 05:28
cfx distributed parallel running problem in linux greatwall CFX 0 August 19, 2011 00:26
Problem in running CFX in red hat linux Q CFX 0 March 30, 2006 09:11
Problems on running cfx in parallel Nan CFX 1 March 29, 2006 04:10
CFX 10 in CFX 5.7 panneerselvam.R CFX 6 February 6, 2006 03:56


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