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

operators in openfoam

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

Like Tree1Likes
  • 1 Post By fumiya

Reply
 
LinkBack Thread Tools Display Modes
Old   August 12, 2013, 17:20
Question operators in openfoam
  #1
Senior Member
 
Join Date: Jan 2013
Posts: 197
Rep Power: 4
openfoammaofnepo is on a distinguished road
Hi All,

When I add the following lines in fireFoam.C:

if(x > length)
{
........
}

I failed to compiled it successfully. The error message is:

mo match for 'operator>' in x > length

If I indeed would like this condition in if statements, how can modify the source file fireFoam.C? Can anybody help me ? My C++ skill is a little low.

Thank you in advance!
openfoammaofnepo is offline   Reply With Quote

Old   August 12, 2013, 21:14
Default
  #2
Senior Member
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 169
Rep Power: 7
fumiya is on a distinguished road
Hi,

If you want to find the cells whose x-coordinates are greater than the value "length", you can use the following:

Code:
forAll(mesh.cells(), cellI) //Loop over the cells
{
if(mesh.C()[cellI].x() > length) //Compare the x-coordinate of the cellI's center with the scalar length { ...... }
}
Hope this helps,
Fumiya
immortality likes this.
fumiya 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
Problem installing OpenFOAM 1.5 installation on RHEL 4. vwsj84 OpenFOAM Installation 4 April 23, 2009 04:48
2009 OpenFOAM Summer School in Zagreb, Croatia hjasak OpenFOAM Announcements from Other Sources 0 March 27, 2009 13:08
Summer School on Numerical Modelling and OpenFOAM hjasak OpenFOAM 5 October 12, 2008 13:14
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07
OpenFOAM Training and Workshop Zagreb 2628Jan2006 hjasak OpenFOAM 1 February 2, 2006 22:07


All times are GMT -4. The time now is 00:12.