CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Boundary Conditions Problem

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 30, 2013, 05:04
Question Boundary Conditions Problem
  #1
Senior Member
 
Himanshu Sharma
Join Date: Jul 2012
Posts: 101
Rep Power: 13
himanshu28 is on a distinguished road
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 projet2.png
/*--------------------------------*- 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
himanshu28 is offline   Reply With Quote

Old   January 30, 2013, 10:26
Default
  #2
Member
 
Ali Khalifesoltani
Join Date: Mar 2011
Location: Esfahan, Iran
Posts: 56
Rep Power: 15
asoltoon is on a distinguished road
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
asoltoon is offline   Reply With Quote

Old   January 30, 2013, 12:46
Default Thanks &Query
  #3
Senior Member
 
Himanshu Sharma
Join Date: Jul 2012
Posts: 101
Rep Power: 13
himanshu28 is on a distinguished road
Quote:
Originally Posted by asoltoon View Post
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 jet27.pngvector.png

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 is offline   Reply With Quote

Old   February 1, 2013, 07:42
Default Pressure Outlet condition ??
  #4
Senior Member
 
Himanshu Sharma
Join Date: Jul 2012
Posts: 101
Rep Power: 13
himanshu28 is on a distinguished road
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 newjet.png
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.
himanshu28 is offline   Reply With Quote

Old   February 2, 2013, 07:54
Default
  #5
Member
 
Ali Khalifesoltani
Join Date: Mar 2011
Location: Esfahan, Iran
Posts: 56
Rep Power: 15
asoltoon is on a distinguished road
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
asoltoon is offline   Reply With Quote

Old   February 3, 2013, 01:14
Unhappy Problem unresolved
  #6
Senior Member
 
Himanshu Sharma
Join Date: Jul 2012
Posts: 101
Rep Power: 13
himanshu28 is on a distinguished road
Quote:
Originally Posted by asoltoon View Post
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 jet2.png

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.
himanshu28 is offline   Reply With Quote

Old   February 3, 2013, 01:39
Default
  #7
Member
 
Ali Khalifesoltani
Join Date: Mar 2011
Location: Esfahan, Iran
Posts: 56
Rep Power: 15
asoltoon is on a distinguished road
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
asoltoon is offline   Reply With Quote

Old   February 4, 2013, 05:05
Default
  #8
Senior Member
 
Himanshu Sharma
Join Date: Jul 2012
Posts: 101
Rep Power: 13
himanshu28 is on a distinguished road
Quote:
Originally Posted by asoltoon View Post
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.cordi.jpgdia.pngerror.jpg
himanshu28 is offline   Reply With Quote

Old   February 4, 2013, 05:13
Default
  #9
Member
 
Martin
Join Date: Nov 2011
Posts: 35
Rep Power: 14
wernsen is on a distinguished road
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;
    }
}

// ************************************************************************* //
wernsen is offline   Reply With Quote

Old   February 4, 2013, 06:04
Default
  #10
Member
 
Ali Khalifesoltani
Join Date: Mar 2011
Location: Esfahan, Iran
Posts: 56
Rep Power: 15
asoltoon is on a distinguished road
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
asoltoon is offline   Reply With Quote

Old   February 4, 2013, 06:39
Default Thanks &Query
  #11
Senior Member
 
Himanshu Sharma
Join Date: Jul 2012
Posts: 101
Rep Power: 13
himanshu28 is on a distinguished road
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.
himanshu28 is offline   Reply With Quote

Old   February 4, 2013, 07:11
Default
  #12
Member
 
Ali Khalifesoltani
Join Date: Mar 2011
Location: Esfahan, Iran
Posts: 56
Rep Power: 15
asoltoon is on a distinguished road
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
asoltoon is offline   Reply With Quote

Old   February 4, 2013, 07:28
Default
  #13
Member
 
Martin
Join Date: Nov 2011
Posts: 35
Rep Power: 14
wernsen is on a distinguished road
Quote:
Originally Posted by himanshu28 View Post
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 is offline   Reply With Quote

Old   February 4, 2013, 07:31
Default
  #14
Member
 
Martin
Join Date: Nov 2011
Posts: 35
Rep Power: 14
wernsen is on a distinguished road
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.

Last edited by wernsen; February 4, 2013 at 07:32. Reason: typo
wernsen is offline   Reply With Quote

Old   February 5, 2013, 00:16
Lightbulb
  #15
Senior Member
 
Himanshu Sharma
Join Date: Jul 2012
Posts: 101
Rep Power: 13
himanshu28 is on a distinguished road
Quote:
Originally Posted by wernsen View Post
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
himanshu28 is offline   Reply With Quote

Old   February 5, 2013, 00:22
Default
  #16
Senior Member
 
Himanshu Sharma
Join Date: Jul 2012
Posts: 101
Rep Power: 13
himanshu28 is on a distinguished road
Quote:
Originally Posted by asoltoon View Post
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
himanshu28 is offline   Reply With Quote

Old   February 8, 2013, 07:11
Unhappy Problem unresolved
  #17
Senior Member
 
Himanshu Sharma
Join Date: Jul 2012
Posts: 101
Rep Power: 13
himanshu28 is on a distinguished road
Quote:
Originally Posted by asoltoon View Post
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.

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.
mesh.jpg
himanshu28 is offline   Reply With Quote

Old   February 8, 2013, 08:52
Default
  #18
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 250
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Hi!

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

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   February 8, 2013, 08:54
Default
  #19
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 250
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
One quick advice: you can start from potentialFoam solution to improve your initial conditions.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   February 8, 2013, 09:53
Question case file on googleDOC
  #20
Senior Member
 
Himanshu Sharma
Join Date: Jul 2012
Posts: 101
Rep Power: 13
himanshu28 is on a distinguished road
Quote:
Originally Posted by makaveli_lcf View Post
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.

Last edited by himanshu28; February 9, 2013 at 00:34.
himanshu28 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 05:21
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 17:44
CG, BICGSTAB(2) : problem with matrix operation and boundary conditions moomba Main CFD Forum 2 February 17, 2010 03:37
Problem with Boundary conditions Mahiboobswamulu Main CFD Forum 10 August 26, 2003 13:24
boundary conditions problem reinaldo kuhn Phoenics 1 March 27, 2003 11:46


All times are GMT -4. The time now is 11:36.