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

BC development: how can I access to the patch normal?

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

Like Tree1Likes
  • 1 Post By Phicau

Reply
 
LinkBack Thread Tools Display Modes
Old   September 11, 2013, 05:59
Default BC development: how can I access to the patch normal?
  #1
New Member
 
Marcel Vonlanthen
Join Date: Nov 2012
Location: Zurich, Switzerland
Posts: 28
Rep Power: 4
Sylv is on a distinguished road
Dear Foamer,

I'm currently developing a boundary condition to force a given pressure gradient.

For a gradient boundary condition, OpenFOAM needs the normal gradient, for example, a fixed pressure gradient looks like this (in the p file):
Code:
outlet
    {
        type            fixedValue;
        value           uniform 1;
       //value         uniform (1 0 0); <== this is wrong!
    }
In my new bc, I'm working with the pressure gradient, which is a vector. but at the very end of all my calculations, I need to do the dot product between the pressure gradient and the patch normal, which should lead to something like this:
Code:
Field<scalar>& gradient = this->gradient();
gradient = myGradP*patchNormal  //how to get "patchNormal"?
In this example, "myGradP" is a vectorField with the same size as "gradient".

The problem, I don't now how to access to the patch normal. Any Idea?

Cheers,
Marcel
Sylv is offline   Reply With Quote

Old   September 11, 2013, 06:09
Default
  #2
Senior Member
 
Pablo Higuera
Join Date: Jan 2011
Posts: 237
Rep Power: 7
Phicau is on a distinguished road
Hi, this is what you need:

Code:
    vectorField nVecCell = patch().nf();
Best,

Pablo
Sylv likes this.
Phicau is offline   Reply With Quote

Reply

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
Using starToFoam clo OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 33 September 26, 2012 04:04
Cyclic Boundary Condition Luiz Eduardo Bittencourt Sampaio (Sampaio) OpenFOAM Running, Solving & CFD 36 July 2, 2012 12:23
chtMultiRegionFoam Tutorial m.nichols19 OpenFOAM 12 September 9, 2010 11:56
StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12


All times are GMT -4. The time now is 00:43.