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

interFoam: T-junction outlet boundary conditions

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By gkarlsen
  • 1 Post By gkarlsen

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 2, 2020, 12:35
Default interFoam: T-junction outlet boundary conditions
  #1
New Member
 
Carlos
Join Date: Feb 2020
Location: Barcelona
Posts: 19
Rep Power: 6
cmoreno98 is on a distinguished road
Hello everybody,

I'm running some simulations in a T-junction (water enters through the vertical pipe and air through the horizontal one) using interFoam. The full case folder can be downloaded HERE (includes a .log file of the last simulation).

The geometry and the mesh are the following (428k cells):






Something strange is happening at the outlet, bubbles are not leaving the pipe in a proper way. These are the last pictures of the simulation, before the Courant number blows up:




Air velocity is 0.5 m/s, water velocity is also 0.5 m/s. DeltaT is 1e-6, endTime is 0.0512. I paste here alpha.air, p_rgh and U files:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      alpha.air;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

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

    inlet2
    {
        type            fixedValue;
        value		uniform 0;
    }

    walls1
    {
        type            constantAlphaContactAngle;
        theta0          155;
        limit           gradient;
        value           uniform 0;
    }

    walls2
    {
        type            fixedValue;
        value		uniform 0;
    }

    outlet
    {
        type            zeroGradient;
    }
}

// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     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
{
    inlet1
    {
        type            fixedFluxPressure;
        value           $internalField;
    }

    inlet2
    {
        type            fixedFluxPressure;
        value           $internalField;
    }

    walls1
    {
        type            zeroGradient;
    }

    walls2
    {
        type            zeroGradient;
    }

    outlet
    {
        type            fixedValue;
	value		$internalField;
    }
}

// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (0 0 0);

boundaryField
{
    inlet1
    {
        type            fixedValue;
        value           uniform (0.5 0 0);
    }

    inlet2
    {
        type            fixedValue;
        value           uniform (0 -0.5 0);
    }

    walls1
    {
        type            noSlip;
    }

    walls2
    {
        type            noSlip;
    }

    outlet
    {
        type            zeroGradient;
    }
}

// ************************************************************************* //

I don't know where the error is. Outlet BC are zeroGradient for alpha.air and U files and fixedValue uniform 0 for pressure file (atmospheric pressure), all of them make sense to me.

What should I change? Any help is appreciated,

Carlos
cmoreno98 is offline   Reply With Quote

Old   April 5, 2020, 12:59
Default
  #2
New Member
 
Carlos
Join Date: Feb 2020
Location: Barcelona
Posts: 19
Rep Power: 6
cmoreno98 is on a distinguished road
Can someone help me, please?
cmoreno98 is offline   Reply With Quote

Old   April 6, 2020, 13:46
Default
  #3
New Member
 
Carlos
Join Date: Feb 2020
Location: Barcelona
Posts: 19
Rep Power: 6
cmoreno98 is on a distinguished road
I would appreciate it
cmoreno98 is offline   Reply With Quote

Old   April 6, 2020, 17:07
Default
  #4
Member
 
Geir Karlsen
Join Date: Nov 2013
Location: Norway
Posts: 59
Rep Power: 14
gkarlsen is on a distinguished road
Hi,

I downloaded and modified your case as follows:
Controldict:
AdjustTimeStep: Yes
MaxCo: 1
MaxAlphaCo: 0.5

Boundary conditions for outlet patch:
U: pressureInletOutletVelocity
p_rgh: prghTotalPressure, P0 uniform 1e5
alpha.air: inletOutlet, inletvalue 0

Seems to run just fine. The time step is low, but that is to be expected as your geometry is only about 6 mm long. The velocity is quite significant for such a small geometry

Animation of my results:
https://drive.google.com/file/d/19v-...ew?usp=sharing
cmoreno98 likes this.
gkarlsen is offline   Reply With Quote

Old   April 8, 2020, 12:29
Default
  #5
New Member
 
Carlos
Join Date: Feb 2020
Location: Barcelona
Posts: 19
Rep Power: 6
cmoreno98 is on a distinguished road
Quote:
Originally Posted by gkarlsen View Post
Hi,

I downloaded and modified your case as follows:
Controldict:
AdjustTimeStep: Yes
MaxCo: 1
MaxAlphaCo: 0.5

Boundary conditions for outlet patch:
U: pressureInletOutletVelocity
p_rgh: prghTotalPressure, P0 uniform 1e5
alpha.air: inletOutlet, inletvalue 0

Seems to run just fine. The time step is low, but that is to be expected as your geometry is only about 6 mm long. The velocity is quite significant for such a small geometry

Animation of my results:
https://drive.google.com/file/d/19v-...ew?usp=sharing
Hello gkarlsen,

thank you very much! The key was to activate AdjustTimeStep, limiting the Courant number. I have 2 questions:
  1. How do you export the results of the simulation in 3D? (the .avi file that you have shared)
  2. If you have a look at the outlet, the diameter of the bubbles gets smaller when leaving the geometry. Is there a way to modify it? It looks like they are being "absorbed" at the exit. Which boundary condition should we change? I want the bubbles to remain the same size when they go through the outlet.

Thank you in advance,

Carlos
cmoreno98 is offline   Reply With Quote

Old   April 9, 2020, 17:14
Default
  #6
Member
 
Geir Karlsen
Join Date: Nov 2013
Location: Norway
Posts: 59
Rep Power: 14
gkarlsen is on a distinguished road
Quote:
Originally Posted by cmoreno98 View Post
Hello gkarlsen,
  1. How do you export the results of the simulation in 3D? (the .avi file that you have shared)
  2. If you have a look at the outlet, the diameter of the bubbles gets smaller when leaving the geometry. Is there a way to modify it? It looks like they are being "absorbed" at the exit. Which boundary condition should we change? I want the bubbles to remain the same size when they go through the outlet.
Hi, glad you got it to work

I used paraview "save animation" to export each timestep to a png. You can combine these to make a video file. The filter used is "clip" set to alpha scalar (not inverted). Reduce opacity to "see through" the bubbles.

It could be advantageous to extend your computational domain if you want to capture the actual flow conditions at the outlet. Are you trying to replicate experimental conditions? Is your geometry actually submerged in water or air?
cmoreno98 likes this.
gkarlsen is offline   Reply With Quote

Old   April 9, 2020, 19:27
Default
  #7
New Member
 
Carlos
Join Date: Feb 2020
Location: Barcelona
Posts: 19
Rep Power: 6
cmoreno98 is on a distinguished road
Quote:
Originally Posted by gkarlsen View Post
Hi, glad you got it to work

I used paraview "save animation" to export each timestep to a png. You can combine these to make a video file. The filter used is "clip" set to alpha scalar (not inverted). Reduce opacity to "see through" the bubbles.
Thanks, I'll do it the next time.

Quote:
Originally Posted by gkarlsen View Post
It could be advantageous to extend your computational domain if you want to capture the actual flow conditions at the outlet. Are you trying to replicate experimental conditions? Is your geometry actually submerged in water or air?
Yes, I want to replicate an experiment. The following picture shows the experiment results (left) and the results of a simulation that Aboukhedr et al. (2018 paper) did in OpenFOAM (right):



Here the inlets are changed (liquid through the horizontal and air through the vertical), but the results at the outlet should be similar.
In both cases the bubbles are exiting the geometry without any deformation. I want to replicate this behavior. I don't know if just changing some BC I can get this result or if the problem is more complex.


In the paper they use the following BCs:



I copied the BCs and I got the same results as before, the diameter of the bubbles gets smaller at the outlet... Any idea?

Thank you very much gkarlsen
cmoreno98 is offline   Reply With Quote

Old   April 10, 2020, 04:08
Default
  #8
Member
 
Geir Karlsen
Join Date: Nov 2013
Location: Norway
Posts: 59
Rep Power: 14
gkarlsen is on a distinguished road
There is probably a "correct" way to do this, but personally I would just elongate the horizontal part of the pipe for the simulation, and then cut it back to size during post processing. This should eliminate the disturbance from the BC at the outlet. I do not think bubbles would exit undisturbed in real life. The bouyancy/gravity alone could warp them.
gkarlsen is offline   Reply With Quote

Old   May 20, 2022, 16:37
Default Can you request help
  #9
New Member
 
mumu
Join Date: May 2022
Posts: 3
Rep Power: 4
mumuaye is on a distinguished road
Hello

I'm new to OpenFOAM and I'm trying to run a similar question. The blockMesh has always been unsuccessful, can you give me a blockMesh file?

Thank you.
mumuaye is offline   Reply With Quote

Reply

Tags
boundary condition, bubble, interfoam, t-junction


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
interFoam (HELYX-OS) pressure boundary conditions SFr OpenFOAM Running, Solving & CFD 8 June 23, 2016 17:36
Velocity vector in impeller passage ngoc_tran_bao CFX 24 May 3, 2016 22:16
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 09:44
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05


All times are GMT -4. The time now is 12:45.