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

no match for ‘operator<’

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 10, 2021, 06:48
Default no match for ‘operator<’
  #1
QMW
New Member
 
Qi
Join Date: Feb 2021
Posts: 7
Rep Power: 5
QMW is on a distinguished road
Hi everyone
I am a beginner of openfoam.I want to add a if condition in the following form to my turbulence model code

volScalarField::Internal rek
(
this->rho_*sqrt(k_)*y_/this->nu()
);
if(rek > 10)
...

but when I compile it the following error is being produced
"no match for ‘operator<’ (operand types are ‘Foam::volScalarField {aka Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>}’ and ‘int’)"

I would appreciate if you help me
QMW is offline   Reply With Quote

Old   March 12, 2021, 15:21
Default
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,906
Rep Power: 33
hjasak will become famous soon enough
You are asking if a field is greater than 10: since the field has one value for each cell and each boundary face, this is how many results you get.

You seem to expect only one. Which? Is it max(field) > 10?

I think you’ve got your coding logic mixed up.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak 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
[ANSYS Meshing] Match Control, is this weird or am I stupid? Moufle ANSYS Meshing & Geometry 2 November 18, 2015 16:00
createPatch Segmentation Fault (CORE DUMPED) sam.ho OpenFOAM Pre-Processing 2 April 21, 2014 02:01
Match Control and Symmetry Boundary Condtions in a quasi 2D calculation peterputer ANSYS Meshing & Geometry 0 May 15, 2012 08:53
gmsh2ToFoam sarajags_89 OpenFOAM 0 November 24, 2009 22:50
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15


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