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] problem with Velocity Profile with groovyBC (https://www.cfd-online.com/Forums/openfoam-community-contributions/140080-problem-velocity-profile-groovybc.html)

ssss August 7, 2014 09:11

problem with Velocity Profile with groovyBC
 
Hi,

Iḿ trying to implement a turbulent velocity inlet profile with grooveBC, here is my code

Code:

inlet
 {
        type            groovyBC
    variables      "delta0Star=1;uInf=4.5;";
    valueExpression "(pos().y<=(8*delta0Star))  ? vector(4.5* pow( pos().y/(8*1) , 1/7 ),0,0 ) : vector( 4.5,0,0)";
        value          uniform (4.5 0 0);
  }

So my first problem is that if I write my variables name in the valueExpression I get the following groovyError error: Parser Error for driver PatchValueExpressionDriver at "1.15-24" :"field delta0Star not existing or of wrong type".

Second error is that if I substitute the variables for their real values I get the following problem:

http://i62.tinypic.com/29xdbvo.png

As you see it seems like if pos().y is inverted it should be the other way around, not starting from yMax instead starting in y=0 as pos().y<=20*delta0Star says

Anyone has a clue about the problem?

Thank you very much

gschaider August 7, 2014 14:44

Quote:

Originally Posted by ssss (Post 504847)
Hi,

Iḿ trying to implement a turbulent velocity inlet profile with grooveBC, here is my code

Code:

inlet
 {
        type            groovyBC
    variables      "delta0Star=1;uInf=4.5;";
    valueExpression "(pos().y<=(8*delta0Star))  ? vector(4.5* pow( pos().y/(8*1) , 1/7 ),0,0 ) : vector( 4.5,0,0)";
        value          uniform (4.5 0 0);
  }

So my first problem is that if I write my variables name in the valueExpression I get the following groovyError error: Parser Error for driver PatchValueExpressionDriver at "1.15-24" :"field delta0Star not existing or of wrong type".

Classic: you forgot the ; after groovyBC. OpenFOAM therefor thought your variables-entry is part of the type entry and didn't "see" it.

Quote:

Originally Posted by ssss (Post 504847)
Second error is that if I substitute the variables for their real values I get the following problem:

http://i62.tinypic.com/29xdbvo.png

As you see it seems like if pos().y is inverted it should be the other way around, not starting from yMax instead starting in y=0 as pos().y<=20*delta0Star says

Anyone has a clue about the problem?

Thank you very much

I don't see anything from that picture. U on the boundary has a higher magnitude than on the interior. That's all.

Please:
- Use "Save Screenshot" in paraview. So we don't have to look at the Ubuntu-logo
- Add a colorbar so that we get a sense of the quantities
- Use the "insert Image" of the board. That way the posting gets properly formated. Now it is formatted to the width of your picture which makes it almost unreadable
- When talking about values use the cell values not the point-values. Because right now we're looking at interpolation artefacts (in the upper left corner)
- to discuss stuff that groovyBC did select only the boundary in question in "Mesh parts" and deselect the internal field.


All times are GMT -4. The time now is 20:08.