|
[Sponsors] |
![]() |
![]() |
#1 |
Member
Horst van Gras
Join Date: Oct 2018
Posts: 46
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; } |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,301
Rep Power: 30 ![]() ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Member
Horst van Gras
Join Date: Oct 2018
Posts: 46
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error when solving p_rgh | bob94 | OpenFOAM | 0 | March 17, 2020 08:12 |
Problem simulating the temperature rise in a composite material (chtMultiRegionFoam) | Adam_K | OpenFOAM Running, Solving & CFD | 2 | March 27, 2019 06:51 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 18:57 |
[Other] StarToFoam error | Kart | OpenFOAM Meshing & Mesh Conversion | 1 | February 4, 2010 04:38 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 08:19 |