How to make Matlab wait for complete process of Ansys Fluent?

I trying to link Matlab with Ansys Fluent, but when I use the command "!fluent..." in Matlab the script don't wait for the final process of Fluent. How can I make it? I need the result files of Fluent to continue the work.
Thanks, Rafael

1 Commento

Dear Rafael Stange,
I want to link matlab with Ansys Fluent do you know any documentation without AAS toolbox?
Best Regards,

Accedi per commentare.

Risposte (1)

Nhan Nguyen
Nhan Nguyen il 29 Nov 2018
Modificato: Nhan Nguyen il 29 Nov 2018
Hello Rafael,
I don't know much about ANSYS Fluent. But I have some experience with ABAQUS.
To check if a ABAQUS simulation is done or not we can read a .sta file (or .log flle).
Usually, its name is Job-1.sta where Job-1 is the name of the ABAQUS job.
The job is done If the two end-lines of the file contains the following string
THE ANALYSIS HAS COMPLETED SUCCESSFULLY
Belows is a small script to do that verification. Hope that it will help you.
Best regards,
Nhan
idletime = 0;
flag = 1;
while flag
fid = fopen('Job-1.sta','r');
while ~feof(fid)
tline1 = fgets(fid);
tline2 = fgets(fid);
keystr = 'THE ANALYSIS HAS COMPLETED SUCCESSFULLY';
if contains(tline1,keystr ) || contains(tline2,keystr)
flag = 0;
fprintf('Running time = %d (s)\n',idletime)
break;
end
end
fclose(fid);
pause(1);
idletime = idletime + 1;
if idletime > 600 % 10 minutes
fprintf('Waste idle time = %d (s)\n',idletime)
error ('Too slow simulation (> 10 minutes). Please recheck your code');
end
end

2 Commenti

Thank you so much, I was going crazy trying to guess the Abaqus simulation time with a simple "pause()". This helped me a lot!
Hello Rafael
you can use the Matlab aas toolbox to connect to local/remote Fluent session
The toolbox is now availabe for download from Mathworks File Exchange at
You can stream the Fluent commands from your Matlab script. When you are done streaming you can shutdown Fluent from matlab using the terminate command
Sorinb

Accedi per commentare.

Categorie

Prodotti

Richiesto:

il 3 Dic 2015

Commentato:

il 16 Nov 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by