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

Working with CFX from command line

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By ghorrocks
  • 1 Post By ghorrocks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2016, 09:54
Default Working with CFX from command line
  #1
Member
 
Jack
Join Date: May 2015
Posts: 98
Rep Power: 10
Jack001 is on a distinguished road
Hello,

I am about to start working with a computing cluster to speed up my CFD simulations.

I am familiar with working with OpenFoam, and since this has no GUI, it would be relatively easy to make the jump from my computer to cluster. However I am stuck with using CFX as my solver and so I need some help understanding what to expect. There are a few things I wonder about:

1) How does one mesh the geometry (I use turbogrid or icem) from a command line? or is it common to do meshing on a workstation and then copy the mesh file over to your cluster directory?

2) What about setting up the case? From what I understand, the bare minimum you need to run a CFX run is to a have a <filename.def> file and then invoke

Code:
cfx5solve -def <filename.def> &
This will create a .dir directory and a .out file which contains all the solver output. So first of all how do I set-up the .def file? It seems to be a binary file and I can't edit it in vim like I can with the files in OpenFoam... This is where I need to specify the boundary conditions, solver settings, output control etc. Basically Im wondering how to use CFX-Pre from the command line!

3) Im also wondering what the usual way to monitor residuals and selected variables. Im guessing these are output in the .out file and so I guess I could write a python/matlab script to read from the file and plot the residuals? Is this the preferred method?

4) What do I need to do if I want to pause the simulation and look at the results in paraview? I can interrupt the current simulation using

Code:
 cfx5stop -directory <filename.dir>
(but how do I restart it??)

and in the GUI for CFX solve, you can choose to export results to Ensight format (which is needed for paraview). How would I do this from the command line?
Jack001 is offline   Reply With Quote

Old   May 11, 2016, 10:04
Default
  #2
Senior Member
 
Maxim
Join Date: Aug 2015
Location: Germany
Posts: 415
Rep Power: 12
-Maxim- is on a distinguished road
have a look in the documentation - all commands are explained there.

1) never tried that - sorry

2) I always used Pre to create def files - not sure if you can do that via command line

3) missing

4) you can open solver manager and check your monitors for any running or completed calculation. For running simulations, you need to direct solver manager to the .dir folder.
If you are only interested in the out-File, you can "tail" the out-file in your command line application. Unix can do that with the standard apps, for windows, you will need to install one of the many (free) console apps.

5) you can stop it with the command you mentioned, or directly from the solver manager with the STOP button.
continue with
Code:
-cont-from-file
With the new 17.1 you can load running simulations in POST if you like.
-Maxim- is offline   Reply With Quote

Old   May 11, 2016, 10:11
Default
  #3
Member
 
Jack
Join Date: May 2015
Posts: 98
Rep Power: 10
Jack001 is on a distinguished road
Hello Maxim, thank you for your response.

4) What is this solver manager? It sounds like a GUI application, so I wouldn't be able to open that I think. Can you give an example of the tail functionality?

5) How can I view the current results in paraview?
Jack001 is offline   Reply With Quote

Old   May 11, 2016, 10:26
Default
  #4
Senior Member
 
Maxim
Join Date: Aug 2015
Location: Germany
Posts: 415
Rep Power: 12
-Maxim- is on a distinguished road
I thought you worked with OpenFOAM before and you would know the tail command from unix/linux. Google it.
With that command you will see the stuff that is written to the out-file in your command line in real time.

Yes, SolverManager is part of the Ansys Toolbox and basically the GUI of the solver. You can display all monitors and the out-file.

You already asked here about ParaView...
-Maxim- is offline   Reply With Quote

Old   May 11, 2016, 10:32
Default
  #5
Member
 
Jack
Join Date: May 2015
Posts: 98
Rep Power: 10
Jack001 is on a distinguished road
I see, I think I misunderstood you. Im fine with seeing the data that is printed out, I was just wondering if the preferred way of plotting the residuals is to read through the .out file and plot from there or if that is unnecessary.

As for the paraview question, yes I can export the results from the GUI in the cfx solver, but I don't have access to the GUI and I want to do everything from the terminal with some simple commands. After I have completed my simulation I will have a lot of data, and I don't want to have to move this around to a place where I can export it to the Ensight format, only to have to move it back for post processing. I hope this makes sense.
Jack001 is offline   Reply With Quote

Old   May 11, 2016, 12:02
Default
  #6
Senior Member
 
