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

How to Start ANSYS CFD-POST from MATLAB?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Lance
  • 1 Post By juzer_700

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 21, 2014, 06:59
Post How to Start ANSYS CFD-POST from MATLAB?
  #1
Member
 
Join Date: Apr 2012
Location: Mainz, Germany
Posts: 60
Rep Power: 14
juzer_700 is on a distinguished road
Hello Guys,

I want to write a code in matlab which starts ansys cfd-post, loads the result file and then loads the session file.

I will really appreciate any help from you guys.

Steps:
1) Start CFD-Post
2) Load .res file
3) Load .cse file

Thanks.
juzer_700 is offline   Reply With Quote

Old   April 22, 2014, 06:06
Default
  #2
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
Load up CFD-Post and record a session file. Do the actions you describe and the commands to do it get recorded in the session file. Then you have a text file for the session file you can edit to do whatever you want.
ghorrocks is offline   Reply With Quote

Old   April 22, 2014, 07:43
Default
  #3
Member
 
Join Date: Apr 2012
Location: Mainz, Germany
Posts: 60
Rep Power: 14
juzer_700 is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
Load up CFD-Post and record a session file. Do the actions you describe and the commands to do it get recorded in the session file. Then you have a text file for the session file you can edit to do whatever you want.
Thanks for your valuable suggestion.

I did the same. Now I a have a session file (say Session2.cse) which

1) loads the result file,
2) then performs all tasks (such as goemetry spilt-up and storing values in another .txt file) and
3) then quits CFX-Post.

But my problem remains the same.

I can use system() command in matlab to start CFX-POST. But then how do I load the Session2.cse file which performs the three steps.

Is there a command I can give from matlab or run the .cse file or any command line that loads the session file in CFX-Post

Thanking you in anticipation.
juzer_700 is offline   Reply With Quote

Old   April 22, 2014, 08:43
Default
  #4
Senior Member
 
Lance
Join Date: Mar 2009
Posts: 669
Rep Power: 22
Lance is on a distinguished road
cfdpost accepts the following arguments:
[-gui|-line|-batch <file>] [-report <option> [-outdir <dir>] [-name <name>]]
[-graphics ogl|mesa] [-state <statefile>] [-session <sessionfile>]
[-display <display>] [-multiconfig single|separate|last] [-help] [-v]

so,
Code:
cfdpost -session my_session_file.cse
would then start post and load the file "my_session_file.cse".
cfd seeker likes this.
Lance is offline   Reply With Quote

Old   April 23, 2014, 11:00
Smile
  #5
Member
 
Join Date: Apr 2012
Location: Mainz, Germany
Posts: 60
Rep Power: 14
juzer_700 is on a distinguished road
Quote:
Originally Posted by Lance View Post
cfdpost accepts the following arguments:
[-gui|-line|-batch <file>] [-report <option> [-outdir <dir>] [-name <name>]]
[-graphics ogl|mesa] [-state <statefile>] [-session <sessionfile>]
[-display <display>] [-multiconfig single|separate|last] [-help] [-v]

so,
Code:
cfdpost -session my_session_file.cse
would then start post and load the file "my_session_file.cse".
Thanks for your help.

Initially I wrote this code in Matlab:

status=system('cd /ansys_inc/v145/CFD-Post/bin/');
status=system('&cfdpost -line);

This opened a command promt of CFX in Matlab where again I had to type

CFX< readsession filename=Session_final.cse

I wanted to avoid this as it became manual entering of command. But then with your help I used the below code which worked perfectly fine.

status=system('cd /ansys_inc/v145/CFD-Post/bin/');
status=system('cfdpost -session Session_final.cse');

This automatically does everything I wanted. Thanks for your help.
cfd seeker likes this.
juzer_700 is offline   Reply With Quote

Old   July 12, 2014, 09:01
Default
  #6
New Member
 
Jacob
Join Date: Apr 2014
Posts: 23
Rep Power: 12
smartsoldier is on a distinguished road
I am trying to do the same as you, however my MATLAB won't connect the two system() commands. When I run them I get an error: cfdpost not valid command. As if it is trying to run cfdpost from a regular cmd that hasn't navigated to the cfdpost folder, even though I told it to on the line before. Any ideas?
smartsoldier is offline   Reply With Quote

Old   May 14, 2015, 09:25
Default
  #7
Senior Member
 
Join Date: Mar 2011
Location: Germany
Posts: 552
Rep Power: 20
cfd seeker is on a distinguished road
@Lance @Juzer

Can you guys tell me if there is any difference between the session file created on Linux platform and Windows? do the session file created on Linux should work on Windows PC also?

Best Regards
cfd seeker is offline   Reply With Quote

Old   May 15, 2015, 06:57
Default
  #8
Senior Member
 
Join Date: Mar 2011
Location: Germany
Posts: 552
Rep Power: 20
cfd seeker is on a distinguished road
Quote:
status=system('cd /ansys_inc/v145/CFD-Post/bin/');
status=system('cfdpost -session Session_final.cse');
@Juzer @Lance
The above commands(syntax) is working for me on Linux but not on Windows. Any suggestions how I can implement it on windows?
cfd seeker is offline   Reply With Quote

Old   May 15, 2015, 07:02
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
Didn't I just answer this question on your other thread? http://www.cfd-online.com/Forums/cfx...ows-linux.html
ghorrocks is offline   Reply With Quote

Reply


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
Learn ANSYS ICEM CFD easy_astronaut ANSYS 2 December 15, 2013 15:34
Parallel process & CFD POST jypark FLUENT 2 August 14, 2013 23:49
Using ICEM CFD to repair/edit ANSYS Meshing Kaaji1359 ANSYS 2 July 30, 2013 10:28
Difference between ANSYS CFD & CFD solamy ANSYS 3 October 21, 2010 16:06
Free UK seminars: ANSYS CFD software Gavin Butcher CFX 0 November 23, 2004 09:13


All times are GMT -4. The time now is 06:31.