Random number generator
Hi all
I am wondering if anyone can help me to use the random number generator to select some cells on a boundary and to give them different boundary condition. Thanks AsaidZ |
Here you have an example of how to use the C random number generator:
http://www.cplusplus.com/reference/c.../cstdlib/rand/ you can easily adapt this code to your problem. Do |
Thanks a lot for your reply
AsaidZ |
Hello,
In OF 211, if I use the following random number generator : scalar Random::scalar01() { return osRandomDouble(); } The function osRandomDouble() is defined as: Foam::scalar Foam::osRandomDouble() { #ifdef USE_RANDOM return (scalar)random()/INT_MAX; #else return drand48(); #endif } Is the radnom number from this generator with zero mean and unity variance? Thanks |
All times are GMT -4. The time now is 19:27. |