CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] whats wrong with this groovyBC expression in parenthesis?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 30, 2013, 15:17
Default whats wrong with this groovyBC expression in parenthesis?
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
Code:
valueExpression "1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))";
Code:
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;
b1              1;
c1              10;
F3              false;
}

fluxScheme: Kurganov

Starting time loop

Mean and max Courant Numbers = 3.846733161 23.44685531
deltaT = 2.127659574e-09
Time = 2.12766e-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
[2] swak4Foam: Allocating new repository for sampledGlobalVariables
[3] swak4Foam: Allocating new repository for sampledGlobalVariables
[0] swak4Foam: Allocating new repository for sampledGlobalVariables
[1] swak4Foam: Allocating new repository for sampledGlobalVariables
smoothSolver:  Solving for Ux, Initial residual = 1, Final residual = 2.261632314e-10, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 1, Final residual = 1.356428384e-11, No Iterations 2
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for e, Initial residual = 0.003206774438, Final residual = 2.033790977e-08, No Iterations 50000
time step continuity errors : sum local = 5.358600541e-20, global = -5.358600541e-20, cumulative = -5.358600541e-20
smoothSolver:  Solving for omega, Initial residual = 0.009786991015, Final residual = 7.059726646e-08, No Iterations 4
[0] [1]
[1]
[1] --> FOAM FATAL ERROR:
[1] [2]
[3]
[3]
[3]  Parser Error for driver PatchValueExpressionDriver at "1.39" :"syntax error, unexpected ')'"
"1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
^
----------------------------------------|

Context of the error:


- From dictionary: /home/ehsan/Desktop/Central/nonUniformMesh/Turbulent_WR/main_test/processor1/0/k.boundaryField.left
Evaluating expression "1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
[1]
[1]
[1]     From function parsingValue
[1]     in file lnInclude/CommonValueExpressionDriverI.H at line 1039.
[1]
FOAM parallel run exiting
[1]
--> FOAM FATAL ERROR:
[3]  Parser Error for driver PatchValueExpressionDriver at "1.39" :"syntax error, unexpected ')'"
"1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
^
----------------------------------------|

Context of the error:


- From dictionary: /home/ehsan/Desktop/Central/nonUniformMesh/Turbulent_WR/main_test/processor3/0/k.boundaryField.left
Evaluating expression "1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
[3]
[3]
[3]     From function parsingValue
[3]     in file lnInclude/CommonValueExpressionDriverI.H at line 1039.
[3]
FOAM parallel run exiting
[3]
[2]
[2] --> FOAM FATAL ERROR:
[2]  Parser Error for driver PatchValueExpressionDriver at "1.39" :"syntax error, unexpected ')'"
"1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
^
----------------------------------------|

Context of the error:


- From dictionary: /home/ehsan/Desktop/Central/nonUniformMesh/Turbulent_WR/main_test/processor2/0/k.boundaryField.left
Evaluating expression "1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"

[0]
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 1 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
[0] --> FOAM FATAL ERROR:
[0]  Parser Error for driver PatchValueExpressionDriver at "1.39" :"syntax error, unexpected ')'"
"1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
^
----------------------------------------|

Context of the error:


- From dictionary: /home/ehsan/Desktop/Central/nonUniformMesh/Turbulent_WR/main_test/processor0/0/k.boundaryField.left
Evaluating expression "1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
[0]
[0]
[0]     From function parsingValue
[0]     in file lnInclude/CommonValueExpressionDriverI.H at line 1039.
[0]
FOAM parallel run exiting
[0]
--------------------------------------------------------------------------
mpirun has exited due to process rank 3 with PID 8236 on
node Ehsan-com exiting without calling "finalize". This may
have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------
[Ehsan-com:08227] 2 more processes have sent help message help-mpi-api.txt / mpi-abort
[Ehsan-com:08227] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages
Killing PID 8223
 PyFoam WARNING on line 232 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Execution/FoamThread.py : Process 8223 was already dead 
Getting LinuxMem: [Errno 2] No such file or directory: '/proc/8223/status'
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   May 31, 2013, 13:01
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
Code:
valueExpression "1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))";
Code:
[0] [1]
[1]
[1] --> FOAM FATAL ERROR:
[1] [2]
[3]
[3]
[3]  Parser Error for driver PatchValueExpressionDriver at "1.39" :"syntax error, unexpected ')'"
"1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
^
----------------------------------------|

Context of the error:


- From dictionary: /home/ehsan/Desktop/Central/nonUniformMesh/Turbulent_WR/main_test/processor1/0/k.boundaryField.left
Evaluating expression "1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
[1]
[1]
[1]     From function parsingValue
[1]     in file lnInclude/CommonValueExpressionDriverI.H at line 1039.
[1]
FOAM parallel run exiting
[1]
--> FOAM FATAL ERROR:
[3]  Parser Error for driver PatchValueExpressionDriver at "1.39" :"syntax error, unexpected ')'"
"1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
^
----------------------------------------|

Context of the error:


- From dictionary: /home/ehsan/Desktop/Central/nonUniformMesh/Turbulent_WR/main_test/processor3/0/k.boundaryField.left
Evaluating expression "1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
[3]
[3]
[3]     From function parsingValue
[3]     in file lnInclude/CommonValueExpressionDriverI.H at line 1039.
[3]
FOAM parallel run exiting
[3]
[2]
[2] --> FOAM FATAL ERROR:
[2]  Parser Error for driver PatchValueExpressionDriver at "1.39" :"syntax error, unexpected ')'"
"1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
^
----------------------------------------|

Context of the error:


