CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Improved implementation of dynamic Smagorinsky

Register Blogs Community New Posts Updated Threads Search

Like Tree37Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2011, 10:51
Default
  #41
New Member
 
Perry L. Johnson
Join Date: Feb 2011
Location: Orlando, FL, USA
Posts: 17
Rep Power: 15
PerryLJohnson is on a distinguished road
Alberto,

Sorry to bug you some more on this code. I was revisiting your code, and it seems to me you have left out two coefficients in your MM equation (Germano et al. Eq 15, right hand side): the 2 out in front and the sqrt(2) in the | Sij | = sqrt (2 * Sij * Sij).

Quote:
volSymmTensorField MM =
sqr(delta())*(filter_(mag(D)*(D)) - 4*mag(filter_(D))*filter_(D));
But I also see that the sqrt(2) is cancelled out in the definition of nuSgs because it is not included there either.
Quote:
nuSgs_ = max(cD(D)*sqr(delta())*sqrt(magSqr(D)), -nu());
The leading coefficient of 2 (coming from tau_ij = 2 * nu_eff * S_ij) does not appear to cancel out since the definition of the effective stress is higher up in the turbulence model code.

Quote:
00096 tmp<fvVectorMatrix> GenEddyVisc::divDevBeff(volVectorField& U) const
00097 {
00098 return
00099 (
00100 - fvm::laplacian(nuEff(), U) - fvc::div(nuEff()*dev(T(fvc::grad(U))))
00101 );
00102 }
So it seems to me there should be something to the effect of
MM *= 2;
directly after your definition of the MM tensor.

Please correct me if I am missing something here.

Regards,
Perry
PerryLJohnson is offline   Reply With Quote

Old   July 15, 2011, 13:07
Default
  #42
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Hi, my code is entirely based on what OF calls "homogeneousDynSmagorinsky" model. I think the reference is not Germano et al. but Lilly (1992) "A proposed modification of the Germano subgrid-scale closure method".

If there is a bug in the original code, then there is a bug in mine too :-D. I will check into that as soon as I can.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   July 18, 2011, 03:39
Default
  #43
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
I also have the impression there is something wrong with the definition of MM, see this post: http://www.cfd-online.com/Forums/ope...details-2.html But if you can point me at my mistake there you're very welcome

@alberto: In the Lilly formulation c(D) is devided by two (Cs=LM/(2*M*M)), which is not incorporated here, so if you apply his suggestion, MM *= 2, then you would end up with exactly that right?
shuige likes this.
Bernhard is offline   Reply With Quote

Old   July 18, 2011, 04:39
Default
  #44
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
I am sorry, I pointed to the wrong reference in my last post. The implementation of LES models in OpenFOAM is based on:

C. Fureby, G. Tabor, H. G. Weller, and A. D. Gosman, A comparative study of subgrid scale models in homogeneous isotropic turbulence, Phys. Fluids 9, 1416 (1997); doi:10.1063/1.869254

According to this work:

k_sgs = c_I*(delta*|D|)^2

nu_sgs = c_D*(delta^2)*|D|

In the dynamic approach, they define:

c_I = <0.5 tr(L) m>/<mm>

c_D = <L_D M>/<M M>

with L_D, m and M defined as a function of D, in a way that seems consistent to me (please, check, I went through it quickly) with the OF implementation.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   July 18, 2011, 11:56
Default
  #45
New Member
 
Perry L. Johnson
Join Date: Feb 2011
Location: Orlando, FL, USA
Posts: 17
Rep Power: 15
PerryLJohnson is on a distinguished road
I am in agreement with Bernhard. In Lilly's paper, the coefficient '2' in equation 8 (Fureby equation 6) becomes manifest in the coefficient '1/2' in equation 11. It seems to mysteriously vanish in Fureby's derivation, however, in his equation 7.
PerryLJohnson is offline   Reply With Quote

Old   July 18, 2011, 12:08
Default
  #46
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Hi, I agree. However, since the problem also affects homogeneousDynSmagorinsky, I think you should report it on OpenCFD bug tracker. This might provide an explanation too.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   July 18, 2011, 15:00
Default
  #47
New Member
 
Perry L. Johnson
Join Date: Feb 2011
Location: Orlando, FL, USA
Posts: 17
Rep Power: 15
PerryLJohnson is on a distinguished road
I put in a bug report, we'll see if an explanation is forthcoming.
PerryLJohnson is offline   Reply With Quote

Old   July 23, 2011, 15:13
Default
  #48
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Bug corrected upstream, and fix merged in my modified version. You can download it from the usual git repository ( https://github.com/AlbertoPa/dynamicSmagorinsky ).

Thanks for pointing this out.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.

Last edited by alberto; July 23, 2011 at 15:14. Reason: Added link
alberto is offline   Reply With Quote

Old   August 9, 2011, 04:42
Default
  #49
Member
 
Nico T
Join Date: Aug 2010
Location: Leipzig, Germany
Posts: 39
Rep Power: 16
deniggo is on a distinguished road
Hi,
Alberto, thanks for providing the code. I compiled it in OF 2.0 and changed input-files as described in readme.
My case works but it stays laminar, while in the standard Smagorinsky with constant coefficients turbulence is developed. I use pisoFoam and pimpleFoam. Did I forget something to change or is the model not applicable to piso/pimpleFoam?

Thanks for your help!

Nico
deniggo is offline   Reply With Quote

Old   August 9, 2011, 11:04
Default
  #50
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Hi, depending on your case you need to initialise the simulation with a perturbed field to favour the development of the turbulent structures. There are is a tool in the forum for channel flows (perturbU) and probably some user adapted it to pipe flows too.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   January 5, 2012, 03:58
Default
  #51
New Member
 
M.H.Arabnezhad
Join Date: Jun 2011
Location: Sharif University of Technology, Tehran,Iran
Posts: 3
Rep Power: 15
engma3 is on a distinguished road
Hi alberto,
Thanks for providing the code. I use your code for simulation of a swirl jet. The problem is in calculation of kinetic energy , It gives me negative values.

Thanks,
engma3
engma3 is offline   Reply With Quote

Old   January 5, 2012, 11:25
Default
  #52
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
The value should be bounded to kMin_.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   February 7, 2012, 15:28
Default Problems with trying the model
  #53
Member
 
Yuri Feldman
Join Date: Mar 2011
Posts: 30
Rep Power: 15
feldy77 is on a distinguished road
Dear Alberto,
Thank you very much for your contribution. I tried to use your model with buoyantBoussinesqPimleFoam. The compilation process was completed successfully. Then I modified LESProperties and controlDictionary files according to your instructions. Unfortunately something screws up when I try to run the simulation. I am getting the following warning:
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName& functionLibName)
in file db/dlLibraryTable/dlLibraryTable.C at line 78
could not load /home/yurifeld/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libdynLocalAverageSmagorinskyModel.so: undefined symbol: _ZNK4Foam14incompressible9LESModels11GenEddyVisc1B Ev


