# problem with groovyBC

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

 December 4, 2012, 10:17 problem with groovyBC #1 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,186 Rep Power: 16 when I use groovyBC in my run this error is shown.but simple boundary conditions have no error. error: --------------------------------------------------------------------------------------- fluxScheme: Kurganov Starting time loop Mean and max Courant Numbers = 1.06808 2.25305 deltaT = 1.72414e-07 Time = 1.72414e-07 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 swak4Foam: Allocating new repository for sampledGlobalVariables smoothSolver: Solving for Ux, Initial residual = 0.0172088, Final residual = 2.44657e-17, No Iterations 3 smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 3.09454e-15, No Iterations 3 diagonal: Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0 word::stripInvalid() called for word r For debug level (= 2) > 1 this is considered fatal Aborted --------------------------------------------------------------------------------------- my U condition is: --------------------------------------------------------------------------------------- dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { right { type fixedValue; value uniform (0 0 0); } left { type groovyBC; variables "PI=3.1415926535;y_max=max(pts().y);y_min=min(pts( ).y);r=0.06;rpm=3600;omegav=rpm*PI/30;vel_r=r*omegav;tetha_1=11*PI/180;tetha_2=60*PI/180;tetha_3=90*PI/180;time_1=tetha_1/omegav;time_2=tetha_2/omegav;time_3=tetha_3/omegav;pr_01=250000;Tr_01=288;pr_02=100000;Tr_02=2 88;gamma=1.4;R_g=287.14;H_t=gamma*R_g*internalFiel d(T)/(gamma-1)+0.5*pow(mag(internalField(U)),2);R_minus=mag(in ternalField(U))-(2/(gamma-1))*sqrt(gamma*R_g*internalField(T));c_b=(-2*R_minus+sqrt(4*pow(R_minus,2)-4*(1+2/(gamma-1))*((gamma-1)/2)*(pow(R_minus,2)-2*H_t)))/(2+4/(gamma-1));U_b=2*c_b/(gamma-1)+R_minus;time_final=0.005;"; valueFraction "((y_max-pos().y)/vel_r+time_2<=time()&&time()<=time_3)?0:1"; valueExpression "(0<=time()&&time()<=((y_max-pos().y)/vel_r))||(time_1<=time()&&time()<=time_2)||(time_2 <=time()&&time()<=((y_max-pos().y)/vel_r+time_2))||(time_3<=time()&&time()<=time_fina l) ? vector(0,-vel_r,0):vector(U_b,0,0)"; gradientExpression "vector(0,0,0)"; value uniform (0 0 0); //type fixedValue; //value uniform (2 0 0); //type zeroGradient; } //M1=sqrt(((pow((pr_01/p_prime),.2857142857))-1)*(2/(gamma-1))) walls { type fixedValue; value uniform (0 0 0); } empty { type empty; } } --------------------------------------------------------------------------------------- my p is this: --------------------------------------------------------------------------------------- dimensions [1 -1 -2 0 0 0 0]; internalField uniform 1000; boundaryField { right { type zeroGradient; } left { type groovyBC; variables "PI=3.1415926535;y_max=max(pts().y);y_min=min(pts( ).y);r=0.06;rpm=3600;omegav=rpm*PI/30;vel_r=r*omegav;tetha_1=11*PI/180;tetha_2=60*PI/180;tetha_3=90*PI/180;time_1=tetha_1/omegav;time_2=tetha_2/omegav;time_3=tetha_3/omegav;pr_01=250000;Tr_01=288;pr_02=100000;Tr_02=2 88;gamma=1.4;R_g=287.14;H_t=gamma*R_g*internalFiel d(T)/(gamma-1)+0.5*pow(mag(internalField(U)),2);R_minus=mag(in ternalField(U))-(2/(gamma-1))*sqrt(gamma*R_g*internalField(T));c_b=(-2*R_minus+sqrt(4*pow(R_minus,2)-4*(1+2/(gamma-1))*((gamma-1)/2)*(pow(R_minus,2)-2*H_t)))/(2+4/(gamma-1));U_b=2*c_b/(gamma-1)+R_minus;time_final=0.005;"; valueFraction "((0<=time()&&time()<=((y_max-pos().y)/vel_r))||(time_1<=time()&&time()<=time_2)||(time_2 <=time()&&time()<=((y_max-pos().y)/vel_r+time_2))||(time_3<=time()&&time()<=time_fina l)?0:1"; valueExpression "(time()

December 4, 2012, 11:35
#2
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
Quote:
 Originally Posted by immortality when I use groovyBC in my run this error is shown.but simple boundary conditions have no error. error: --------------------------------------------------------------------------------------- fluxScheme: Kurganov Starting time loop Mean and max Courant Numbers = 1.06808 2.25305 deltaT = 1.72414e-07 Time = 1.72414e-07 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 swak4Foam: Allocating new repository for sampledGlobalVariables smoothSolver: Solving for Ux, Initial residual = 0.0172088, Final residual = 2.44657e-17, No Iterations 3 smoothSolver: Solving for Uy, Initial residual = 1, Final residual = 3.09454e-15, No Iterations 3 diagonal: Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0 word::stripInvalid() called for word r For debug level (= 2) > 1 this is considered fatal Aborted ---------------------------------------------------------------------------------------
Which version of groovy/swak4Foam do you use? I guess it is an old one (this problem should be fixed in the current release): the problem is that the old version was sensitive to spaces on the left hand side of = (in the current version these get stripped away. Spaces on the right are always ignored). My guess is that you have a space somewhere at the "r=someExpression;" but it is hard to see the way you formatted the output (use the CODE-tag above).

BTW: do yourself a favour and use the list-form for variables (it is much easier to read than the single string:
Code:
```variables (
"var1=pos();"
"var2=mag(var1);"
);```
__________________
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 4, 2012, 17:44 #3 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,186 Rep Power: 16 is it possible to write formulas in more than one line in valueExpression etc too?

December 4, 2012, 19:21
#4
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
Quote:
 Originally Posted by immortality is it possible to write formulas in more than one line in valueExpression etc too?
No. Reason is that OF doesn't support multiline string variables in files (at least to my knowledge).
__________________
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

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Thom OpenFOAM Running, Solving & CFD 5 October 26, 2012 05:16 Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43 Se-Hee CFX 2 June 10, 2007 06:29 ParodDav CFX 5 April 29, 2007 19:13 Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52

All times are GMT -4. The time now is 04:47.