|
[Sponsors] |
February 5, 2013, 05:16 |
Access faces in multiregion case
|
#1 |
New Member
Join Date: Apr 2010
Location: Linz, Austria
Posts: 16
Rep Power: 15 |
Hi folks,
I want to access the faces of a certain patch in a certain region. I do some first tests with the code from the Thread http://www.cfd-online.com/Forums/ope...tml#post298405 Code:
// Find the patchID of the patch by name label patchID = mesh.boundaryMesh().findPatchID("movingWall"); // Create a polyPatch for looping const polyPatch& myPatch = mesh.boundaryMesh()[patchID]; // Initialize patchArea scalar patchArea = 0.0; // Loop trhough all faces on the polyPatch, adding their magnitude surface // area vectors forAll(myPatch, faceI) { patchArea += mesh.magSf().boundaryField()[patchID][faceI]; } How do I have to modify the mentioned code? Thanks for your support Michael |
|
February 7, 2013, 02:46 |
|
#2 |
New Member
Join Date: Apr 2010
Location: Linz, Austria
Posts: 16
Rep Power: 15 |
I figured out how to access the mesh of a region. Maybe the following information will help other foamers:
You just have to add these lines to the main program: Code:
timeSelector::addOptions(); # include "addRegionOption.H" Code:
# include "createMesh.H" Code:
# include "createNamedMesh.H" |
|
March 23, 2017, 11:48 |
|
#3 |
New Member
Join Date: Oct 2016
Posts: 20
Rep Power: 9 |
Hi! I'm having a similar problem...I need to access a temperature field in a patch from a different region.
When you said "you just have to add these lines to the main program", you meant chtMultiRegionFoam, right? Then, how did you excecute this in your code for creating a mesh in an specific region? Hope you see this post! Or if any one else knows anything related to this, I would be very grateful! |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] No layers in a small gap | bobburnquist | OpenFOAM Meshing & Mesh Conversion | 6 | August 26, 2015 09:38 |
Basic hints for runing a multiregion case | RuiVO | OpenFOAM Pre-Processing | 1 | February 2, 2012 09:44 |
udf to access variables from a different case | yashmash | Fluent UDF and Scheme Programming | 6 | January 25, 2012 09:10 |
multi region case - access field from another region | mabinty | OpenFOAM Programming & Development | 3 | September 6, 2011 10:25 |
Problem with decomposePar tool | vinz | OpenFOAM Pre-Processing | 18 | January 26, 2011 02:17 |