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

How to start Fluent with Matlab??

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By Jay Hu
  • 1 Post By Sorin

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 21, 2011, 22:24
Default How to start Fluent with Matlab??
  #1
New Member
 
Jay
Join Date: Jul 2011
Location: IN
Posts: 2
Rep Power: 0
Jay Hu is on a distinguished road
Hello,
I am working on a problem that will need to start Fluent with Matlab. I am wondering if this is possible. If yes, how to do that?
What I want to do can be described as follow:
1. Run Matlab to obtain the B.C. for Fluent;
2. Start Fluent with Matlab (how to write this command in .m file?), use the calculated B.C. from previous step and run Fluent journal file;
3. Export calculated Fluent result;
4. Fluent results will be read by Matlab .m file;
5. Continute the following Matlab calculation; If necessary, run Fluent again.
UDF file may be needed.
How can I do that? It seems like we can do that.
Thanks
Jay
sumeetkotak and Richard Hu like this.
Jay Hu is offline   Reply With Quote

Old   March 30, 2012, 01:12
Default Loop Automation
  #2
New Member
 
Luca Gorasso
Join Date: Oct 2011
Location: Harbin, China
Posts: 24
Rep Power: 15
elcino is on a distinguished road
Send a message via Skype™ to elcino
Hi,

so, is quiet easy, I do that every day, but depends on your version of the programs and if is a 3d or 2d problem. By the way, I do this:

1) You write the part of the *.m file which calculate the BC or any other parameter as you want.
2) The second part of the program write a *.txt file used as a journal file for Gambit (see the Matlab guide how to write *.txt files).
3) Launch Gambit in Batch mode with the command:
! C:\Gambit\ntbin\ntx86\gambit.exe -inp *.txt
4) With the same commands above write the Journal file for Fluent.
5) Launch Fluent in batch mode with the command:
! fluent fluent 3ddp -g -i "C:\Admin\Desktop\*.jou"
6) In the fluent journal provide the necessary commands to plot *.txt files of the results.
7) Read this results with Matlab (see the guide hot to do it).
8) And restart the loop or process them.

The Gambit and Fluent journal language is not easy to explain in a single post like this.

Best regards,

Luca, HIT (Harbin, China)
elcino is offline   Reply With Quote

Old   August 7, 2012, 16:25
Default
  #3
Member
 
Negin Nazarian
Join Date: Jan 2012
Location: San Diego
Posts: 61
Rep Power: 14
nenazarian is on a distinguished road
Hi

Im trying to do the same procedure in MATLAB

I have this function that writes the journal file and Im trying to open fluent in that function but the command "!fluent-3ddp" or even
! C:\Program files\ANSYS Inc\...\fluent.exe -3ddp
doesnt work.

The thing is when I dont add anything after the fluent path it works fine and the fluent window pops up, but as soon as I add "-3ddp" or "-i" or anything else it wont work anymore and give me this error

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

Do u have any suggestion?
I appreciate your help.

Cheers
Negin
nenazarian is offline   Reply With Quote

Old   August 8, 2012, 08:59
Default
  #4
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27
ghost82 will become famous soon enough
Hi Negin,
Try to put the the path into a string "", such as "C:\Program files\ANSYS Inc\blablabla\fluent.exe -3ddp"
ghost82 is offline   Reply With Quote

Old   August 8, 2012, 15:17
Default
  #5
Member
 
Negin Nazarian
Join Date: Jan 2012
Location: San Diego
Posts: 61
Rep Power: 14
nenazarian is on a distinguished road
HI

thanks for your reply
I used "system" command and used " too

Cheers
Negin
nenazarian is offline   Reply With Quote

Old   October 9, 2013, 15:20
Default
  #6
New Member
 
Sorin Munteanu
Join Date: Apr 2013
Posts: 27
Rep Power: 14
Sorin is on a distinguished road
Hi Jay,

You can script Fluent directly from Matlab without having to create Fluent journal ,start Fluent in batch mode and then shutdown Fluent. The process of starting/shutting down Fluent can be quite expensive.

I will recommend the following steps

1.Start Matlab on Matlab machine
2.Start Fluent on Fluent machine in server mode (add -aas option)
3.Connect Matlab with Fluent
4. Compute B.C for Fluent in Matlab
5. Apply BC for Fluent in Matlab
6. Ask Fluent to perform CFD simulation from Matlab
7. Ask Fluent to provide calculated results from Matlab
8. Continue to follow Matlab calculation
9. Repeat steps 3 to 8 as needed to perform Fluent-Matlab simulation
10. Shutdown Fluent from Matlab when not needed.

This way you will have a remote Fluent-Matlab simulation, without having to start/shutdown Fluent and load/save Fluent cases or data.

Also your whole simulation logic will be in one place, in your Matlab code that will issue both Matlab and Fluent commands.

For more references about the technique follow the instructions in my following CFD-online post:

http://www.cfd-online.com/Forums/flu...ab-fluent.html

I hope this helps.

Sorin

Quote:
Originally Posted by Jay Hu View Post
Hello,
I am working on a problem that will need to start Fluent with Matlab. I am wondering if this is possible. If yes, how to do that?
What I want to do can be described as follow:
1. Run Matlab to obtain the B.C. for Fluent;
2. Start Fluent with Matlab (how to write this command in .m file?), use the calculated B.C. from previous step and run Fluent journal file;
3. Export calculated Fluent result;
4. Fluent results will be read by Matlab .m file;
5. Continute the following Matlab calculation; If necessary, run Fluent again.
UDF file may be needed.
How can I do that? It seems like we can do that.
Thanks
Jay
sumeetkotak likes this.
Sorin is offline   Reply With Quote

