# Inlet Booundary Condition for Velocitie

 Register Blogs Members List Search Today's Posts Mark Forums Read

 January 24, 2018, 05:07 Inlet Booundary Condition for Velocitie #1 Member   Join Date: Jun 2017 Posts: 73 Rep Power: 9 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

 January 24, 2018, 08:01 #2 Super Moderator     Tobias Holzmann Join Date: Oct 2010 Location: Tussenhausen Posts: 2,708 Blog Entries: 6 Rep Power: 51 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 { 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

 January 24, 2018, 09:14 #3 Member   Join Date: Jun 2017 Posts: 73 Rep Power: 9 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.

 January 24, 2018, 09:24 #4 Super Moderator     Tobias Holzmann Join Date: Oct 2010 Location: Tussenhausen Posts: 2,708 Blog Entries: 6 Rep Power: 51 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 void Foam::turbulentInletFvPatchField::updateCoeffs() { if (this->updated()) { return; } if (curTimeIndex_ != this->db().time().timeIndex()) { Field& patchField = *this; Field 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::one, fluctuationScale_ )*mag(referenceField_) ); curTimeIndex_ = this->db().time().timeIndex(); } fixedValueFvPatchField::updateCoeffs(); } amolrajan and john_alm like this. __________________ Keep foaming, Tobias Holzmann

 January 24, 2018, 13:16 #5 Member   Join Date: Jun 2017 Posts: 73 Rep Power: 9 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.

 November 3, 2023, 08:44 #6 Senior Member   Saeed Jamshidi Join Date: Aug 2019 Posts: 214 Rep Power: 7 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.