problem with a parabolic velocity profile
2 Attachment(s)
Hi all!
I'm trying to apply, as BC, a parabolic velocity profile at the inlet of my problem (a pipe) using groovyBC (from swak4foam). It works, in the sense that I have a parabolic profile, but: I would like to have velocity values (only in x direction) between 0 and 2 instead: I obtain a profile going from -0.11924 (negative!!) to 1.993 , looking only Ux in paraview, and from 1.929e-5 to 1.993 considering the Umagnitude. (see attached pictures) I'm worried about the negative value overall. Do you have any idea why I obtain these results instead of what I expected (zero?! Here how I applied the condition: Code:
{ I defined zp=pos().z+0.005 because z interval is [-0.0075 : -0.0025]. Thank you in advance! Claudio |
Quote:
The max not hitting 2 is OK: if the peak of the parabola doesn't "hit" a face-center then you will get a slightly lower value. The "+0.005"-trick can be avoided. Use max(pts().z) to get the maximum of the vertices of the patch. Get the minimum the same way (see how it is done in the pulsating pitzDaily). |
4 Attachment(s)
Hi Bernhard,
thank you for your quick answer! I tried to do what you said, and now it works! I mean: Quote:
Quote:
Code:
{ If you could explain it to me someway it could be usefull! Thank you very much! |
Quote:
I tried the same but wanted to achieve a fixed volumetric flow rate. I post this here, maybe someone can make use of it. If somebody has a better solution I would be glad to hear it. First I obtain the list of face centres for the x and z coordinate (xp, zp) corrected by the offset between the centre of the pipe inlet and the origin. This way the maximum value is at the centre of the inlet patch. For the parabolic profile (para) I used the same function Claudio used. What I call normalizedFlux is the resulting flux for a parabola with a maximum velocity of 1m/s. The ratio between my desired flux and the normalizedFlux is then used in the valueExpression along with the parabolic profile. This results in the same flux as for the flowRateInletVelocity boundary condition with a uniform value. Code:
inflow |
Dear All,
I am trying to do the same trick, using the coded BC instead of using swak4Foam, since I can't compile it on the machine where I have to launch my simulations. Do you know how I can fix this? I tried something like Code:
movingWall Could you help, please? Thanks, Samuele |
Quote:
I think what you want is (I'm doing this from memory so it might be slightly off. Especially the .y()-part) Code:
yp=this->patch().Cf()[i].y(); Also replace the next line with Code:
myPatch[i]=vector(0,-2*a,0); Concerning "can't compile it on the machine where I have to launch my simulations": if it is about outdated bison&flex on that machine: the development-version (and next release) of swak have a script to download and build a more up-to-date version of bison and use that. Nothing more than a C++-compiler is needed. And you must have access to that on that machine (otherwise coded wouldn't work) |
All times are GMT -4. The time now is 01:58. |