|
[Sponsors] |
February 19, 2016, 10:36 |
Access to neighbor faces on a boundary
|
#1 |
Member
Join Date: Mar 2013
Posts: 98
Rep Power: 13 |
Dear all,
I have a problem in the implementation of a smoothing filter that smooth a value averaging the neighbor ones. The variable to smooth (let's call it sensitivity) is a volScalarField defined only along a wall surface. Therefore, the sensitivity is zero everywhere and different from zero on the wall faces. I have access to the face values on the wall with sensitivity.boundaryField() but I'm not able to take the values of the neighbor faces on the wall. The typical way how to have access to neighbors is to use mesh.cellCells() and mesh.neighbor() but they are related to neighbor cells and neighbor internal faces respectively. Someone knows how to have access to the neighbor faces on a boundary (the wall in my case)? Thanks for any help Giacomo |
|
February 19, 2016, 11:36 |
|
#2 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
sensitivity.boundaryField()[patchI] will give a fvScalarPatchField with all the values on it. Call patch() to get fvPatch, then call patch() again to get polyPatch. That has connectivity:
Code:
forAll(sensitivity.boundaryField(), i) { fvScalarPatch& patchI(sensitivity.boundaryField()[patchI]); polyPatch& pp(patchI.patch().patch()); } I'm sure there's an easier way. Try looking for examples. PrimitivePatch::calcPointNormals creates a normal for each point on the face that is the average of the surrounding face normals. May be useful. (Mind you, this one doesn't account for parallel processing.) Sorry for the ramble. Hope this helps ever so slightly. Need more coffee this morning.
__________________
~~~ Follow me on twitter @DavidGaden Last edited by marupio; February 19, 2016 at 11:37. Reason: Missed [code] tags |
|
April 29, 2016, 07:15 |
|
#3 |
Member
Join Date: Mar 2013
Posts: 98
Rep Power: 13 |
Many thanks for the advice, I'll have a look on that.
For the moment I solved the problem in a more simple way. I perform a double interpolation: - interpolation of the face values to obtain the values on the boundary points (faceToPointInterpolate). - interpolation of the boundary values to obtain the values on the face centers (pointToFaceInterpolate). The interpolation is a linear interpolation so essentially I average twice to get a smoother values on the face center. In this way the smoothing is more conservative than a simple average between the face center values. However, I still want to try to develop the first idea so I will check more in detail your suggestions. |
|
January 29, 2019, 08:23 |
|
#4 | |
Senior Member
Timofey Mukha
Join Date: Mar 2012
Location: Stockholm, Sweden
Posts: 119
Rep Power: 14 |
Quote:
A short note after working with a similar thing. Instead of pp[faceIndex], use pp.faceEdges()[faceIndex] to use local addressing, compatible with pp.edgeFaces()[edgeIndex]. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
sliding mesh problem in CFX | Saima | CFX | 46 | September 11, 2021 08:38 |
Access to the velocity at boundary cells | mathslw | OpenFOAM | 14 | January 10, 2018 00:31 |
Domain Imbalance | HMR | CFX | 5 | October 10, 2016 06:57 |
Low torque values on Screw Turbine | Shaun Waters | CFX | 34 | July 23, 2015 09:16 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |