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

Average of patch face values in "corner cells"

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 30, 2012, 08:41
Default Average of patch face values in "corner cells"
  #1
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
Hi foamers,

I have to do some interpolation/average of boundary values at corner cells.
More specific: I'm regarding e.g. a cell (hex mesh element) that is located at the upper right, front corner of my domain. Therefore, three of its faces are lying on boundary patches (inlet, right, top).

Within my solver I'm modifying the boundary condition values on these patches every time step. So I first have to find the cells that have three faces connected to patches, and then I need to calculate the average of these three boundary values and assign it to the single faces.

Therefore my question: How can I announce the corresponding face labels on the two remaining patches for every patch face? I was thinking of some extensive loops of loops over patches, faces and cells including lists and comparisons, but I hope that there is a faster way which has not yet come to my mind...

Any ideas?

Arne
Arnoldinho is offline   Reply With Quote

Old   April 3, 2012, 02:11
Default
  #2
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
In case someone might do a similar thing: I found a way based on this rather old thread Retrieving boundary patch values adjacent to a given cell using the functions whichPatch and whichFace that I had not known before.

Arne
Arnoldinho is offline   Reply With Quote

Old   April 3, 2012, 05:07
Default
  #3
Member
 
Laurens Van Dyck
Join Date: Jul 2011
Location: Netherlands/Germany
Posts: 34
Rep Power: 6
laurensvd is on a distinguished road
Cant you just define the coordinate of that corner and loop over the cells to see which cell center is closest to that point? You could even make it faster by retrieving the cells which neighbor one of those patches and see which one of those is closest to that point. Take the smallest patch and youll have minimum overhead.
laurensvd is offline   Reply With Quote

Old   April 3, 2012, 13:48
Default
  #4
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
Hi laurens,

thanks for your hint. I already implemented it similar to the way it was mentioned by the link I posted:
1. Start from the boundary patches,
2. find corresponding cells in corners (and intersections),
3. calculate average values based on the corresponding patch face cells and temporarily store them,
4. write them back to the patch faces.

Arne
Arnoldinho 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
mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 12 December 12, 2011 05:16
chtMultiRegionFoam Tutorial m.nichols19 OpenFOAM 12 September 9, 2010 11:56
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 21:54.