CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Execute a Fortran program with Fluent (

marye May 10, 2010 04:46

Execute a Fortran program with Fluent

I'd like to know how to execute a Fortran program with Fluent

Thank you! :)

DoHander May 10, 2010 08:16

Please give me more details if you want a more practical answer. Do you want to call a Fortran program from Fluent ? Or do you want to call Fluent from your Fortran program ?

What exactly are you trying to do ?

If you want to execute a Fortran code from Fluent you will use a UDF function in which you can use the C "system" command, I've never tried but it is your best guess. You must use a compiled UDF for having access at the entire C syntax.


marye May 10, 2010 08:47


First thank you for your answer!
Basically, I have an algorithm written in Fortran.
This algorithm has already been used to work with Marc Mentat and now I have to use it with Fluent.

But I don't know how to execute a Fortran program with Fluent and also I don't know how to call Fluent in my algorithm.
is it clearier?

DoHander May 10, 2010 10:30

I see two solutions:

1. Send data back and forth using text files, for example Fluent writes the data your Fortran algorithm needs in a file and starts the Fortran code, which will save his results in a new file. When the Fortran code has finished, Fluent reads the data file written by Fortran and so on ... This is a simple hack and not an elegant solution but it will usually work.

2. Reimplement your Fortran code in C as a UDF function, this will be directly accessible in Fluent. Probably this is the recommended solution for your problem. (If your Fortran code is Fortran 77 you can automatically translate parts of it using f2c - a program for Fortran to C conversion). I would recommend however a manual translation from Fortran to C.

In any case you will need a solid background of Fortran and C.


marye May 11, 2010 03:32

ok, thanks, I will try...

maryam.s December 1, 2012 16:25

how execute fluent with fortran?
I want to call Fluent in my Fortran program,i need to run journal file of fluent for several times in fortran loop ,i use command system:

CALL SYSTEM("E:/program files/Fluent.Inc/ntbin/ntx86/fluent.exe 2ddp")
but program shows this error:
'E program' is not recognized as an internal or external command,operable program or batch file.
please help me:(

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