CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

Boundary Conditions for Flow Problem

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 21, 2012, 09:30
Default Boundary Conditions for Flow Problem
  #1
Member
 
Join Date: Mar 2012
Location: Munich, Germany
Posts: 67
Rep Power: 5
treima is on a distinguished road
Hello,

Ive some questions about how to implement boundary conditions.

I have a domain, where something flows through, in my case Im using rhoCentralFoam.
At the inlet Ive a fixed velocity, a fixed temperature and a fixed pressure. At the outlet I want to set a fixed pressure and give no defaults to velocity and temperature. These should be calculated from the neighbour cells in the timestep before.
I hope, you know what I mean

How can I do this in OpenFoam? Is there a possiblity with the standard bc or groovyBC?


regards

treima
treima is offline   Reply With Quote

Old   June 21, 2012, 09:39
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by treima View Post
Hello,

Ive some questions about how to implement boundary conditions.

I have a domain, where something flows through, in my case Im using rhoCentralFoam.
At the inlet Ive a fixed velocity, a fixed temperature and a fixed pressure. At the outlet I want to set a fixed pressure and give no defaults to velocity and temperature. These should be calculated from the neighbour cells in the timestep before.
I hope, you know what I mean

How can I do this in OpenFoam? Is there a possiblity with the standard bc or groovyBC?
I say "groovyBC" to all of these questions, but in your case fixedValue and zeroGradient is sufficient. Although you might want to set the pressure to zeroGradient at the inlet instead of fixedValue which you're proposing
gschaider is offline   Reply With Quote

Old   June 21, 2012, 09:52
Default
  #3
Member
 
Join Date: Mar 2012
Location: Munich, Germany
Posts: 67
Rep Power: 5
treima is on a distinguished road
Thanks.

Ive tried fixedValue and zeroGradient. If I set these outlet conditions,

U - zeroGradient
p - fixedValue
T - zeroGradient

the case gives a floating exeption and problemes with the courant-number.

If I set

U - zeroGradient
p - zeroGradient
T - zeroGradient

the case works, but doesnt match to my ideas.

The best think would be, if its possible to set a "new" boundary condition for every timestep. But if this isnt possible ive to setup a new case with other physical relations. Im just wondering that this case havent discussed before


regards

treima
treima is offline   Reply With Quote

Old   June 21, 2012, 10:07
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by treima View Post
Thanks.

Ive tried fixedValue and zeroGradient. If I set these outlet conditions,

U - zeroGradient
p - fixedValue
T - zeroGradient

the case gives a floating exeption and problemes with the courant-number.

If I set

U - zeroGradient
p - zeroGradient
T - zeroGradient

the case works, but doesnt match to my ideas.

The best think would be, if its possible to set a "new" boundary condition for every timestep. But if this isnt possible ive to setup a new case with other physical relations. Im just wondering that this case havent discussed before


regards

treima
What is the inlet condition for the pressure?
gschaider is offline   Reply With Quote

Old   June 22, 2012, 07:20
Default
  #5
Member
 
Join Date: Mar 2012
Location: Munich, Germany
Posts: 67
Rep Power: 5
treima is on a distinguished road
My inlet conditions are

p - fixedValue, value uniform 1,
T - fixedValue, value uniform 1,
U - fixedValue, value uniform (3 0 0).

And my outlet conditions just should be

p - fixedValue, value uniform 1,

T and U should be calculated from the domain in the timestep before.
treima is offline   Reply With Quote

Old   June 22, 2012, 15:11
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by treima View Post
My inlet conditions are

p - fixedValue, value uniform 1,
T - fixedValue, value uniform 1,
U - fixedValue, value uniform (3 0 0).

And my outlet conditions just should be

p - fixedValue, value uniform 1,

T and U should be calculated from the domain in the timestep before.
Usually you fix the pressure only on the outlet and on the inlet have a zeroGradient. Your boundary condition says "I want a velocity, but no pressure drop". It is very hard for a self-respecting fluid (fluid with a viscosity) to fulfill that and probably while trying to do so your solver blows up
gschaider is offline   Reply With Quote

Old   June 25, 2012, 02:34
Default
  #7
Member
 
Join Date: Mar 2012
Location: Munich, Germany
Posts: 67
Rep Power: 5
treima is on a distinguished road
Thank you for your advice.

Ive tried to fix the pressure at the outlet and set zeroGradient at the Inlet, but I still cant calculate a solution because of a "floating execption"...

Perhaps this is caused by my geomety, which you can see below. My idea was to set at

inlet: p - fixedValue, T - fixedValue, U - fixedValue
outlet: p - fixedValue
Gamma_free and Gamma_fixed: slip condition (u*n=0).

I was searching for good choices for the remaing conditions. I want to use these conditions, because they are just the first step in a bigger calculation. The aim is to do a very simple shape-optimization with adjoint equations for this case. On Gamma_free should be a given pressure-distribution.
Attached Images
File Type: png geometry_2dee.png (6.3 KB, 36 views)
treima is offline   Reply With Quote

Old   June 25, 2012, 05:34
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by treima View Post
Thank you for your advice.

Ive tried to fix the pressure at the outlet and set zeroGradient at the Inlet, but I still cant calculate a solution because of a "floating execption"...
Can be a lot of things. A stack-trace would be helpful
gschaider is offline   Reply With Quote

Old   July 2, 2012, 05:21
Default
  #9
Member
 
Join Date: Mar 2012
Location: Munich, Germany
Posts: 67
Rep Power: 5
treima is on a distinguished road
Ive solved this problem.
If you take a very low temperature, you have a mach-number > 1, so you have to set just inlet-conditions and no condition at the outlet. Now Im taking a appropriate proportion between velocity and temperature, so that

Ma = (|U|^2)/T < 1

for all timesteps and every cell. Now it works very well.


Now, in my next step, I want to implement the adjoint equation. I have calculated the adjoint equations and boundary conditions. In the subsonic case, for example, I have just one boundary condition, a function dependent of all adjoint variables. A small example is, with a the adjoint variables,

a1 + 2 a2 + 3 a3 + 4 a4 = 0.

Is it possible to implement this in OpenFoam? Ive a underdetermined equation system as a boundary condtion...
treima is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
non reflective boundary conditions for incompresible flow Pascal_doran OpenFOAM Programming & Development 16 August 25, 2015 05:35
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
Import problem ARC Open Source Meshers: Gmsh, Netgen, CGNS, ... 0 February 27, 2010 11:56
CG, BICGSTAB(2) : problem with matrix operation and boundary conditions moomba Main CFD Forum 2 February 17, 2010 04:37
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07


All times are GMT -4. The time now is 14:44.