|
[Sponsors] |
August 3, 2017, 11:46 |
Reading the patch labels
|
#1 |
Member
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9 |
Hello,
I need patch ID for some calculations in the kEpsilon.C . I found on forum that patch can be accessed like: Code:
label patchID = patch.boundaryMesh.lookupPatchID("patchName") 1. when I am compiling the EXE for this, the patchName does not exist as such since I have not run any solver such as simpleFoam or pisoFoam, or kEpsilon file does not have the mesh details. So, how will it get the patchID given the patchName. 2. I get an error: 'patch' was not declared in this scope 3. How can I read patchID as I read other constants such as Cmu_, sigmaK_ etc from coeffDict? I tried: Code:
kEpsilon::kEpsilon(..,...,..):RASModel(....), inletID ( dimensioned<label>::lookupOrAddToDict ( "inletID", 1 ) ) So, how should I get the labelID for the patch names I have described in blockMeshDict? |
|
August 3, 2017, 15:14 |
|
#2 |
Member
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14 |
Hi Vedamt,
Code:
string patchName = mesh.boundaryMesh()[patchI].name(); |
|
August 3, 2017, 15:29 |
|
#3 |
Member
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9 |
No. I my idea is to get the patchID from the patchName.
But i don't have patchName available in the RASModel.C or kEpsilon.C So, I want to get that information from the user. |
|
August 3, 2017, 15:37 |
|
#4 |
Member
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14 |
I see what you say. Do have a look at this,
Code:
forAll(mesh.boundaryMesh(), patchI) { string patchNameNeeded = "patchNameInBlockMesh"; string patchName = mesh.boundaryMesh()[patchI].name(); if (patchName.find(patchNameNeeded) != std::string::npos) // checks if "patchNameInBlockMesh" is in the current patchName { // } } |
|
August 3, 2017, 15:59 |
|
#5 |
Member
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9 |
Thank you Sugajen, this explains well what I needed.
I will post in couple of days when I am able to run the case using this implementation. |
|
Tags |
kepsilon, label, lookup error, mesh, patch |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] Problems with ANSYS mesh conversion | tdog | OpenFOAM Meshing & Mesh Conversion | 1 | March 31, 2016 18:36 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
[Other] How to create an MRF zone ? | aminem | OpenFOAM Meshing & Mesh Conversion | 2 | December 8, 2014 11:45 |
[GAMBIT] periodic faces not matching | Aadhavan | ANSYS Meshing & Geometry | 6 | August 31, 2013 12:25 |
[Commercial meshers] FluentMeshToFoam | CRT | OpenFOAM Meshing & Mesh Conversion | 3 | May 24, 2012 17:07 |