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

How to get the face numbers of a boundary?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2009, 04:19
Default How to get the face numbers of a boundary?
  #1
New Member
 
Shui Pei
Join Date: Mar 2009
Posts: 27
Rep Power: 17
spwater is on a distinguished road
I knew I can check the polyMesh directory, however now I am tyring to modify boundary in the solver, and it will deal with different meshes, so which function should I use?
By the way, is their any documents to introduce some common function used in Openfoam, I really don't want to trouble someone...

With regards.

Pei
spwater is offline   Reply With Quote

Old   March 24, 2009, 02:01
Wink face number for boundary mesh
  #2
Member
 
Su Xiaohui
Join Date: Mar 2009
Location: Singapore
Posts: 30
Rep Power: 17
sxhdhi is on a distinguished road
Send a message via Skype™ to sxhdhi
Hi,

try to go through the below code maybe you can learn something for your question.

label patchInletWaterID = mesh.boundaryMesh().findPatchID("outletWater");
const polyPatch& cInletWaterPatch = mesh.boundaryMesh()[patchInletWaterID];
vectorField inletWaterFaceCentres(mesh.C().boundaryField()[patchInletWaterID]);
scalarField inletWaterY(inletWaterFaceCentres.component(vector ::Y));
scalarField inletWaterX(inletWaterFaceCentres.component(vector ::X));

forAll(cInletWaterPatch, faceI)
{
scalar YWaterpos(inletWaterY[faceI]);
scalar XWaterpos(inletWaterX[faceI]);
vector faceWaterU(vector::zero);

if (YWaterpos<=0.2)
{
faceWaterU.x()=0.1;
// U.boundaryField()[patchInletWaterID][faceI] = faceWaterU;
// pd.boundaryField()[patchInletWaterID][faceI] = rho.boundaryField()[patchInletWaterID][faceI] *-gh.boundaryField()[patchInletWaterID][faceI];
pd.boundaryField()[patchInletWaterID][faceI] = 0.5*rho.boundaryField()[patchInletWaterID][faceI]*faceWaterU.x()*faceWaterU.x();
// p.boundaryField()[patchInletWaterID][faceI] = 2*pd.boundaryField()[patchInletWaterID][faceI];
cout<< "I am here to change pd value x,y"<<XWaterpos<<"\t"<<YWaterpos<<"\n";
cout<< "gh:="<<gh.boundaryField()[patchInletWaterID][faceI]<<"\n";
cout<< "gamma:="<< gamma.boundaryField()[patchInletWaterID][faceI]<<"\n";
cout<< "rho:="<< rho.boundaryField()[patchInletWaterID][faceI]<<"\n";
cout<<"pd="<<pd.boundaryField()[patchInletWaterID][faceI]<<" P="<<p.boundaryField()[patchInletWaterID][faceI]<<"\n";
}

}
sxhdhi 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
[Commercial meshers] Face ordering problem for nonrectangular cyclic boundary conditions cfdmarkus OpenFOAM Meshing & Mesh Conversion 3 August 17, 2011 16:07
[Commercial meshers] Internal boundary problem stefanke OpenFOAM Meshing & Mesh Conversion 2 May 24, 2011 03:21
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 15:11
Boundary condition vector field gradient from two sides of patch face quba OpenFOAM 0 December 12, 2007 06:26
Gambit: face mesh starts at edge, not boundary lr Chris Bailey FLUENT 0 December 5, 2005 14:50


All times are GMT -4. The time now is 21:23.