# How to set the inlet velocity profile with fluctuations in Gaussian distribution

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

 May 11, 2020, 12:38 How to set the inlet velocity profile with fluctuations in Gaussian distribution #1 New Member   gen pei Join Date: Aug 2019 Posts: 10 Rep Power: 6 Dear All, I am trying to perform a DNS of the flow over a flat plate (turbulent boundary layer) using StarCCM+. For the inlet BC, I want to superimpose the time-varying velocity fluctuations in Gaussian distribution on the mean velocity profile. I am just wondering what the best way is to do it in StarCCM+? I can think of two ways that may do the trick, but really need your help to refine the ideas. Please correct me if I made mistake. 1) Using the field function to define the velocity as a function of time. But I am not sure if it is possible to set the fluctuations in Gaussian distribution in StarCCM+. I searched for it at Steve Portal and seems there is no functions/operators can do something like the normal distribution function. 2) Using the Table (x,y,z,t). This approach definitely can work but may be relatively troublesome. I am thinking of using Matlab to generate the whole time-varying velocity profile through the simulation time and import it to the StarCCM+. It should work but seems quite inconvenient as the DNS requires extremely small time step, and the table can easily has large size. I am wondering if you have any better ideas or advice for this. I really need your insights. Thank you! Regards, Gary

 May 11, 2020, 18:53 #2 Senior Member   Lucky Join Date: Apr 2011 Location: Orlando, FL USA Posts: 5,683 Rep Power: 66 Indeed there is no rng in Star field functions. You have to use a table. An alternative might be to use a .java macro which gives you access to functions in java-land. But I still have no clue how to give random vectors in space and time. If you are doing no-SGS LES/DES, you have the synthetic turbulence generator which accomplishes the same feat. GaryPei likes this.

 May 11, 2020, 21:13 #3 New Member   gen pei Join Date: Aug 2019 Posts: 10 Rep Power: 6 Dear LuckyTran, Thank you so much for the insights. I guess I will try to use the table generated by Matlab. Regards, Gary

 May 12, 2020, 02:56 #4 Senior Member   Ping Join Date: Mar 2009 Posts: 556 Rep Power: 20 i would be doing it as a c user function since libraries will also be available in c and it will be very fast and better than a massive imported table GaryPei likes this.

 May 12, 2020, 04:02 #5 Senior Member   Lucky Join Date: Apr 2011 Location: Orlando, FL USA Posts: 5,683 Rep Power: 66 That's honestly a much better idea. It completely crossed my mind since it's a (relatively) newer feature that I haven't used yet. From the tree diagram, Tools=> User Code and you can import a library. You should be able to yoink a code from somewhere with relative ease. Knowing this, now I am excited because there are a bunch of functions I've been wanting to code for Star. =) GaryPei likes this.

 May 12, 2020, 04:12 #6 Senior Member   Ping Join Date: Mar 2009 Posts: 556 Rep Power: 20 glad to remind you and the feature has been there for at least a decade after looking at some old c++ ucode of mine

 May 18, 2020, 22:38 #7 New Member   gen pei Join Date: Aug 2019 Posts: 10 Rep Power: 6 Dear Ping, Thank you so much for your reply. It is extremely helpful! Regards, Gen Pei