|
[Sponsors] |
Average of patch face values in "corner cells" |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 30, 2012, 08:41 |
Average of patch face values in "corner cells"
|
#1 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
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 |
|
April 3, 2012, 02:11 |
|
#2 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
In case someone might do a similar thing: I found a way based on this rather old thread http://www.cfd-online.com/Forums/ope...iven-cell.html using the functions whichPatch and whichFace that I had not known before.
Arne |
|
April 3, 2012, 05:07 |
|
#3 |
Member
Laurens Van Dyck
Join Date: Jul 2011
Location: Netherlands/Germany
Posts: 34
Rep Power: 14 |
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.
|
|
April 3, 2012, 13:48 |
|
#4 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 17:22 |
[Commercial meshers] Using starToFoam | clo | OpenFOAM Meshing & Mesh Conversion | 33 | September 26, 2012 04:04 |
chtMultiRegionFoam Tutorial | m.nichols19 | OpenFOAM | 12 | September 9, 2010 11:56 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 06:51 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 11:55 |