CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

problem with groovyBC

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 4, 2012, 10:17
Default problem with groovyBC
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
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()<time_1) ? pr_01*(1+(gamma-1)/2*(U_b/c_b)^2)^(gamma/(gamma-1))r_02*(1+(gamma-1)/2*((sqr(mag(internalField(U))))/(gamma*R_g*internalField(T))))^(-gamma/(gamma-1))";

gradientExpression "0";
value uniform 100000;
//type fixedValue;
//value uniform 250000;
}

walls
{
type zeroGradient;

}

empty
{
type empty;

}
}
---------------------------------------------------------------------------------------

and the T boundary condition is:
---------------------------------------------------------------------------------------
dimensions [0 0 0 1 0 0 0];

internalField uniform 288;

boundaryField
{
right
{
type zeroGradient;
}

left
{
type groovyBC;
variables "PI=3.1415926535;y_max=max(pos().y);y_min=min(pos( ).y); r=.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;t_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( internalField(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;";



valueFraction "(y_max-y)/vel_r<time()&&time()<time_1)?1:0";

valueExpression "Tr_01/(1+(gamma-1)/2*(U_b/c_b)^2)";

gradientExpression "0";
value uniform 288;
immortality is offline   Reply With Quote

Old   December 4, 2012, 11:35
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
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
gschaider is offline   Reply With Quote

Old   December 4, 2012, 17:44
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
is it possible to write formulas in more than one line in valueExpression etc too?
immortality is offline   Reply With Quote

Old   December 4, 2012, 19:21
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
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
gschaider is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
epsilon groovyBC problem Thom OpenFOAM Running, Solving & CFD 5 October 26, 2012 05:16
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


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