CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

how to call the random function in Fluent

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2004, 22:40
Default how to call the random function in Fluent
  #1
Yong
Guest
 
Posts: n/a
hello, I don't know how to call random generator in Fluent by using UDF. I found this function in random.h that locate in fluent\src folder. If you know the answer, please reply. Thanks in advance.
  Reply With Quote

Old   April 4, 2004, 14:19
Default Re: how to call the random function in Fluent
  #2
ap
Guest
 
Posts: n/a
You can use the random generator functions of the C compiler:

The function

randomize();

initializes the random number generator, while the function

random(int n);

generates a random number between 0 and n-1.

Look on google for further details. Here there is an example (if you remove random.html, you have access to a guide to C):

http://www.phanderson.com/C/random.html

Hi

ap
  Reply With Quote

Old   April 4, 2004, 14:21
Default Re: how to call the random function in Fluent
  #3
ap
Guest
 
Posts: n/a
I forgot to say, you need to include stdlib.h

#include <stdlib.h>

and use compiled UDF.

Hi

ap
  Reply With Quote

Old   April 6, 2004, 04:52
Default Re: how to call the random function in Fluent
  #4
Yong
Guest
 
Posts: n/a
Hi, ap, I got it. Thank you very much.
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluent UDF - Random Noise Tanner FLUENT 2 May 29, 2014 04:27
LiencubiclowRemodel nzy102 OpenFOAM Bugs 14 January 10, 2012 09:53
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 15:11
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


All times are GMT -4. The time now is 21:31.