CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Supersonic helium jet with sonicFoam (http://www.cfd-online.com/Forums/openfoam-pre-processing/130282-supersonic-helium-jet-sonicfoam.html)

Intrepid February 23, 2014 12:25

Need serious help please! --- Supersonic helium jet with sonicFoam
 
Hi everyone,

This is my first post on this forum, I hope someone can help me.

I want to simulate a supersonic helium jet coming from a nozzle and expanding into an helium atmosphere (helium jet in helium environment, so the Mach number is calculated with respect to sound velocity in helium).

I want to do it with sonicFoam. I'm new to serious case study with OpenFoam: I've already used it but limited myself to basic properties like zeroGradient and fixedValue...

For now, to simplify the case, my inlet is the exit of the nozzle, so I just want to simulate the jet which goes out of the nozzle, not what happens in the nozzle. My mesh is axisymmetric. This is what the domain looks like:

http://i.imgur.com/lkQEGnA.png

The small white part at the bottom left is the inlet, the big one at the right is the outlet.

The command ideasUnvToFoam worked well and checkMesh says "Mesh OK".

constant/polyMesh/boundary :

Code:

    inlet
    {
        type            patch;
        nFaces          4;
        startFace      10049;
    }
    outlet
    {
        type            patch;
        nFaces          51;
        startFace      10053;
    }
    aboveInlet
    {
        type            wall;
        nFaces          47;
        startFace      10104;
    }
    top
    {
        type            wall;
        nFaces          100;
        startFace      10151;
    }
    front
    {
        type            wedge;
        nFaces          5100;
        startFace      10251;
    }
    back
    {
        type            wedge;
        nFaces          5100;
        startFace      15351;
    }

In the ideal, I'd like to set "top" and "aboveInlet" as open surfaces (so the fluid can leave the domain) but I don't know how to do it, so I've set it to walls.

constant/thermophysicalProperties :

Code:

thermoType
{
    type hePsiThermo;
    mixture pureMixture;
    transport const;
    thermo hConst;
    equationOfState perfectGas;
    specie specie;
    energy sensibleInternalEnergy;
}

mixture
{
    specie
    {
        nMoles 1;
        molWeight 4.0;
    }
    thermodynamics
    {
        Cp 5193.1;
        Hf 0;
    }
    transport
    {
        mu 2.146e-05;
        Pr 0.69738;
    }
}

Is it correct for helium?


0/p :

Code:

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

internalField  uniform 101325;

boundaryField
{
    front
    {
        type            wedge;
    }
    back
    {
        type            wedge;
    }
    top
    {
        type            zeroGradient;
    }
    aboveInlet
    {
        type            zeroGradient;
    }
    inlet
    {
        type          fixedValue;
        value          uniform 1013250;
    }
    outlet
    {
        type          waveTransmissive;
        field          p;
        phi            phi;
        rho            rho;
        psi            thermo:psi;
        gamma          1.66;
        fieldInf        100.0;
        lInf            1;
        value          uniform 101325;
    }
}

0/T :

Code:

dimensions      [0 0 0 1 0 0 0];

internalField  uniform 300;

boundaryField
{
    front
    {
        type            wedge;
    }
    back
    {
        type            wedge;
    }
    top
    {
        type            zeroGradient;
    }
    aboveInlet
    {
        type            zeroGradient;
    }
    inlet
    {
        type            fixedValue;
        value          uniform 350;
    }
    outlet
    {
        type            zeroGradient;
    }
}

0/U :

Code:

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

internalField  uniform (0 0 0);

boundaryField
{
    front
    {
        type            wedge;
    }
    back
    {
        type            wedge;
    }
    top
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    aboveInlet
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    inlet
    {
        type            pressureInletVelocity;
        phi            phi;
        rho            rho;
        value          uniform (0 0 0);
    }
    outlet
    {
        type            zeroGradient;
    }
}

I want the flow to be induced by the pressure difference between inlet (exit of the nozzle) and the environment, so I don't want to fix the inlet velocity.
I've been looking for the right boundary conditions for weeks. I've browsed the Doxygen documentation and found pressureInletVelocity and waveTransmissive which seem to be what I'm looking for... but here is what I obtain at t=6.9e-7s with a time step of dt=3e-9s:

http://i.imgur.com/s3FdxBo.png

The maximum velocity in the X-direction should be along the X-axis, right? I think my boundary conditions are wrong... What's wrong with my files?

Could someone help me, please? It's driving me crazy...

Another question related to sonicFoam: when I try to visualize pressure or temperature in paraView on a calculation made by sonicFoam (this one, for instance), the values are always between 0 and 1, even if I fix them to other values! Could you tell me what happens?


Thank you very much in advance.

Intrepid February 25, 2014 13:59

Anyone? Please I really need help with OpenFoam! I know it's a classic case but I can't get it work... I can't find a complete tutorial... People are making videos of supersonic flows but never really say HOW they do it...

How would you do to simulate a supersonic flow coming from a nozzle, with sonicFoam or maybe rhoCentralFoam (I don't even know if there is a difference)? What would your boundary conditions be? Can you share your p, T and U files? Thank you very much to those who'll take the time to help...

tomf February 26, 2014 04:15

Hi,

I think you may need to change your static pressure on the inlet to a total pressure. Also it may just be some startup effects. Or maybe your mesh density is not sufficient. Hard to tell.

About ParaView: probably you have to set to automatically scale to the entire data range. Usually you open ParaView, show some data, choose your favorite colorbar, tick automatically scale to data range, hit set as default and close ParaView. Next time it should scale to the entire range automatically. But the behavior has changed a bit from version to version.

Regards,
Tom

Intrepid February 26, 2014 10:26

Hi tomf, thank you for your reply!

I've tried totalPressure as mentionned here, like this in 0/p:
Code:

inlet
{
        type            totalPressure;
        U                U;
        phi              phi;
        rho              none;
        psi              thermo:psi;
        gamma        1.66;
        p0              uniform 101325;
}

but that doesn't change anything.

Here is my mesh:
http://i.imgur.com/sYFcFiS.png

You think it could come from the fact that my cells are too big?


For pressure and temperature visualization in paraView, it also comes from a BC since with pressureInletOutletVelocity, I guess I once had the correct values...

tomf February 26, 2014 10:40

Maybe you can get some grading in the y-direction, so you have more cells near the edge of your nozzle. Than also run the simulation longer and see what happens.

In using the totalPressure BC, p0 should be your total pressure (I assume this should be 1013250 Pa, as you have in your code example for pressureInletVelocity).

So:

Code:

inlet
{       
    type            totalPressure;       
    U                U;       
    phi              phi;       
    rho              none;       
    psi              thermo:psi;       
    gamma        1.66;       
    p0              uniform 1013250;
}

Good luck,
Tom


All times are GMT -4. The time now is 21:53.