CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   groovyBC synthax help (http://www.cfd-online.com/Forums/openfoam-pre-processing/93958-groovybc-synthax-help.html)

Baldy October 31, 2011 22:08

groovyBC synthax help
 
I'm trying to set a velocity profile at my inlet for a 2D laminar flow using 1.6-ext

The equation I'm trying to write is U(y)=3/2*U0*(1-(2*y^2)/b^2)

From looking at other threads this is the best I could come up with:

Code:

  inlet
    {
        type            groovyBC;
        value          uniform (0 0 0);
        variables          "U_0=2.17;b=0.01;profile=(3/2)*U_0*(1-((pos().y*2)^2)/b^2)";
        valueExpression        "vector (profile, 0, 0)";
    }

but I'm getting this error:


gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type groovyBC)
on patch inlet of field U in file "/home/OpenFOAM/Simulation/test_1/0/U"
You are probably trying to solve for a field with a generic boundary condition.

From function genericFvPatchField<Type>::gradientInternalCoeffs( ) const
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 782.

nimasam November 1, 2011 02:23

Quote:

Originally Posted by Baldy (Post 330236)
I'm trying to set a velocity profile at my inlet for a 2D laminar flow using 1.6-ext

The equation I'm trying to write is U(y)=3/2*U0*(1-(2*y^2)/b^2)

From looking at other threads this is the best I could come up with:

Code:

  inlet
    {
    type            groovyBC;
    value          uniform (0 0 0);
        variables      "U_0=2.17;b=0.01;profile=(3/2)*U_0*(1-((pos().y*2)^2)/b^2)";
    valueExpression    "vector (profile, 0, 0)";
    }

but I'm getting this error:


gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type groovyBC)
on patch inlet of field U in file "/home/OpenFOAM/Simulation/test_1/0/U"
You are probably trying to solve for a field with a generic boundary condition.

From function genericFvPatchField<Type>::gradientInternalCoeffs( ) const
in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 782.

you have two main obstacles
1) in syntacs why ^ use (2*pow(y,2)) for example for 2*y^2
2)you should add following sentence to the controlDict :
libs ("libOpenFOAM.so""libgroovyBC.so");

Baldy November 13, 2011 23:41

Works great. Thanks

Goutam March 20, 2012 09:39

Dear Badly,

Sorry...

gschaider March 20, 2012 10:03

Quote:

Originally Posted by Goutam (Post 350418)
Dear Badly,

where I will write libs("libOpenFOAM.so" "libgroovyBC.so"); ?
where is the location of controlDict?
I am using OF_2.1.0.

Thanks

controlDict has been in the same location since the beginning of mankind (OK. Almost. Since OF 1.0). Have a look at the user-guide, chapter 4 (in particular 4.3). But you must already have stumbled upon it when you were going through the first tutorial in the UG

Goutam March 20, 2012 11:18

Quote:

Originally Posted by gschaider (Post 350428)
controlDict has been in the same location since the beginning of mankind (OK. Almost. Since OF 1.0). Have a look at the user-guide, chapter 4 (in particular 4.3). But you must already have stumbled upon it when you were going through the first tutorial in the UG

Sorry, actually I am using OF 2.1.0 and I want to use groovyBC, I didn't find this. I see the link in openfoamwiki but it does not work. I just missed what I want to ask. Sorry...


All times are GMT -4. The time now is 20:37.