|
[Sponsors] |
May 17, 2006, 05:08 |
Random Function in UDF per DPM
|
#1 |
Guest
Posts: n/a
|
Hi users, I need to generate an array of random part_id #. I tried to use c function 'rand()%scalefactor' and 'srand(time(NULL))' but I need number between 1:10,000,000 and rand() returns numbers bw 0:37,***. How doing? THANKS a lot! Adriano
|
|
May 18, 2006, 07:19 |
Re: Random Function in UDF per DPM
|
#2 |
Guest
Posts: n/a
|
If rand() returns real numbers then you would just have to boost them to the size you want, i.e.
your_random_number = rand() * (10000000.0 / 37.0); /Henrik |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile problem | ivanyao | OpenFOAM Running, Solving & CFD | 1 | October 12, 2012 10:31 |
channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 14:06 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 07:42 |
UDF parse error at profile function line | Wiggy | Fluent UDF and Scheme Programming | 1 | July 27, 2009 16:59 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |