# Interfoam failed to solve for alpha (air-water flow in 3D pipe)

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

 October 28, 2016, 04:11 Interfoam failed to solve for alpha (air-water flow in 3D pipe) #1 Member   Milad Join Date: Jul 2015 Location: USA Posts: 45 Rep Power: 8 Guys, I am getting so confused. I used to simulate 2D air-water two phase flow using interFoam as the solver, but recently I just switched to 3D simulation. Unfortunately I just came up with no results for alpha (volume phase fraction). I used blockMesh to create my geometry as below: /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.01; vertices ( (0 0 0) //0 (0.3535 0.3535 0) //1 (-0.3535 0.3535 0) //2 (-0.3535 -0.3535 0) //3 (0.3535 -0.3535 0) //4 (0.3535 0.3535 30) //5 (-0.3535 0.3535 30) //6 (-0.3535 -0.3535 30) //7 (0.3535 -0.3535 30) //8 (0 0 30) //9 ); blocks ( hex (1 2 3 4 5 6 7 8) (10 10 150) simpleGrading (1 1 1) ); edges ( arc 1 2 (0 0.5 0) arc 2 3 (-0.5 0 0) arc 3 4 (0 -0.5 0) arc 4 1 (0.5 0 0) arc 5 6 (0 0.5 30) arc 6 7 (-0.5 0 30) arc 7 8 (0 -0.5 30) arc 8 5 (0.5 0 30) ); boundary ( inlet { type patch; faces ( (1 2 3 4) ); } outlet { type patch; faces ( (5 6 7 8) ); } fixedWalls { type wall; faces ( (5 6 2 1) (6 7 3 2) (7 8 4 3) (8 5 1 4) ); } ); mergePatchPairs ( ); // ************************************************** *********************** // I was actually wondering if I did not set the proper inlet condition for alpha! /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object alpha.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type inletOutlet; inletValue uniform 0.5; value uniform 0.5; } outlet { type zeroGradient; } fixedWalls { type zeroGradient; } } // ************************************************** *********************** // But just take a look at the result of alpha for example @ t=0.1s: /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0.1"; object alpha.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type inletOutlet; inletValue uniform 0.5; value uniform 0; } outlet { type zeroGradient; } fixedWalls { type zeroGradient; } } // ************************************************** *********************** // I appreciate if anyone could please make any comments on that.

 October 28, 2016, 04:46 #2 Member   Arsalan Join Date: Jul 2014 Posts: 74 Rep Power: 9 Hi Milad, what did you set the inlet boundary condition for velocity? please give detailed information for a more accurate solution. Furthermore, its better to use [CODE] tag for writing dictionaries in your thread, anyway it has a better representation. Regards, Arsalan. mizzou likes this.

October 28, 2016, 11:08
#3
Member

Join Date: Jul 2015
Location: USA
Posts: 45
Rep Power: 8
Quote:
 Originally Posted by arsalan.dryi Hi Milad, what did you set the inlet boundary condition for velocity? please give detailed information for a more accurate solution. Furthermore, its better to use [CODE] tag for writing dictionaries in your thread, anyway it has a better representation. Regards, Arsalan.
Dear Arsalan

Thank you so much for your response. I used fixedVelocity for inlet U. Attached hereby, please find my case file.

Best,
Attached Files
 pipeflow.tar.gz (3.8 KB, 28 views)

 October 29, 2016, 04:20 #4 Member   Brian Willis Join Date: Mar 2011 Location: Cape Town, South Africa Posts: 58 Rep Power: 12 Hi Milad Check your U boundary condition in your 0 time directory. The length of your pipe is along the z-direction. Your U boundary condition on the inlet is (1 0 0). Changing it to (0 0 1) should sort out your problem. I tested it out and it works with just that change. Regards, Brian mizzou likes this. Last edited by Dipsomaniac; October 29, 2016 at 05:11. Reason: spelling

 October 29, 2016, 07:13 #5 Member   Arsalan Join Date: Jul 2014 Posts: 74 Rep Power: 9 Hi Milad, As Brian said, you should modify velocity boundary condition at inlet along the Z direction and normal to the patch (like (0,0,1)),this will solve the problem. Regards, Arsalan. mizzou likes this.

 October 29, 2016, 07:41 #6 Member   Milad Join Date: Jul 2015 Location: USA Posts: 45 Rep Power: 8 Dear fiends Brian and Arsalan, I really appreciate your helps. You are right and that worked. Thank you! Dipsomaniac likes this.