|
[Sponsors] |
December 18, 2012, 12:20 |
a groovyBC error
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
why this error is shown?
thesis@thesis-X58A-UD7:~/Desktop/method_4$ rhoCentralFoam /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 2.1.0-0bc225064152 Exec : rhoCentralFoam Date : Dec 18 2012 Time : 19:22:27 Host : "thesis-X58A-UD7" PID : 3659 Case : /home/thesis/Desktop/method_4 nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Disallowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 Reading thermophysical properties Selecting thermodynamics package ePsiThermo<pureMixture<constTransport<specieThermo <hConstThermo<perfectGas>>>>> Reading field U Creating turbulence model Selecting turbulence model type RASModel Selecting RAS turbulence model kOmegaSST kOmegaSSTCoeffs { alphaK1 0.85034; alphaK2 1; alphaOmega1 0.5; alphaOmega2 0.85616; Prt 1; gamma1 0.5532; gamma2 0.4403; beta1 0.075; beta2 0.0828; betaStar 0.09; a1 0.31; c1 10; } Reading thermophysicalProperties fluxScheme: Kurganov Starting time loop Mean and max Courant Numbers = 1.70419 74.97 deltaT = 1.33387e-10 Time = 1.33387e-10 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 diagonal: Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0 diagonal: Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0 --> FOAM FATAL ERROR: Parser Error at "1.29-31" :"syntax error, unexpected TOKEN_points" "(0<=time() && time()<=(w_w1-pts().y)/v_r)||((w_w1+w_p1-pts().y)/v_r<=time() && time()<=(w_w1+w_p1+w_w2-pts().y)/v_r)||((w_w1+w_p1+w_w2+w_p2-pts().y)/v_r<=time() && time()<=(w_w1+w_p1+w_w2+w_p2+w_w3-w_cell)/v_r)?1:0" " ^^^ " From function parsingValue in file lnInclude/CommonValueExpressionDriverI.H at line 802. FOAM exiting |
|
December 18, 2012, 13:36 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Either you juggle with the toFace() to toPoint() functions (see Examples) or you use pos() instead of pts() (which I think is what you wanted to use in the first place)
__________________
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 |
||
December 19, 2012, 09:14 |
|
#3 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
thanks.I want to use fields on vertices.because I want the points on the patch gradually change from wall condition to environment(p0,T0).then I should use for example toPoint(U.x)? U should be internalField(U.x) for reading U from neighbour cells in grid.how should I merge these then?
thank you and best regards. I wrote as this: left { type groovyBC; variables ( //"pi=3.1415926535;" "ymax=max(pos().y);" "ymin=min(pos().y);" "r=0.06;" "rpm=3600;" "omega=rpm*pi/30;" "v_r=r*omega;" "w_cell=.003;" "w_w1=.003;" "w_p1=.06*11*pi/180;" "w_w2=.06*49*pi/180;" "w_p2=.06*30*pi/180;" "w_w3=.003;" "p0_1=250000;" "T0_1=288;" "p0_2=100000;" "T0_2=288;" "gamma=1.4;" "R=287.14;" ); fractionExpression "((0<=time() && time()<=(w_w1-pts().y)/v_r)||((w_w1+w_p1-pts().y)/v_r<=time() && time()<=(w_w1+w_p1+w_w2-pts().y)/v_r)||((w_w1+w_p1+w_w2+w_p2-pts().y)/v_r<=time() && time()<=(w_w1+w_p1+w_w2+w_p2+w_w3-w_cell)/v_r))?0:1"; valueExpression "((w_w1-pts().y)/v_r<time() && time()<(w_w1+w_p1-pts().y)/v_r)?(p0_1/pow((1+(gamma-1)/2*sqr(U.x)/(gamma*R*T0_1-(gamma-1)/2*sqr(U.x)),gamma/(gamma-1)))p0_2/pow((1+(gamma-1)/2*sqr(U.x)/(gamma*R*T0_2-(gamma-1)/2*sqr(U.x)),gamma/(gamma-1)))"; value uniform 100000; gradientExpression "0"; //type fixedValue; //value uniform 250000; } |
|
December 19, 2012, 09:34 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Draw yourself a sketch of a small sketch (5 faces or so are sufficient) and think what the difference in point and face positions mean for your expression
__________________
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 |
||
December 22, 2012, 11:47 |
|
#5 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
I changed all terms to pos() function.but this error appeared:
fluxScheme: Kurganov Starting time loop Mean and max Courant Numbers = 1.70419 4.02331 deltaT = 2.48509e-08 Time = 2.48509e-08 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 diagonal: Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0 diagonal: Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0 smoothSolver: Solving for Ux, Initial residual = 0.00115429, Final residual = 4.61702e-18, No Iterations 3 smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 8.05495e-17, No Iterations 3 diagonal: Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0 smoothSolver: Solving for e, Initial residual = 0.00265688, Final residual = 3.54541e-12, No Iterations 3 swak4Foam: Allocating new repository for sampledGlobalVariables --> FOAM FATAL ERROR: Parser Error at "1.33" :"syntax error, unexpected ')'" "1-(gamma-1)*sqr(internalField(U))/(2*gamma*R*T0_1)" " ^ " From function parsingValue in file lnInclude/CommonValueExpressionDriverI.H at line 802. FOAM exiting --------------------------------------------------------------------------------------- my BC is: --------------------------------------------------------------------------------------- left { type groovyBC; variables ( //"pi=3.1415926535;" "ymax=max(pos().y);" "ymin=min(pos().y);" "r=0.06;" "rpm=3600;" "omega=rpm*pi/30;" "v_r=r*omega;" "w_cell=.003;" "w_w1=.003;" "w_p1=.06*11*pi/180;" "w_w2=.06*49*pi/180;" "w_p2=.06*30*pi/180;" "w_w3=.003;" "p0_1=250000;" "T0_1=288;" "p0_2=100000;" "T0_2=288;" "gamma=1.4;" "R=287.14;" "par1=1-(gamma-1)*sqr(internalField(U))/(2*gamma*R*T0_1);" "par2=1-(gamma-1)*sqr(internalField(U))/(2*gamma*R*T0_2);" ); fractionExpression "(0<=time()&&time()<=(.003-pos().y)/22)||((.003+.01151917-pos().y)/22<=time()&&time()<=(.003+.01151917+.05131268-pos().y)/22)||((.003+.01151917+.05131268+.031415927-pos().y)/22<=time()&&time()<=(.003+.01151917+.05131268+.031 415927+.003-.003)/22)?0:1"; valueExpression "((w_w1-pos().y)/v_r<time() && time()<(w_w1+w_p1-pos().y)/v_r)? p0_1*pow(part1,3.5) : p0_2*pow(par2,3.5)"; value uniform 1000000; gradientExpression "0"; //type fixedValue; //value uniform 250000; //(p0_1/pow(1+(gamma-1)/2*sqr(internalField(U)/(gamma*R*T0_1-(gamma-1)/2*sqr(internalField(U),3.5)) //(w_w1-pos().y)/22<time() && time()<(w_w1+w_p1-pos().y)/22)? //p0_1*pow(1-(gamma-1)*sqr(internalField(U))/(2*gamma*R*T0_1),gamma/(gamma-1)) //2*gamma*R*T0_1 } walls { type zeroGradient; } empty { type empty; } Last edited by immortality; December 22, 2012 at 13:11. |
|
December 22, 2012, 20:01 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Using the CODE-tag for terminal output improves the usefulness tremendously (although in my example the '^' is still not at the right place): Code:
--> FOAM FATAL ERROR: Parser Error at "1.33" :"syntax error, unexpected ')'" "1-(gamma-1)*sqr(internalField(U))/(2*gamma*R*T0_1)" " ^ "
__________________
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 |
||
December 23, 2012, 10:27 |
|
#7 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
I refined it in this manner:
Code:
left { type groovyBC; variables ( //"pi=3.1415926535;" "ymax=max(pos().y);" "ymin=min(pos().y);" "r=0.06;" "rpm=3600;" "omega=rpm*pi/30;" "v_r=r*omega;" "w_cell=.003;" "w_w1=.003;" "w_p1=.06*11*pi/180;" "w_w2=.06*49*pi/180;" "w_p2=.06*30*pi/180;" "w_w3=.003;" "p0_1=2500000;" "T0_1=288;" "p0_2=1000000;" "T0_2=288;" "gamma=1.4;" "R=287.14;" ); fractionExpression "(0<=time() && time()<=(w_w1-pos().y)/v_r)||((w_w1+w_p1-pos().y)/v_r<=time() && time()<=(w_w1+w_p1+w_w2-pos().y)/v_r)||((w_w1+w_p1+w_w2+w_p2-pos().y)/v_r<=time() && time()<=(w_w1+w_p1+w_w2+w_p2+w_w3-w_cell)/v_r)?0:1"; valueExpression "(w_w1-pos().y)/v_r<time() && time()<(w_w1+w_p1-pos().y)/v_r) ? T0_1-(gamma-1)/(2*gamma*R)*magSqr(internalField(U.x)):T0_2-(gamma-1)/(2*gamma*R)*magSqr(internalField(U.x))"; value uniform 288; gradientExpression "0"; } Code:
Starting time loop Mean and max Courant Numbers = 1.70419 4.02331 deltaT = 2.48546e-09 Time = 2.48546e-09 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 diagonal: Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0 diagonal: Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0 smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 5.94738e-17, No Iterations 3 smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 1.2546e-16, No Iterations 3 diagonal: Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0 --> FOAM FATAL ERROR: Parser Error at "1.60" :"syntax error, unexpected ')', expecting $end" "(w_w1-pos().y)/v_r<time() && time()<(w_w1+w_p1-pos().y)/v_r) ? T0_1-(gamma-1)/(2*gamma*R)*magSqr(internalField(U.x)):T0_2-(gamma-1)/(2*gamma*R)*magSqr(internalField(U.x))" " ^ " From function parsingValue in file lnInclude/CommonValueExpressionDriverI.H at line 802. FOAM exiting |
|
December 23, 2012, 12:02 |
|
#8 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Have you ever considered to think for 5 minutes about what the error message means and whether it could be your input that caused it? I think that would be faster than copy/pasting it to the message board and waiting for someone else to do the thinking you should have done. Especially if people stop answering
__________________
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 Last edited by gschaider; December 23, 2012 at 12:03. Reason: Deleted opening of quote |
||
December 23, 2012, 13:21 |
|
#9 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
thanks.sorry also I grasped it after sending.good people never refuse to help even if the question is silly.
thanks for your help. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries | NickG | OpenFOAM Installation | 3 | December 30, 2019 01:21 |
[blockMesh] blockMesh with double grading. | spwater | OpenFOAM Meshing & Mesh Conversion | 92 | January 12, 2019 10:00 |
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh | gschaider | OpenFOAM Community Contributions | 300 | October 29, 2014 19:00 |
OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 10:17 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |