CFD Online Discussion Forums

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 05: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
{
type zeroGradient;
}

wall
{
type zeroGradient;
}

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 10: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 12: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 07: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 07: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 01: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 01: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 05: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,
thanks for replying.
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 05: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 06: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 06:39

Thanks &Query
 
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.

asoltoon February 4, 2013 07: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.
if your problem didn't solved I will be glad to help you if I could. ;)

Regards,
Ali

wernsen February 4, 2013 07: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 07: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 00: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 00: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 07:11

Problem unresolved
 
1 Attachment(s)
Quote:

Originally Posted by asoltoon (Post 405897)
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.
if your problem didn't solved I will be glad to help you if I could. ;)

Regards,
Ali

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 08: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 08:54

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

himanshu28 February 8, 2013 09:53

case file on googleDOC
 
Quote:

Originally Posted by makaveli_lcf (Post 406740)
One quick advice: you can start from potentialFoam solution to improve your initial conditions.

https://docs.google.com/file/d/0B8Og...it?usp=sharing

this is my case link at google Drive.

himanshu28 February 11, 2013 08:32

Unresolved problem and Queries
 
Quote:

Originally Posted by asoltoon (Post 405897)
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.
if your problem didn't solved I will be glad to help you if I could. ;)

Regards,
Ali

Hi,
From other post on the forums (http://www.cfd-online.com/Forums/ope...rintstack.html) i came across checking the mesh by "checkMesh" i did that thing and found few things about my mesh bold ones.
Code:

Overall number of cells of each type:
  hexahedra:    223866
    prisms:        0
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:    0

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces ...
    Patch              Faces    Points  Surface topology                 
    wall                21803    21858    ok (non-closed singly connected) 
    inlet              278      300      ok (non-closed singly connected) 
    outlet              493      528      ok (non-closed singly connected) 

Checking geometry...
    Overall domain bounding box (-0.0199212 -4.33681e-19 -0.0008) (-0.00992118 0.01 0.0108)
    Mesh (non-empty, non-wedge) directions (1 1 1)
    Mesh (non-empty) directions (1 1 1)
    Boundary openness (-2.29843e-15 2.69037e-17 -4.91973e-18) OK.
    Max cell openness = 3.26926e-16 OK.
    Max aspect ratio = 21.2719 OK.
    Minumum face area = 1.27927e-10. Maximum face area = 1.16148e-07.  Face area magnitudes OK.
    Min volume = 1.28223e-14. Max volume = 2.27969e-11.  Total volume = 1.00065e-06.  Cell volumes OK.
  Mesh non-orthogonality Max: 43.6834 average: 7.57081
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 1.12467 OK.
    Coupled point location match (average 0) OK.

you can see my cells are very small is it the reason of my Courant number getting raised very high?? i have another doubt that as the flow inside develops in ,since my outlet sections is way small comparative to the wall,are my boundary conditions right to make the flow patterns in side the box ?? what i want as a result is after providing a pressure outlet condition i should get a velocity at the outlet patch since there is no other outlet present in the domain.Is my approach right in setting the boundary conditions since this is the common approach for seeing boundary conditions in the commercial softwares. Do open foam work in same way? i.e. if we provide zeroGradient condition in the 0/p at the outlet then the solver will extrapolate values from inside for the velocity.These are some basic doubts regarding the software if you can throw some light on it.:confused::confused:

asoltoon February 12, 2013 08:08

Hi,

According to CFL condition, your dt should be less than 1.2e-14 sec, so you should make a coarser mesh. I am not an expert on openFoam but as much as I know if you don't overconstrain the B.Cs there should be no problem in the boundary conditions you defined.
I ran your case and worked a little bit on it but no success was observed. I thought that the problem is probably for your Initial Pressure Condition in the domain and it will cause some math. error in the solution but there was no success. I think the first step to solve your problem is to obey the CFL condition(by decreasing dt or making a coarser mesh) and then investigate on the B.Cs.

Regards.
Ali

himanshu28 February 12, 2013 23:43

Quote:

Originally Posted by asoltoon (Post 407399)
Hi,

According to CFL condition, your dt should be less than 1.2e-14 sec, so you should make a coarser mesh. I am not an expert on openFoam but as much as I know if you don't overconstrain the B.Cs there should be no problem in the boundary conditions you defined.
I ran your case and worked a little bit on it but no success was observed. I thought that the problem is probably for your Initial Pressure Condition in the domain and it will cause some math. error in the solution but there was no success. I think the first step to solve your problem is to obey the CFL condition(by decreasing dt or making a coarser mesh) and then investigate on the B.Cs.

Regards.
Ali

Hi,
Thanks for Reply
I also think that it necessary for defining an interior pressure conditions in side the box since i don't think wit the given velocity inlet the solver is developing the interior pressure field. but then if i specify some interior pressure inside the domain then it will start affecting my inlet boundary conditions hence i am totally in a mess how to make this problem as this is on of my projects in the university.And i will now try to coarse my mesh and then try to implement the boundary condition how it might work.if you find some ways than please do share.

Regards
Himanshu sharma


All times are GMT -4. The time now is 04:40.