CFD Online URL
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

is this expression as bolean sentence wrong in groovyBC?

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

Like Tree1Likes
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Display Modes
Old   February 19, 2013, 16:19
Default is this expression as bolean sentence wrong in groovyBC?
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 16
immortality is on a distinguished road
is time_3 equivalent to 0 or 1 in such a expression correct?
Code:
"time_3=(t1<time()&&time()<t1+c1)||(t2<time()&&time()<t2+c1)||(t3<time()&&time()<t3+c1)||(t4<time()&&time()<t4+c1)||(t5<time()&&time()<t5+c1)||(t6<time()&&time()<t6+c1)||(t7<time()&&time()<t7+c1)||(t8<time()&&time()<t8+c1)||(t9<time()&&time()<t9+c1)||(t10<time()&&time()<t10+c1)||(t11<time()&&time()<t11+c1);"
but this error is shown:
Code:
--> FOAM FATAL ERROR:
Parser Error at "1.764-769" :"field time_3 not existing or of wrong type"
"((0<=time()&&time()<=t1)||(t1+c1<=time()&&time()<=t1+c2)||(t1+c3<=time()&&time()<=t1+c4)||(t2+c1<=time()&&time()<=t2+c2)||(t2+c3<=time()&&time()<=t2+c4)||(t3+c1<=time()&&time()<=t3+c2)||(t3+c3<=time()&&time()<=t3+c4)||(t4+c1<=time()&&time()<=t4+c2)||(t4+c3<=time()&&time()<=t4+c4)||(t5+c1<=time()&&time()<=t5+c2)||(t5+c3<=time()&&time()<=t5+c4)||(t6+c1<=time()&&time()<=t6+c2)||(t6+c3<=time()&&time()<=t6+c4)||(t7+c1<=time()&&time()<=t7+c2)||(t7+c3<=time()&&time()<=t7+c4)||(t8+c1<=time()&&time()<=t8+c2)||(t8+c3<=time()&&time()<=t8+c4)||(t9+c1<=time()&&time()<=t9+c2)||(t9+c3<=time()&&time()<=t9+c4)||(t10+c1<=time()&&time()<=t10+c2)||(t10+c3<=time()&&time()<=t10+c4)||(t11+c1<=time()&&time()<=t11+c2)||(t11+c3<=time()&&time()<=t11+c4))?vector(0,-v_r,0):(M>=1?((time_3=1)?V3:V1):V_in)"
"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ^^^^^^               "

From function parsingValue
in file lnInclude/CommonValueExpressionDriverI.H at line 802.

Last edited by immortality; February 19, 2013 at 17:43.
immortality is offline   Reply With Quote

Old   February 19, 2013, 17:22
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,553
Rep Power: 23
ngj will become famous soon enoughngj will become famous soon enough
Look at where the ^^^^^^^^^ points in the error message.

You need two "=", i.e. "==" to test for equality.

/ Niels
ngj is offline   Reply With Quote

Old   February 19, 2013, 17:45
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 16
immortality is on a distinguished road
i want the time_3 become the result of conditions as a bolean value 0 or 1
immortality is offline   Reply With Quote

Old   February 20, 2013, 04:38
Wink
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 16
immortality is on a distinguished road
any comment from dear Bernard?
immortality is offline   Reply With Quote

Old   February 26, 2013, 19:08
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 16
immortality is on a distinguished road
i have not succeed yet.any idea?
immortality is offline   Reply With Quote

Old   March 8, 2013, 05:21
Default
  #6
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,173
Rep Power: 16
immortality is on a distinguished road
i don't give it up at all.
It'll be nice to have some help on it.
immortality is offline   Reply With Quote

Old   March 8, 2013, 06:24
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,889
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
i don't give it up at all.
It'll be nice to have some help on it.
Booleans can only be "true" or "false". Anyway. Instead of "time_3==true" (which I'm not sure whether it is implemented) you can just write "time_3" (which should work)
immortality likes this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider 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
"field U not existing or of wrong type" groovyBC error. immortality OpenFOAM Running, Solving & CFD 1 February 4, 2013 16:08
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 19:44
CGNS lib and Fortran compiler manaliac Main CFD Forum 2 November 29, 2010 07:25
udf error srihari FLUENT 0 February 9, 2009 10:00
Lift, Drag Vs time chart,calculations Jamesd69climber CFX 8 February 17, 2005 18:23


All times are GMT -4. The time now is 10:40.