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

[swak4Foam] groovy boundary condition for pressure

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 14, 2013, 12:51
Default groovy boundary condition for pressure
  #1
Senior Member
 
Ahmed Khattab's Avatar
 
ahmed
Join Date: Feb 2010
Posts: 182
Blog Entries: 1
Rep Power: 16
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, 18:29
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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, 03:26
Default
  #3
Senior Member
 
Ahmed Khattab's Avatar
 
ahmed
Join Date: Feb 2010
Posts: 182
Blog Entries: 1
Rep Power: 16
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, 06:30
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
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

Old   November 14, 2015, 21:18
Default
  #5
Member
 
Saurabh Tandon
Join Date: Nov 2015
Location: Austin
Posts: 43
Rep Power: 10
STutexas is on a distinguished road
Hi
I am a new Openfoam user and I have a question about the snGrad operator. In the post you describe the use of operator on a scalar field. But if the operator is applied to a vector field would it give a tensor?
STutexas is offline   Reply With Quote

Reply

Tags
groovy, pressure, scalar, vector, velocity

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 18:38
Boundary condition not met, although fully converged Zerzura FLUENT 0 January 20, 2016 05:21
Radiation interface hinca CFX 15 January 26, 2014 18:11


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