CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] linear inlet velocity profile (https://www.cfd-online.com/Forums/openfoam-community-contributions/128293-linear-inlet-velocity-profile.html)

eRzBeNgEl January 8, 2014 11:22

linear inlet velocity profile
 
Hi guys,

i want to create a linear velocity profile at the inlet patch for simulating couette flow in a channel with less computational effort, therefore I tried following code:


Quote:

inlet
{
type groovyBC;
variables "maxVel=1;yp=pts().y;minY=min(yp);maxY=max(yp) ;";
valueExpression "((maxY-minY)/maxVel)*normal()*time();";
value uniform (1 0 0);
}

Is this right? I already set the maximal velocity in the U description of a moving wall (velocity = 1 m/s). Is there an option to link the groovyBC (maxVel part) with this boundary condition, eg: "maxVel=mag(U)@movingWall";

eRzBeNgEl January 9, 2014 05:32

any idea? my results are not right, so there must be a mistake

gschaider January 9, 2014 16:20

Quote:

Originally Posted by eRzBeNgEl (Post 469158)
Hi guys,

i want to create a linear velocity profile at the inlet patch for simulating couette flow in a channel with less computational effort, therefore I tried following code:


Is this right? I already set the maximal velocity in the U description of a moving wall (velocity = 1 m/s). Is there an option to link the groovyBC (maxVel part) with this boundary condition, eg: "maxVel=mag(U)@movingWall";

I'm not completely clear what you exactly want to do. You mean something like "maxVel{movingWall}=max(U)"? ( see http://openfoamwiki.net/index.php/Co...al_expressions or the incomplete reference guide)

eRzBeNgEl January 10, 2014 04:56

3 Attachment(s)
Hi,

in general I will produce a linear gradient velocity profile at my inlet in y-direction


This is my test setup
http://upload.wikimedia.org/wikipedi...inar_shear.svg


1. I tried by groovyBC but I failed -


2. I changed the hard coded parabolicVelocity.C File of HJasak and got the profile at figure 1. - it seems to be right
BUT
if i calculate further I got wiggles at the corner on bottom. How can I avoid them?(see Figure 2 & Figure 3) and in Couette there should be no velocity gradient in y-direction, but there is!


and in general, how can I set this profile to whole domain and not just to the inlet?


Here is my Member Function of the linear velocity profile:
Code:

void linearVelocityFvPatchVectorField::updateCoeffs()
{
    if (updated())
    {
        return;
    }


    // Get range and orientation
    boundBox bb(patch().patch().localPoints(), true);


    vector ctr = (bb.max() + bb.min());


    const vectorField& c = patch().Cf();


    // Calculate local 1-D coordinate for the linear profile
    scalarField coord = ((c - ctr) & y_)/((bb.max() - bb.min()) & y_);


  //n=flow direction, maxValue=peakVelocity
    vectorField::operator=(n_*maxValue_*(1.0-sqr(coord)));


wyldckat January 11, 2014 17:10

Greetings to all!

@eRzBeNgEl: There are several details here that are either missing or that you are not taking into account:
  1. The correct way to be properly that the values are as you want them, is to see the cell data, not the point data. See this post for more information: http://www.cfd-online.com/Forums/ope...tml#post446469 post #12
  2. You are not telling us what boundary conditions you are using for the walls, namely the ones that are perpendicular to the inlet. Or at least, I did not understand it from your description.
  3. I have not understood why you need to use this boundary condition for the inlet. Because a simple modification to the cavity tutorial could give you the couette flow, without any special boundary conditions.
  4. You can set the whole domain to have the desired flow, by using funkySetFields: http://openfoamwiki.net/index.php/Co...funkySetFields
  5. The code you've provided does not seem to have been modified. It's still a parabolic flow, because of this specific detail:
    Code:

    1.0-sqr(coord)
Best regards,
Bruno


All times are GMT -4. The time now is 14:56.