Skip to content
Snippets Groups Projects
Commit 33ef139a authored by Kutalmış Berçin's avatar Kutalmış Berçin Committed by Andrew Heather
Browse files

ENH: Digital-Filter Based Synthetic Turbulence Generation Method for LES/DES Inflows

    Velocity boundary condition generating synthetic turbulence-alike
    time-series for LES and DES turbulent flow computations.

    To this end, two synthetic turbulence generators can be chosen:
    - Digital-filter method-based generator (DFM)

    \verbatim
    Klein, M., Sadiki, A., and Janicka, J.
        A digital filter based generation of inflow data for spatially
        developing direct numerical or large eddy simulations,
        Journal of Computational Physics (2003) 186(2):652-665.
        doi:10.1016/S0021-9991(03)00090-1
    \endverbatim

    - Forward-stepwise method-based generator (FSM)

    \verbatim
    Xie, Z.-T., and Castro, I.
        Efficient generation of inflow conditions for large eddy simulation of
        street-scale flows, Flow, Turbulence and Combustion (2008) 81(3):449-470
        doi:10.1007/s10494-008-9151-5
    \endverbatim

    In DFM or FSM, a random number set (mostly white noise), and a group
    of target statistics (mostly mean flow, Reynolds stress tensor profiles and
    length-scale sets) are fused into a new number set (stochastic time-series,
    yet consisting of the statistics) by a chain of mathematical operations
    whose characteristics are designated by the target statistics, so that the
    realised statistics of the new sets could match the target.

    Random number sets ---->-|
                             |
                         DFM or FSM ---> New stochastic time-series consisting
                             |           turbulence statistics
    Turbulence statistics ->-|

    The main difference between DFM and FSM is that the latter replaces the
    streamwise convolution summation in DFM by a simpler and a quantitatively
    justified equivalent procedure in order to reduce computational costs.
    Accordingly, the latter potentially brings resource advantages for
    computations involving relatively large length-scale sets and small
    time-steps.
parent 350fe1a2
No related branches found
No related tags found
No related merge requests found
......@@ -200,6 +200,7 @@ $(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVe
$(derivedFvPatchFields)/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.C
$(derivedFvPatchFields)/turbulentDFSEMInlet/eddy/eddy.C
$(derivedFvPatchFields)/turbulentDFSEMInlet/eddy/eddyIO.C
$(derivedFvPatchFields)/turbulentDigitalFilterInlet/turbulentDigitalFilterInletFvPatchVectorField.C
$(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C
$(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C
$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 - 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "pointToPointPlanarInterpolation.H"
#include "Time.H"
#include "IFstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type>>
Foam::turbulentDigitalFilterInletFvPatchVectorField::interpolateOrRead
(
const word& fieldName,
const dictionary& dict,
bool& interpolateField
) const
{
if (dict.found(fieldName))
{
tmp<Field<Type>> tFld
(
new Field<Type>
(
fieldName,
dict,
this->patch().size()
)
);
interpolateField = false;
return tFld;
}
else
{
interpolateField = true;
return interpolateBoundaryData<Type>(fieldName);
}
}
template<class Type>
Foam::tmp<Foam::Field<Type>>
Foam::turbulentDigitalFilterInletFvPatchVectorField::interpolateBoundaryData
(
const word& fieldName
) const
{
const word& patchName = this->patch().name();
fileName valsFile
(
fileHandler().filePath
(
fileName
(
this->db().time().path()
/this->db().time().caseConstant()
/"boundaryData"
/patchName
/"0"
/fieldName
)
)
);
autoPtr<ISstream> isPtr
(
fileHandler().NewIFstream
(
valsFile
)
);
Field<Type> vals(isPtr());
Info<< "Turbulent DFM/FSM patch " << patchName
<< ": Interpolating field " << fieldName
<< " from " << valsFile << endl;
return patchMapper().interpolate(vals);
}
template<class Form, class Type>
Form Foam::turbulentDigitalFilterInletFvPatchVectorField::generateRandomSet
(
const label len
)
{
Form randomSet(len);
std::generate
(
randomSet.begin(),
randomSet.end(),
[&]{return rndGen_.GaussNormal<Type>();}
);
return randomSet;
}
// ************************************************************************* //
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment