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

how to call the random function in Fluent

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 1, 2004, 21: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, 13: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, 13: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, 03: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

Thread Tools
Display Modes

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 On
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 03: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 FOAM warning gaottino OpenFOAM Native Meshers: blockMesh 7 July 19, 2010 14:11
Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00


All times are GMT -4. The time now is 03:26.