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

Strange Results at Tank Outlet with InterFoam

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

Like Tree5Likes
  • 1 Post By wyldckat
  • 4 Post By wyldckat

Reply
 
LinkBack Thread Tools Display Modes
Old   June 19, 2013, 22:51
Default Strange Results at Tank Outlet with InterFoam
  #1
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 137
Rep Power: 7
mgdenno is on a distinguished road
Hello,

I am experiencing weird results at the outlet of a tank I am trying to simulate. The simulation is a tank that is open to the atmosphere at the top and has two pipes in the bottom, one is the inlet (taller one) and one is the outlet (shorter one). Solver is interFoam.

Overview

Both the inlet and outlet pipes have fixed value velocities of 0.77 m/s in the z-direction. The inlet seems to work as needed but the outlet does not. It appears (I believe) that because the outlet boundary is a vector acting in the negative z-direction, the y-direction and x-direction components of the flow approaching the outlet ultimately get reflected back upward back into the domain. Does this makes sense? See the following images and boundary conditions.

Based on what I am seeing it appears that the fixed value outlet boundary is not correct for what I am trying to achieve. Is there an average magnitude outlet boundary such that the outlet flow rate is maintained but the direction of the velocity vector is not limited to being normal to the patch? Any other suggestions? I would like to be able to control both the inlet and outlet flow rates.

Alpha1 Slice

Velocity Slice

Velocity Slice Close-up

U
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.0                                 |
|   \\  /    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 0.7700);
    }

    outlet
    {
        type            fixedValue;
        value           uniform (0 0 -0.7700);
    }

    "walls_.*"
    {
        type            fixedValue;
		value           uniform (0 0 0);
    }

    atmosphere
    {
        type            pressureInletOutletVelocity;
        phi             phi;
        value           uniform (0 0 0);
    }

}

// ************************************************************************* //
p_rgh
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            buoyantPressure;
        value           uniform 0;
    }

    outlet
    {
	    type            inletOutlet;
	    inletValue      uniform 0;
	    value           uniform 0;
    }

    "walls_.*"
    {
        type            buoyantPressure;
        value           uniform 0;
    }

    atmosphere
    {
        type            totalPressure;
        p0              uniform 0;
        U               U;
        phi             phi;
        rho             none;
        psi             none;
        gamma           1;
        value           uniform 0;
    }

}

// ************************************************************************* //
alpha1
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      alpha1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //.

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            fixedValue;
	    value		    uniform 1;
    }

    outlet
    {
        type            inletOutlet;
        inletValue      uniform 1;
        value           uniform 0;
    }

    "walls_.*"
    {
        type            zeroGradient;
    }

    atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }
}

// ************************************************************************* //
mgdenno is offline   Reply With Quote

Old   June 20, 2013, 18:25
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Matthew,

From what I could very briefly see, specially when I look at "p_rgh", I think you should read this: dambreak tutorial's weird velocity field. post #7

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   June 20, 2013, 22:38
Default
  #3
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 137
Rep Power: 7
mgdenno is on a distinguished road
Bruno,

Thank you for the suggestion. I have initialized the p_rgh field using funkySetFields. I will post back with my findings.

Matt
mgdenno is offline   Reply With Quote

Old   June 26, 2013, 21:08
Default
  #4
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 137
Rep Power: 7
mgdenno is on a distinguished road
Just a quick update: I ran the simulation after initializing the the p_rgh field, but unfortunately it did not change the result.

Any other thoughts?
mgdenno is offline   Reply With Quote

Old   June 27, 2013, 17:43
Default
  #5
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Matthew,

Can you show the snapshot of the "p_rgh" field at time "0" and another from a time a little bit later?

In addition, a snapshot that shows what the mesh looks like.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   June 27, 2013, 22:58
Default
  #6
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 137
Rep Power: 7
mgdenno is on a distinguished road
Hi Bruno,

Thanks for your interest in my problem. I have created the screen shots that you requested, and a few extras too.

