CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

OppositeCellFace how to use

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 11, 2008, 03:49
Default Hi All, How can oppositeCel
  #1
Member
 
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17
nikwin is on a distinguished road
Hi All,

How can oppositeCellFace.C found in the doxygen manual be used? I would like to find the face opposite to a known face on the boundary to be able to calculate snGrad for that face.

Thanks in advance
/NW
nikwin is offline   Reply With Quote

Old   December 12, 2008, 03:06
Default Please, anyone?
  #2
Member
 
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17
nikwin is on a distinguished road
Please, anyone?
nikwin is offline   Reply With Quote

Old   December 12, 2008, 05:32
Default Hi Niklas, why don't you us
  #3
kbr
New Member
 
Kerstin
Join Date: Mar 2009
Posts: 16
Rep Power: 17
kbr is on a distinguished road
Hi Niklas,

why don't you use

<name>.boundaryField()[patchID].snGrad()

where 'name' is the name of the field you need snGrad for and patchID is the ID of the patch which can be found using

patchID = mesh.boundaryMesh().findPatchID("name")

where name is the name of patch, e.g. inlet?

Or did I misunderstand you?

Kerstin
kbr is offline   Reply With Quote

Old   December 12, 2008, 08:05
Default Hi, Thanks for the reply!
  #4
Member
 
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17
nikwin is on a distinguished road
Hi,

Thanks for the reply!
I've tried <name>.boundaryField()[patchID].snGrad(). The problem is that if the BC for PatchID is e.g. set to zeroGradient as in my case the answer it gives is only zero. And my aim is to check the actual boundary condition "value".

But, I found that the following line can be used to find the opposite face, a lot of trixing with doxygen,

faceList oppFace=mesh.cells()[cellI].opposingFaceLabel(c[i],mesh.faces());

Correct me if I'm wrong, please!

So, now snGrad on oppFace is needed!?
All the Best
/NW
nikwin is offline   Reply With Quote

Old   December 12, 2008, 08:25
Default Sorry, label or labelList not
  #5
Member
 
Niklas Winkler
Join Date: Mar 2009
Location: Stockholm, Stockholm, Sweden
Posts: 73
Rep Power: 17
nikwin is on a distinguished road
Sorry, label or labelList not faceList!
/NW
nikwin is offline   Reply With Quote

Old   December 12, 2008, 08:28
Default Hi Niklas, if you want to k
  #6
kbr
New Member
 
Kerstin
Join Date: Mar 2009
Posts: 16
Rep Power: 17
kbr is on a distinguished road
Hi Niklas,

if you want to know the value of the field at the boundary than try

scalarField valueOnPatch = <name>.boundaryField()[patchID];

for any scalar or

vectorField valueOnPatch = <name>.boundaryField()[patchID];

for any vector. Then you get a field containing the values of the variable "name" on patch with ID "patchID". I think using oppositeCellFace is not a good choice to compute snGrad. Think about using polyhedras! Which is the opposite face in that case? Have a look in "oppositeCellFace.C". There's a comment written concerning that problem.

By the way, snGrad for a zeroGradient-BC gives you "zero" and that's right beause snGrad is the surface normal gradient and setting BC to zeroGradient you define your surface normal gradient to be zero.

Kerstin
kbr is offline   Reply With Quote

Reply


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



All times are GMT -4. The time now is 05:53.