CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   beginner-hlp pls (http://www.cfd-online.com/Forums/openfoam/68716-beginner-hlp-pls.html)

sarajags_89 September 29, 2009 22:52

beginner-hlp pls
 
hi guys i want to set a pressuer of 2 units in movingwall1 and 1 in movingwall .. am getting an error in this could you guys help me with it?:(

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
movingWall
{
type fixedValue;
value uniform (1 0 0);
}

movingWall1
{
type fixedValue;
value uniform (2 0 0);
}

fixedWalls
{
type zeroGradient;
}

frontAndBack
{
type empty;
}
}

// ************************************************** *********************** //

alberto September 30, 2009 00:40

Quote:

Originally Posted by sarajags_89 (Post 230926)
hi guys i want to set a pressuer of 2 units in movingwall1 and 1 in movingwall .. am getting an error in this could you guys help me with it?:(

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
movingWall
{
type fixedValue;
value uniform (1 0 0);
}

movingWall1
{
type fixedValue;
value uniform (2 0 0);
}

fixedWalls
{
type zeroGradient;
}

frontAndBack
{
type empty;
}
}

// ************************************************** *********************** //

A pressure is a scalar, not a vector, so don't use (1 0 0) but simply 1.

However, why do you specify the pressure at a wall, since if you use the no-slip condition, you already specify the velocity, and the pressure should be set to zeroGradient.

Best,

sarajags_89 September 30, 2009 13:27

@ alberto
 
Thanks for the reply. Actually I am modifying the cavity problem in the tutorial. I am keeping one face as inlet and the other as outlet. So I named one face of the face as movingwall and an opposite face as movingwall1. I then specified pressure difference as well as velocity difference is this right

alberto September 30, 2009 13:38

You should specify velocity at the inlet, where p is set to zeroGradient, and pressure at the outlet, where velocity is set to zeroGradient. Keep in mind you consider incompressible flows.

sarajags_89 September 30, 2009 17:09

@alberto
 
hi.. I understood what you said.. my question is how do i differentiate vectors and scalars when I type them in the editor
hope this is clear

for pressure

movingWall
{
type fixed;
value 0;
}

is this correct?

alberto September 30, 2009 19:55

Quote:

Originally Posted by sarajags_89 (Post 231039)
hi.. I understood what you said.. my question is how do i differentiate vectors and scalars when I type them in the editor
hope this is clear

for pressure

movingWall
{
type fixed;
value 0;
}

is this correct?

No it is not correct.

movingWall
{
type fixedValue;
value uniform 0;
}

is the right syntax. This should be clear by all the examples you find in the tutorials.

Best,

alberto September 30, 2009 19:56

Quote:

Originally Posted by annoyed (Post 231042)
>hi.. I understood what you said..

Please, don't lie at us.

>my question is how do i type vectors scalars

'v' 'e' 'c' 't' 'o' 'r' 's' 's' 'c' 'a' 'l' 'a' 'r' 's'

>what is uniform(0 0 0) mean?..

The mean of uniform(0 0 0) is (0 0 0).

You should check your '.' key. It is typing itself in places, where it makes as little sense as the rest of the questions.

Maybe next time you can save your time, and do not reply at all.


All times are GMT -4. The time now is 15:23.