|
[Sponsors] |
[swak4Foam] is this expression as bolean sentence wrong in groovyBC? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 19, 2013, 16:19 |
is this expression as bolean sentence wrong in groovyBC?
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
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);" 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. |
|
February 19, 2013, 17:22 |
|
#2 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Look at where the ^^^^^^^^^ points in the error message.
You need two "=", i.e. "==" to test for equality. / Niels |
|
February 19, 2013, 17:45 |
|
#3 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
i want the time_3 become the result of conditions as a bolean value 0 or 1
|
|
February 20, 2013, 04:38 |
|
#4 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
any comment from dear Bernard?
|
|
February 26, 2013, 19:08 |
|
#5 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
i have not succeed yet.any idea?
|
|
March 8, 2013, 05:21 |
|
#6 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
i don't give it up at all.
It'll be nice to have some help on it. |
|
March 8, 2013, 06:24 |
|
#7 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
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)
__________________
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 |
|
|
|
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 |