|
[Sponsors] |
March 2, 2023, 15:43 |
Moving average in OpenFOAM
|
#1 |
Member
Uttam
Join Date: May 2020
Location: Southampton, United Kingdom
Posts: 35
Rep Power: 6 |
Hi,
Objective: Get a volume weighted moving average. What do I mean? I have an unstructured grid with data residing in the cells. I would like to construct a structured "mesh" wherein, I find out the points from my unstructured grid that lie inside each of the cells in this structured "mesh" and take a volume weighted average of those cells and assign it to the structured mesh cell. What I have tried? I noticed that topoSet has this feature boxToCell wherein I can define a box with minimum and maximum coordinates. I can then create a cellSet from which a cellZone can be created that has the cell indices stored in it. By using the function object volFieldValue, I can find out the volume averaged value of the quantity in that cellZone. This is all good for one box. But I would like to create a list of such boxes that encompass my entire unstructured domain and perform the same function till the whole structured domain is populated. Question: How can this be done? Remember, I need to insert this into a source code. Secondly, Can I get the mesh information for this new "structured" mesh (such as points, faces, cells etc). If so, how can this be done?
__________________
Best Regards Uttam ----------------------------------------------------------------- “When everything seem to be going against you, remember that the airplane takes off against the wind, not with it.” – Henry Ford. |
|
March 14, 2023, 06:26 |
|
#2 |
Senior Member
Josh Williams
Join Date: Feb 2021
Location: Scotland
Posts: 113
Rep Power: 5 |
We have a post-processing tool to do something similar (not sure if you meant at run-time or post-processing). We have used it to apply a top-hat filter convolution to a DNS flow-field to extract a priori LES information. It has only been used on periodic domains (box geometry with periodic BCs).
See the github link: https://github.com/aliozel/coarseningFoam For the approach you mention, I would probably specify a coarse structured mesh within our coarseningFoam library (just define an array with min and max x,y,z coordinates for each cell). |
|
Tags |
cellset, cellzone, functionobjects, toposetdict, toposetsource |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Moving Spatial Average in 3D | janGaertner | OpenFOAM Community Contributions | 1 | February 27, 2023 12:36 |
why is the pressure equation in OpenFoam the same for moving grids and for fixed grid | mAlletto | OpenFOAM | 0 | March 14, 2022 13:28 |
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology | wyldckat | OpenFOAM | 17 | November 10, 2017 16:54 |
Report of moving average | gravis | STAR-CCM+ | 2 | August 20, 2014 09:16 |
New OpenFOAM Forum Structure | jola | OpenFOAM | 2 | October 19, 2011 07:55 |