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

inletOutlet example application

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

Like Tree9Likes
  • 8 Post By miles_davis
  • 1 Post By Shawn_A

Reply
 
LinkBack Thread Tools Display Modes
Old   September 14, 2011, 12:10
Default inletOutlet example application
  #1
Member
 
Rui Vizinho de Oliveira
Join Date: Sep 2011
Posts: 31
Rep Power: 5
RuiVO is on a distinguished road
Hello all, I'm new to openFoam and I need help besides that provided by the openFoam tutorials and UserGuide.

Can I have an example on how to apply an inletOutlet boundary condition on a far field like zone in order to analyse an airfoil?

The files concerning this boundary condition are pressure "p" and velocity "U" at /0 folder.

Best regards
RuiVO is offline   Reply With Quote

Old   September 15, 2011, 03:54
Default
  #2
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 359
Rep Power: 11
romant is on a distinguished road
for something far field, take a look at the motorbike example under .../tutorials/simpleFoam/motorBike . It is similar to simulating an airfoil, but in this case you are using a motor bike in a wind tunnel so to say.
__________________
~roman
romant is offline   Reply With Quote

Old   September 15, 2011, 04:56
Default
  #3
Member
 
Rui Vizinho de Oliveira
Join Date: Sep 2011
Posts: 31
Rep Power: 5
RuiVO is on a distinguished road
Thank you romant !

B.r.

Rui
RuiVO is offline   Reply With Quote

Old   September 28, 2011, 13:23
Default
  #4
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 5
miles_davis is on a distinguished road
Hi
I rebound on this question because I am a bit confused:
in this tuto outletinlet is written:
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value $internalField;
}

Does that means:
- if the velocity is directed inwanrd the domain, the velocity value will be set to zero
- if it is directed outward the domain velocity is set to the internalfield value (I guess this is the value in the cell neigbouring the boundary face)

I was under the impression that this BC was made to fix value to zeroGradient if the flow was going outward.

So I do not understand why two values are given.

Thanks
miles_davis is offline   Reply With Quote

Old   September 28, 2011, 15:36
Default
  #5
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 359
Rep Power: 11
romant is on a distinguished road
Hej,

the mention of the internal field means that it is set to the original value that is stated under internal field at the beginning of the file.

it is part of the macro substitution system of OpenFOAM. the value behind the keyword "internalField" at the beginning of the input file, can be used at any position by stating $internalField , this will be substituted at the call of the file and when written back into a file after the start file it will be the value that is stated at the internalValue field.

as an example

Code:
internalField uniform (0 0 0);

outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value $internalField;
}
can be written as

Code:
internalField uniform (0 0 0);

outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
__________________
~roman
romant is offline   Reply With Quote

Old   September 28, 2011, 16:14
Default
  #6
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 5
miles_davis is on a distinguished road
Hi,

thanks for your detailed answer.
There are a few things that I still don't get.

Quote:
Originally Posted by romant View Post
Code:
 
internalField uniform (0 0 0);
 
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
- the inlet value will be set if the flow goes inward?
- if it goes outward it would be a zerogradient set up?
So why do you specify a value?
- Do you know if there is any way to fix the value at a boundary face from to the one calculated in the neighbouring cell?

Best regards,

Miles
miles_davis is offline   Reply With Quote

Old   September 28, 2011, 16:24
Default
  #7
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 359
Rep Power: 11
romant is on a distinguished road
i am not quite sure. i usually use this condition for outlet if i don't know if i have backflow. in this case i get inflow but not forced, but just drawn in by pressure differences.

your second question, it should be something like zeroGradient, since this will set the same value on the boundary as is in the neighboring cell.
__________________
~roman
romant is offline   Reply With Quote

Old   September 29, 2011, 09:45
Default
  #8
Member
 
Rui Vizinho de Oliveira
Join Date: Sep 2011
Posts: 31
Rep Power: 5
RuiVO is on a distinguished road
I think there should be a little more detail in the description of the BC functions, since there is so much people with the same doubts about what is the meaning of this particular BC or that BC, it should be included a little explanation of what these BC do...

Best regards.
RuiVO is offline   Reply With Quote

