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

[swak4Foam] is this expression as bolean sentence wrong in groovyBC?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread 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,208
Rep Power: 27
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: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
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,208
Rep Power: 27
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,208
Rep Power: 27
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,208
Rep Power: 27
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,208
Rep Power: 27
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: 4,225
Rep Power: 51
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


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
udf error srihari FLUENT 1 October 31, 2016 15:18
[swak4Foam] Boundary condition with a non-uniform gradient - groovyBC? STiss OpenFOAM Community Contributions 3 October 11, 2013 03:04
expression for rotatin a disk hmasenger CFX 3 April 8, 2013 19:24
[swak4Foam] "field U not existing or of wrong type" groovyBC error. immortality OpenFOAM Community Contributions 1 February 4, 2013 16:08
[swak4Foam] Boundary Conditions with GroovyBC, Normal Gradient treima OpenFOAM Community Contributions 2 January 26, 2013 03:37


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