How to link Fluent and MATLAB and exchange data?
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.
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.
Could you please share me the code regarding linking between fluent and Matlab or modefrontier. Atleast the simple version.
Thanks in advance
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:
Coding is pretty straight forward, quite fast and it will not require other software but Fluent and Matlab.
|All times are GMT -4. The time now is 01:40.|