CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Creating log. velocity profile with groovyBC (http://www.cfd-online.com/Forums/openfoam/98599-creating-log-velocity-profile-groovybc.html)

krsp March 14, 2012 12:59

Creating log. velocity profile with groovyBC
 
Hi everyone,

I would like to create a logarithmic velocity profile at the inlet. I have tried with "groovyBC", however I keep getting the same error:

--> FOAM FATAL ERROR:
Parser Error at "1.8-9" :"field uf not existing or of wrong type"
"vector(uf/K*log(zp/z0), 0.0, 0.0)"
" ^^ "
From function parsingValue
in file PatchValueExpressionDriver.C at line 192.
FOAM exiting

In the 0/U-file, I have typed the following for my BC:
inlet
{
type groovyBC
variables "uf=0.002257;ks=0.0051;z0=ks/30;K=0.4;zp=pts().z;";
valueExpression "vector(uf/K*log(zp/z0), 0.0, 0.0)";
}

Can anyone tell me, what I have done wrong? (I use OpenFoam 1.6-ext)

Thanks in advance :)

gschaider March 14, 2012 14:26

Quote:

Originally Posted by krsp (Post 349461)
Hi everyone,

I would like to create a logarithmic velocity profile at the inlet. I have tried with "groovyBC", however I keep getting the same error:

--> FOAM FATAL ERROR:
Parser Error at "1.8-9" :"field uf not existing or of wrong type"
"vector(uf/K*log(zp/z0), 0.0, 0.0)"
" ^^ "
From function parsingValue
in file PatchValueExpressionDriver.C at line 192.
FOAM exiting

In the 0/U-file, I have typed the following for my BC:
inlet
{
type groovyBC
variables "uf=0.002257;ks=0.0051;z0=ks/30;K=0.4;zp=pts().z;";
valueExpression "vector(uf/K*log(zp/z0), 0.0, 0.0)";
}

Can anyone tell me, what I have done wrong? (I use OpenFoam 1.6-ext)

Thanks in advance :)

Should work. Some questions:

- which version of groovyBC are you using? (To put it differently: is is a version that supports variables?)
- Have you tried deliberatly introducing a syntax error into the evaluation of uf (for instance "uf=nix*0.002257;") to see whether it is evaluated at all

Bernhard

krsp March 15, 2012 07:37

I think you were right, that I was using a wrong version of groovyBC.. Now I have downloaded swak4Foam (1.7), and I think it works :)

Thank you!


All times are GMT -4. The time now is 00:36.