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/)
-   -   inletOutlet example application (https://www.cfd-online.com/Forums/openfoam-solving/92446-inletoutlet-example-application.html)

RuiVO September 14, 2011 12:10

inletOutlet example application
 
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

romant September 15, 2011 03:54

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.

RuiVO September 15, 2011 04:56

Thank you romant !

B.r.

Rui

miles_davis September 28, 2011 13:23

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

romant September 28, 2011 15:36

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);
}


miles_davis September 28, 2011 16:14

Hi,

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

Quote:

Originally Posted by romant (Post 325977)
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

romant September 28, 2011 16:24

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.

RuiVO September 29, 2011 09:45

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.

miles_davis September 29, 2011 12:12

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

RuiVO October 3, 2011 06:51

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

miles_davis October 3, 2011 09:36

Quote:

Originally Posted by RuiVO (Post 326480)
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 (Post 326480)
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

Shawn_A November 12, 2011 20:05

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.

michael1023 December 14, 2012 01:14

Quote:

Originally Posted by miles_davis (Post 326093)
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.

Mike_star June 8, 2016 04:35

Quote:

Originally Posted by Shawn_A (Post 331841)
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.

Dear Shawn_A,
It's been a month that I am struggling with this BC and I think you are totally right. For a circular boundary some cells would have fixed velocity and some cells would have zero gradient boundary condition.

Do you still agree with this statement?


jeanpinto24| June 10, 2017 16:57

:)
 
Very good explanation!


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