CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   sonicfoam nozzle case (https://www.cfd-online.com/Forums/openfoam-solving/158113-sonicfoam-nozzle-case.html)

rafigh August 16, 2015 00:15

sonicfoam nozzle case
 
2 Attachment(s)
hi
i am try to simulate aerospike nozzle and examine different bc. when i decrease initial p solving diverge. my bc
for p
dimensions [1 -1 -2 0 0 0 0];

internalField uniform 500000;

boundaryField
{
gasInlet
{
// type fixedValue;
// value uniform 800000;
type totalPressure;
p0 uniform 700000;
U U;
phi phi;
rho none;
psi none;
gamma 1.3;
value uniform 364000;

// type zeroGradient;
}
airInlet
{
// type fixedValue;
// value uniform 100000;

type zeroGradient;
}

outlet
{

type waveTransmissive;
field p;
phi phi;
rho rho;
psi thermo:psi;
gamma 1.3;
fieldInf 14000;
lInf 1;
value uniform 14000;

// type zeroGradient;
}

symPlane
{
type symmetry;
}

freestreem
{
type zeroGradient;
}

spikeWall
{
type zeroGradient;
}

frontAndBack
{
type empty;
}
}
for u

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

internalField uniform (100 0 0);

boundaryField
{
gasInlet
{
// type fixedValue;
//value uniform (650 0 0);
type pressureInletOutletVelocity;
phi phi;
rho rho;
value uniform (0 0 0);
}
airInlet
{
// type fixedValue;
// value uniform (10 0 0);
type pressureInletVelocity;
phi phi;
rho rho;
value uniform (0 0 0);
/*
type supersonicFreestream;
pInf 380000;
TInf 300;
UInf (650 0 0);
gamma 1.3;
value uniform (0 0 0);
*/
}

outlet
{
type pressureInletOutletVelocity;
inletValue uniform (0 0 0);
value uniform (0 0 0);
}

symPlane
{
type symmetry;
}

freestreem
{
type supersonicFreestream;
pInf 500000;
TInf 300;
UInf (400 0 0);
gamma 1.3;
value uniform (0 0 0);

// type slip;
}

spikeWall
{
type fixedValue;
value uniform (0 0 0);
}

frontAndBack
{
type empty;
}
}

for T
dimensions [0 0 0 1 0 0 0];

internalField uniform 300;

boundaryField
{
gasInlet
{
type fixedValue;
value uniform 320;
}
airInlet
{
type fixedValue;
value uniform 300;
}

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

symPlane
{
type symmetry;
}

freestreem
{
type inletOutlet;
inletValue uniform 300;
value uniform 300;
}

spikeWall
{
type zeroGradient;
}

frontAndBack
{
type empty;
}
}

I want the flow to be induced by the pressure difference between inlet (exit of the nozzle) and the ambient.Attachment 41433

Attachment 41434



With thanks for your attention

rafigh August 16, 2015 08:57

no one comment???????

mkraposhin August 17, 2015 03:52

Hi, can you show picture with schematic view of your computational domain - where inlet is located, where outlet and so on.

mkraposhin August 17, 2015 03:59

Can you als share your case directory with 0, constant and system?

rafigh August 17, 2015 04:14

thank you for your answer.
please visit this
regards

mkraposhin August 17, 2015 05:37

Quote:

Originally Posted by rafigh (Post 559832)
thank you for your answer.
please visit this
regards

Hi,

information on the link, that you provided do not gives more about your numerical model.

Problem can be:
- in numeric schemes (fvSchemes, fvSolution)
- in physical properties (constant/thermopysicalProperties)
- in boundary conditions (0/)

The first step, i would recommend is to switch outlet pressure condition to totalPressure.

Can you also upload your case here?

rafigh August 17, 2015 06:26

1 Attachment(s)
Attachment 41478

thanks a lot for the reply.
i have attached.

mkraposhin August 17, 2015 16:23

Hi,

I would suggest next steps to improve stability

- change pressure "outlet" condition to totalPressure
Code:

    outlet
    {
        type              totalPressure;
        p0                uniform 350000;
        U                  U;
        phi                phi;
        rho                none;
        psi                none;
        gamma              1.3;
        value              uniform 350000;
    }

- change "freestreem" condition for velocity to slip
Code:

    freestreem
    {
        type            slip;
    }

- change schemes for convection terms to upwind (system/fvSchemes)
Code:

divSchemes
{
    default        none;
    div(phi,U)      Gauss upwind;
    div(phi,e)      Gauss upwind;
    div(phid,p)    Gauss upwind;
    div(phi,K)      Gauss upwind;
    div(phiv,p)    Gauss upwind;
    div(phi,k)      Gauss upwind;
    div(phi,epsilon) Gauss upwind;
    div((muEff*dev2(T(grad(U))))) Gauss linear;
}

- change solution methods for p, U, e (system/fvSolution)
Code:

    "p.*"
    {
        solver            PBiCG;
        preconditioner  DILU;
        tolerance      1e-08;
        relTol          0;
    }

    "(U|e|R).*"
    {
        $p;
    }

    "(k|epsilon).*"
    {
        $p;
    }

- disable relaxation for all fields (system/fvSolution)
Code:

relaxationFactors
{
}

- disable outer corrections, momentum predictor, enable explicit non-orthogonal correction
Code:

PIMPLE
{
    nOuterCorrectors 1;
    nCorrectors      2;
    nNonOrthogonalCorrectors 1;
}

Maybe, it would be better to switch to rhoPimpleFoam instead of sonicFoam. Because rhoPimpleFoam can work without momentumPredictor and energy conservation, formulated in enthalpy.

Also, you must check that max Courant number (Co) do reach values 0.5 or higher.

Also you can try rhoCentralFoam for your case.

Unfortunately, i can't check this case updated with my changes, because polyMesh folder is missing in tgz

rafigh August 17, 2015 18:17

thank you very much for the your exact answer and Attention.
after apply your suggest,i am decrease the ambient pressure and case Converged.:)
i am try rhoCentralFoam but Unfamiliarity with that setup, case diverged.
if i increase the nozzle pressure to supersonic flow, must i change freestreem and outlet BC?
polymesh file i have attached here.


