CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   how can use the LES filter? (laplace filter and anistropic filter) (

ethan oh January 3, 2012 10:20

how can use the LES filter? (laplace filter and anistropic filter)
Our thease is about filtration in LES.
We study LESfilters codes (LESfilter,NewFilter,Simple,Laplace,anistropic) but we have following problem about them:
1-Algorithm and Formulation of filtration that used in these codes.
2-According to the discription part of laplacefilter.H and anisotropicfilter.H :

Kernel as filter as Test filter with ratio 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
Box filter: g = delta2/24 -> g = delta2/6
Spherical box filter: g = delta2/64 -> g = delta2/16
Gaussian filter: g = delta2/24 -> g = delta2/6

what is "g" parameter and where is the effect of "g" in these codes.
3-What is "widthcoeff_" that used in these codes?

We REALLY need the answer of these question.thanks for your help.

Bernhard January 3, 2012 11:14

The implementation of the filter can be found for example in de laplacaFilter.C file. It is defined in the operator() for different field types. This is smart, since if you somewhere define

laplaceFilter filter_;
You can operate use it as filter_( anyField ) as a type of function (this is what is done in the LES models).

Now if you follow the coeff_ in this piece of code, you will find how widthCoeff_ is used.

With respect to your second question, I am not so familiar with the Laplace filter, so I cannot help you there.

ehsan February 26, 2012 06:25


Could I kindly ask you which filter type is used in LES of incompressible flows OpenFoam? In fact, we don't set any filter in LESproprties for interPhaseChangeFoam.


Djub July 18, 2012 11:16

Hi Ehsan,

I think the available filters in Foam (simple, laplace, anisotropic,...) are in fact the filters for the dynamic models (synSmagorinsky, dynOneEqEddy, maybe dynLagrangian,...). In fact, these are the filter for the test level, not the grid level. With oneEqEddy or Smagorinsky, there is only one level, so only one filtering, chosen by delta (PrandtlDelta, cubeRootVolDelta, smoothDelta, maxDeltaxyz).

Please, correct me if I am wrong! ;)



arunsmec November 7, 2012 01:09

Filter for Smagorinsky model
Hi Djub
I am trying to simulate a roundjet. I am using Smagorisnsky model and wish to use a Gaussian filter.
According to you the filter is dictated by delta. So how can i implement a Gaussian filter for my problem? Which 'delta' will give a fairly Gaussian filter?

Thank you

Djub November 7, 2012 05:11

Trying to help
hi arunsmec,

OK, it seems I was not exact. Not wrong neither, but not exact...

delta is the SIZE of the filter, not his SHAPE.

The LESfilter can act on the both levels (subgrid and dynamic):
- simpleFilter acts only on the dynamic level, with a simple top-hat filter
- laplaceFilter and anisotropicFilter can affect both levels:

Kernel as filter as Test filter with ratio 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
Box filter: g = delta2/24 -> g = delta2/6
Spherical box filter: g = delta2/64 -> g = delta2/16
Gaussian filter: g = delta2/24 -> g = delta2/6

Thus, you should be able to use a Gaussian filter, changing the kernel.

but I don't know how...

francesco_capuano November 28, 2012 17:04

For LES, OpenFOAM adopts the so-called implicit filtering technique, i.e., the equations are implicitly filtered by the discretization schemes and computational grid: no explicit filtering is applied. In such technique, the filter width (which appears in the SGS models) is typically related to a certain measure of the local grid cell size, which can be chosen via the 'delta' parameter; a pretty usual choice is to take the cube root volume of the local cell.

However, some SGS models, for instance those belonging to the dynamic family, require two levels of filtering. When using those models, the first level of filtering is implicit (as usual), whilst the second one (the so-called test filter) has to be performed explicitly by means of one of the discrete forms of filters provided.

aylalisa February 7, 2014 17:13

Hello francesco_capuano,, Hello Djub!

In case I would like to simulate transition from laminar to turbulent flow I guess I have to choose a dynamical sgs model like dynSmagorinsky.
That way I ensure that in different flow regimes the appropriate value of the coefficient (SmagorinskyCoefficient C_S) is used, instead of some damping function (van Driest). condition: fine grid (in the direction I want to do explicit filtering).

Does this mean in case the grid spacing is fine enough I don't have to care neither for wall functions nor for damping functions?
And in case I have a coarse grid I don't have to care for damping functions but I have to care for wall functions?

Do I have to set one of the availabe filters ( laplaceFilter, simpleFilter or anisotropicFilter) only in the case I use a dynamic LESmodel (dynSmagorinsky)?

You've written that Delta is the size of the filter. I've seen in an example case ( that the LESModel and delta are defined in the LESProperties file with help of appropriate keywords and in the same tutorial case the defined solver is pisoFoam.

How does OpenFoam account for \tau_{ij}^R in the Navier-Stokes equations which results from analytical procedure of filtering?
How is the filtered nonlinear convective term of momentum equation incorporated in the solution procedure? pisoFoam is a solver for transient incompressible flow, initially without containing an additional shear stress term that accounts for turbulence effects?

Are the stress components of the tensor \tau_{ij}^R computed with help of Smagorinsky's closure idea:
\tau_{ij}^r =-2 \nu_r \overline{S}_{ij}
\nu_r = l^2_S \overline{S} = (C_S \Delta )^2 \overline{S} ?

...and somehow add (?) to the discretized equations?

In case of high Re: C_S = constant
- no dynamik model
- close to wall: damping function necessary
- if mesh is coarse --> wall functions necessary

In case of low Re + wall treatment + high Re: C_S = computed tensor
- dynamik model necessary (to account for all situations)
- therefore no damping function necessary
- wall function --> depending on mesh resolution (yes if mesh=coarse, no if mesh=fine)

To what extent do the discretization schemes in fvSchemes influence the choosen LESmodel???

How exactly is the filter technique defined?
I thought the transfer function of the filter function is determined by the energy spectrum of the flow. So I thought depending on the spectrum you receive a transfer function and this one leads to the Coefficient C respectively to the filter width \Delta???
But in OpenFoam the user is prompted to decide the filter size \Delta.
How is the user defined filter size processed in OpenFoam?
Is the spectrum determined by the choice of the LESmodel?

I really hope for your expert support!


ehsan August 27, 2015 16:16

Could any one says what is the purpose of:

pow(mesh.V(), 2.0/3.0)/widthCoeff_

in laplcaFilter.C.


turbu July 12, 2017 14:44

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