|July 21, 2011, 21:24||
How to start Fluent with Matlab??
Join Date: Jul 2011
Posts: 2Rep Power: 0
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.
|March 30, 2012, 00:12||
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.
Luca, HIT (Harbin, China)
|August 7, 2012, 15:25||
Join Date: Jan 2012
Location: San Diego
Posts: 61Rep Power: 6
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
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.
|August 8, 2012, 07:59||
Join Date: Oct 2010
Posts: 987Rep Power: 16
Try to put the the path into a string "", such as "C:\Program files\ANSYS Inc\blablabla\fluent.exe -3ddp"
|October 9, 2013, 14:20||
Join Date: Apr 2013
Posts: 15Rep Power: 6
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.
|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|