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

Moving average in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 2, 2023, 14:43
Exclamation Moving average in OpenFOAM
  #1
Member
 
Uttam
Join Date: May 2020
Location: Southampton, United Kingdom
Posts: 34
Rep Power: 6
openfoam_aero is on a distinguished road
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.
openfoam_aero is offline   Reply With Quote

Old   March 14, 2023, 05:26
Default
  #2
Senior Member
 
Josh Williams
Join Date: Feb 2021
Location: Scotland
Posts: 113
Rep Power: 5
joshwilliams is on a distinguished road
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).
joshwilliams is offline   Reply With Quote

Reply

Tags
cellset, cellzone, functionobjects, toposetdict, toposetsource


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Other] Moving Spatial Average in 3D janGaertner OpenFOAM Community Contributions 1 February 27, 2023 11:36
why is the pressure equation in OpenFoam the same for moving grids and for fixed grid mAlletto OpenFOAM 0 March 14, 2022 12:28
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 15:54
Report of moving average gravis STAR-CCM+ 2 August 20, 2014 08:16
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 06:55


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