CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Add P_rgh to solver with P (https://www.cfd-online.com/Forums/openfoam/216278-add-p_rgh-solver-p.html)

rmn_990 April 2, 2019 11:57

Add P_rgh to solver with P
 
Hi,
I have an incompressible case and this case has some problems with pressure outlet bounday condition.
it is just a duct with an velocity inlet and an pressure outlet.
https://bugs.openfoam.org/file_downl...=2631&type=bug

I asked a friend why the outlet works like this and I got this message:

MPPICFoam/DPMFoam are incompressible solvers so you could use the uniformDensityHydrostaticPressure. However this is not as accurate or reliable as using p_rgh for strongly buoyant flows so you could change these solvers to solve for p_rgh or fund this development.

I tried uniformDensityHydrostaticPressure but it didn't work. Now, I want to add p_rgh instead of p in my solver.

Do you have any idea of what should I do?
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.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.5 0 0);
        //phi phi.water;
        //alpha alpha.water;
    }

    outlet
    {
        type zeroGradient;
        /*
        type inletOutlet;
        phi phi.water;
        inletValue uniform (0 0 0);
        value uniform (0 0 0);
        */
    }
   
    upperWall
    {
        type noSlip;
        /*
        type inletOutlet;
        phi phi.water;
        inletValue uniform (0 0 0);
        value uniform (0 0 0);
        */
       
    }

    walls
    {
        type noSlip;
    }
   
    sides
    {
        type noSlip;
    }
}

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

Code:

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

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

internalField uniform 0;

boundaryField
{
    inlet
    {
        type fixedFluxPressure;
        phi phi.water;
        value $internalField;
    }

    outlet
    {
        type fixedValue;
        value uniform 0;;
        //phi phi.water;
        //value $internalField;
    }
   
    upperWall
    {
        type zeroGradient;
    }
    walls
    {
        type zeroGradient;
        /*
        type fixedFluxPressure;
        phi phi.water;
        value $internalField;
        */
    }

    sides
    {
        type zeroGradient;
        /*
        type fixedFluxPressure;
        phi phi.water;
        value $internalField;
        */
    }
}

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


LeeRuns April 2, 2019 22:39

Dry but why not use the incompressible solvers for you incompressible case?

rmn_990 April 5, 2019 17:18

Quote:

Originally Posted by LeeRuns (Post 729672)
Dry but why not use the incompressible solvers for you incompressible case?

Thanks for your response. I think I used most of the boundary conditions and none of them works.
What's your suggestion?

wyldckat May 1, 2019 10:53

A few quick answers/questions:
  1. In the first post, the boundary condition for "p" at the inlet is wrong:
    Code:

        inlet
        {
            type fixedFluxPressure;
            phi phi.water;
            value $internalField;
        }

    If the solver is incompressible, then you should not use buoyancy dependent boundary conditions:
    Code:

        inlet
        {
            type zeroGradient;
        }

  2. Why exactly is your flow is buoyant? What is the mechanism that is making it work that way?
    • I ask this, just in case you were misguided somewhere along the development of your project... perhaps the flow is not buoyant by nature and only the particles are inducing a distortion to the flow?

rmn_990 May 1, 2019 14:36

Quote:

Originally Posted by wyldckat (Post 732392)
A few quick answers/questions:
  1. In the first post, the boundary condition for "p" at the inlet is wrong:
    Code:

        inlet
        {
            type fixedFluxPressure;
            phi phi.water;
            value $internalField;
        }

    If the solver is incompressible, then you should not use buoyancy dependent boundary conditions:
    Code:

        inlet
        {
            type zeroGradient;
        }

  2. Why exactly is your flow is buoyant? What is the mechanism that is making it work that way?
    • I ask this, just in case you were misguided somewhere along the development of your project... perhaps the flow is not buoyant by nature and only the particles are inducing a distortion to the flow?

Thanks for your response Bruno.
I tried the boundary condition that you proposed and I can see the problem with outlet boundary condition.
Flow is incompressible and the length of the control volume is less than 10cm. Reynolds number is around 10 and 9.81 gravity.
As far as the dimension is small and also Re is low, I thought that maybe we have buoyant flow. I did this simulation with MPPICInterFoam (with one phase) and everything works well because it works with p_rgh.

I am sure that particles don't have any role in this disturbtion becasue I didn't inject any particle at this stage and I just used MPPICFoam solver.


All times are GMT -4. The time now is 05:30.