Old   November 10, 2018, 04:20
Default
  #7
New Member
 
Sumeet kotak
Join Date: Jun 2015
Posts: 13
Rep Power: 11
sumeetkotak is on a distinguished road
Quote:
Originally Posted by Sorin View Post
Hi Jay,

You can script Fluent directly from Matlab without having to create Fluent journal ,start Fluent in batch mode and then shutdown Fluent. The process of starting/shutting down Fluent can be quite expensive.

I will recommend the following steps

1.Start Matlab on Matlab machine
2.Start Fluent on Fluent machine in server mode (add -aas option)
3.Connect Matlab with Fluent
4. Compute B.C for Fluent in Matlab
5. Apply BC for Fluent in Matlab
6. Ask Fluent to perform CFD simulation from Matlab
7. Ask Fluent to provide calculated results from Matlab
8. Continue to follow Matlab calculation
9. Repeat steps 3 to 8 as needed to perform Fluent-Matlab simulation
10. Shutdown Fluent from Matlab when not needed.

This way you will have a remote Fluent-Matlab simulation, without having to start/shutdown Fluent and load/save Fluent cases or data.

Also your whole simulation logic will be in one place, in your Matlab code that will issue both Matlab and Fluent commands.

For more references about the technique follow the instructions in my following CFD-online post:

http://www.cfd-online.com/Forums/flu...ab-fluent.html

I hope this helps.

Sorin
Hi Sorin,
Can you help in regarding step no 3. "Connect Matlab with Fluent"

How to connect?

Thanks in Advance

Sumeet Kotak
sumeetkotak is offline   Reply With Quote

Old   November 9, 2022, 07:16
Default
  #8
Member
 
sina
Join Date: Nov 2021
Posts: 41
Rep Power: 5
sina_sls is on a distinguished road
Quote:
Originally Posted by elcino View Post
Hi,

so, is quiet easy, I do that every day, but depends on your version of the programs and if is a 3d or 2d problem. By the way, I do this:

1) You write the part of the *.m file which calculate the BC or any other parameter as you want.
2) The second part of the program write a *.txt file used as a journal file for Gambit (see the Matlab guide how to write *.txt files).
3) Launch Gambit in Batch mode with the command:
! C:\Gambit\ntbin\ntx86\gambit.exe -inp *.txt
4) With the same commands above write the Journal file for Fluent.
5) Launch Fluent in batch mode with the command:
! fluent fluent 3ddp -g -i "C:\Admin\Desktop\*.jou"
6) In the fluent journal provide the necessary commands to plot *.txt files of the results.
7) Read this results with Matlab (see the guide hot to do it).
8) And restart the loop or process them.

The Gambit and Fluent journal language is not easy to explain in a single post like this.

Best regards,

Luca, HIT (Harbin, China)
Hello,

I want to run fluent from matlab and i can't use AAS toolbox because i don't access to it, how can i run multiple times ?

i use it :

! "C:\Program Files\ANSYS Inc\v212\fluent\ntbin\win64\fluent.exe" 2ddp -i "C:\Users\SINA\Desktop\New_folder\15KArms.jou" '

but i want to run again this file by another journal file after finishing the first journal file i mean in following of first journal . How can i do it?

Best Regards,
sina_sls is offline   Reply With Quote

Old   November 9, 2022, 07:30
Default
  #9
Member
 
sina
Join Date: Nov 2021
Posts: 41
Rep Power: 5
sina_sls is on a distinguished road
Quote:
Originally Posted by nenazarian View Post
Hi

Im trying to do the same procedure in MATLAB

I have this function that writes the journal file and Im trying to open fluent in that function but the command "!fluent-3ddp" or even
! C:\Program files\ANSYS Inc\...\fluent.exe -3ddp
doesnt work.

The thing is when I dont add anything after the fluent path it works fine and the fluent window pops up, but as soon as I add "-3ddp" or "-i" or anything else it wont work anymore and give me this error

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

Do u have any suggestion?
I appreciate your help.

Cheers
Negin
Hello,

I want to run fluent from matlab and i can't use AAS toolbox because i don't access to it, how can i run multiple times ?

i use it :

! "C:\Program Files\ANSYS Inc\v212\fluent\ntbin\win64\fluent.exe" 2ddp -i "C:\Users\SINA\Desktop\New_folder\15KArms.jou" '

but i want to run again this file by another journal file after finishing the first journal file i mean in following of first journal . How can i do it?

Best Regards,
sina_sls 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
How to link Fluent and MATLAB and exchange data? z701531118 FLUENT 3 October 9, 2013 15:26
few quesions on ANSYS ICEMCFD and FLUENT Prakash.Paudel ANSYS 0 August 12, 2010 13:07
Fluent 12.0 is worst then Fluent 6.2 herntan FLUENT 5 December 14, 2009 03:57
Matlab programming for Fluent study case ASHLEY FLUENT 1 April 5, 2008 14:17
matlab for fluent punit FLUENT 0 February 9, 2006 13:09


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