# groovy boundary condition for pressure

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 14, 2013, 11:51 groovy boundary condition for pressure #1 Senior Member     ahmed Join Date: Feb 2010 Posts: 161 Blog Entries: 1 Rep Power: 7 Hi, i'm using groovy boundary condition to express velocity as a relation of pressure difference of pressure of two regions. the problem is that velocity is vector field while pressure is scalar so, there is a problem to express vector value as a relation of scalar value. i think that if i use gradp instead of p it will be helpful but openfoam can't understand gradp since it is not stored in file. any one can help me figuring out a solution for this problem.

October 14, 2013, 17:29
#2
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
Quote:
 Originally Posted by rebel ahmed Hi, i'm using groovy boundary condition to express velocity as a relation of pressure difference of pressure of two regions. the problem is that velocity is vector field while pressure is scalar so, there is a problem to express vector value as a relation of scalar value. i think that if i use gradp instead of p it will be helpful but openfoam can't understand gradp since it is not stored in file. any one can help me figuring out a solution for this problem.
If you look at http://openfoamwiki.net/index.php/Co...her_field_are: then you'll find that snGrad(p) gives you the gradient of p in the normal()-direction
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

 October 15, 2013, 02:26 #3 Senior Member     ahmed Join Date: Feb 2010 Posts: 161 Blog Entries: 1 Rep Power: 7 Dear gschaider, thanks for your reply, i tried this Boundary condition for velocity Code: ``` type groovyBC; valueExpression "(pUpperFlow-pMiddleFlow)/(mu)"; variables "pUpperFlow{patch'upperFlow_to_upperFilter}=snGrad(p);pMiddleFlow{patch'middleFlow_to_upperFilter/middleFlow}=snGrad(p);"; value uniform (0 0 0);``` and this is the error message: Code: ```[2] --> FOAM FATAL ERROR: [3] [3] [3] --> FOAM FATAL ERROR: [3] The expected return type vector is different from the stored result type "scalar" --> FOAM FATAL ERROR: [1] The expected return type vector is different from the stored result type "scalar" [1] [1] [1] From function tmp > ExpressionResult::getResult() [1] [2] The expected return type vector is different from the stored result type "scalar"```

October 15, 2013, 05:30
#4
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
Quote:
 Originally Posted by rebel ahmed Dear gschaider, thanks for your reply, i tried this Boundary condition for velocity Code: ``` type groovyBC; valueExpression "(pUpperFlow-pMiddleFlow)/(mu)"; variables "pUpperFlow{patch'upperFlow_to_upperFilter}=snGrad(p);pMiddleFlow{patch'middleFlow_to_upperFilter/middleFlow}=snGrad(p);"; value uniform (0 0 0);``` and this is the error message: Code: ```[2] --> FOAM FATAL ERROR: [3] [3] [3] --> FOAM FATAL ERROR: [3] The expected return type vector is different from the stored result type "scalar" --> FOAM FATAL ERROR: [1] The expected return type vector is different from the stored result type "scalar" [1] [1] [1] From function tmp > ExpressionResult::getResult() [1] [2] The expected return type vector is different from the stored result type "scalar"```
As I said below: snGrad is the gradient IN THE DIRECTION NORMAL TO THE BOUNDARY. So it is a scalar. To get the actual vector multiply it with normal()
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

 Tags groovy, pressure, scalar, vector, velocity

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post hinca CFX 15 January 26, 2014 18:11 sunilpatil CFX 8 April 26, 2013 07:00 Mukund Pondkule Main CFD Forum 0 March 16, 2011 04:23 HMR CFX 3 March 6, 2011 21:10 yating9901 FLUENT 3 June 28, 2010 12:26

All times are GMT -4. The time now is 04:34.