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

How to access 'patchTypes'?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 19, 2014, 17:35
Default How to access 'patchTypes'?
  #1
New Member
 
Join Date: Jan 2013
Posts: 7
Rep Power: 13
fa123 is on a distinguished road
Hi everybody,

can anybody give me a hint about how one can get access to the type of the patches,
similar to
Code:
const labelList& patch1 = mesh.boundary()["inlet"].faceCells();
Here, I want just see the type of the patches instead, like "patch, wall, empty ...".

Thanx in advance.
fa123 is offline   Reply With Quote

Old   February 20, 2014, 00:54
Default Access Patches
  #2
Senior Member
 
Mohammad Shakil Ahmmed
Join Date: Oct 2012
Location: AUS
Posts: 137
Rep Power: 14
ahmmedshakil is on a distinguished road
Just for a example:

Code:
  DynamicList<label> fluidCoupledTemperaturePatchIDs(Tf.boundaryField().size());
	DynamicList<label> fluidCoupledHeatFluxPatchIDs(Tf.boundaryField().size());
	forAll(Tf.boundaryField(), patchI) 
	{
		if(Tf.boundaryField()[patchI].type() == "regionCoupleTemperature")
		{
			fluidCoupledTemperaturePatchIDs.append(patchI);
		}
		else if(Tf.boundaryField()[patchI].type() == "regionCoupleHeatFlux")
		{
			fluidCoupledHeatFluxPatchIDs.append(patchI);
		}
	}

Quote:
Originally Posted by fa123 View Post
Hi everybody,

can anybody give me a hint about how one can get access to the type of the patches,
similar to
Code:
const labelList& patch1 = mesh.boundary()["inlet"].faceCells();
Here, I want just see the type of the patches instead, like "patch, wall, empty ...".

Thanx in advance.
ahmmedshakil is offline   Reply With Quote

Old   February 20, 2014, 04:28
Default
  #3
New Member
 
Join Date: Jan 2013
Posts: 7
Rep Power: 13
fa123 is on a distinguished road
Thank you for the answer.

But i am looking for the base boundary type (patch, wall, empty, cyclic, symmetry ...).

I found the solution now.
Code:
      const polyBoundaryMesh& patches = mesh.boundaryMesh();

      forAll(patches, patchI)
      {
        const polyPatch& pp = patches[patchI];
       Info<< " type " << pp.type() << endl;
      }
fa123 is offline   Reply With Quote

Old   February 20, 2014, 19:49
Default
  #4
Member
 
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 13
ChrisA is on a distinguished road
Also might be helpful for you:

Code:
 	      	forAll(JTherm.boundaryField(),patchI)
 	      	{
 	      	 	if (isA<wallFvPatch>(mesh.boundary()[patchI]))
 	      	 	{
A snippet of a piece of code I used to set wall normal values manually to zero (since it couldn't be done through boundary conditions for the field in question and the model called for it)
ChrisA is offline   Reply With Quote

Reply


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
Getting access to mesh (fvMesh) via object registry Chris Lucas OpenFOAM Programming & Development 18 January 15, 2024 02:57
[DesignModeler] DesignModeler Scripting: How to get Full Command Access ANT ANSYS Meshing & Geometry 53 February 16, 2020 15:13
Online libraries - with access to Journals momentum_waves Main CFD Forum 2 December 12, 2007 10:08
Error: access: unbound variable,HELP sudhakar FLUENT 0 January 15, 2007 23:21
Access Density Allan Walsh FLUENT 3 October 4, 2005 07:55


All times are GMT -4. The time now is 14:56.