CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Double Precision (https://www.cfd-online.com/Forums/fluent/28963-double-precision.html)

Ugur October 4, 2001 15:44

Double Precision
 
Hi;

I have a question. Is there any way to use double precision real numbers in user defined functions?

Thanks...

Ugur

Anthony Wachs October 5, 2001 04:33

Re: Double Precision
 
Hi,

I am wondering if I have clearly understood your question. According to me, simply replace :

real x;

by :

double x;

Is that what you would like to know ? I apologize in advance if my answer is too trivial. If it is the kind of anwer you expected, I hope it might help...

Best regards,

Anthony

Ugur October 5, 2001 14:58

Re: Double Precision
 
Yes, you gotteh question correctly, does double work in interpreted UDFs? Or, when your case in double precision,even if you define as real is it single or double precision. I mean, does precision of the case affect the precision of the UDF? Thanks...

Greg Perkins October 9, 2001 04:32

Re: Double Precision
 
You don't need to do anything. Just declare your variabes as

real x;

you will find that when you use double precision the Fluent header files define

#define real double

while for single precision Fluent defines

#define real float

Thus if you always use real you should have no probs.

Have a look at the .h files in the /src folders under Fluent.Inc/fluent5.x/ etc.

Greg


All times are GMT -4. The time now is 17:52.