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

How to link Fluent and MATLAB and exchange data?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 12, 2009, 03:22
Default How to link Fluent and MATLAB and exchange data?
  #1
New Member
 
Tom
Join Date: Dec 2009
Posts: 2
Rep Power: 0
z701531118 is on a distinguished road
1. My aim is to use Matlab as a "master" program and fluent as a "slave", analyzing flow in Fluent and do multiobjective optimization in MATLAB.
2. How can I convert *.jun to *.bat in order to import data into MATALB.
3. I want to implement gene algorithm on MATLAB to tune the value of flow rate and rpm in Fluent.
z701531118 is offline   Reply With Quote

Old   December 17, 2009, 12:38
Default
  #2
los
Member
 
Tiago Macarios
Join Date: Mar 2009
Posts: 35
Rep Power: 17
los is on a distinguished road
I had to do something like this once and I think I can help you.

First do no use matlab, it is REALLY, I mean REALLY slow to converge to a optimum if it is what do you want. I would suggest you using "esteco modefrontier"

The next question is how good at programming are you? I have wrote 3 solutions for you that gose from simple to complicated and, as you can presume, from slowest to fast:

1- use matlab/modefrontier to create a journal file for fluent and then run it in batch mode. (slow because fluent needs to relaod mesh at every new configuration, so depending of your computational domain, it can consume some time)
2 - write an UDF in fluent that write the output data to a file and then you can read it into matlab/modefrontier. Then matlab will write another file that will be read by fluent, that udpates the boundary conditions with the udf. (fluent will just change the boundary conditions and converge again, the slow part here is using the harddisk as a communication between programs)
3- The most elegant - write a code in matlab/modefrontier that opens a pipe to fluent and communicate trough it. if you dont known pipes: http://linux.die.net/man/7/pipe

I think that with some thinking all this solutions can be parallelized (different simulations at the same time), fluent parallelization can always be used.
modefrontier has already a module for fluent, I never used it but you might give it a try.

=D
los is offline   Reply With Quote

Old   November 9, 2011, 23:30
Default
  #3
Member
 
john
Join Date: Nov 2010
Posts: 50
Rep Power: 15
johnwinter is on a distinguished road
Hi Tiago,

Could you please share me the code regarding linking between fluent and Matlab or modefrontier. Atleast the simple version.

Thanks in advance
John
johnwinter is offline   Reply With Quote

Old   October 9, 2013, 14:26
Default
  #4
New Member
 
Sorin Munteanu
Join Date: Apr 2013
Posts: 27
Rep Power: 13
Sorin is on a distinguished road
Hi John,

I hope this reply is not coming too late...

You can start Fluent in server mode and access it from a remote Matlab machine.
I will not report my post, but you might want to go over my cfd-online post at the following link:
http://www.cfd-online.com/Forums/flu...ab-fluent.html

Coding is pretty straight forward, quite fast and it will not require other software but Fluent and Matlab.

Sorin

Quote:
Originally Posted by johnwinter View Post
Hi Tiago,

Could you please share me the code regarding linking between fluent and Matlab or modefrontier. Atleast the simple version.

Thanks in advance
John
Sorin 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
Parse error in UDF, URGENT HELP NEEDED!!! Boris Kloser FLUENT 2 December 12, 2009 03:16


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