- From dictionary: /home/ehsan/Desktop/Central/nonUniformMesh/Turbulent_WR/main_test/processor2/0/k.boundaryField.left
Evaluating expression "1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"

[0]
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 1 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
[0] --> FOAM FATAL ERROR:
[0]  Parser Error for driver PatchValueExpressionDriver at "1.39" :"syntax error, unexpected ')'"
"1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
^
----------------------------------------|

Context of the error:


- From dictionary: /home/ehsan/Desktop/Central/nonUniformMesh/Turbulent_WR/main_test/processor0/0/k.boundaryField.left
Evaluating expression "1.5*sqr(I*sum(mag(U.x)*Sf())/sum(Sf()))"
[0]
[0]
[0]     From function parsingValue
[0]     in file lnInclude/CommonValueExpressionDriverI.H at line 1039.
[0]
FOAM parallel run exiting
[0]
--------------------------------------------------------------------------
mpirun has exited due to process rank 3 with PID 8236 on
node Ehsan-com exiting without calling "finalize". This may
have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------
[Ehsan-com:08227] 2 more processes have sent help message help-mpi-api.txt / mpi-abort
[Ehsan-com:08227] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages
Killing PID 8223
 PyFoam WARNING on line 232 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Execution/FoamThread.py : Process 8223 was already dead 
Getting LinuxMem: [Errno 2] No such file or directory: '/proc/8223/status'
Is I a field you're using here or is it really your intention to use it as the unit-tensor? This means that the scalar expression you have here is promoted to a spherical tensor and swak doesn't know how to calculate the square of this, so it expects SOMETHING that reduces the tensor to a scalar (or at least a vector) when it encounters the ")"
__________________
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   May 31, 2013, 13:41
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
Hi
'I' is a constant defined in variables equal to .05 according to turbulent kinetic energy formula k=1.5 \, {(l \, I \,U)}^{2} .why OF assumes it as a tensor?for its capital form?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   May 31, 2013, 14:03
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
Hi
'I' is a constant defined in variables equal to .05 according to turbulent kinetic energy formula k=1.5 \, {(l \, I \,U)}^{2} .why OF assumes it as a tensor?for its capital form?
In newer versions of swak if no field I is defined then I is assumed to be the unit tensor. Otherwise the field should be used. Maybe this doesn't work with variables. Try for a test to replace it with the actual value. Or another variable name
__________________
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   May 31, 2013, 14:22
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
thanks dear Bernard.
I wrote it as:
Code:
valueExpression "1.5*sqr(I*sum(mag(U.x)*mag(Sf()))/sum(mag(Sf())))";
and doen't show an error on the expression although the run crashes after some(around 12) iterations.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   May 31, 2013, 16:14
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
thanks dear Bernard.
I wrote it as:
Code:
valueExpression "1.5*sqr(I*sum(mag(U.x)*mag(Sf()))/sum(mag(Sf())))";
and doen't show an error on the expression
OK. Then this is a bug (concerning the handling of I)

Quote:
Originally Posted by immortality View Post
although the run crashes after some(around 12) iterations.
That is not a swak-problem
__________________
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   May 31, 2013, 18:06
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
Bernhard do you mean it should display an error on 'I'?I have defined it as a constant why do you say so?
yes that was for a somewhat bad BC.
-----------
and if should report,I have to speak about what aspect of issue?
thanks.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   May 31, 2013, 19:20
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
Bernhard do you mean it should display an error on 'I'?I have defined it as a constant why do you say so?
yes that was for a somewhat bad BC.
-----------
and if should report,I have to speak about what aspect of issue?
thanks.
Well. It should say "Ah, there's a variable 'I'. He probably means that and not the unit tensor" but it doesn't. It shouldn't display and error
__________________
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   June 1, 2013, 05:00
Default
  #9
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
i think this error was on Sf() .it should have been mag(Sf()) and when i noticed and corrected it,no error displayed.
Anyway i understand what you said about the error but I still think the error should be modified.it says a ) is lost while its about using tensors and/or vectors.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 4, 2013, 12:34
Default
  #10
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
i think this error was on Sf() .it should have been mag(Sf()) and when i noticed and corrected it,no error displayed.
Anyway i understand what you said about the error but I still think the error should be modified.it says a ) is lost while its about using tensors and/or vectors.
Some function (maxPosition for instance) expect a scalar. So if you say "maxPosition(pos())" at the last ")" it says "hey. That can't be all. At least add a .x or so to make it a scalar. But the ')' is to early". This is what "unexpected ')'" means .. sometimes. At other times you just forgot a '('
immortality likes this.
__________________
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   June 5, 2013, 05:50
Default
  #11
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
thanks so much.
a lateral question from your example!
I use max(pos().y) for example.whats the difference between function max and function maxPosition?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   June 5, 2013, 07:54
Default
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
thanks so much.
a lateral question from your example!
I use max(pos().y) for example.whats the difference between function max and function maxPosition?
That is explained in the README file AND the reference documentation (sometimes I seriously wonder why I write those files): the position where the maximum occurs
__________________
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


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 04:18
Convergence problem with tetrahedral grids Tarak OpenFOAM Running, Solving & CFD 22 June 25, 2018 19:09
[swak4Foam] groovyBC not working pakanatiakash OpenFOAM Community Contributions 5 January 13, 2016 11:25
meshing of a compound volume in GMSH shawn3531 OpenFOAM 4 March 12, 2015 10:45
[swak4Foam] is this expression as bolean sentence wrong in groovyBC? immortality OpenFOAM Community Contributions 6 March 8, 2013 05:24


All times are GMT -4. The time now is 18:53.