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

Reading the patch labels

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Sugajen

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 3, 2017, 11:46
Default Reading the patch labels
  #1
Member
 
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9
vcvedant is an unknown quantity at this point
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")
My questions are:
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
        )
    )
I get the error: no matching function for call to 'Foam::dimensioned<int>::lookupOrAddToDict(const char [8], int)'

So, how should I get the labelID for the patch names I have described in blockMeshDict?
vcvedant is offline   Reply With Quote

Old   August 3, 2017, 15:14
Default
  #2
Member
 
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14
Sugajen is on a distinguished road
Hi Vedamt,

Code:
string patchName = mesh.boundaryMesh()[patchI].name();
Is this what you're looking for?
Sugajen is offline   Reply With Quote

Old   August 3, 2017, 15:29
Default
  #3
Member
 
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9
vcvedant is an unknown quantity at this point
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.
vcvedant is offline   Reply With Quote

Old   August 3, 2017, 15:37
Default
  #4
Member
 
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14
Sugajen is on a distinguished road
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
	{
	//
	}
}
ruloz and dasa like this.
Sugajen is offline   Reply With Quote

Old   August 3, 2017, 15:59
Default
  #5
Member
 
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9
vcvedant is an unknown quantity at this point
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.
vcvedant is offline   Reply With Quote

Reply

Tags
kepsilon, label, lookup error, mesh, patch


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
[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


All times are GMT -4. The time now is 19:18.