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

rhoCentralFoam - Supersonic nozzle BC's

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By shock77

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 3, 2021, 13:36
Post rhoCentralFoam - Supersonic nozzle BC's
  #1
New Member
 
Join Date: Feb 2021
Posts: 3
Rep Power: 5
retroglass is on a distinguished road
Hello, I've been using OpenFOAM for a few months, so I am fairly new to most of the applications. I've been trying to simulate a supersonic nozzle at various altitudes to see the flow conditions inside the nozzle. Only have the divergent part where my inlet is the "throat" and the outlet is the nozzle outlet.


I've been meaning to ask a few questions regarding my system. Since I don't have a reservoir or a combustion chamber, is it safe to use a fixedValue for the pressure at the throat? (Where I calculated the appropriate values.) I ran it a few different back pressures but the exit results don't seem to get affected by it. What would be the reason?



I read some of the applications of pressureInletOutletVelocity. Would it be feasible for this simulation? Tried using it for the inlet (throat) with totalPressure, but got a negative initial temperature error.


I've added my p, T and U case files. Thank you all for your time.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
/*   Windows 32 and 64 bit porting by blueCAPE: http://www.bluecape.com.pt   *\
|  Based on Windows porting (2.0.x v4) by Symscape: http://www.symscape.com   |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 101325.1; //101325

boundaryField
{
    front
    {
        type            empty;
    }
    back 
    {
        type            empty;
    }
    inlet
    {
    type        totalPressure; //totalPressure 
    value        uniform 5134898;
    rho        rho;
    psi        thermo:psi;
    p0        uniform 5134898;
    gamma        1.4;
    field        p;
    }
    
    nozzle
    {
        type            zeroGradient;
    }
    
    outlet
    {
        
        type            waveTransmissive;
        gamma           1.4;
    field        p;
    phi        phi;
    rho        rho;
    psi        thermo:psi;
        fieldInf        101325;
          lInf            15;
        value           uniform 101325;
    }
    symmetry
    {
        type            symmetryPlane;
    }    
}


 // ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
/*   Windows 32 and 64 bit porting by blueCAPE: http://www.bluecape.com.pt   *\
|  Based on Windows porting (2.0.x v4) by Symscape: http://www.symscape.com   |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    location    "0";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (100 0 0); // ()

boundaryField
{
    front
    {
        type            empty;
    }
    
    back
    {
        type            empty;
    }
    
    inlet
    {
        type           fixedValue; 
        value        uniform ( 1213 0 0 );

        //type        pressureInletOutletVelocity;
        //value        uniform ( 1213 0 0 );
    }
    nozzle
    {
    
        type           slip;

    }
    outlet
    {
       type        zeroGradient; 
    }
    
    symmetry
    {
        type            symmetryPlane;
    }
}


 // ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
/*   Windows 32 and 64 bit porting by blueCAPE: http://www.bluecape.com.pt   *\
|  Based on Windows porting (2.0.x v4) by Symscape: http://www.symscape.com   |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0";
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField   uniform 274;

boundaryField
{
    front
    {
        type            empty;
    }
    back
    {
        type            empty;
    }
    inlet
    {
        type           fixedValue; //totalTemperature
        value        uniform 2965;
        gamma        1.4;
        T0        uniform 2965;
        inletValue    uniform 2965;
        psi        thermo:psi;
        field        U;          
    }
    nozzle
    {
        type            zeroGradient;
    }
    outlet
    {    
        type            zeroGradient;
    }
    
    symmetry
    {
        type            symmetryPlane;
    }
}


// ************************************************************************* //
retroglass is offline   Reply With Quote

Old   June 4, 2021, 06:42
Default
  #2
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 8
shock77 is on a distinguished road
Hi,


I would mesh the entire nozzle (convergent and divergent part). For the inlet I would choose totalPressure, totalTemperature, pressureInletOutletVelocity. I suppose in your case slip walls should be ok. At the outlet waveTransmissive for p and U and zeroGradient for T.


A 2D-Mesh is not applicable for a nozzle. I hope you mean axially symmetrical mesh, basically a wedge.
hogsonik and retroglass like this.
shock77 is offline   Reply With Quote

Old   June 4, 2021, 12:10
Default
  #3
New Member
 
Join Date: Feb 2021
Posts: 3
Rep Power: 5
retroglass is on a distinguished road
Hi shock,

Quote:
Originally Posted by shock77 View Post
I hope you mean axially symmetrical mesh, basically a wedge.
Yes, I totally forgot to mention that. It is a 2D axis-symmetric mesh.

Quote:
Originally Posted by shock77 View Post
I would mesh the entire nozzle (convergent and divergent part).
I used method of characteristics for the divergent part of course, but I don't think there is such an ideal approach for the congervent part right? I remember someone mentioning like basic rule of thumbs would be enough mostly.

Quote:
Originally Posted by shock77 View Post
For the inlet I would choose totalPressure, totalTemperature, pressureInletOutletVelocity. I suppose in your case slip walls should be ok. At the outlet waveTransmissive for p and U and zeroGradient for T.
waveTransmissive outlet for the velocity gave me more stable results. Thanks for that! And using fixedValue for the pressure at the throat is what's making the exit pressure constant at all back pressures I implemented. (totalPressure at the throat doesn't make much sense I think?)

Using totalPressure with a convergent part is more feasible as you suggested. I'll give that a try.

Thank you so much.
retroglass is offline   Reply With Quote

Old   June 7, 2021, 05:00
Default
  #4
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 8
shock77 is on a distinguished road
Hi,


I am glad your results improved!


Using fixedPressure at the throat can be very tricky, thats why I suggested to model the convergent and divergent part of the nozzle and to use totalPressure. The reason is the following:


Imagine a long throttle, lets say 100 mm long. What you learn is that the throttle becomes critical, but thats in fact not entirely true. For like 90% of the throttle you will have Ma: 0.8-0.9, only at the exit of throat you will have Ma = 1.
shock77 is offline   Reply With Quote

Old   June 8, 2021, 08:42
Default
  #5
New Member
 
Join Date: Feb 2021
Posts: 3
Rep Power: 5
retroglass is on a distinguished road
Hi,



Quote:
Imagine a long throttle, lets say 100 mm long. What you learn is that the throttle becomes critical, but thats in fact not entirely true. For like 90% of the throttle you will have Ma: 0.8-0.9, only at the exit of throat you will have Ma = 1.
Yes, now I understand why some method of characteristics papers said about how the mach distribution around the throat should be circular. (As opposed to being like a vertical cut.)


With totalPressure and totalTemperature I got some good results. But I noticed that if I dont give a slight initial velocity for the internalField the case just diverges to unreal velocities like 10^38 m/s. Do you have any idea why that happens?


Thanks again!



retro.
retroglass is offline   Reply With Quote

Old   June 8, 2021, 17:33
Default
  #6
New Member
 
Lewis
Join Date: Jun 2021
Posts: 26
Rep Power: 5
cfdcheckers is on a distinguished road
Quote:
Originally Posted by shock77 View Post
Hi,


I would mesh the entire nozzle (convergent and divergent part). For the inlet I would choose totalPressure, totalTemperature, pressureInletOutletVelocity. I suppose in your case slip walls should be ok. At the outlet waveTransmissive for p and U and zeroGradient for T.


A 2D-Mesh is not applicable for a nozzle. I hope you mean axially symmetrical mesh, basically a wedge.

Would these same BCs work for a compressible but subsonic flow? I am trying to work out one such case using rhoSimpleFoam but my solver crashes.
cfdcheckers is offline   Reply With Quote

Old   June 9, 2021, 04:37
Default
  #7
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 8
shock77 is on a distinguished road
Yes, you can also use the totalPressure BC for subsonic flows, but the formulation of the total pressure changes, see here: https://cpp.openfoam.org/v3/a02627.html


And also there is no need to use waveTransmissive, since you do not have anny shockwaves. As far as I know you use totalPressure and fixedPressure for inlet and outlet in subsonic flows.
shock77 is offline   Reply With Quote

Old   June 9, 2021, 05:39
Default
  #8
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 802
Blog Entries: 1
Rep Power: 18
dlahaye is on a distinguished road
My doubt here is whether in the regime in which 0.4 <= Mach-number <= 1 pressure waves might arise that will reflect from the outlet patch and cause spurious effects.

Any ideas?
dlahaye is offline   Reply With Quote

Old   June 9, 2021, 10:45
Default
  #9
New Member
 
Lewis
Join Date: Jun 2021
Posts: 26
Rep Power: 5
cfdcheckers is on a distinguished road
Quote:
Originally Posted by shock77 View Post
Yes, you can also use the totalPressure BC for subsonic flows, but the formulation of the total pressure changes, see here: https://cpp.openfoam.org/v3/a02627.html


And also there is no need to use waveTransmissive, since you do not have anny shockwaves. As far as I know you use totalPressure and fixedPressure for inlet and outlet in subsonic flows.

Yup, I think it's a good pointer and that should be fine. I am however stuck with the corresponding T and U BCs for inlet and outlet. I tried setting mass flow rate for U with those pressure BCs but it doesn't quiet work - probably because of bad T BCs.
cfdcheckers is offline   Reply With Quote

Old   June 10, 2021, 06:22
Default
  #10
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 8
shock77 is on a distinguished road
Quote:
Originally Posted by retroglass View Post
Hi,



Yes, now I understand why some method of characteristics papers said about how the mach distribution around the throat should be circular. (As opposed to being like a vertical cut.)


With totalPressure and totalTemperature I got some good results. But I noticed that if I dont give a slight initial velocity for the internalField the case just diverges to unreal velocities like 10^38 m/s. Do you have any idea why that happens?


Thanks again!



retro.

Sometime when I start with 0 m/s I get strange oscillations. There is a reason, but I have actually forgotten way. I dont think its the checker board problem, but also in my cases it helps to start with like 1 m/s.
shock77 is offline   Reply With Quote

Old   April 5, 2024, 13:24
Exclamation Problems with simulation control
  #11
New Member
 
Join Date: Mar 2024
Posts: 1
Rep Power: 0
ok2ood is on a distinguished road
Hi there,


I am also simulating a CD nozzle with rhoCentralFoam but I am having trouble with actually getting the simulation ready, as I get many errors:


#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::sqrt(Foam::Field<double>&, Foam::UList<double> const&) at ??:?
#4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::sqrt<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&) in "/opt/openfoam9/platforms/linux64GccDPInt32Opt/bin/rhoCentralFoam"
#5 ? in "/opt/openfoam9/platforms/linux64GccDPInt32Opt/bin/rhoCentralFoam"
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7 ? in "/opt/openfoam9/platforms/linux64GccDPInt32Opt/bin/rhoCentralFoam"



I've seen that changing deltaT and other controlDict parameters it actually simulates for a few iterations but again stops, but then all the residuals and everything is 0, so I don't think it is actually simulating.


May I get some help on this topic please.


Many thanks in advance.
ok2ood is offline   Reply With Quote

Reply

Tags
nozzle flow, openfoam, rhocentralfoam


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
Help: rhoCentralFoam de Laval Nozzle supersonic shock waves vizvaz OpenFOAM Running, Solving & CFD 2 August 15, 2022 09:27
kOmegaSST Boundary Conditions for Supersonic Nozzle shang2 OpenFOAM Running, Solving & CFD 2 September 17, 2018 14:06
Supersonic Nozzle Exhaust Simulation mikeh FLUENT 0 May 1, 2014 22:28
calculate a nozzle flow using rhoCentralFoam hg2lf OpenFOAM 0 October 25, 2012 22:26
some questions for supersonic channel nozzle goldenland FLUENT 2 November 4, 2007 22:18


All times are GMT -4. The time now is 12:50.