|
[Sponsors] |
July 26, 2021, 17:23 |
fieldFunctionObject all region
|
#1 |
Member
Horst van Gras
Join Date: Oct 2018
Posts: 45
Rep Power: 8 |
Hi,
i have a multi region simulation and working on some postprocess routines. However I have to specify each time the region to get the value. However, I would like to have the functions looping over all regions. Code:
functions { CellVolumeSteel { // Mandatory entries (unmodifiable) type writeCellVolumes; libs (fieldFunctionObjects); // Optional (inherited) entries region steel; enabled true; log true; executeControl writeTime; writeControl writeTime; } |
|
July 27, 2021, 04:34 |
|
#2 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Hi,
There is a new multiregion function object allowing to do this in the latest ESI-OpenCFD release (OpenFOAM-v2106) : https://www.openfoam.com/news/main-n...ng#multiregion AFAIK, there is nothing similar in the older versions nor in the foundation branch, but I would be happy to know if somebody else has a solution for this. As a workaround to save you a little bit of time, you can do something like this in order to avoid duplicating the function definition: Code:
functions { CellVolumeSteel { // Mandatory entries (unmodifiable) type writeCellVolumes; libs (fieldFunctionObjects); // Optional (inherited) entries region steel; enabled true; log true; executeControl writeTime; writeControl writeTime; } CellVolumeRegion2 { $CellVolumeSteel region region2; } ... } Another way around would be to write a script yourself to loop over all the regions and automatically generate the proper code. It could be worth spending to write such a script if you have a lot of regions in your case. Cheers, Yann |
|
July 28, 2021, 11:30 |
|
#3 |
Member
Horst van Gras
Join Date: Oct 2018
Posts: 45
Rep Power: 8 |
Hi,
thanks for this. It works like a charm with ESI Toolbox version2012. I have 3 regions. Therefore I don't think that I will code a loop This new function is indeed quite useful. But I will have to adapt my custom solver to it. |
|
Tags |
fieldfunctionobjects, multiregion, postprocess |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error when solving p_rgh | bob94 | OpenFOAM | 0 | March 17, 2020 09:12 |
Problem simulating the temperature rise in a composite material (chtMultiRegionFoam) | Adam_K | OpenFOAM Running, Solving & CFD | 2 | March 27, 2019 07:51 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
[Other] StarToFoam error | Kart | OpenFOAM Meshing & Mesh Conversion | 1 | February 4, 2010 05:38 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 09:19 |