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

Mass flow rate issue

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By parthigcar

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 12, 2021, 01:51
Post Mass flow rate issue
  #1
New Member
 
parth
Join Date: Feb 2020
Posts: 23
Rep Power: 6
parthigcar is on a distinguished road
I am trying to solve flow inside an inverted L type of annulus cylinder. I am simulating for one sector of the annulus cylinder. Where there is fixed pressure is provided at the inlet. The outlet is inletOutlet boundary condition. I have set up the case according to the TJunction case, which is also pressure based flow. The inlet pressure is about ~0.21 MPa. And my working material is sodium. I have divided the inlet pressure with the sodium density, and appropriate viscosity has been provided. However, I am not getting the correct mass flow rate at the outlet compared to lumped calculations. Additionally, I took the same geometry and ran the case in fluent, I got the correct mass flow at the outlet. I am not able to figure out where I have made mistake in the OpenFOAM model.

My boundary conditions are as follows:
Velocity boundary conditions
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1912                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     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
{
    inlet
    {
        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }
    walls
    {
        type            noSlip;
    }
    wedge1
    {
        type            symmetry;
    }
    wedge2
    {
        type            symmetry;
    }
    top_walls
    {
        type            noSlip;
    }
    outlet
    {
        type            inletOutlet;
        inletValue      uniform (0 0 0);
        value           uniform (0 0 0);
    }
    interface3
    {
        type            empty;
    }
    interface4
    {
        type            empty;
    }
}



// ************************************************************************* //
Pressure boundary conditions
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1912                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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


internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 238;
    }
    walls
    {
        type            zeroGradient;
    }
    wedge1
    {
        type            symmetry;
    }
    wedge2
    {
        type            symmetry;
    }
    top_walls
    {
        type            zeroGradient;
    }
    outlet
    {
        type            fixedValue;
        value           uniform 0;
    }
    interface3
    {
        type            empty;
    }
    interface4
    {
        type            empty;
    }
}


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

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


internalField   uniform 0.0034;

boundaryField
{
    inlet
    {
        type            turbulentIntensityKineticEnergyInlet;
        intensity       0.05;
        value           uniform 0.0034;
    }
    walls
    {
        type            kqRWallFunction;
        value           uniform 0.0034;
    }
    wedge1
    {
        type            symmetry;
    }
    wedge2
    {
        type            symmetry;
    }
    top_walls
    {
        type            kqRWallFunction;
        value           uniform 0.0034;
    }
    outlet
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }
    interface3
    {
        type            empty;
    }
    interface4
    {
        type            empty;
    }
}


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

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


internalField   uniform 0.1;

boundaryField
{
    inlet
    {
        type            turbulentMixingLengthFrequencyInlet;
        mixingLength    1.2;
        phi             phi;
        k               k;
        value           uniform 0.1;
    }
    walls
    {
        type            omegaWallFunction;
        blended         1;
        beta1           0.075;
        value           uniform 0.1;
    }
    wedge1
    {
        type            symmetry;
    }
    wedge2
    {
        type            symmetry;
    }
    top_walls
    {
        type            omegaWallFunction;
        blended         1;
        beta1           0.075;
        value           uniform 0.1;
    }
    outlet
    {
        type            inletOutlet;
        inletValue      uniform 0.1;
        value           uniform 0.1;
    }
    interface3
    {
        type            empty;
    }
    interface4
    {
        type            empty;
    }
}


// ************************************************************************* //
nut

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

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


internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            calculated;
        value           uniform 0;
    }
    walls
    {
        type            nutkWallFunction;
        value           uniform 0;
    }
    wedge1
    {
        type            symmetry;
    }
    wedge2
    {
        type            symmetry;
    }
    top_walls
    {
        type            nutkWallFunction;
        value           uniform 0;
    }
    outlet
    {
        type            calculated;
        value           uniform 0;
    }
    interface3
    {
        type            empty;
    }
    interface4
    {
        type            empty;
    }
}


// ************************************************************************* //
blockMesh

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
scale 1;

