CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   help!!about udf,fortran and C! (https://www.cfd-online.com/Forums/fluent/30567-help-about-udf-fortran-c.html)

winall November 23, 2002 03:21

help!!about udf,fortran and C!
 
cause i have to use UDF and i have only the Fortran editon code, i wonder whether in fluent the udf can be in fortran? if not, can i using a simple c code inside which the fortran code is used?? please give me some advice!!! i am a newer here!!

ravi varma November 23, 2002 13:06

Re: help!!about udf,fortran and C!
 
the code can be written in Fortran as well according to UDF user guide. try a simple code in Fortran to see if it works. and then paste your entire code.

winall November 24, 2002 09:26

Re: help!!about udf,fortran and C!
 
but the help says that the udf can only be written in C !!help!!!

Greg Perkins November 25, 2002 01:03

Re: help!!about udf,fortran and C!
 
For version 5 and above you'll need to use C, as per the manual. You may still be able to link some Fortran code if you want, but at least the code that interfaces with Fluent will need to be in C.

For versions 4 you need to use Fortran, but can link some C code into the executable.

Greg

Joakim Majander November 27, 2002 11:17

Re: help!!about udf,fortran and C!
 
You can link Fortran into Fluent 5 and 6 UDF. I have done that several times. The current appliation has ~10 000 lines of Fortran. You have to do some machine dependent modifications to makefile and write the interface in C, since you can not use the UDF macros in Fortran. There are a few things to note when linking C and fortran. E.g. array indices and parameter types.

Joakim

winall December 1, 2002 04:42

Re: help!!about udf,fortran and C!
 
can you give me some details about it??thanks!!


All times are GMT -4. The time now is 01:18.