
[Sponsors] 
February 25, 2014, 09:33 
Use LES filter operation

#1 
Senior Member
Join Date: Jan 2013
Posts: 297
Rep Power: 6 
Dear all,
Similar to the filtering operation in dynamic Smagorinsky model for the incompressible flows: Code:
homogeneousDynSmagorinsky.H 1, How the class LESfilter is initialized? In homogeneousDynSmagorinsky.H, it appears as the priviate data: Code:
LESfilter& filter_ 2, In homogeneousDynSmagorinsky.C, the filter operation is applied as filter_(x), I do not why here filter_(*) is used like a function, it is an object! Thank you so much if anyone can provide some guidance. 

March 1, 2014, 07:15 

#2  
Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,556
Blog Entries: 39
Rep Power: 97 
Hi OFFO (the acronym OF is a lot easier to write ),
If the questions were about hardcore LES mathematics, I wouldn't be able to answer, but since it's C++ related questions, here we go: Quote:
Quote:
If you look into the header file respective to LESfilter: https://github.com/OpenFOAM/OpenFOAM...er/LESfilter.H  you'll see that there are four "operator()", each one receiving a different type of field. These are abstract virtual methods, as explained here: http://www.cplusplus.com/doc/tutorial/polymorphism/  which means that you will have to look at the specific filter implementation to see what the respective operator does. Best regards, Bruno
__________________


March 1, 2014, 07:30 

#3 
Senior Member
Join Date: Jan 2013
Posts: 297
Rep Power: 6 
Dear Bruno,
Thank you first for your so detailed help. I will dig into it later today. Now I am implementing a dynamic constants in my mixing model, where the test filtering is used. Thank you again. OFFO. 

March 5, 2014, 12:16 

#4 
Senior Member
Join Date: Jan 2013
Posts: 297
Rep Power: 6 
Dear Bruno,
About the following lines: Code:
filterPtr_(LESfilter::New(U.mesh(), coeffDict())), filter_(filterPtr_()) Code:
// Return a reference to the selected LES filter static autoPtr<LESfilter> New ( const fvMesh&, const dictionary& ); Besides, filter_ is the reference of the object "filterPtr_()". Are the above what I saying correct? In the dynamic LES models , the expressions filter_ extensively appears, like filter_(U()) and filter_(D). what is the relation between the filter_(U()) and filter_(filterPtr_())? A little confused. Thank you so much. OFFO 

March 5, 2014, 16:38 

#5 
Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,556
Blog Entries: 39
Rep Power: 97 
Hi OFFO,
I know, C++ can get seriously confusing I suggest that you give a good study at this tutorial: http://www.cplusplus.com/doc/tutorial/ So, the notion to keep in mind is that this: Code:
filterPtr_(LESfilter::New(U.mesh(), coeffDict())), filter_(filterPtr_()) In practice, for example, doing this: Code:
MyOwnClass::MyOwnClass() : filterPtr_(LESfilter::New(U.mesh(), coeffDict())), filter_(filterPtr_()) { } Code:
MyOwnClass::MyOwnClass() { filterPtr_ = LESfilter::New(U.mesh(), coeffDict()); filter_ = filterPtr_(); }
As for: Code:
filter_(U); Code:
filter_.operator()(U); Code:
filter_(U); For example, doing: Code:
filter_(2.0+1); Best regards, Bruno
__________________


March 6, 2014, 06:08 

#6 
Senior Member
Join Date: Jan 2013
Posts: 297
Rep Power: 6 
Dear Bruno,
Thank you for your help. Much clearer now! have a nice day! OFFO 

April 8, 2014, 04:24 
filter_

#7 
New Member
ehk
Join Date: Sep 2012
Posts: 21
Rep Power: 5 
Hi Bruno,
I there a way to use filter_ operator in a solver like channelFoam, as in can be used in models. 

April 13, 2014, 14:28 

#8  
Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,556
Blog Entries: 39
Rep Power: 97 
Quote:
From what I can see, my guess is that you'll have to create a new local instance of LESfilter, indicated in point #2, at post #2, namely this one: 

April 13, 2014, 14:36 

#9 
Senior Member
Join Date: Jan 2013
Posts: 297
Rep Power: 6 
Yes, Bruno is right.
In order to use coeffDict(), you need to define the following in createFields.H Code:
autoPtr<compressible::LESModel> les ( compressible::LESModel::New ( rho, U, phi, thermo ) ); Code:
autoPtr<LESfilter> filterPtr(LESfilter::New(U.mesh(), les>coeffDict())); LESfilter& filter(filterPtr()); 

August 21, 2015, 09:10 
filter_

#10 
Senior Member
ehsan
Join Date: Mar 2009
Posts: 106
Rep Power: 9 
Hello
Could any one help me to know where the function "filter_" is defined in OF? https://github.com/OpenFOAM/OpenFOAM...dynOneEqEddy.C this function, filter_, used many times here and in other dynamic based SGS models but I could not find its definition. Regards Last edited by ehsan; August 21, 2015 at 10:20. 

August 21, 2015, 10:47 

#11  
Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,556
Blog Entries: 39
Rep Power: 97 
Quote:


August 21, 2015, 14:01 

#12 
Senior Member
ehsan
Join Date: Mar 2009
Posts: 106
Rep Power: 9 
Thank you, the problem is solved in this thread:
autoPtr<LESfilter> filterPtr_; LESfilter& filter_; Since it is an autoPtr its special Type is defined during runtime. Meanwhile, I would like now to apply a new filter, which is called "scaledependent dynamics viscosity" from this paper: A scaledependent dynamic model for largeeddy simulation: application to a neutral atmospheric boundary layer, by PorteAgel et al. A scaledependent Lagrangian dynamic model for large eddy simulation of complex turbulent flows , which needs a third filter as well, could any one gives a help? Thanks a lot 

August 21, 2015, 18:21 

#13 
Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,556
Blog Entries: 39
Rep Power: 97 
Quick answers:


August 24, 2015, 02:08 

#14 
Senior Member
ehsan
Join Date: Mar 2009
Posts: 106
Rep Power: 9 
On the meanwhile, may I ask you why in dynamicSmagorinsky, the used filter width is not two times larger than the cell size, it calls filter_, without doubling the filter width.
Regards 

August 24, 2015, 11:54 

#15 
Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,556
Blog Entries: 39
Rep Power: 97 
Hi Ehsan,
Sorry, I have no idea. I'm not familiar with LES modelling itself. Perhaps openfoammaofnepo (the forum member who started this thread ) can answer about that? Nonetheless, I believe there are a lot of threads about dynamicSmagorinsky itself, including a modified model provided here: https://bitbucket.org/albertop/dynamicsmagorinsky Good luck! Best regards, Bruno
__________________


June 27, 2016, 13:49 
implement simplefilter inside solver

#16  
New Member
sina
Join Date: Jul 2013
Posts: 15
Rep Power: 5 
Quote:
I want to implement sompleFilter on one of the term in my solver. would you please let me know how I can add the filter inside a solver regards 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
how can use the LES filter? (laplace filter and anistropic filter)  ethan oh  OpenFOAM Running, Solving & CFD  8  August 27, 2015 16:16 
LES Filter in Smagorinsky model on inhomogenous grids  Ivan  Main CFD Forum  1  October 25, 2012 11:30 
calculation of test filter quantites for desired parameters(equations) in les  mrn  FLUENT  0  July 15, 2010 05:04 
LES with different filter  Rick  Main CFD Forum  1  August 22, 2008 18:10 
Bugs in LES filter codes  yekaniyasari  OpenFOAM Bugs  3  February 18, 2008 02:59 