GroovyBC syntax
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 |
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 |
Thanks you. What is the directory where I must install the groovyBC library?
|
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::operator==(const pve::position&, const pve::position&)’: 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? |
Hi,
seems you need to install flex. Regards, Stefan |
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 |
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 |
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 |
I think i have a similar problem.
I have this inlet condition Code:
Code:
--> FOAM FATAL ERROR: Solved imposing (in a not elegant way, i guess) ; Code:
inlet |
Quote:
Bernhard |
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?
|
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. |
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 |
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 |
Ok, thank you Bernhard! I basically reproduced my post here, but if you need any more information let me know.
- Anton |
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) |
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.. |
Quote:
Thanks for correcting it Quote:
|
Forget this message
1 Attachment(s)
The previous message was all wrong, sorry
|
Sorry, my fault. Everything is fine....
|
All times are GMT -4. The time now is 19:50. |