Old   September 29, 2011, 12:12
Default
  #9
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 5
miles_davis is on a distinguished road
Sorry guys

I am struggling on another subject (installation off SWAK4FOAM actually)
I have read various things.
Let's take a domain with an inlet_surf and an outlet_surf.
We try to set P and U boundary conditions!

inlet_surf
{
type inletOutlet;
inletValue uniform (5 0 0);
value uniform (0 0 0);
}
if the velocity goes inward (i.e. from the surface to the domain)
the value (5 0 0) will be applied to the velocity vector
if the velocity goes outward (i.e. from the domain to the surface)
the velocity gradient in the normal direction to the face will be set to 0

let's now take the outlet surface
outlet_surf
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
if the velocity goes inward (i.e. from the domain to the surface)
the value (0 0 0) will be applied to the velocity vector
if the velocity goes outward (i.e. from the domain to the surface)
the velocity gradient in the normal direction to the face will be set to 0

For the pressure we want the exact opposite effect.
So in order not to get confused with directions for outlet_surface one should better use a outletInlet BC.
outlet_surf
{
type outletInlet;
outletValue uniform 0;
value uniform 0;
}

So if velocity goes outward at the exit (from the domain to the surf) the value 0 will be set to the pressure. Otherwise the normal gradient will be set to zero.

This is what I have understood so far.
A confusing thing is that in the usergude it is written:
“inletOutlet Switches U and p between fixedValue and zeroGradient depending on direction of U”

but this Bc works also for k or esplion etc...

Please if you do not agree with my post do not hesitate to correct it.
Than I will move it to a new poste “inletoutlet for dummies”. So if any beginner has the same concern he will have a quick and easy answer!

Regards,


Miles
miles_davis is offline   Reply With Quote

Old   October 3, 2011, 06:51
Default
  #10
Member
 
Rui Vizinho de Oliveira
Join Date: Sep 2011
Posts: 31
Rep Power: 5
RuiVO is on a distinguished road
Superb Miles Davis !

But what is the meaning of "value" then ?

What is it for?

We have the inletValue to determine what happens when the velocity goes inward (i.e. from the surface to the domain) in the case of a inletOutlet B.C. and ZeroGradient is applied when the inverse happens.

This "value" has some usefulness ?

And what is the difference between inletOutlet and outletInlet B.C.'s ?

Best regards

Rui Oliveira
RuiVO is offline   Reply With Quote

Old   October 3, 2011, 09:36
Default
  #11
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 5
miles_davis is on a distinguished road
Quote:
Originally Posted by RuiVO View Post
Superb Miles Davis !

But what is the meaning of "value" then ?

What is it for?

We have the inletValue to determine what happens when the velocity goes inward (i.e. from the surface to the domain) in the case of a inletOutlet B.C. and ZeroGradient is applied when the inverse happens.

This "value" has some usefulness ?
yeah I tortured myself with this one.
Since I am still a OF dummy I am gonna quote the OF wiki

"value: is used if no "valueExpression" is given. value: is used for the first timestep/iteration if "valueExpression" is specified.
If "valueExpression" is specified without setting "value", 0 is taken for the first timestep/iteration. (might cause an fpe)"

So "value" should be called "defaultvalue" or "initializing value" instead!

Quote:
Originally Posted by RuiVO View Post
And what is the difference between inletOutlet and outletInlet B.C.'s ?

Best regards

Rui Oliveira
The difference between outletinlet and Inletoutlet is the test you make on the velocity orientation
- inletOultet you test if the velocity is going inward (phi<0) and in this case you apply the inlet value you have specified.

- outletInlet, is is the opposite: you test if the velocity is goint outward (phi>0) and in this case you apply the outlet specified value.

Tell me if it is clear for you. so we can call the post "Inlet/oulet for dummies"


Miles

P.S.: Sorry to have applied the rule number one to lose somebody: introducing a new term in an explanation without any definition.
phi is the flow rate through a face. so it is the dot product of vector velocity and face normal vector.
In OF the normal vector for a boundary face points outward the domain.
so if phi=vel*normal <0 : velocity is going inward the domain
if phi=vel*normal>0: velocity is going outward the domain
miles_davis is offline   Reply With Quote

