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

How to start Fluent with Matlab??

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 21, 2011, 21: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
Jay Hu is offline   Reply With Quote

Old   March 30, 2012, 00:12
Default Loop Automation
  #2
New Member
 
Luca Gorasso
Join Date: Oct 2011
Location: Harbin, China
Posts: 24
Rep Power: 5
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, 15:25
Default
  #3
Member
 
Negin Nazarian
Join Date: Jan 2012
Location: San Diego
Posts: 61
Rep Power: 5
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, 07:59
Default
  #4
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 899
Rep Power: 15
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, 14:17
Default
  #5
Member
 
Negin Nazarian
Join Date: Jan 2012
Location: San Diego
Posts: 61
Rep Power: 5
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, 14:20
Default
  #6
New Member
 
Sorin Munteanu
Join Date: Apr 2013
Posts: 15
Rep Power: 5
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:

looking for a smart interface matlab fluent

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
Sorin is offline   Reply With Quote

Reply

Thread Tools
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 On
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 14:26
few quesions on ANSYS ICEMCFD and FLUENT Prakash.Paudel ANSYS 0 August 12, 2010 12: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 13:17
matlab for fluent punit FLUENT 0 February 9, 2006 13:09


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