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/)
-   -   Time-varying boundary condition (http://www.cfd-online.com/Forums/openfoam-pre-processing/121366-time-varying-boundary-condition.html)

yurifrey July 26, 2013 09:39

Time-varying boundary condition
 
Hello!

I am a new OpenFoam user and I am trying to set up a case with time-dependent boundary condition for velocity. In the tutorial I found something but it's not working.. :( In the "0" folder I wrote the file "U" for velocity specifying the inlet condition :

inlet

{type uniformFixedValue;
uniformValue table
(
(0 0)
(2.0 1.0)
)
}

I thought this was the way to say I have a uniform inlet profile which goes from 0 m/s to 1 m/s between time t=0 and t=2, but when I start icoFoam this is what I get:

--> FOAM FATAL IO ERROR:
Expected a '(' while reading VectorSpace<Form, Cmpt, nCmpt>, found on line 49 the label 0

file: /home/yurifrey/Scrivania/tesi/aorta/0/U.boundaryField.inlet.uniformValue at line 49.

From function Istream::readBegin(const char*)
in file db/IOstreams/IOstreams/Istream.C at line 94.

FOAM exiting

Wish someone can help me,
thank you very much,

Yuri

alexeym July 26, 2013 09:49

Velocity is a vector so table should contain vectors (1 0 0). You put there scalars, and it is the reason for OpenFOAM to complain.

Table should be something like:

{type uniformFixedValue;
uniformValue table
(
(0 (0 0 0))
(2.0 (1.0 0 0))
)
}

yurifrey July 26, 2013 10:00

Thank you very much! :)

yurifrey July 27, 2013 05:20

Just another little question.. What if I want the velocity to be directed normal to the boundary, instead of giving the components of the vector? I tried

{type surfaceNormalFixedValue;
refValue uniform table
(
(0 0)
(2 -1)
);
}

but it's not working..
Thank you again!

Yuri

alexeym July 27, 2013 07:51

AFAIK uniformFixedValue BCs are implemented only for limited types of boundary conditions (http://www.openfoam.org/version2.1.0...conditions.php).

Though it is rather simple to implement your own boundary condition. For example you can change surfaceNormalFixedValue. Instead of
Code:

class surfaceNormalFixedValueFvPatchVectorField
:
    public fixedValueFvPatchVectorField
{
    // Private data
   
        scalarField refValue_;

you put something like

Code:

class surfaceNormalUniformFixedValueFvPatchVectorField
:
    public fixedValueFvPatchVectorField
{
    // Private data
   
        autoPtr<DataEntry<Type> > refValue_;

and reimplement operator = to use new time dependent reference value.


All times are GMT -4. The time now is 18:46.