Join Date: Jun 2009
Posts: 1,804
Rep Power: 32
Opaque will become famous soon enough
My advice is to rethink your approach. Following an established approach for another software may not be very efficient for a different software.

You can rethink a new approach from your old approach as long as you do not stick to the details, but to the high level steps.

For example, you are used to "vi MyOpenFoamCase", then read the CFX documentation about how you can script the creation of a definition file. It does not have to be "vi". CFX provides what is a "session file" that you can create once by recording your steps through the user interface, and later modify using "vi" and the documentation for example.

The solver manager user interface can be run from a computer different from the cluster as long as you have read access to the directory where the data is being stored. There will be no load on the cluster, and it will save you a ton of time to get from point A (setting up the case) to point B (obtain meaningful engineering results)

Good luck,
Opaque is offline   Reply With Quote

Old   May 11, 2016, 13:15
Default
  #7
Member
 
Jack
Join Date: May 2015
Posts: 98
Rep Power: 10
Jack001 is on a distinguished road
Hi Opaque,

Thank you that is exactly the advice I needed. I have only one worry left, and that is the post processing part of the results. I need to use paraview for this and I am worried that when dealing with large result files of unsteady simulations, it won't make sense or will be very time consuming to convert from the ansys format to ensight/vtk. Do you have any understanding of whether this would be prohibitive or not?
Jack001 is offline   Reply With Quote

Old   December 27, 2018, 20:15
Default
  #8
Member
 
Soumitra Vadnerkar
Join Date: Aug 2018
Posts: 70
Rep Power: 7
soumitra2102 is on a distinguished road
Quote:
Originally Posted by Jack001 View Post
Hello,

3) Im also wondering what the usual way to monitor residuals and selected variables. Im guessing these are output in the .out file and so I guess I could write a python/matlab script to read from the file and plot the residuals? Is this the preferred method?

I am also interested in viewing the .out file for residuals changing dynamically. What can be done to do so?
soumitra2102 is offline   Reply With Quote

Old   December 27, 2018, 20:56
Default
  #9
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You can simply view the output file at any time, it is just a text file. Just do a tail ***.out if you only want the latest stuff.

Or are you looking for the residuals so you can plot them? If so then just view it in Solver Manager and all the solver variables are plotted there. If for some reason I do not understand you want to plot them yourself rather than use Solver Manager then have a look in the temporary run directory and you will find a text file with the residuals (and all other solver variables) in a comma delimited text file.
soumitra2102 likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is online now   Reply With Quote

Old   December 27, 2018, 21:15
Default
  #10
Member
 
Soumitra Vadnerkar
Join Date: Aug 2018
Posts: 70
Rep Power: 7
soumitra2102 is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
You can simply view the output file at any time, it is just a text file. Just do a tail ***.out if you only want the latest stuff.

Or are you looking for the residuals so you can plot them? If so then just view it in Solver Manager and all the solver variables are plotted there. If for some reason I do not understand you want to plot them yourself rather than use Solver Manager then have a look in the temporary run directory and you will find a text file with the residuals (and all other solver variables) in a comma delimited text file.

Yes, I get your point. To see the plots, which a graphical task, I would need to look into Solver Manager.
Anyway, I was looking for at least viewing the residuals (not the plots) as they appear in the Solver Manager window on the right side in the terminal window (which doesn't require GUI related X-server).
As this is dynamic task, I don't know how to see the ever changing .out file in terminal. Need help if there is any linux command for that.



Also, can you please elaborate more on what you said about 'tail ***.out'?
soumitra2102 is offline   Reply With Quote

Old   December 27, 2018, 21:20
Default
  #11
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Want to know about the linux command "tail"? Then type "man tail". You can look up the documentation for any linux command with "man".

For your text viewer search the web for a suitable viewer. I suspect ones like emacs and probably even vi could do it, when set up properly.
soumitra2102 likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is online now   Reply With Quote

Reply

Tags
ansys, cfx, command line


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
CFX Pre & Post Startup Error vigges CFX 12 March 17, 2023 03:30
CFX vs. FLUENT turbo CFX 4 April 13, 2021 08:08
error about fsi in CFX and ANSYS WANGFIRE CFX 1 April 21, 2015 01:48
Differences between CFX and OpenFOAM regarding convergence and robustness! magjohan OpenFOAM Running, Solving & CFD 4 February 26, 2015 10:26
CFX 10's solutions differ from CFX 5.7's Atit Koonsrisuk CFX 4 July 26, 2006 11:59


All times are GMT -4. The time now is 03:20.