
[Sponsors] 
May 1, 2016, 05:17 
A few questions about LES filtering in OpenFOAM

#1 
New Member
章严
Join Date: May 2014
Posts: 21
Rep Power: 4 
Hello,
In the OpenFOAM source codes,I found "laplace Filter" in the source codes, so I guessed the dynLagrangian must be used accompany with "laplace Filter". Actually, I am going to implement the dynamic KE or dynLagrangian SGS model to another software. But I don't know how to implement the "simple Filter". It seems that implementing laplace Filter is more easier. Could you tell me does the SGS models must be used accompany with particular Filters? For example, dynamicKEqn + simple filter; dynamicLagrangian + laplace Filter. Another question: If you understand the meaning of "simple Filter", Could you tell me the physical meaning of it? Please forgive my poor English. simple Filter: tmp<volScalarField> filteredField = fvc::surfaceSum ( mesh().magSf()*fvc::interpolate(unFilteredField) )/fvc::surfaceSum(mesh().magSf()) laplace Filter: tmp<volTensorField> filteredField = unFilteredField() + fvc::laplacian(coeff_, unFilteredField()) Thanks, Zhang Yan [ Moderator note  Moved from here: What LES should do for you? ] Last edited by wyldckat; May 1, 2016 at 15:01. Reason: see "Moderator note" 

May 4, 2016, 09:50 

#2 
New Member
Join Date: Sep 2015
Posts: 24
Rep Power: 3 
Hi Zhang Yan,
I am trying to figure out LES implementation in OpenFOAM myself but I'll still try to give an answer. Please correct me if I am wrong. simpleFilter If you look at the code, you will see that the unFilteredField is first interpolated from the cell centers to the cell faces using 'fvc::interpolate'. Then, the filteredField is simply the areaweighted average of the interpolated values using 'fvc::surfaceSum'. laplaceFilter I am not so sure about this but I'll try. I'm borrowing some ideas from image processing since that's all the relevant information that I could find on Laplace filters. Let's say you have a random signal, which has high frequency noise that you wish to filter/smooth. We can derive the finite difference Laplace operator for the signal as: According to the code, the Laplacian is first multiplied by 'coeff_' which is proportional to and, hence, has the dimensions of . This result is then added to the unFilteredField. Let's try to do that by letting the proportionality parameter 'widthCoeff_' as 4: As it can be seen, the result is an average over the adjacent cells. Conclusion I think filtering operation can be viewed as smoothing or averaging operation. I would love to know if I am getting any of this wrong. Also, I am not too sure as to the role of 'widthCoeff_' and would like to know more as well. As to which filter to use with which dynamic SGS model, I think it does not really matter. Any filter should be fine as long as you define the relevant '<LESFilter>Coeffs'. However, according to this, the laplace filter is not generally used. Not too sure why. Anyway, hope this helps you. 

May 4, 2016, 10:11 

#3 
New Member
章严
Join Date: May 2014
Posts: 21
Rep Power: 4 
Thank you very much!
Since it's too late today (in my country), I will study your admirable answer carefully tomorrow. 

May 7, 2016, 02:53 

#4  
New Member
章严
Join Date: May 2014
Posts: 21
Rep Power: 4 
Quote:
Hi, According to your reply, I got my answer about simple filter: filteredField = sum(A_i * S_i) / sum(S_i) A_i is face value after interpolate, S_i is face area. Is it right? Besides, I have another question: If I use simple filter as the test filter for a dynamic SGS model, as a test filter, how does simple filter show the double width compared to the first filter? Last edited by zhangyan; May 7, 2016 at 06:51. 

May 8, 2016, 09:34 

#5 
New Member
Join Date: Sep 2015
Posts: 24
Rep Power: 3 
Hi there,
Yup, I have the same idea of the simple filter. I am reading up on filtering myself (I am new to LES/OpenFOAM as well) but here is what I think is happening: The filtering of the original LES equations is implicit in OpenFOAM, i.e. the finite volume method (grid+discretization) itself acts as a filter! This is known as implicit LES. So, when you apply any dynamic model, it performs a further filtering process, the test filter. The factor of two does appear in the code. For example, for the 'homogeneousDynSmagorinsky' model: Code:
const volSymmTensorField MM ( sqr(delta())*(filter_(mag(D)*(D))  4*mag(filter_(D))*filter_(D)) ); where . Hope this helps. Last edited by usv001; May 8, 2016 at 09:37. Reason: Error in formula 

May 8, 2016, 10:05 

#6 
New Member
章严
Join Date: May 2014
Posts: 21
Rep Power: 4 
Thanks for your explanation!
Now I am implementing dynamic procedure to KIVA (the software I'm using). In KIVA, velocity is stored on the vertices. So one of the face(bottom) value is : 0.25(u1+u2+u3+u4). Code:
7//6 / /  /  /  / /  8//5          3   2  /  /   /  /  /  / 41 You know, I must interpolate Sij to the cell faces. For example, S11=dudx, in KIVA, dudx=0.25*(u3+u4+u7+u8u1u2u5u6)/delta_X I know velocity is stored on the vertice, but I don't know where Sij is stored. So I don't know how to interpolate Sij to the cell faces. Do you have any idea? 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
LES filter in OpenFOAM  openfoammaofnepo  OpenFOAM Programming & Development  1  October 23, 2014 07:27 
implicit and explicit filtering in LES  kkpal  OpenFOAM  0  February 19, 2014 03:27 
Molecular viscosity calculation in LES on OpenFOAM  babakflame  OpenFOAM  0  January 26, 2014 05:13 
Frequently Asked Questions about Installing OpenFOAM  wyldckat  OpenFOAM Installation  0  January 1, 2014 20:21 
Serious bug in LES interface  fs82  OpenFOAM Bugs  21  November 16, 2009 09:15 