Here is of the p_rgh field at t=0 seconds . This reflects to field values that I set using setFields which I calculated in a spreadsheet shown here.

Here is the p_rgh field at t=1 second re-scaled to show the full range of values.

Here is a closeup of the mesh and the velocity field.

Here is a screen shot (at t=1) only showing the range of p_rgh values between the maximum value at t=0 and the maximum value at t=1, and here is a similar close-up of the outlet.

Thanks again.

Matt
mgdenno is offline   Reply With Quote

Old   June 28, 2013, 15:47
Default
  #7
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Matthew,

From the image with Uz of the mesh at the outlet, it looks like you've got serious mesh resolution problem. Basically you're seeing the opposite of a jet stream. I'll try to explain without images:
  1. Imagine the jet coming out of an F-16 jet engine.
  2. Now, imagine that you generated a mesh over the jet, where the mesh refinement is only greater from the engine outlet to half of the jet's length.
  3. What do you see after this more refined region? A big blob of kinetic energy trying to flow away from the jet engine
So, my advice, based on these images you've shown, is to increase the refinement zone around the outlet, so that the simulated fluid can better reflect the real nature of the flow.


Another advice is to first simplify you case into a 2D case. This way you can first diagnose what you need to do in this case, for the mesh and the boundary conditions.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   June 30, 2013, 22:38
Default
  #8
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 137
Rep Power: 7
mgdenno is on a distinguished road
Bruno,

Thank again for your help.

I had considered setting up a 2D version for this case, but thought that this one was going to be straight forward. That was foolish of me .

Anyway, I have now setup a 2D case with the same mesh refinement as the 3D case. Oddly, it doesn't suffer the same problem as the 3D case, but this may be because the flow patterns in the 2D case are quite different than the 3D case due to the inlet and outlet pipes obstructing the entire domain instead of just a small part like in the 3D one.

Here is a screen shot of the 2D case.

I think I will try adding refinement to the 3D case and try that.

I will report back with my results.

Matt
mgdenno is offline   Reply With Quote

Old   July 3, 2013, 22:40
Default
  #9
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 137
Rep Power: 7
mgdenno is on a distinguished road
Hi Bruno,

So, I added some more refinement near the inlet and outlet of the tank. The resulting velocity (in the z direction) is here and a close-up showing the mesh refinement is here. At this point the cells nearest the outlet are approximately 0.01 meters and the velocity through the outlet is 0.77 m/s. Unfortunately the behavior seems to be the same only more well defined. Do you think that the mesh needs more refining? Or maybe the wrong boundary condition? Or as I am writing this I am thinking that I haven't really tried any different discretization schemes.

I currently have for the velocity:
Code:
div(rho*phi,U)  Gauss upwind;
I think I will try a second order scheme and see what happens.

Matt
mgdenno is offline   Reply With Quote

Old   July 4, 2013, 04:11
Default
  #10
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
Quote:
Originally Posted by mgdenno View Post
Hi Bruno,

I think I will try a second order scheme and see what happens.

Matt
I strongly doubt that will help. A second order scheme will reduce diffusion, but diffusion is not the culprit here. Either your boundary conditions at the outlet are not appropriate, or your simulation is not converging. Did you compare your boundary conditions with tutorial cases, e.g. interFoam/ras/waterChannel?

- Anton
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   July 5, 2013, 01:59
Default
  #11
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
setting velocity at outlet isn't correct.you better set there the pressure.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   July 14, 2013, 21:48
Default
  #12
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 137
Rep Power: 7
mgdenno is on a distinguished road
Sorry for the delayed response. I appreciate your feedback, but got wrapped up in some other projects.

@Anton
You are correct. The schemes had little to no affect on the behavior that I am seeing. I also suspected that this would be the case, but thought that I would see for myself. Thanks for the recommended tutorial case. I have run quite a few what I will call "open channel" cases successfully in the past, unfortunately, this tank case with a specified outlet flow rate has some interesting (unwanted) behavior at the outlet. I feel certain that it is an issue with the outlet boundary condition; in order to specify a flow rate it appears that the available BCs assume the flow is normal to the face. I believe that this is the source of my problems.

