|
[Sponsors] |
![]() |
![]() |
#1 |
Member
Kabir Shariff
Join Date: Oct 2016
Location: France
Posts: 53
Rep Power: 9 ![]() |
Hello, I want to implement a groovyBC on k field in a form of log law.
The BC is given in the figure attached herewith I have an error when running from the BC Code:
--> FOAM FATAL ERROR: Parser Error for driver PatchValueExpressionDriver at "1.8-9" :"field Hh not existing or of wrong type" " (log((Hh/z0))/log((zp+z0)/z0))*Iamb" Code:
inlet { type groovyBC; variables ( "zp = pos().z;" "Hh = 50;" "Uin = 2.7;" "z0 = 0.001;" "Iamb = 0.2;" "II = (log((Hh/z0))/log((zp+z0)/z0))*Iamb;" "k = 1.5*II*II*Uin*Uin;" ); valueExpression "k"; } Thank you. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
|
Hi,
My guess is that the syntax is incorrect as it only seems to read the first line. Can you try this: Code:
inlet { type groovyBC; variables "zp = pos().z; Hh = 50; Uin = 2.7; z0 = 0.001; Iamb = 0.2; II = (log((Hh/z0))/log((zp+z0)/z0))*Iamb; k = 1.5*II*II*Uin*Uin;"; valueExpression "k"; } Code:
inlet { type groovyBC; variables "zp = pos().z;Hh = 50;Uin = 2.7;z0 = 0.001;Iamb = 0.2;II = (log((Hh/z0))/log((zp+z0)/z0))*Iamb;k = 1.5*II*II*Uin*Uin;"; valueExpression "k"; } |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Member
Kabir Shariff
Join Date: Oct 2016
Location: France
Posts: 53
Rep Power: 9 ![]() |
Hi, yes indeed the error is in declaration of variables,
I calculated the expression in the valueExpression as follows; Code:
{ type groovyBC; variables "H=50;z0=0.001;vel=2.7;amb=0.2;"; valueExpression "1.5*pow((amb*(log(H/z0)/log(pos().z/z0)))*vel,2)"; } |
|
![]() |
![]() |
![]() |
Tags |
groovybc |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] Error installing swak4Foam | Hisham | OpenFOAM Community Contributions | 182 | February 8, 2024 10:36 |
[Other] vtk to OpenFoam (or something else that can reach after OpenFoam) | cristina87 | OpenFOAM Meshing & Mesh Conversion | 8 | July 19, 2019 08:28 |
ERROR CCL parser failed with message: Perl Syntax errors detected: Can't use an undef | nands_bullwalker | Fluent UDF and Scheme Programming | 2 | October 9, 2017 09:13 |
[swak4Foam] Error using groovyBC - 'parser error for expression driver' | odellar | OpenFOAM Community Contributions | 4 | September 21, 2015 11:51 |
parabolic inlet velocity condition | ofslcm | OpenFOAM Programming & Development | 12 | February 5, 2014 00:30 |