|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
sebastien vilfayeau
Join Date: Feb 2012
Posts: 14
Rep Power: 15 ![]() |
Hi everyone,
I would like to calculate the average of neighbour cells connected by edge. I already know how to do the average of neighbour cells connected by face: labelListList neighbour = this->mesh().cellCells(); However, I cannot find those connected by edge. Let me know if you have any hint. Best, Sebastien |
|
|
|
|
|
|
|
|
#2 | |
|
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 19 ![]() |
Quote:
You could start by taking a look at /src/OpenFOAM/lnInclude/primitiveMesh.H There you should be able to spot a lot of useful connectivity information, including the cellCells function which you seem to have already discovered. With a combination of edgeCells and cellEdges you should be able to assemble a data structure which suits your needs. I hope that helps! Cheers, Kyle |
||
|
|
|
||
|
|
|
#3 | |
|
New Member
sebastien vilfayeau
Join Date: Feb 2012
Posts: 14
Rep Power: 15 ![]() |
Hi Kyle,
Thanks for the advice. I have already explored this class. But I was wondering if someone already put all the piece together and do a smart filtering to not count for duplicate cells. I did it. Here is my piece of code to calculate average with cells connected by edge or points. Quote:
Sebastien |
||
|
|
|
||
|
|
|
#4 |
|
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 38 ![]() ![]() |
Hi Sebastian,
A small word of warning: Your averaging is based on the number of cells with a uniform weighting. You might want to perform a weighting by cell volumes on non-equidistant meshes. You can also find the volume in the primitive mesh class, which Kyle pointed to. Kind regards, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
|
|
|
|
![]() |
| Tags |
| edges, neighboring cell |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [snappyHexMesh] Snappy creates strange cells far away from boundary | vainilreb | OpenFOAM Meshing & Mesh Conversion | 3 | December 16, 2020 06:11 |
| [snappyHexMesh] No layers in a small gap | bobburnquist | OpenFOAM Meshing & Mesh Conversion | 6 | August 26, 2015 10:38 |
| snappyHexMesh in parallel - FOAM Fatal IO Error | mturcios777 | OpenFOAM Running, Solving & CFD | 4 | August 10, 2012 20:18 |
| fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |
| physical boundary error!! | kris | Siemens | 2 | August 3, 2005 01:32 |