@immortality
I have tried the pressure boundary in the past and it works fine, except it doesn't give me the easy control over the outlet flow rate that I was hoping for. However, I may have to reconsider the setup such that I can use the pressure boundary instead.

Thanks

Matt
mgdenno is offline   Reply With Quote

Old   July 16, 2013, 17:20
Default
  #13
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

@Matt: I was going to suggest that you set the pressure BC on the inlet and outlet to zero gradient, but then it came to me:
  • What's the actual inlet and outlet area/diameter sizes?
  • Have you confirmed in ParaView?
  • Are you using the mesh/geometry in millimetres or in metres?
  • Have you confirmed that you're using the correct fluid properties?
Because if my guess is correct, the geometry/mesh is in millimetres and 0.77 m/s at either inlet/outlet implies that you'll see some gruesome water effects, such as the sort-of-capillary-rise of the backlash at the outlet, where the water being sucked out from the sides squeezes the water near the centre axis into going up and at higher speeds!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   July 17, 2013, 06:11
Default
  #14
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Hi Bruno
whats gruesome water effects?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   July 21, 2013, 05:38
Default
  #15
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Ehsan,

Quote:
Originally Posted by immortality View Post
whats gruesome water effects?
Well... imagine any task you do every day, such as opening a door or picking up a glass. Now imagine that you use 1000 times the nominal force you usually use. What would happen to the door and glass?

This is the kind of image I was trying to convey. By using 0.77 m/s on an inlet or outlet, where the size of said inlet/outlet are 1000 times smaller then they were meant to be, then it means that the fluid will have to be sort-of-squished 1000 times more than it was originally intended. Which is what I deduce that is what's occurring in this case, since the outlet is squeezing a massive jet of fluid in the wrong direction!

Or imagine the opposite: if the geometry was at the right scale, but the fluid were set to move 1000 times faster, that would mean 770 m/s. Water at this speed is... well... extremely dangerous?

Best regards,
Bruno
immortality likes this.
wyldckat is offline   Reply With Quote

Old   July 30, 2013, 23:12
Default
  #16
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 137
Rep Power: 7
mgdenno is on a distinguished road
Hi Bruno,

I believe that my geometry is in meters as intended and that the fluid properties are correct (water and air). I have checked the dimensions in paraview and they are appear to be correct.

While using a pressure outlet boundary seems to solve the issue of the flow being reflected back into the domain, I was hoping to eventually be able to specify time series inflow and outflow pumping rates and see how the flow patterns in the tank change. This would require that I be able to specify flow rates at both the inlet and the outlet to the tank.

I am thinking that in order to specify a flow rate at the outlet I may need to change the extent of my domain to include part of the outlet pipe, such that the point where the flow is converging to exit the tank is not at the boundary. Thoughts?

The case can be found here if anyone is interested. This case is not a real project case, but just a test case to iron out this kind of issue before starting any "real" cases.

Any feedback is welcome.

Matt
mgdenno is offline   Reply With Quote

Old   August 17, 2013, 16:35
Default
  #17
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Matt,

Many thanks for sharing the case! I think I found the reason why you have the outlet re-injecting flow back into the tank

Remember when we talked about mesh resolution? Well, there are two more details you should have checked:
  1. Time resolution, but only in the sense of inspecting what was happening around the outlet. And what happens during the first second is extremely important, so you should have saved more time snapshots for the first second.
  2. Resulting from the previous point, the conclusion is that the extension of the high resolution zone around the outlet is not nearly enough for the flow to properly stabilize!
I honestly have to say that this is another one of those crazy CFD cases I really like! Check the sequence of attached images!

So, what I did for examining this case, was:
  1. Change the run time settings in "controlDict" to simulate only 1 second and to save every 0.01s.
  2. Used the "Slice" filter to view the flow near the outlet.
  3. Changed the representation to Uz and the scale limits to around +-0.095 m/s.
  4. Applied the "Glyph" filter to the "Slice" entry and chose to display the glyphs as 2D arrows, with the "Scale Mode" off, the respective factor at 0.02 and unchecked the "Mask Points" option.

