CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

groovy boundary condition for pressure

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 14, 2013, 11:51
Default groovy boundary condition for pressure
  #1
Senior Member
 
Ahmed Khattab's Avatar
 
ahmed
Join Date: Feb 2010
Posts: 161
Blog Entries: 1
Rep Power: 7
Ahmed Khattab is on a distinguished road
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.
Ahmed Khattab is offline   Reply With Quote

Old   October 14, 2013, 17:29
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by rebel ahmed View Post
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
gschaider is offline   Reply With Quote

Old   October 15, 2013, 02:26
Default
  #3
Senior Member
 
Ahmed Khattab's Avatar
 
ahmed
Join Date: Feb 2010
Posts: 161
Blog Entries: 1
Rep Power: 7
Ahmed Khattab is on a distinguished road
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<Field<Type> > ExpressionResult::getResult()
[1] 
[2] The expected return type vector is different from the stored result type "scalar"
Ahmed Khattab is offline   Reply With Quote

Old   October 15, 2013, 05:30
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,912
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by rebel ahmed View Post
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<Field<Type> > 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
gschaider is offline   Reply With Quote

Reply

Tags
groovy, pressure, scalar, vector, velocity

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Radiation interface hinca CFX 15 January 26, 2014 18:11
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
Setting outlet Pressure boundary condition using CAFFA code Mukund Pondkule Main CFD Forum 0 March 16, 2011 04:23
Domain Imbalance HMR CFX 3 March 6, 2011 21:10
How exactly the "pressure outlet" bdry condition compute properties on the boundary? yating9901 FLUENT 3 June 28, 2010 12:26


All times are GMT -4. The time now is 13:31.