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

Trying to convert a case from laminar to turbulent (K-OmegaSST)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 29, 2020, 02:53
Question Trying to convert a case from laminar to turbulent (K-OmegaSST)
  #1
Senior Member
 
Sultan Islam
Join Date: Dec 2015
Location: Canada
Posts: 141
Rep Power: 10
EternalSeekerX is on a distinguished road
Hello everyone,

I am currently working on a supersonic Fighter Jet validation case. As I posted before, its an OpenFOAM 4 case, but I am working on improving it. I ran the Laminar Case with no issues, and now I want to get turbulence case going.

One issue I am running into is creating BC for alphat, omega, nut and K.

These are my current settings:

Turbulence Properties (These values were taken from a similar case I was looking into):
Code:
/*--------------------------------*- C++ -*----------------------------------*\
|       o          |                                                          |
|    o     o       | HELYX-OS                                                  |
|   o   O   o      | Version: v2.4.0                                           |
|    o     o       | Web:     http://www.engys.com                            |
|       o          |                                                          |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version 2.0;
    format ascii;
    class dictionary;
    location constant;
    object turbulenceProperties;
}

    simulationType RAS;
    
    RAS {
        RASModel kOmegaSST;
        turbulence on;
        printCoeffs on;
         kOmegaSSTCoeffs
        {
            label "k-\u03C9 SST";
            fieldMaps
            {
                k k;
                omega omega;
                nut nut;
                alphat alphatCompressible;
            }

            alphaK1 0.85034;
            alphaK2 1.0;
            alphaOmega1 0.5;
            alphaOmega2 0.85616;
            gamma1 0.5532;
            gamma2 0.4403;
            beta1 0.0750;
            beta2 0.0828;
            betaStar 0.09;
            a1 0.31;
            c1 10;
            Cmu 0.09;
            alphah 1.111;
        }
    }
U
Code:
/*--------------------------------*- C++ -*----------------------------------*\
|       o          |                                                          |
|    o     o       | HELYX-OS                                                  |
|   o   O   o      | Version: v2.4.0                                           |
|    o     o       | Web:     http://www.engys.com                            |
|       o          |                                                          |
\*---------------------------------------------------------------------------*/
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.0 0.0);
boundaryField
{
    port
    {
        type symmetryPlane;
    }

    starboard
    {
        type symmetryPlane;
    }

    bottom
    {
        type symmetryPlane;
    }

    top
    {
        type symmetryPlane;
    }

    inlet
    {
        type zeroGradient;
        value uniform ( 0.0 0.0 0.0 );
    }

    outlet
    {
        type zeroGradient;
        value uniform ( 0.0 0.0 0.0 );
    }

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

}
P
Code:
/*--------------------------------*- C++ -*----------------------------------*\
|       o          |                                                          |
|    o     o       | HELYX-OS                                                  |
|   o   O   o      | Version: v2.4.0                                           |
|    o     o       | Web:     http://www.engys.com                            |
|       o          |                                                          |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version 2.0;
    format ascii;
    class volScalarField;
    location "0";
    object p;
}
dimensions [ 1 -1 -2 0 0 0 0 ];
internalField uniform 101325.0;
boundaryField
{
    port
    {
        type symmetryPlane;
    }

    starboard
    {
        type symmetryPlane;
    }

    bottom
    {
        type symmetryPlane;
    }

    top
    {
        type symmetryPlane;
    }

    inlet
    {
        type totalPressure;
        p0 uniform 372518.38;
        value uniform 101325;
        rho rho;
        psi none;
        U U;
        phi phi;
        gamma 1.4;
    }

    outlet
    {
        type zeroGradient;
    }

    sukhoi
    {
        type zeroGradient;
    }

}
T
Code:
/*--------------------------------*- C++ -*----------------------------------*\
|       o          |                                                          |
|    o     o       | HELYX-OS                                                  |
|   o   O   o      | Version: v2.4.0                                           |
|    o     o       | Web:     http://www.engys.com                            |
|       o          |                                                          |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version 2.0;
    format ascii;
    class volScalarField;
    location "0";
    object T;
}
dimensions [ 0 0 0 1 0 0 0 ];
internalField uniform 300.0;
boundaryField
{
    port
    {
        type symmetryPlane;
    }

    starboard
    {
        type symmetryPlane;
    }

    bottom
    {
        type symmetryPlane;
    }

    top
    {
        type symmetryPlane;
    }

    inlet
    {
        type fixedValue;
        value uniform 300;
    }

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

    sukhoi
    {
        type zeroGradient;
    }

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

kInlet          0.01;

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

internalField   uniform $kInlet;

boundaryField
{
	  port
    {
        type symmetryPlane;
    }

    starboard
    {
        type symmetryPlane;
    }

    bottom
    {
        type symmetryPlane;
    }

    top
    {
        type symmetryPlane;
    }

    inlet
    {
        type            calculated;
        value           uniform 0;
    }

    outlet
    {
        type            calculated;
        value           uniform 0;
    }

    sukhoi
    {
        type zeroGradient;
    }
    
    freestream
    {
        type            inletOutlet;
        inletValue      uniform $kInlet;
        value           uniform $kInlet;
    }

    wall
    {
        type            kqRWallFunction;
        value           uniform $kInlet;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

// ************************************************************************* //
alphat
Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7  
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
	  port
    {
        type symmetryPlane;
    }

    starboard
    {
        type symmetryPlane;
    }

    bottom
    {
        type symmetryPlane;
    }

    top
    {
        type symmetryPlane;
    }

    inlet
    {
        type            calculated;
        value           uniform 0;
    }

    outlet
    {
        type            calculated;
        value           uniform 0;
    }

    sukhoi
    {
        type zeroGradient;
    }

    freestream
    {
        type            calculated;
        value           uniform 0;
    }

    wall
    {
        type            compressible::alphatWallFunction;
        value           uniform 0;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

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

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

internalField   uniform 0;

boundaryField
{
	  port
    {
        type symmetryPlane;
    }

    starboard
    {
        type symmetryPlane;
    }

    bottom
    {
        type symmetryPlane;
    }

    top
    {
        type symmetryPlane;
    }

    inlet
    {
        type            calculated;
        value           uniform 0;
    }

    outlet
    {
        type            calculated;
        value           uniform 0;
    }

    sukhoi
    {
        type zeroGradient;
    }
    
    freestream
    {
        type            calculated;
        value           uniform 0;
    }

    wall
    {
        type            nutkWallFunction;
        type            nutkWallFunction;
        value           uniform 0;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

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

omegaInlet      10;

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

internalField   uniform $omegaInlet;

boundaryField
{
	  port
    {
        type symmetryPlane;
    }

    starboard
    {
        type symmetryPlane;
    }

    bottom
    {
        type symmetryPlane;
    }

    top
    {
        type symmetryPlane;
    }

    inlet
    {
        type            calculated;
        value           uniform 0.000001;
    }

    outlet
    {
        type            calculated;
        value           uniform 0.000001;
    }

    sukhoi
    {
        type zeroGradient;
    }
    
    freestream
    {
        type            inletOutlet;
        inletValue      uniform $omegaInlet;
        value           uniform $omegaInlet;
    }

    wall
    {
        type            omegaWallFunction;
        value           uniform $omegaInlet;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

// ************************************************************************* //
I am wondering if I am setting the right conditions for inlet and outlet? When i run this, I get a fatal error stating:

Code:
--> FOAM FATAL ERROR: 
cannot be called for a calculatedFvPatchField
    on patch inlet of field omega in file "/home/CentOS-VM/Documents/OpenFOAM/OpenFOAM-7/Run/Supersonic_Jet/test/0/omega"
    You are probably trying to solve for a field with a default boundary condition.

    From function Foam::tmp<Foam::Field<Type> > Foam::calculatedFvPatchField<Type>::gradientInternalCoeffs() const [with Type = double]
    in file fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C at line 188.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::calculatedFvPatchField<double>::gradientInternalCoeffs() const at ??:?
#3  Foam::fv::gaussLaplacianScheme<double, double>::fvmLaplacianUncorrected(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#4  Foam::fv::gaussLaplacianScheme<double, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#5  Foam::fv::laplacianScheme<double, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#6  Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::laplacian<double, double>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#7  Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::laplacian<double, double>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#8  Foam::kOmegaSST<Foam::eddyViscosity<Foam::RASModel<Foam::EddyDiffusivity<Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > > > >, Foam::EddyDiffusivity<Foam::ThermalDiffusivity<Foam::CompressibleTurbulenceModel<Foam::fluidThermo> > > >::correct() at ??:?
#9  ? at ??:?
#10  __libc_start_main in "/lib64/libc.so.6"
#11  ? at ??:?
Aborted (core dumped)
Do I have calculate the values by hand and used FixedValue? Or?
EternalSeekerX is offline   Reply With Quote

Old   October 29, 2020, 05:13
Default
  #2
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 7
shock77 is on a distinguished road
Hi,


you cant use calculated for omega. For the outlet I would apply zeroGradient and for the inlet fixedValue or turbulentMixingLengthFrequencyInlet.


When you have shocks, you should apply limiters to help the solution converge. Some problems may occur with your nut, if you dont apply limiters on your k and omega equations.
shock77 is offline   Reply With Quote

Old   October 29, 2020, 16:01
Wink Thanks for the clarification
  #3
Senior Member
 
Sultan Islam
Join Date: Dec 2015
Location: Canada
Posts: 141
Rep Power: 10
EternalSeekerX is on a distinguished road
Quote:
Originally Posted by shock77 View Post
Hi,


you cant use calculated for omega. For the outlet I would apply zeroGradient and for the inlet fixedValue or turbulentMixingLengthFrequencyInlet.


When you have shocks, you should apply limiters to help the solution converge. Some problems may occur with your nut, if you dont apply limiters on your k and omega equations.
Hello,

I appreciate the reply. I am still new to openfoam and my learning has been based on examples in tutorials and other validation cases. A similar compressible case didn't have any additional boundary conditions so I had to add them myself.

So for omega I should use:
Code:
inlet {
    type fixedValue; 
    value uniform 0; 
         } 

outlet { 
      type zeroGradient;
           }
Would this be the same for the others too? Also if I use turbulentMixingLengthFrequencyInlet, would that just be something like:
Code:
Inlet {
   type turbulentMixingLengthFrequencyInlet;
          }
Also what sort of limiters should I be looking at? Do they just go at the end of the files for time 0?

Thanks
EternalSeekerX is offline   Reply With Quote

Old   October 29, 2020, 16:10
Default
  #4
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 7
shock77 is on a distinguished road
If you set omega to a fixed value, you have to calculate it first. https://www.openfoam.com/documentati...omega-sst.html



You can use the boundary condition like this:


Code:
[
    inlet
    {
    type            turbulentMixingLengthFrequencyInlet;
    mixingLength    1;
    value           uniform 1;
    }
The limiters have to be applyed in fvSchemes. If you use a tutorial case, they are already applyed I guess. Still you have to be carefull, because too diffusive schemes may lead to unsufficient accuracy, while compressive ones to a crash. You should maybe look into some literature to make sure your simulation works out.
shock77 is offline   Reply With Quote

Old   October 29, 2020, 16:34
Default Thank you for the link
  #5
Senior Member
 
Sultan Islam
Join Date: Dec 2015
Location: Canada
Posts: 141
Rep Power: 10
EternalSeekerX is on a distinguished road
Quote:
Originally Posted by shock77 View Post
If you set omega to a fixed value, you have to calculate it first. https://www.openfoam.com/documentati...omega-sst.html



You can use the boundary condition like this:


Code:
[
    inlet
    {
    type            turbulentMixingLengthFrequencyInlet;
    mixingLength    1;
    value           uniform 1;
    }
The limiters have to be applyed in fvSchemes. If you use a tutorial case, they are already applyed I guess. Still you have to be carefull, because too diffusive schemes may lead to unsufficient accuracy, while compressive ones to a crash. You should maybe look into some literature to make sure your simulation works out.
I see, I will look into fvSchemes. So these BC for inlet and outlet, should this be applied to alphat, k, and nut as well?

Edit: I had to make sure the same bc for inlet and outlet were defined in the other files as well. I also made sure to check and set limiters in fvSchemes. Also had to add a few lines in fvSolutions for these new terms. Ran a seriel run for a few iterafions to check if it works. It does , hopefully it doesn't crash when I can get to setting up the parallel run this weekend.

Last edited by EternalSeekerX; October 30, 2020 at 05:01.
EternalSeekerX is offline   Reply With Quote

Old   October 30, 2020, 07:47
Default
  #6
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 7
shock77 is on a distinguished road
Thats the inlet boundary condition for omega. For nut and alphat I would just use calculated. For k fixed value or


type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value $internalField;


For the outlet you can use zeroGradient for k and omega and calculated for nut and alphat.
shock77 is offline   Reply With Quote

Old   October 30, 2020, 14:51
Default Appreciate the info
  #7
Senior Member
 
Sultan Islam
Join Date: Dec 2015
Location: Canada
Posts: 141
Rep Power: 10
EternalSeekerX is on a distinguished road
Quote:
Originally Posted by shock77 View Post
Thats the inlet boundary condition for omega. For nut and alphat I would just use calculated. For k fixed value or


type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value $internalField;


For the outlet you can use zeroGradient for k and omega and calculated for nut and alphat.
Okay, so for alphat and nut I can use the default bc of calculated uniform 0 then? Or do I need to calculate that?

Will edit that in tonight.

Thanks
EternalSeekerX is offline   Reply With Quote

Old   November 1, 2020, 17:16
Default
  #8
Senior Member
 
Join Date: Dec 2019
Posts: 215
Rep Power: 7
shock77 is on a distinguished road
Yes, you can intiate your field with 0.
shock77 is offline   Reply With Quote

Reply

Tags
boundary condition, komega sst model, supersonic


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
Turbulent and laminar conditions in one case Fool OpenFOAM 2 November 23, 2018 09:28
Laminar vs Turbulent Navier-Stokes truman Main CFD Forum 8 July 10, 2017 08:20
Convert laminar to turbulent model in IcoFsiFOAM soheil nazmdeh OpenFOAM Programming & Development 0 August 20, 2013 17:52
pisoFoam turbulent case looks like laminar case inf.vish OpenFOAM Running, Solving & CFD 0 August 16, 2013 04:31
Turbulent Flat Plate Validation Case Jonas Larsson Main CFD Forum 0 April 2, 2004 11:25


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