The explanation of what happened is as follows:
  1. After 0.01s, the flow was already well oriented, after some pressure adjustment had already occurred.
  2. At around 0.06s, a circulation centre appeared (aka a vortex) near the centre of the outlet boundary.
  3. At around 0.15s, there is a clear shape inside the refined zone, which looks like a ball-reshaped vortex of fluid (imagine a conic vortex, constrained a bit at the top of the cone).
  4. This shape is moving upwards, away from the outlet.
  5. At around 0.25s, the centre of this ball-reshaped vortex hits the boundary between the high refinement zone and the lower refined zone of the mesh, near the outlet.
  6. After that, at around 0.28s, the ball-reshaped vortex is changing shape, due to the loss of mesh resolution, leading the Finite Volume algorithm to do it's best to preserve the mass flow inside the cells. This makes the centre of the vortex completely change its dynamics and it's as if the refinement boundary became a flow bouncing wall.
  7. At around 0.33s, the centre ball-reshaped vortex completely outside of the high refinement zone and has got a centre of upward flow of around 0.04 m/s!
  8. At around 0.36s, the centre of the vortex has already managed to create a massive upward suction effect (>0.09 m/s) near the boundary between refinement levels, which has already lead the FV algorithm to propagate the suction effect from the centre of the high refinement zone!
  9. At around 0.60s, the high suction effect that was felt inside the high refinement zone, has reached the boundary between the levels. And the awesome detail is that the centre inside the high refinement zone has already reached an upward speed of 0.985 m/s!
  10. At 1.0s, the end of my simulation, shows that the maximum upward speed reduced to 0.935 m/s and is located above in the lower refinement zone.
And so, the reason for the problem is now explained! It's not the boundary conditions themselves to be blamed here, nor a problem with a high Courant number, nor even the schemes! The problem is the mesh refinement that is not respecting the requirements of the flow itself.


In a few minutes I'll upload the modified case to my Dropbox account, along with some images of the flow.

edit: The links to the files on my Dropbox:

Best regards,
Bruno
Attached Images
File Type: jpg DetailedFlow.0000.jpg (102.5 KB, 180 views)
File Type: jpg DetailedFlow.0001.jpg (102.5 KB, 144 views)
File Type: jpg DetailedFlow.0002.jpg (102.4 KB, 134 views)
File Type: jpg DetailedFlow.0003.jpg (103.3 KB, 119 views)
File Type: jpg DetailedFlow.0004.jpg (103.4 KB, 348 views)

Last edited by wyldckat; August 17, 2013 at 18:01. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   August 18, 2013, 21:18
Default
  #18
Senior Member
 
Matthew Denno
Join Date: Feb 2010
Posts: 137
Rep Power: 7
mgdenno is on a distinguished road
Wow, Bruno thanks for looking at the case and for providing such a detailed description of what is happening and how you came to the conclusion. I am just getting back from traveling (away from the internet ). I am going to download the files you uploaded right now an dig into them. I will post back after I have had a chance to process.

Also, I am almost done developing a new mesh that also includes the outlet pipes. It should be interesting to see how the solution for the new mesh compares. I will share it once it is "done".
mgdenno 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
strange curvature with interFoam (comparison with Brackbill work) duongquaphim OpenFOAM Running, Solving & CFD 23 July 25, 2013 01:03
interFoam 2.1.x gives wrong results on low Froude numbers lt.quibbler OpenFOAM Running, Solving & CFD 12 June 14, 2012 08:06
Strange behaviour on outlet boundary using LES segersson OpenFOAM Running, Solving & CFD 0 December 9, 2009 04:57
Outlet boundary condition for pd in InterFoam gopala OpenFOAM Running, Solving & CFD 0 March 19, 2008 10:26
VOF Outlet boundary condition in cfd - ace JM Main CFD Forum 0 December 15, 2006 09:07


All times are GMT -4. The time now is 06:53.