Do you have any idea what can be the problem?
Thank you very much, Yuri
feldy77 is offline   Reply With Quote

Old   February 7, 2012, 20:05
Default
  #54
New Member
 
Perry L. Johnson
Join Date: Feb 2011
Location: Orlando, FL, USA
Posts: 17
Rep Power: 15
PerryLJohnson is on a distinguished road
Quote:
Originally Posted by feldy77 View Post
Dear Alberto,
Thank you very much for your contribution. I tried to use your model with buoyantBoussinesqPimleFoam. The compilation process was completed successfully. Then I modified LESProperties and controlDictionary files according to your instructions. Unfortunately something screws up when I try to run the simulation. I am getting the following warning:
--> FOAM Warning :
From function dlLibraryTable:pen(const fileName& functionLibName)
in file db/dlLibraryTable/dlLibraryTable.C at line 78
could not load /home/yurifeld/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libdynLocalAverageSmagorinskyModel.so: undefined symbol: _ZNK4Foam14incompressible9LESModels11GenEddyVisc1B Ev


Do you have any idea what can be the problem?
Thank you very much, Yuri
Yuri,

You should be able to safely ignore this warning, see post #21.

Perry
PerryLJohnson is offline   Reply With Quote

Old   February 7, 2012, 21:49
Default
  #55
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Yes, Perry is right :-)

Btw, you could also consider the langrangianDynSmagorinsky model in OpenFOAM 2.x, which is based on a more rigorous treatment of the dynamic coefficient.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   April 8, 2012, 18:29
Default
  #56
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
For your information, I moved my repository to bitbucket, so future versions will be here:

https://bitbucket.org/albertop/dynamicsmagorinsky
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   March 27, 2013, 17:29
Default
  #57
Member
 
ehk
Join Date: Sep 2012
Posts: 30
Rep Power: 14
ehsankf is on a distinguished road
Dear Alberto,

I would like to know if this new dynamic smagorinsky model could be changed to do averaging in homogenous direction ( not whole domain) in case of channel flow .
Thanks in advance
ehsankf is offline   Reply With Quote

Old   May 3, 2013, 12:43
Default
  #58
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16
babakflame is on a distinguished road
Dear Alberto

I am trying to include dynamicSmagorinsky SGS model for reactingFoam solver, I did exactly as u have said in
https://bitbucket.org/albertop/dynamicsmagorinsky
However, When I executed the file; I got this error:

Selecting LES turbulence model dynamicSmagorinsky


Code:
--> FOAM FATAL ERROR: 
Unknown LESModel type dynamicSmagorinsky

Valid LESModel types:

6
(
DeardorffDiffStress
Smagorinsky
SpalartAllmaras
homogeneousDynOneEqEddy
lowReOneEqEddy
oneEqEddy
)


    From function LESModel::New(const volScalarField&, const volVectorField&, const surfaceScalarField&, const basicThermo&, const word&)
    in file LESModel/LESModel.C at line 140.

FOAM exiting


It seems that the code has not recognized dynamicSmagorinsky.H & .C files.
I should note that I have put the dynamicSmagorinsky folder in My home directory and not in OpenFOAM sources, My openFOAM version is 2.1.x

Would You PLZ help me?

Any hint is appreciated

Best Regards
Bobi
babakflame is offline   Reply With Quote

Old   May 3, 2013, 12:50
Default
  #59
Member
 
ehk
Join Date: Sep 2012
Posts: 30
Rep Power: 14
ehsankf is on a distinguished road
you should include the new model in controlDict.
ehsankf is offline   Reply With Quote

Old   May 3, 2013, 13:09
Default
  #60
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16
babakflame is on a distinguished road
Dear Ehsan
Hi
I have included this line at the end of controldict file:

Code:
libs ( "libOpenFOAM.so" "libdynamicSmagorinskyModel.so" ) ;
However, The problem is still apparent

Bobi
babakflame is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Smagorinsky Dynamic Cosant in UDF Paolo Lampitella FLUENT 1 June 17, 2009 04:40
Dynamic Smagorinsky LES Lourival FLUENT 0 April 14, 2006 14:48
Dynamic Smagorinsky Model Andrew Main CFD Forum 1 November 30, 2004 01:52
Reply to Tim Re Dynamic Smagorinsky model Ajay S. Parihar Main CFD Forum 9 June 2, 2002 17:24
Dynamic Smagorinsky model Tim Main CFD Forum 7 May 29, 2002 08:37


All times are GMT -4. The time now is 22:44.