Thanks for all.

rafigh August 18, 2015 15:06

hi dear Matvej.
can you check the k,epsilon,alphat,mut files??
thanks a lot.

rafigh August 18, 2015 16:55

hi matvej
i am decrease the ambient pressure to 14000 and case diverged.
so i refinement mesh to 109000 cell but diverged.

mkraposhin August 19, 2015 13:27

Hi, mohammad

After inspecting your case i found next issues about computational domain and B.C.:

1) Mesh is too thick in z-direction. Despite the absence of third coordinate (Z) in solution, it is a good practice, to have thickness of cells in Z-direction for 2D simulation in OpenFOAM of order 1/100 of some characteristic length. In your case i would propose to make thickness of mesh 100 or more times smaller then you have now

2) Also, checkMesh tells, that you have some edges, that are not aligned or not perpindicular to empy (Z) direction. This usually means, that mesh is corrupted somewhere. See checkMesh log at the end of my message.

3) For supersonic flows you have to change your boundary conditions at inlet as follow:
- if you know velocity and it is supersonic, then you must supply pressure (p), velocity (U) and temperature (T) at inlet
- if you know only pressure at inlet, then you must extend your inlet in upwind direction to build converging-diverging nozzle to resolve subsonic-supersonic flow correctly

I hope, this will help you

Code:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:          9208
    internal points:  0
    faces:            31351
    internal faces:  13229
    cells:            8916
    faces per cell:  5
    boundary patches: 7
    point zones:      0
    face zones:      0
    cell zones:      0
                                                                                                                                                                                                                                           
Overall number of cells of each type:                                                                                                                                                                                                       
    hexahedra:    0                                                                                                                                                                                                                       
    prisms:        8916                                                                                                                                                                                                                     
    wedges:        0                                                                                                                                                                                                                       
    pyramids:      0                                                                                                                                                                                                                       
    tet wedges:    0                                                                                                                                                                                                                       
    tetrahedra:    0                                                                                                                                                                                                                       
    polyhedra:    0                                                                                                                                                                                                                       
                                                                                                                                                                                                                                           
Checking topology...                                                                                                                                                                                                                       
    Boundary definition OK.                                                                                                                                                                                                                 
    Cell to face addressing OK.                                                                                                                                                                                                             
    Point usage OK.                                                                                                                                                                                                                         
    Upper triangular ordering OK.                                                                                                                                                                                                           
    Face vertices OK.                                                                                                                                                                                                                       
    Number of regions: 1 (OK).                                                                                                                                                                                                             
                                                                                                                                                                                                                                           
Checking patch topology for multiply connected surfaces...                                                                                                                                                                                 
    Patch              Faces    Points  Surface topology                                                                                                                                                                                 
    frontAndBack        17832    9208    ok (non-closed singly connected)                                                                                                                                                                 
    outlet              17      36      ok (non-closed singly connected)                                                                                                                                                                 
    freestreem          47      96      ok (non-closed singly connected)                                                                                                                                                                 
    spikeWall          86      176      ok (non-closed singly connected)                                                                                                                                                                 
    gasInlet            2        6        ok (non-closed singly connected)                                                                                                                                                                 
    symPlane            87      176      ok (non-closed singly connected)                                                                                                                                                                 
    airInlet            51      104      ok (non-closed singly connected)                                                                                                                                                                 
                                                                                                                                                                                                                                           
Checking geometry...                                                                                                                                                                                                                       
    Overall domain bounding box (-0.0441409 0 0) (2.07111 0.82878 1)                                                                                                                                                                       
    Mesh (non-empty, non-wedge) directions (1 1 0)                                                                                                                                                                                         
    Mesh (non-empty) directions (1 1 0)                                                                                                                                                                                                     
 ***Number of edges not aligned with or perpendicular to non-empty directions: 7
  <<Writing 14 points on non-aligned edges to set nonAlignedEdges
    Boundary openness (2.96576e-17 7.11784e-17 -1.0531e-19) OK.
    Max cell openness = 2.18691e-16 OK.
    Max aspect ratio = 2.09584 OK.
    Minimum face area = 1.5752e-06. Maximum face area = 0.0662324.  Face area magnitudes OK.
    Min volume = 1.57525e-06. Max volume = 0.00138491.  Total volume = 1.74312.  Cell volumes OK.
    Mesh non-orthogonality Max: 18.7975 average: 4.39822
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 0.402559 OK.
    Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End


rafigh August 19, 2015 22:49

Hi Matvej.
You know what is the reason of diverge case in very low ambient pressure(14000)?

فرستاده شده از GLX G5ِ من با Tapatalk

matzbanni August 20, 2015 02:58

Quote:

Originally Posted by mkraposhin (Post 559920)
Also, you must check that max Courant number (Co) do reach values 0.5 or higher.

Don't understand this part, why?

Regards!

mkraposhin August 20, 2015 04:43

Quote:

Originally Posted by matzbanni (Post 560296)
Don't understand this part, why?

Regards!

I'm sorry, Co do not reach 0.5

mkraposhin August 20, 2015 12:42

Hi, mohammad

Did you fixed your mesh and B.C.?


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