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

How to determine a boundary type in the code?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 12, 2013, 23:27
Default How to determine a boundary type in the code?
  #1
Member
 
Charlie
Join Date: Dec 2010
Location: 415 Kinross Dr. Newark, DE 19711
Posts: 78
Rep Power: 6
cheng1988sjtu is on a distinguished road
Hi Foamers,

I have a general question about how to determine a boundary type in the code, for example, in twoPhseEulerFoam (OF2.1.0), the pEqn.H has the following code to determine whether the boundary patch is zeroGradient or not:

forAll(p.boundaryField(),patchi)
{
if (isA<zeroGradientFvPatchScalarField>(p.boundaryFie ld()[patchi]))
{
phiDraga.boundaryField()[patchi] = 0.0;
phiDraga.boundaryField()[patchi] = 0.0;
}
}

So, my question is, what if I want to determine whether the boundary field of p is symmetryPlane or not?

I tried the following, and it turns out that it does not work, any hint??
forAll(p.boundaryField(),patchi)
{
if (isA<symmetryPlaneFvPatchScalarField>(p.boundaryFi eld()[patchi]))
{
phiDraga.boundaryField()[patchi] = 0.0;
phiDraga.boundaryField()[patchi] = 0.0;
}
}

Thanks!!!
cheng1988sjtu is offline   Reply With Quote

Old   June 12, 2013, 23:39
Default Further Info
  #2
Member
 
Charlie
Join Date: Dec 2010
Location: 415 Kinross Dr. Newark, DE 19711
Posts: 78
Rep Power: 6
cheng1988sjtu is on a distinguished road
forAll(p.boundaryField(),patchi)
{
if (isA<symmetryFvPatchScalarField>(p.boundaryField()[patchi]))
{
phiDraga.boundaryField()[patchi] = 0.0;
phiDragb.boundaryField()[patchi] = 0.0;
}
}

and get the following error message when I tried to compile the code:

error: 'symmetryFvPatchScalarField' was not declared in this scope
error: no matching function for call to 'isA(Foam::fvPatchField<double>&)'

any help?? Thanks!

Charlie
cheng1988sjtu is offline   Reply With Quote

Old   June 13, 2013, 12:20
Default
  #3
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 727
Rep Power: 18
mturcios777 will become famous soon enough
In the basic folder of fvPatchFields in $FOAM_SRC, there is a folder for the basic type basicSymmetry. I think the type you want to test for is basicSymmetryFvPatchScalarField (you'll probably have to do a much more thorough check than I did).
mturcios777 is offline   Reply With Quote

Old   June 13, 2013, 12:36
Default Thanks!
  #4
Member
 
Charlie
Join Date: Dec 2010
Location: 415 Kinross Dr. Newark, DE 19711
Posts: 78
Rep Power: 6
cheng1988sjtu is on a distinguished road
Thanks, Marco,

Thank you for you suggestions, the problem is now solved, I need to include "symmetryFvPatchFields.H" in my main files, that's why the error message said,

error: 'symmetryFvPatchScalarField' was not declared in this scope.

Thanks!

Charlie
cheng1988sjtu is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LES supersonic free jet martyn88 OpenFOAM 22 April 17, 2015 06:00
interFoam/kOmegaSST tank filling with printStackError/Mules simpomann OpenFOAM Running, Solving & CFD 3 February 17, 2014 18:06
CFX does not continue Shafiul CFX 10 February 17, 2011 08:57
pipe flow with heat transfer Fabian OpenFOAM 2 December 12, 2009 05:53
Concentric tube heat exchanger (Air-Water) Young CFX 5 October 6, 2008 23:17


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