Use LES filter operation
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. |
Hi OFFO (the acronym OF is a lot easier to write ;)),
If the questions were about hard-core 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 |
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. |
Dear Bruno,
About the following lines: Code:
filterPtr_(LESfilter::New(U.mesh(), coeffDict())), Code:
//- Return a reference to the selected LES filter 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 |
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())), In practice, for example, doing this: Code:
MyOwnClass::MyOwnClass() : Code:
MyOwnClass::MyOwnClass()
As for: Code:
filter_(U); Code:
filter_.operator()(U); Code:
filter_(U); For example, doing: Code:
filter_(2.0+1); Best regards, Bruno |
Dear Bruno,
Thank you for your help. Much clearer now! have a nice day! OFFO |
filter_
Hi Bruno,
I there a way to use filter_ operator in a solver like channelFoam, as in can be used in models. |
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: Quote:
|
Yes, Bruno is right.
In order to use coeffDict(), you need to define the following in createFields.H Code:
autoPtr<compressible::LESModel> les Code:
autoPtr<LESfilter> filterPtr(LESfilter::New(U.mesh(), les->coeffDict())); Quote:
|
filter_
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 |
Quote:
|
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 "scale-dependent dynamics viscosity" from this paper: A scale-dependent dynamic model for large-eddy simulation: application to a neutral atmospheric boundary layer, by Porte-Agel et al. A scale-dependent 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 |
Quick answers:
|
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 |
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 |
implement simplefilter inside solver
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 |
Did you manage to solve your problem with applying a filter within the solver?
|
Quote:
|
Quote:
As in other threads we discuss if the simple filter of OpenFOAM uses neighboring cells? |
Quote:
Hello Dear Foamer, and thanks for this useful thread. I have the same intention to use filter operation in pimpleFoam. Thus, I tired to do the initialization using "autoPtr...". However I get the following error: no suitable user-defined conversion from "Foam::volVectorField" to "const Foam::geometricOneField" exists incompressible::LESModel::New(U, phi, laminarTransport) The same error is repeated for "phi" and "laminarTransport" based on their types (the error is basically the same as "no suitable user-defined conversion..." Here is what I wrote in creatFields.H: autoPtr<incompressible::LESModel> sgsModel ( incompressible::LESModel::New(U, phi, laminarTransport) ); autoPtr<LESfilter> filterPtr(LESfilter::New(U.mesh(), sgsModel->coeffDict())); LESfilter& filter(filterPtr()); Any idea on what goes wrong here? |
All times are GMT -4. The time now is 12:43. |