|
[Sponsors] |
May 29, 2010, 15:54 |
GroovyBC syntax
|
#1 |
Senior Member
Daniele
Join Date: Feb 2010
Posts: 134
Rep Power: 16 |
Hi All
I must impose a velocity profile on inlet, and I want use groovyBC boundary condition. The velocity profile is: Ux=c1/c2log(y-y0/y0), I'm a newbe, and I would like know the correct syntax to use. Thanks |
|
May 31, 2010, 04:02 |
|
#2 |
Senior Member
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 18 |
Hi,
did you take a look here: http://openfoamwiki.net/index.php/Contrib_groovyBC ? There is also an example for an inlet-condition. Regards, Stefan |
|
May 31, 2010, 07:20 |
|
#3 |
Senior Member
Daniele
Join Date: Feb 2010
Posts: 134
Rep Power: 16 |
Thanks you. What is the directory where I must install the groovyBC library?
|
|
May 31, 2010, 08:41 |
|
#4 |
Senior Member
Daniele
Join Date: Feb 2010
Posts: 134
Rep Power: 16 |
I tried to compile this library but I have this message during compilation:
wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file PatchResult.C Making dependency list for source file PatchValueExpressionParser.yy could not open file PatchValueExpressionParser.tab.hh for source file PatchValueExpressionParser.yy Making dependency list for source file PatchValueExpressionLexer.ll could not open file PatchValueExpressionParser.tab.hh for source file PatchValueExpressionLexer.ll Making dependency list for source file PatchValueExpressionDriver.C could not open file PatchValueExpressionParser.tab.hh for source file PatchValueExpressionDriver.C Making dependency list for source file groovyBCFvPatchFields.C could not open file PatchValueExpressionParser.tab.hh for source file groovyBCFvPatchFields.C Making dependency list for source file groovyBCPointPatchFields.C could not open file MixedPointPatchField.H for source file groovyBCPointPatchFields.C could not open file PatchValueExpressionParser.tab.hh for source file groovyBCPointPatchFields.C could not open file PointPatchFieldMapper.H for source file groovyBCPointPatchFields.C SOURCE=PatchResult.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -IMake/linuxGccDPOpt -I/home/acconcia/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/acconcia/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/acconcia/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/PatchResult.o PatchResult.C: In member function ‘void Foam::PatchResult::uglyDelete()’: PatchResult.C:97: warning: deleting ‘void*’ is undefined SOURCE=PatchValueExpressionParser.yy ; rm -f Make/linuxGccDPOpt/PatchValueExpressionParser.C Make/linuxGccDPOpt/PatchValueExpressionParser.tab.hh; bison -ra -v -d $SOURCE ; mv *.tab.cc Make/linuxGccDPOpt/PatchValueExpressionParser.C ; mv *.tab.hh Make/linuxGccDPOpt/PatchValueExpressionParser.tab.hh ; mv *.hh Make/linuxGccDPOpt ; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -IMake/linuxGccDPOpt -I/home/acconcia/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/acconcia/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/acconcia/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c Make/linuxGccDPOpt/PatchValueExpressionParser.C -o Make/linuxGccDPOpt/PatchValueExpressionParser.o In file included from Make/linuxGccDPOpt/location.hh:44, from PatchValueExpressionParser.tab.hh:65, from PatchValueExpressionParser.tab.cc:61: position.hh: In function ‘bool pve:perator==(const pve:osition&, const pve:osition&)’: position.hh:136: warning: suggest parentheses around && within || PatchValueExpressionParser.tab.cc: In member function ‘unsigned char pve::PatchValueExpressionParser::yytranslate_(int) ’: PatchValueExpressionParser.tab.cc:4941: warning: use of old-style cast SOURCE=PatchValueExpressionLexer.ll ; rm Make/linuxGccDPOpt/PatchValueExpressionLexer.C ; flex -f $SOURCE ; mv *.c Make/linuxGccDPOpt/PatchValueExpressionLexer.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -IMake/linuxGccDPOpt -I/home/acconcia/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/acconcia/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/acconcia/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c Make/linuxGccDPOpt/PatchValueExpressionLexer.C -o Make/linuxGccDPOpt/PatchValueExpressionLexer.o rm: impossibile rimuovere `Make/linuxGccDPOpt/PatchValueExpressionLexer.C': Nessun file o directory /bin/sh: flex: not found mv: impossibile fare stat di `*.c': Nessun file o directory g++: Make/linuxGccDPOpt/PatchValueExpressionLexer.C: Nessun file o directory g++: no input files make: *** [Make/linuxGccDPOpt/PatchValueExpressionLexer.o] Errore 1 it's correct? |
|
May 31, 2010, 11:13 |
|
#5 |
Senior Member
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 18 |
Hi,
seems you need to install flex. Regards, Stefan |
|
June 11, 2010, 09:30 |
|
#6 |
New Member
mikael
Join Date: Jun 2010
Posts: 18
Rep Power: 16 |
Hi everybody!
It's my first time on CFD Online and I begin on OpenFOAM. I'm working on a floating body simulation which I found online and I would like to generate waves on the object. So I've used the famous GroovyBC but when I compile OF return: Reading transportProperties Selecting incompressible transport model Newtonian Selecting incompressible transport model Newtonian --> FOAM FATAL ERROR: Not Implemented trying to construct an genericFvPatchField on patch inlet of field rho But rho is defined for both fluids in transportProperties file. Maybe somebody can help me? thanks in advance Keul |
|
June 14, 2010, 04:24 |
|
#7 |
Senior Member
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 18 |
Hi Mikael,
I think the problem is that your solver doesn't recognize the boundary condition for rho. Have you added the Code:
libs ( "libOpenFOAM.so" "libgroovyBC.so" ); Just for explanation: I guess you are using interFoam. Then BC's for rho are transferred from BC's for gamma. If using groovyBC for gamma, the solver won't be able to construct rho, if the above text is not included in your controlDict. Regards, Stefan |
|
June 14, 2010, 06:38 |
|
#8 |
New Member
mikael
Join Date: Jun 2010
Posts: 18
Rep Power: 16 |
Hi Stephan
Thanks for your response. I had already got this problem with the groovyWaveTank file and so I go by this example. I've used the same kind of BC's. It seems that the program stops when OF is reading the transportProperties file where rho is defined for the two phases. Do you think I should modify BC's in my gamma file? I want to simulate a floating object (cube_region0) in a big box where there are two sides for the inlet and oulet, two sides I consider as wall (minY and maxY), the atmosphere and the bottom (minZ). BC's in my gamma file: boundaryField { inlet { type groovyBC; refValue uniform 0; refGradient uniform 0; valueFraction uniform 1; valueExpression "(pos().z<=A*cos(-w*time())+0.5*k*A*A*cos(2*(-w*time()))) ? 1 : 0"; gradientExpression "0"; fractionExpression "1"; variables "l=5;A=0.1;g=vector(0,0,-9.81);k=2*pi/l;w=sqrt(k*mag(g));"; timelines ( ); value nonuniform List<scalar> 1600 (......) ; } outlet { type zeroGradient; } minY { type zeroGradient; } maxY { type zeroGradient; } atmosphere { type inletOutlet; inletValue uniform 0; value uniform 0; } minZ { type zeroGradient; } cube_region0 { type zeroGradient; } } Thanks in advance Mikael |
|
June 14, 2010, 10:05 |
|
#9 |
Senior Member
Emanuele
Join Date: Mar 2009
Posts: 110
Rep Power: 17 |
I think i have a similar problem.
I have this inlet condition Code:
inlet { type groovyBC; variables "zp=pts().z;szero=0.001;g=9.81;H=toFace(min(zp));"; valueExpression "(g*szero)/2*nu * (2*H*zp - pow(zp,2))"; value uniform (0 0 0); } Code:
--> FOAM FATAL ERROR: Parser Error at "1.7-9" :"syntax error, unexpected TOKEN_min" "toFace(min(zp))" " ^^^ " From function parsingValue in file PatchValueExpressionDriver.C at line 188. Solved imposing (in a not elegant way, i guess) ; Code:
inlet { type groovyBC; variables "zp=pts().z;szero=0.001;g=9.81;H=1;"; valueExpression "vector((g*szero)/2*nu * (2*pos().z - pow(pos().z,2)),0,0)"; value uniform (0 0 0); } Last edited by nuovodna; June 14, 2010 at 10:14. Reason: Solved |
|
June 15, 2010, 08:47 |
|
#10 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Bernhard |
||
August 18, 2010, 10:31 |
|
#11 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
I'm having the same problem. I took a groovy boundary condition that was working with OF-1.5 and groovyBC from breeder15, and then tried to use it with OF-1.6.x and groovyBC from breeder16 - it works in the former case, but not in the latter. So this seems to be some sort of regression. Were you aware of that Bernhard?
|
|
August 18, 2010, 11:25 |
|
#12 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Your report is a bit unspecific. I'm not even sure whether your expression is not correctly parsed or if it gives the wrong values. |
||
August 18, 2010, 11:41 |
|
#13 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
I'm sorry it was unspecific. The following code works and gives the expected result with OF-1.5 and the appropriate groovyBC. With 1.6 and the newest groovyBC it throws the previously mentioned " Parser Error at "1.7-9" :"syntax error, unexpected TOKEN_min". The problem here is the call of toFace. Using only min(xp) does not lead to an error (although I still have to verify if I get the desired linear temperature gradient in that case).
Code:
top { type groovyBC; refValue uniform 0; refGradient uniform 0; valueFraction uniform 1; value uniform 0; valueExpression "552.55 - (lin * 12)"; gradientExpression "0"; fractionExpression "1"; variables "xp=pts().x;minX=toFace(min(xp));maxX=toFace(max(xp));lin=(pos().x-minX)/(maxX - minX);"; timelines ( ); } Last edited by akidess; August 18, 2010 at 11:43. Reason: make post easier to read |
|
August 18, 2010, 13:09 |
|
#14 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
As I said in the other posting: Report a bug at http://sourceforge.net/apps/mantisbt...e_status_id=-2 and I will attempt to fix this Bernhard |
||
August 18, 2010, 13:43 |
|
#15 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
Ok, thank you Bernhard! I basically reproduced my post here, but if you need any more information let me know.
- Anton |
|
August 19, 2010, 05:40 |
|
#16 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Anyway: the problem itself could not be solved. For the full story see https://sourceforge.net/apps/mantisb...view.php?id=16 (for those who're interested. Anton should have gotten EMail-notifications anyway) |
||
August 19, 2010, 06:05 |
|
#17 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 |
Ok, so to fully resolve things, I think the wiki should be updated by removing the toFace() call from the usage examples, eg. pulsedPitzDaily, and/or stating that the behavior changed with OF-1.6 / groovyBC versions larger than 1792 (from what I can tell I was using 1709 and 1819). Do you agree?
http://openfoamwiki.net/index.php/Co...ulsedPitzDaily PS. I actually didn't get an email because the issue was not automatically monitored.. |
|
August 19, 2010, 09:11 |
|
#18 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Thanks for correcting it Thanks for the feedback. I assumed that the reporter automatically gets added to the monitoring list. Will see whether I can fix this |
||
August 19, 2010, 13:59 |
Forget this message
|
#19 |
New Member
Pal Schmitt
Join Date: Aug 2010
Location: Belfast
Posts: 21
Rep Power: 16 |
The previous message was all wrong, sorry
Last edited by wavemaster; August 20, 2010 at 05:42. Reason: Wrong information |
|
August 20, 2010, 05:40 |
|
#20 |
New Member
Pal Schmitt
Join Date: Aug 2010
Location: Belfast
Posts: 21
Rep Power: 16 |
Sorry, my fault. Everything is fine....
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] log velocity profile with groovyBC - syntax | grjmell | OpenFOAM Community Contributions | 43 | December 9, 2020 16:36 |
what is syntax error : missing ')' before ';' | aleisia | Fluent UDF and Scheme Programming | 8 | March 10, 2015 16:42 |
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 | keepfit | ParaView | 60 | September 18, 2013 04:23 |
[swak4Foam] a problem in groovyBC: "syntax error, unexpected '('" | immortality | OpenFOAM Community Contributions | 14 | December 5, 2012 05:22 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 16:16 |