|
[Sponsors] |
March 28, 2003, 13:10 |
Random function UDF for boundary condition
|
#1 |
Guest
Posts: n/a
|
Hi,
Does anyone know what to write in the UDF if I would like to generate a randomly varying pressure input? Is the command rand() or something? Thanks in advance |
|
March 28, 2003, 14:08 |
Re: Random function UDF for boundary condition
|
#2 |
Guest
Posts: n/a
|
Actually, I want to do this because I would like to obtain a frequency response of a probe that I am modeling...
I figured that if I subject the system to a random input, and generate some output files, I can process the data in MATLAB or something to plot the frequency response curve... I hope this bit of background information helps whoever's able to give me advice! Gracias! |
|
March 28, 2003, 14:28 |
Re: Random function UDF for boundary condition
|
#3 |
Guest
Posts: n/a
|
Hi Chris
I have not used a random function in a UDF, however, you must be careful rand() function in C provides a uniform random number betweem 0 to RAND_MAX=32767 (always integer). Therefore I you want to generate a random number between 0 to 1 you have to divide the rand()/RAND_MAX. Don't know forget to feed somehow a seed generator for the random number srand() In addition if you want to generate a normal distribution function a "bell" shape, you must to use another function, which potentially you could download. Regards Alex |
|
March 28, 2003, 14:39 |
Re: Random function UDF for boundary condition
|
#4 |
Guest
Posts: n/a
|
Thanks Alex. Where could I get the "potential" download?
|
|
March 28, 2003, 16:38 |
Re: Random function UDF for boundary condition
|
#5 |
Guest
Posts: n/a
|
My friend
type on google "random number generation in C" or something related to the type of distributio that you need gauss, binomial, poisson etc. Regards Alex |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF function diverging | ak6g08 | Fluent UDF and Scheme Programming | 1 | December 23, 2013 06:05 |
channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 14:06 |
OpenFOAM static build on Cray XT5 | asaijo | OpenFOAM Installation | 9 | April 6, 2011 13:21 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 07:42 |
Droplet Evaporation | Christian | Main CFD Forum | 2 | February 27, 2007 07:27 |