CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] GroovyBC again (https://www.cfd-online.com/Forums/openfoam-community-contributions/85067-groovybc-again.html)

Rickard.Solsjo February 16, 2011 11:57

GroovyBC again
 
Hi again. Still some groovy problems.
Does anyone know what this problem may be due to?

[15] Parser Error at "1.0-5" :"field Uinlet not existing or of wrong type"
"Uinlet=Uz*cos(theta)*vector(0,0,1)+Uz*sin(theta)* vector(0,1,0)+Uz*sin(theta)*vector(1,0,0)"
"^^^^^^ "
[15]
[15] From function parsingValue
[15] in file PatchValueExpressionDriver.C at line 192.
[15]
FOAM parallel run exiting

jet
{
type groovyBC;

variables "Uz=150;rmax=0.0005;r=sqrt(pow(pos().x,2)+pow(pos( ).y,2));thetaMax=10.75*pi/180;theta=(thetaMax*r)/rmax;";
valueExpression "Uinlet=Uz*cos(theta)*vector(0,0,1)+Uz*sin(theta)* vector(0,1,0)+Uz*sin(theta)*vector(1,0,0)";
fractionExpression "(r<=0.5) ? U=Uinlet : U=vector(0,0,0)";
}

gschaider February 16, 2011 18:04

Quote:

Originally Posted by Rickard.Solsjo (Post 295563)
Hi again. Still some groovy problems.
Does anyone know what this problem may be due to?

[15] Parser Error at "1.0-5" :"field Uinlet not existing or of wrong type"
"Uinlet=Uz*cos(theta)*vector(0,0,1)+Uz*sin(theta)* vector(0,1,0)+Uz*sin(theta)*vector(1,0,0)"
"^^^^^^ "
[15]
[15] From function parsingValue
[15] in file PatchValueExpressionDriver.C at line 192.
[15]
FOAM parallel run exiting

jet
{
type groovyBC;

variables "Uz=150;rmax=0.0005;r=sqrt(pow(pos().x,2)+pow(pos( ).y,2));thetaMax=10.75*pi/180;theta=(thetaMax*r)/rmax;";
valueExpression "Uinlet=Uz*cos(theta)*vector(0,0,1)+Uz*sin(theta)* vector(0,1,0)+Uz*sin(theta)*vector(1,0,0)";
fractionExpression "(r<=0.5) ? U=Uinlet : U=vector(0,0,0)";
}

You can't have an assignment inside of valueExpression (that is what variables is for). valueExpression IS an assignment

ulisses June 16, 2011 16:58

groovyBC error
 
Hi guys,

I am trying to generate a parabolic profile using groovyBC:

inlet
{

type groovyBC;
variables "dirx=vector (1,0,0);dirz=vector (0,0,1);Umin=22;hx=mag(pos()*dirx);hz=mag(pos()*di rz);a=hx*hx+hz*hz;speed=Umin*a";
valueExpression "vector (0, speed, 0)";
}

But I've got the following error:

PHP Code:

    Cannot find 'value' entry on patch entrada of field Ub in file "/home/ulisses/OpenFOAM/ulisses-1.6/run/leitodejorroGroovy/0/Ub"
    
which is required to set the values of the generic patch field.
    (
Actual type groovyBC)

    
Please add the 'value' entry to the write function of the user-defined boundary-condition
    
or link the boundary-condition into libfoamUtil.so

file
: /home/ulisses/OpenFOAM/ulisses-1.6/run/leitodejorroGroovy/0/Ub::entrada from line 36 to line 39.

    From 
function genericFvPatchField<Type>::genericFvPatchField(const fvPatch&, const Field<Type>&, const dictionary&)
    
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 72.

FOAM exiting 

Do you have any suggestion?

Thanks

ulisses June 16, 2011 17:28

I already discovery my mistake.
I wrote in the wrong place in system/controlDict:
libs ("libgroovyBC.so")


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