Swirl input using groovyBC
Hello Foamers,
I am trying to implement swirl input in a cylindrical tube (axis along z dir). I came across the groovyBC code to implement swirl input: inlet { type groovyBC; variables "rpm=8000.0;Un=55.8;c=sum(pos()*mag(Sf()))/sum(mag(Sf()));n=sum(normal())/mag(sum(normal()));p=pos()-c;r=mag(p)+1.0e-10;R=max(r); xt=vector(0,n.z,-n.y);xT=xt/mag(xt);yt=vector(n.y*n.y+n.z*n.z,-n.x*n.y,-n.x*n.z);yT=yt/mag(yt);"; valueExpression "-Un*normal() + (rpm*pi/30)*((p & yT)*xT - (p & xT)*yT)"; } Can someone explain what xt, yt, and (p & yT)*xT - (p & xT)*yT refer to? Thanks so much, Regards, gk |
Hello,
Can anyone provide some hints here? Many thanks, gk |
They are defined in variables. If you don't understand the formulation, make a sketch, using the known vectors (pos and normal), in a random orientation. In your sketch you will understand each term immediately. (With the assumption that this is a correct implementation of course ;))
|
Quote:
I have used following code: Code:
type groovyBC; Lasse |
Thanks a lot for the inputs! Really appreciate it! :)
I was able to get it running using Lasse's code. gk |
Hello,
I used funkySetBoundary in openfoam 1.7 to generate a swirl in the inlet patch for a sector of a cylinder and it works. I have attached below the file funkySetBoundaryDict used. Code:
/*--------------------------------*- C++ -*----------------------------------*\ |
Quote:
For complete (360 degree) cylinder- inlet { type groovyBC; variables ( "yp2=pos().y;" "zp2=pos().z;" "r2=sqrt(pow(zp2,2)+pow(yp2,2));" "U_ax2=0.5496*pow((1-mag(r2-0.0095)/(1.001*0.0035)),(1/7));" "U_t=0.15*(1-pow((mag(r2-0.0095)/(1.001*0.0035)),2));" "U_tz=-U_t*yp2/r2;" "U_ty=U_t*zp2/r2;" ); valueExpression "vector ( U_ax2, U_ty, U_tz )"; value uniform (0 0 0); } The 'value' might need to be added since without it some warning will be appeared. According to my understanding 'value' will be used only for first time-step. |
All times are GMT -4. The time now is 11:04. |