CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   the punctuation token ')' error! (https://www.cfd-online.com/Forums/openfoam-solving/120092-punctuation-token-error.html)

immortality June 30, 2013 12:25

the punctuation token ')' error!
 
I changed my variables in groovyBC as this
Code:

"p_3=p0_3/pow(1+(gamma3-1)/2*magSqr(U)/(gamma3*R*T),(gamma3/(gamma3-1)));"
//"p_2_last=800000;"
//"p_2_first=1600000;"
"p_2=810000;"//(p_2_last-p_2_first)/(c2r-c1r)*(t_mappedr-c1r)+p_2_first

why this error occurred?
Code:

Time = 0.000118


--> FOAM FATAL IO ERROR:
wrong token type - expected string, found on line 30168 the punctuation token ')'

file: /home/ehsan/Desktop/WR/0.000118/p.boundaryField.right.variables at line 30168.

    From function operator>>(Istream&, string&)
    in file primitives/strings/string/stringIO.C at line 56.

FOAM exiting


wyldckat June 30, 2013 18:02

When in doubt, simplify and/or isolate and conquer:
Code:

"p_3_part1=1+(gamma3-1)/2*magSqr(U)/(gamma3*R*T);"
"p_3_part2=(gamma3/(gamma3-1));"
"p_3=p0_3/pow(p_3_part1,p_3_part2);"
"p_2=810000;"

If this works and the other doesn't, then it's possibly a bug in the parser (the algorithm that interprets the expressions) that groovyBC uses.


All times are GMT -4. The time now is 19:59.