CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Boundary Conditions Problem (https://www.cfd-online.com/Forums/openfoam-solving/112505-boundary-conditions-problem.html)

 himanshu28 January 30, 2013 06:04

Boundary Conditions Problem

1 Attachment(s)
Hi,

I am trying to simulate a jet flow inside a square domain i have imported my mesh geometry successfully inside OpenFoam. the boundary conditions i need to specify is shown in the diagram below. The inlet velocity in y direction ,the outlets are all the faces which are at atmospheric pressure i am unable to fix the problem with the boundary condition specification Attachment 18628
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: 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
{
inlet
{
}

wall
{
}

outlet
{
type fixedValue;
value uniform 0;
}
}

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

this is my pressure boundary condition file please see if i am wrong any where
also adding my velocity boundary condition file
Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  2.1.1                                | |  \\  /    A nd          | Web:      www.OpenFOAM.org                      | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      volVectorField;     object      U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions      [0 1 -1 0 0 0 0]; internalField  uniform (0 0 0); boundaryField {     inlet     {     type inletOutlet;     inletValue uniform (-2 0 0);     value (0 0 0);     }     wall     {         type            fixedValue;         value          uniform (0 0 0);     }     outlet     {         type            fixedValue;         value          uniform (0 0 0);     } } // ************************************************************************* //```
i am running the simulation with icoFoam its running but not showing any results.
if some body can help on this issue.

:(:(:(

thanks

 asoltoon January 30, 2013 11:26

Hi himanshu28,

According to the problem geometry that you have attached the velocity Inlet should be (0 -2 0), not (-2 0 0).

Regards,
Ali

 himanshu28 January 30, 2013 13:46

Thanks &Query

2 Attachment(s)
Quote:
 Originally Posted by asoltoon (Post 405067) Hi himanshu28, According to the problem geometry that you have attached the velocity Inlet should be (0 -2 0), not (-2 0 0). Regards, Ali
Hi,

Thanks for the reply. I have made this correction but still my pressure conditions are not so satisfactory if you can comment on which "type" to choose for specifying it.i will attach some of my results Attachment 18635Attachment 18636

I have use icoFoam and i am still not able to achieve steady state solution i think that is the on reason that i am not able to see the complete movement of fluid in the domain

 himanshu28 February 1, 2013 08:42

Pressure Outlet condition ??

1 Attachment(s)
I have edited my model a bit and provided an inlet hole and outlet hole but i am confused in the pressure conditions on the wall
presently what i have done is this
Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  2.1.1                                | |  \\  /    A nd          | Web:      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 {     inlet     {         type            zeroGradient;     }     outlet     {         type            fixedValue;     value        uniform 100;     }     wall     {         type            zeroGradient;     } } // ************************************************************************* //```
i have attached my geometry also have a look at it Attachment 18684
the inlet is from right and the outlet is from left phase ..with these set of pressure cond. i am using ico Foam solver for my case .and getting following error.

after time 0.06
Code:

```#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2  in "/lib/libc.so.6" #3  Foam::PBiCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #4   in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/icoFoam" #5   in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/icoFoam" #6   in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/icoFoam" #7  __libc_start_main in "/lib/libc.so.6" #8   in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/icoFoam" Floating point exception```
Is my pressure conditions at wall are right i have this doubt also. i want to see the effect of inlet jet in the square box if pressure outlet is provided only on the left part.

 asoltoon February 2, 2013 08:54

Hi himanshu28,

I don't know what the error means, but it seems that your pressure B.C. is OK. How about the velocity B.C.? Did you define it correctly? the inlet velocity B.C. should be fixedValue, outlet should be zeroGradient, & wall should be fixedValue and equal to 0.

Regards,
Ali

 himanshu28 February 3, 2013 02:14

Problem unresolved

1 Attachment(s)
Quote:
 Originally Posted by asoltoon (Post 405619) Hi himanshu28, I don't know what the error means, but it seems that your pressure B.C. is OK. How about the velocity B.C.? Did you define it correctly? the inlet velocity B.C. should be fixedValue, outlet should be zeroGradient, & wall should be fixedValue and equal to 0. Regards, Ali
Hi,
I have specifed the same velocity boundaray conditions attaching the code
Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  2.1.1                                | |  \\  /    A nd          | Web:      www.OpenFOAM.org                      | |    \\/    M anipulation  |                                                | \*---------------------------------------------------------------------------*/ FoamFile {     version    2.0;     format      ascii;     class      volVectorField;     object      U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions      [0 1 -1 0 0 0 0]; internalField  uniform (0 0 0); boundaryField {     inlet     {         type            fixedValue;         value          uniform (0 0 -12);     }     outlet     {         type            zeroGradient;             }     wall     {       type            fixedValue;       value          uniform (0 0 0);     } } // ************************************************************************* //```
the solver gives the same error. If i visualize a section at the inlet there is no inflow coming or developing inside the box. see the attachment Attachment 18723

the jet is not at all developing inside the box it seems something wrong with my boundary conditions only.Should i provide zeroGradient of velocity at the wall?
I have a unstructured mesh(tetrahedral imported form ICEM) is it the cause.

 asoltoon February 3, 2013 02:39

Hi,

When the error occures? after a few timesteps going on or before the solution starts?
zeroGradient means that your variable has equal magnitude to the cell beside it. so if your B.C. is no-slip wall it seems that using this condition is not true.
could you attach your last screenshot containing coordinate axis(x,y,z)?
and could you take a screen shot of terminal that contains a few lines before your error until the end?

Regards

 himanshu28 February 4, 2013 06:05

3 Attachment(s)
Quote:
 Originally Posted by asoltoon (Post 405695) Hi, When the error occures? after a few timesteps going on or before the solution starts? zeroGradient means that your variable has equal magnitude to the cell beside it. so if your B.C. is no-slip wall it seems that using this condition is not true. could you attach your last screenshot containing coordinate axis(x,y,z)? and could you take a screen shot of terminal that contains a few lines before your error until the end? Regards
hi,
I have attached some pics. the error comes after running some time step. as u would see in the error pic. so please see and suggest if i need to make corrections in my boundary conditions.Attachment 18747Attachment 18748Attachment 18749

 wernsen February 4, 2013 06:13

Hello himanshu28,

I think the Problem is the boundary file p. Try this:

Code:

```/*--------------------------------*- C++ -*----------------------------------*\ | =========                |                                                | | \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          | |  \\    /  O peration    | Version:  2.1.1                                | |  \\  /    A nd          | Web:      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 98000; boundaryField {     inlet     {                 type            fixedValue;     value        uniform 98000;     }     outlet     {         type            zeroGradient;     }     wall     {         type            zeroGradient;     } } // ************************************************************************* //```

 asoltoon February 4, 2013 07:04

Hi,

As I see the problem settings is such that the courant number becomes much larger than allowed value and so cause the solution to diverge. you must change your boundary as the courant number reduces. there is some suggestions:
1- decrease the inlet velocity and run the problem again.
2- as wernsen said make the initial pressure equal to inlet pressure and set the outlet pressure as zeroGradient.
3- make a finer mesh so that the courant number will decrease. this method is recommended only if you don't have any permission to change the other B.C.s and will make your solution very time consuming.
4- decrease your time-step to decrease Co Number.
5- a blend of 4 past suggestions.

Regards,
Ali

 himanshu28 February 4, 2013 07:39

Thanks &Query

hi,

But what this 98000 stand for i am trying to put the same boundary conditions on the given problem.
As you can see my error message pic that the Courant number is reaching way high should i reduce the time step more presently i am trying to run the solution for
start time 0.0
end time 0.3
deltaT 0.001

is it the problem?
its giving error....problem unresolved.

 asoltoon February 4, 2013 08:11

Hello again,
you can reduce time-step, it doesn't affect the solution but will reduce the Co number and can help your solution to converge. you should determine your time-step such as your Co number doesn't exceed 1 in the solution. 1-reduce and reduce it until the Co number in the terminal shows the accepted value.
as I understood, your mesh is tetrahedral. unstructured meshes if they are not generated well, will have some cells that are very smaller than the biggest cell in your mesh. it will also make your solution dependent to these small cells, so that you should reduce your time step as much as the courant will be max 1 for these cells. If the geometry is not so complicated, such as your case, structured grids are more suggested. they often don't face to these problems. 2-make a good structured grid and run again.

Regards,
Ali

 wernsen February 4, 2013 08:28

Quote:
 Originally Posted by himanshu28 (Post 405888) hi, Thanks for the reply . But what this 98000 stand for i am trying to put the same boundary conditions on the given problem. As you can see my error message pic that the Courant number is reaching way high should i reduce the time step more presently i am trying to run the solution for start time 0.0 end time 0.3 deltaT 0.001 is it the problem? its giving error....problem unresolved.
did you try the new p boundary condition? Maybe you shoud use the "adjustTimeStep yes;" in your controlDict to overcome these huge co numbers.

 wernsen February 4, 2013 08:31

oh and the "internalField 98000" ist the initial value (t=0) of your internal p-field in Pa. I always had problems with a initial value of 0 Pa.

 himanshu28 February 5, 2013 01:16

Quote:
 Originally Posted by wernsen (Post 405902) oh and the "internalField 98000" ist the initial value (t=0) of your internal p-field in Pa. I always had problems with a initial value of 0 Pa.
OK..i have tryed these set of boundary conditions but still my courant number is going very high i think i should pack more number of cells inside my domain.In the previous case (my first post ) i had a single slit and in the box and the mesh count was nearly 1200000+ hence there was no issues with that, in my present case i have on 13000+ cells only i think the cell count that is the mesh may be the reason for it.I am trying to refine my mesh and i think then it should work because according to prescribed boundary conditions in Open Foam and our set boundary conditions are satisfying the flow physics also.i hope it works :rolleyes:

 himanshu28 February 5, 2013 01:22

Quote:
 Originally Posted by asoltoon (Post 405883) Hi, As I see the problem settings is such that the courant number becomes much larger than allowed value and so cause the solution to diverge. you must change your boundary as the courant number reduces. there is some suggestions: 1- decrease the inlet velocity and run the problem again. 2- as wernsen said make the initial pressure equal to inlet pressure and set the outlet pressure as zeroGradient. 3- make a finer mesh so that the courant number will decrease. this method is recommended only if you don't have any permission to change the other B.C.s and will make your solution very time consuming. 4- decrease your time-step to decrease Co Number. 5- a blend of 4 past suggestions. Regards, Ali
Hi,

The 3rd options which us you suggested will work i think. As I think there are less number of cells being packed and hence the my CFL number is shooting up now i am trying to mesh my geometry with finer grid hope it works.

Regards
Himanshu:rolleyes:

 himanshu28 February 8, 2013 08:11

Problem unresolved

1 Attachment(s)
Quote:
Hi,

I tryed your suggestions i refined my mesh, set my boundary conditions as discussed previously but the error is still coming and my Courant number is still shooting up like anything..... i don't know what to do.i will be tell step by step procedure that i did,

1) generated mesh using ICEM--->converted to .msh formate for Ansys fluent.
2) Used conversion option of OpenFoam and converted to foam mesh.
3) Edited my "p , U conditions" -->edited timeStep in "controlDict 0.0001"
4.)Run IcoFoam solver to solve.
5.)the same error after running some iterations.:confused::(:(:(:(

Do i need to have a "setField" file to define pressure conditions inside the domain if required how to do that since i have defined 3 patches only inlet outlet and wall i case across this file searching in tutorials.
I am attaching the pics of my mesh statics.
Attachment 18882

 makaveli_lcf February 8, 2013 09:52

Hi!

Just upload your case or give a link (you can put it on the Googl drive e.g.)

 makaveli_lcf February 8, 2013 09:54

One quick advice: you can start from potentialFoam solution to improve your initial conditions.

 himanshu28 February 8, 2013 10:53