Old   November 12, 2011, 21:05
Default
  #12
Member
 
Shawn
Join Date: Oct 2011
Posts: 56
Rep Power: 5
Shawn_A is on a distinguished road
I was thinking how this would work if I had a single circular (assume 2D) boundary and applied this conditon to it.

U:
circularboundary
{
type inletOutlet;
inletValue uniform (5 0 0);
value uniform (0 0 0);
}

p:
circularboundary
{
type outletInlet;
outletValue uniform 0;
value uniform 0;
}

So I would have a fixed velocity on some "inlet" cells and zero gradient on "outlet" cells; and fixed pressure some "outlet" cells and zero gradient on some "inlet" cells?

I suppose this could be very confusing for the solver, and I don't know if these conditions are applied piecewise to each cell face or to the entire boundary as a whole. I can see that there would be problems where adjacent cells could have an inlet conditon and a zero gradient condition.
atg likes this.
Shawn_A is offline   Reply With Quote

Old   December 14, 2012, 02:14
Default
  #13
New Member
 
Qiang Zhou
Join Date: May 2010
Location: Tongji University, Shanghai, China
Posts: 27
Rep Power: 7
michael1023 is on a distinguished road
Quote:
Originally Posted by miles_davis View Post
Sorry guys

I am struggling on another subject (installation off SWAK4FOAM actually)
I have read various things.
Let's take a domain with an inlet_surf and an outlet_surf.
We try to set P and U boundary conditions!

inlet_surf
{
type inletOutlet;
inletValue uniform (5 0 0);
value uniform (0 0 0);
}
if the velocity goes inward (i.e. from the surface to the domain)
the value (5 0 0) will be applied to the velocity vector
if the velocity goes outward (i.e. from the domain to the surface)
the velocity gradient in the normal direction to the face will be set to 0

let's now take the outlet surface
outlet_surf
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}
if the velocity goes inward (i.e. from the domain to the surface)
the value (0 0 0) will be applied to the velocity vector
if the velocity goes outward (i.e. from the domain to the surface)
the velocity gradient in the normal direction to the face will be set to 0

For the pressure we want the exact opposite effect.
So in order not to get confused with directions for outlet_surface one should better use a outletInlet BC.
outlet_surf
{
type outletInlet;
outletValue uniform 0;
value uniform 0;
}

So if velocity goes outward at the exit (from the domain to the surf) the value 0 will be set to the pressure. Otherwise the normal gradient will be set to zero.

This is what I have understood so far.
A confusing thing is that in the usergude it is written:
“inletOutlet Switches U and p between fixedValue and zeroGradient depending on direction of U”

but this Bc works also for k or esplion etc...

Please if you do not agree with my post do not hesitate to correct it.
Than I will move it to a new poste “inletoutlet for dummies”. So if any beginner has the same concern he will have a quick and easy answer!

Regards,


Miles
Hi, Miles.

Here is what I understand for inletOutlet BC as below.
1. The meaning for that “inletOutlet Switches U and p between fixedValue and zeroGradient depending on direction of U” is choosing fixedValue for p and U when the direction of U is inward (inlet), and zeroGradient when the direction of U is outward (outlet).
2. As for the outletInlet, the positions of fixedValue and zeroGradient is switched, e.g. fixedValue for p and U when the direction of U is outward (outlet).
3. inletValue is used to express the fixedValue.
4. Value is used as the initial value of BC at time 0.
michael1023 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
inletOutlet b.c. vaina74 OpenFOAM Running, Solving & CFD 5 August 26, 2010 11:23
Others library application for OpenFoam 1.5 in Windows lcnmy OpenFOAM Installation on Windows, Mac and other Unsupported Platforms 2 July 21, 2010 20:54
grep -r inletOutlet smillion OpenFOAM 5 May 31, 2010 05:21
RasInterFoam STRANGE RESULTS AT BOUNDARY kumar2 OpenFOAM Running, Solving & CFD 8 March 24, 2008 19:38
Is Playstation 3 cluster suitable for CFD work hsieh OpenFOAM 8 March 12, 2008 05:58


All times are GMT -4. The time now is 13:55.