rin  0.28;
rout 0.29;
h0 0;
h1 1.8;
delh 0.0005;
sin30 0.5;
cos30 0.8660254037844387;
cos0 1;
sin0 0;
dr1 $rout - $rin;
dr2 0.06;

  //  (#calc "$rin*$cos30" #calc "$rin*-$sin30" $h0) //0
  //  (#calc "$rout*$cos30" #calc "$rout*-$sin30" $h0) //1
  //  (#calc "$rout*$cos30" #calc "$rout*$sin30" $h0) //2
  //  (#calc "$rin*$cos30" #calc "$rin*$sin30" $h0) //3
vertices
(
    (#calc "$rin*$cos30" #calc "$rin*-$sin30" $h0) //0
    (#calc "$rout*$cos30" #calc "$rout*-$sin30" $h0) //1
    (#calc "$rout*$cos30" #calc "$rout*$sin30" $h0) //2
    (#calc "$rin*$cos30" #calc "$rin*$sin30" $h0) //3
    (#calc "$rin*$cos30" #calc "$rin*-$sin30" $h1) //4
    (#calc "$rout*$cos30" #calc "$rout*-$sin30" $h1) //5
    (#calc "$rout*$cos30" #calc "$rout*$sin30" $h1) //6
    (#calc "$rin*$cos30" #calc "$rin*$sin30" $h1) //7
    (#calc "$rin*$cos30" #calc "$rin*-$sin30" $h1) //8
    (#calc "$rout*$cos30" #calc "$rout*-$sin30" $h1) //9
    (#calc "$rout*$cos30" #calc "$rout*$sin30" $h1) //10
    (#calc "$rin*$cos30" #calc "$rin*$sin30" $h1) //11
    (#calc "$rin*$cos30" #calc "$rin*-$sin30" #calc "$h1+$delh") //12
    (#calc "$rout*$cos30" #calc "$rout*-$sin30" #calc "$h1+$delh") //13
    (#calc "$rout*$cos30" #calc "$rout*$sin30" #calc "$h1+$delh") //14
    (#calc "$rin*$cos30" #calc "$rin*$sin30" #calc "$h1+$delh") //15
    (#calc "($rin+$dr1)*$cos30" #calc "($rin+$dr1)*-$sin30" $h1) //16
    (#calc "($rout+$dr2)*$cos30" #calc "($rout+$dr2)*-$sin30" $h1) //17
    (#calc "($rout+$dr2)*$cos30" #calc "($rout+$dr2)*$sin30" $h1) //18
    (#calc "($rin+$dr1)*$cos30" #calc "($rin+$dr1)*$sin30" $h1) //19
    (#calc "($rin+$dr1)*$cos30" #calc "($rin+$dr1)*-$sin30" #calc "$h1+$delh") //20
    (#calc "($rout+$dr2)*$cos30" #calc "($rout+$dr2)*-$sin30" #calc "$h1+$delh") //21
    (#calc "($rout+$dr2)*$cos30" #calc "($rout+$dr2)*$sin30" #calc "$h1+$delh") //22
    (#calc "($rin+$dr1)*$cos30" #calc "($rin+$dr1)*$sin30" #calc "$h1+$delh") //23
);
blocks
(
// block 1 and 2, x and y direction divisions should be same
// block 2 and 3 z, y direction divisions should be same
// block 1
hex (0 1 2 3 4 5 6 7) (  10    200    450)  simpleGrading (1 1 1)   // bird
// block 2
hex (8 9 10 11 12 13 14 15) (  10    200    15)  simpleGrading (1 1 1)   //head
// block 3
hex (16 17 18 19 20 21 22 23) (  40    200    15)  simpleGrading (1 1 1)    //beak
);

edges
(
  arc 0 3 ($rin 0 $h0)
  arc 1 2 ($rout 0 $h0)
  arc 4 7 ($rin 0 $h1)
  arc 5 6 ($rout 0 $h1)
  arc 8 11 ($rin 0 #calc "$h1")
  arc 9 10 ($rout 0 #calc "$h1")
  arc 12 15 ($rin 0 #calc "$h1+$delh")
  arc 13 14 ($rout 0 #calc "$h1+$delh")
  arc 16 19 (#calc "$rin+$dr1" 0 #calc "$h1")
  arc 17 18 (#calc "$rout+$dr2" 0 #calc "$h1")
  arc 20 23 (#calc "$rin+$dr1" 0 #calc "$h1+$delh")
  arc 21 22 (#calc "$rout+$dr2" 0 #calc "$h1+$delh")
);

boundary
(
    inlet
    {
        type patch;
       faces
        (
            (0 3 2 1)
        );
    }
    walls
    {
        type wall;
       faces
        (
            (7 3 0 4)
            (12 15 11 8)
            (2 6 5 1)
        );
    }
    wedge1
    {
        type symmetry;
       faces
        (
            (5 4 0 1)
            (8 9 13 12)
            (16 17 21 20)
        );
    }
    wedge2
    {
        type symmetry;
       faces
        (
            (3 7 6 2)
            (15 14 10 11)
            (23 22 18 19)
        );
    }
    top_walls
    {
        type wall;
       faces
        (
            (16 19 18 17)
            (12 13 14 15)
            (20 21 22 23)
        );
    }
    outlet
    {
        type patch;
       faces
        (
            (21 17 18 22)
        );
    }

//    defaultFaces
//    {
//        type empty;
//        faces
//        (
//            (4 5 6 7)
//            (8 9 10 11)
//            (23 20 16 19)
//            (14 13 9 10)
//        );
//    }
interface1
{
type empty;
faces
((4 5 6 7));
}
interface2
{
type empty;
faces
((8 9 10 11));
}
interface3
{
type empty;
faces
((23 20 16 19));
}
interface4
{
type empty;
faces
((14 13 9 10));
}
);
mergePatchPairs
(
(interface1 interface2)
);
I would be thankful if anyone has pointed where I am making mistake. I have spent considerable time in this problem

Thank you,
Parth
parthigcar is offline   Reply With Quote

Old   April 12, 2021, 11:32
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
We are not talking about a real pressure for incompressible solvers. The only thing that matters is the pressure gradient which you set with fixedValue. However, you inlet and outlet do have a fixedValue condition which tells you to have a fixed pressure gradient (static pressure).

Based on your boundary conditions, your mass-flow should increase to infinity as you don´t reduce the pressure gradient - for example - reduce the inlet pressure by the dynamic pressure.


The solution of your problem should be easy:
  • Set the inlet boundary to totalPressure

That condition reduces the static pressure at the faces according to the dynamic pressure and keeps the total pressure equal (to the value you specified). Hence, you get an equilibrium between acceleration of your fluid and the pressure gradient.


By the way. If you inlet pressure is around 0.21 MPa, you need to know which pressure you mention here. Is it the total pressure or the static pressure?
You need to know the pressure at the outlet correpsonding to the same type of the inlet. Here, 0.21 MPa corresponding to your outlet is the static-pressure gradient.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   April 12, 2021, 12:03
Default
  #3
New Member
 
parth
Join Date: Feb 2020
Posts: 23
Rep Power: 6
parthigcar is on a distinguished road
Dear Tobi...!!

Thank you for your reply. I understood it should be total pressure at the inlet.

I have really learnt a lot from your youtube videos, they are very much informative.

Best regards,
Parth
Tobi likes this.
parthigcar is offline   Reply With Quote

Reply

Tags
openfoam1912, pimplefoam, pressure boundary, pressure driven flow, velocity boundary


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
Mass flow rate: calculation v/s computation beguxa FLUENT 5 December 2, 2018 22:02
Target Mass Flow Rate Nitin FLUENT 9 June 17, 2017 11:30
Pressure Outlet Targeted Mass Flow Rate LuckyTran FLUENT 1 November 23, 2016 11:40
Mass flow rate boundary condition with negative values ashtonJ CFX 3 November 26, 2014 06:21
Discrete Phase & Mass Flow Rate MagnusZeus FLUENT 0 December 2, 2011 18:57


All times are GMT -4. The time now is 17:27.