# Random function UDF for boundary condition

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

 March 28, 2003, 13:10 Random function UDF for boundary condition #1 Chris 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 Chris 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 Alex Munoz 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 Chris 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 Alex Munoz 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

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post ak6g08 Fluent UDF and Scheme Programming 1 December 23, 2013 06:05 AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06 asaijo OpenFOAM Installation 9 April 6, 2011 12:21 Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42 Christian Main CFD Forum 2 February 27, 2007 07:27

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