CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Inlet Booundary Condition for Velocitie

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Tobi
  • 2 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 24, 2018, 05:07
Default Inlet Booundary Condition for Velocitie
  #1
Member
 
Join Date: Jun 2017
Posts: 73
Rep Power: 9
Friendly is on a distinguished road
Hi,

I want to use the turbulentInlet boundary Condition. I have found an example in the tutorials:

Code:
inlet
    {
        type            turbulentInlet;
        referenceField  uniform (10 0 0);
        fluctuationScale (0.02 0.01 0.01);
        value           uniform (10 0 0);
    }
What is the difference of referenceField and value? And how do i calculate the fluctuation scale? My first thought is:

2/3 k = 1/3 * (ux'²+ux'²+uz'²) and lets say ux'²=uy'²=uz'²

I get k from:

k=3/2 * (U*I)² , where I is the turbulent intensity.

Greetings,
Friendly
Friendly is offline   Reply With Quote

Old   January 24, 2018, 08:01
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

you can find the information in the source code. Explicitly in the header file. You find the location after going to the source of FOAM files and do something like that:
Code:
shorty@src: find -iname "turbulentInlet"
./finiteVolume/fields/fvPatchFields/derived/turbulentInlet
In the header file you will find the description:
Code:
Description
    This boundary condition generates a fluctuating inlet condition by adding
    a random component to a reference (mean) field.

    \f[
        x_p = (1 - \alpha) x_p^{n-1} + \alpha (x_{ref} + s C_{RMS} x_{ref})
    \f]

    where

    \vartable
        x_p     | patch values
        x_{ref} | reference patch values
        n       | time level
        \alpha  | fraction of new random component added to previous time value
        C_{RMS} | RMS coefficient
        s       | fluctuation scale
    \endvartable

Usage
    \table
        Property     | Description             | Required    | Default value
        fluctuationScale | RMS fluctuation scale (fraction of mean) | yes |
        referenceField | reference (mean) field | yes        |
        alpha | fraction of new random component added to previous| no| 0.1
    \endtable

    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            turbulentInlet;
        fluctuationScale 0.1;
        referenceField  uniform 10;
        alpha           0.1;
    }
    \endverbatim
Optional, you can use doxygen (https://cpp.openfoam.org/v5/classFoa...atchField.html)

The value is normally just a dummy and is replaced in subsequent evaluations. Everything else is self-explaining by the above code or in the link.
amolrajan likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 24, 2018, 09:14
Default
  #3
Member
 
Join Date: Jun 2017
Posts: 73
Rep Power: 9
Friendly is on a distinguished road
Hi,

thank your very much!

I have a remaining short questions:

What is meant by c_RMS and which value is defined? (RMS for Root Mean Square?). Is there somehow a pseudo random algorithm implemented in c_RMS? Alpha adds a fraction of a random component and I dont see anything else which could be random.
Friendly is offline   Reply With Quote

Old   January 24, 2018, 09:24
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
See C++ code. However, I guess this boundary condition is useful for DNS simulations and not for RANS - maybe LES? I am not a turbulent expert.
Code:
template<class Type>
void Foam::turbulentInletFvPatchField<Type>::updateCoeffs()
{
    if (this->updated())
    {
        return;
    }

    if (curTimeIndex_ != this->db().time().timeIndex())
    {
        Field<Type>& patchField = *this;

        Field<Type> randomField(this->size());

        forAll(patchField, facei)
        {
            ranGen_.randomise(randomField[facei]);
        }

        // Correction-factor to compensate for the loss of RMS fluctuation
        // due to the temporal correlation introduced by the alpha parameter.
        scalar rmsCorr = sqrt(12*(2*alpha_ - sqr(alpha_)))/alpha_;

        patchField =
            (1 - alpha_)*patchField
          + alpha_*
            (
                referenceField_
              + rmsCorr*cmptMultiply
                (
                    randomField - 0.5*pTraits<Type>::one,
                    fluctuationScale_
                )*mag(referenceField_)
            );

        curTimeIndex_ = this->db().time().timeIndex();
    }

    fixedValueFvPatchField<Type>::updateCoeffs();
}
amolrajan and john_alm like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 24, 2018, 13:16
Default
  #5
Member
 
Join Date: Jun 2017
Posts: 73
Rep Power: 9
Friendly is on a distinguished road
OK I see there is a random generator, thanks again.

Yes, I want to use it for LES.

But what about my calculation to determine the fluctuation scale? I still dont know what excactly is meant by fluctuation scale. The describtion does not help me.
Friendly is offline   Reply With Quote

Old   November 3, 2023, 08:44
Default
  #6
Senior Member
 
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 7
saeed jamshidi is on a distinguished road
Dear Friendly, I hope this message finds you well.

Have you found your answers about fluctuation scale for turbulent inlet?

I appreciate it if you share your experience at this matter.
Thanks.
saeed jamshidi is offline   Reply With Quote

Reply


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
Fully developed flow as inlet condition Gemmatrix STAR-CCM+ 1 December 6, 2016 04:02
To change temperature in mass flow inlet boundary condition per iteration ajinkya201991 FLUENT 1 July 11, 2014 11:29
Total pressure boundary condition at inlet:how to sustain inlet pressure in cfx faizan CFX 10 March 18, 2014 16:47
boundary condition for coupled inlet and outlet xxxx OpenFOAM Pre-Processing 2 August 13, 2013 15:51
How to use a solution as an inlet boundary condition in another problem in fluent geryes FLUENT 0 February 25, 2010 16:32


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