CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

How to add random velocity fluctuations using groovyBC

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By a.shevchenko
  • 2 Post By a.shevchenko

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 10, 2019, 08:52
Default How to add random velocity fluctuations using groovyBC
  #1
New Member
 
Anton Shevchenko
Join Date: Jan 2018
Posts: 10
Rep Power: 8
a.shevchenko is on a distinguished road
Hello everyone!

I have been trying to add random velocity fluctuations to my 2D jet flow simulation.

First I used turbulentInlet BC – and it did what I wanted, but I find it quite restricting now, as it just gives me a flat velocity profile where i would like to set a parabolic profile for example, and I would also like to add various pulsations to my velocity – not just random noise. So I opted for groovyBC, as it seemed to be able to do a lot of things at once.

Anyway, the task seemed easy. What I did previously (constant velocity profile, fluctuations at 1% of initial velocity) with turbulentInlet looks like this:

inlet
{
type turbulentInlet;
referenceField uniform (6.0 0 0);
fluctuationScale (0.06 0 0);
value uniform (6.0 0 0);
}


so, the same thing with groovyBc would have to look like this:

inlet
{
type groovyBC;
variables
(
"u0=6;"
"noise=0.012*rand()-0.06;"

"u=u0+noise;"
);
valueExpression "vector(u,0,0)";
value uniform (0 0 0);
}


However, when I ran simulations side by side, the results came out to be very different. groovyBC certainly does something – the results are different from the simulations with no noise whatsoever, but the scale of random velocity pulses is nowhere near what I achieved with turbulentInlet (see attached screenshots of velocity profiles as measured near jet inlet)

I am quite certain that I am doing some dumb mistake or overlooking something obvious, but still...

Would be happy to hear any advice)

Anton.
Attached Images
File Type: jpeg turbulentinlet.jpeg (63.2 KB, 72 views)
File Type: jpeg groovyBC.jpeg (71.5 KB, 63 views)
AviSh likes this.
a.shevchenko is offline   Reply With Quote

Old   June 13, 2019, 03:53
Default
  #2
New Member
 
Anton Shevchenko
Join Date: Jan 2018
Posts: 10
Rep Power: 8
a.shevchenko is on a distinguished road
Well, if anyone is interested – it was a typo in expression

"noise=0.012*rand()-0.06;"
instead of
"noise=0.12*rand()-0.06;"
of course

which i somehow managed to overlook.... okay, at least I was right about "obvious dumb mistake"

There is the post about rand() in swak4foam:
how to initialize a random velocity field with funkySetFields
and an example on openfoam wiki:
http://openfoamwiki.net/index.php/Co...RandomVelocity
AviSh and Saikumar Bunni like this.
a.shevchenko is offline   Reply With Quote

Reply

Tags
groovybc, inlet boundary condition, openfoam, random perturbation., swak4faom


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] Power law inlet velocity using groovyBC aviator OpenFOAM Community Contributions 3 November 13, 2013 11:50
[swak4Foam] groovyBC setting different directions for waves and velocity profile kilroy OpenFOAM Community Contributions 1 August 2, 2013 07:00
Random fluctuations at the inlet boundary for LES underGroundMan CFX 3 November 19, 2010 12:11
Random fluctuations at the inlet boundary underGroundMan CFX 12 July 17, 2008 19:16
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 10:11


All times are GMT -4. The time now is 12:48.