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   May 2, 2016, 14:28
Default
  #81
Member
 
Pavan
Join Date: Jan 2016
Posts: 53
Rep Power: 10
pvpnrao is on a distinguished road
Dear Alberto

http://www.cfd-online.com/Forums/members/alberto.html

I was wondering the reason for selecting the ce value in you dynamic Smagorinsky library.

I am new to OpenFOAM, what is ce and what is the reason for specifying that particular value to it?
pvpnrao is offline   Reply With Quote

Old   June 16, 2016, 12:31
Default
  #82
Senior Member
 
Ehsan Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18
syavash is on a distinguished road
Quote:
Originally Posted by huangxianbei View Post
Hi,alberto:
I have a question about the MM definition in volScalarField dynamicSmagorinsky::cD
As Lily stated, MM=filter(delta)^2*filter(S_bar)*filter(D)-(delta)^2*filter(S_bar*D)
D=symm(grad(U))=Sij
in the dynamicSmagorinsky.C
MM=sqr(delta())*(filter_(mag(D)*(D)) - 4*mag(filter_(D))*filter_(D))
So filter(delta)/delta=2 is used
However, mag(D) returns (SijSij)^1/2 instead of (2SijSij)^1/2=S_bar
as a result,
MM=MM_exact/(2^1/2)
Thus
cD=cD_exact*2^1/2
Above, _exact represents the exact value in Lily's method
If it's my misunderstanding, please correct me.
Best reguards
Xianbei
Dear Xianbei or anyone else,

Would you please point out that where "D" is defined in the code?!

Thanks

Syavash
syavash is offline   Reply With Quote

Old   December 21, 2016, 03:29
Default
  #83
New Member
 
mohafarmani
Join Date: Aug 2015
Location: shiraz
Posts: 14
Rep Power: 11
moh-farmani is on a distinguished road
Dear Alberto,

i want to use dynamicsmagorinsky code that you have generously contributed, but as i use your instructions (wmake libso) in openFoam3.01 the error is appeared:

wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file dynamicSmagorinsky.C
could not open file Smagorinsky.H for source file dynamicSmagorinsky.C due to No such file or directory
could not open file LESfilter.H for source file dynamicSmagorinsky.C due to No such file or directory
g++ -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam30/src/turbulenceModels -I/opt/openfoam30/src/turbulenceModels/LES/LESdeltas/lnInclude -I/opt/openfoam30/src/turbulenceModels/LES/LESfilters/lnInclude -I/opt/openfoam30/src/turbulenceModels/incompressible/LES/lnInclude -I/opt/openfoam30/src/transportModels -I/opt/openfoam30/src/finiteVolume/lnInclude -I/opt/openfoam30/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam30/src/OpenFOAM/lnInclude -I/opt/openfoam30/src/OSspecific/POSIX/lnInclude -fPIC -c dynamicSmagorinsky.C -o Make/linux64GccDPInt32Opt/dynamicSmagorinsky.o
In file included from dynamicSmagorinsky.C:25:0:
dynamicSmagorinsky.H:85:25: fatal error: Smagorinsky.H: No such file or directory
compilation terminated.
/opt/openfoam30/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt32Opt/dynamicSmagorinsky.o' failed
make: *** [Make/linux64GccDPInt32Opt/dynamicSmagorinsky.o] Error 1
could you please help me to use the model properly?

Regards
Mohammad
moh-farmani is offline   Reply With Quote

Old   February 6, 2017, 05:52
Default
  #84
Member
 
Lorenzo
Join Date: Oct 2015
Location: Graz
Posts: 49
Rep Power: 11
Lorenzo92 is on a distinguished road
Quote:
Originally Posted by syavash View Post
Dear Xianbei or anyone else,

Would you please point out that where "D" is defined in the code?!

Thanks

Syavash
have a look in Member functions of dynamicSmagorinsky.C. There is a line:

const volSymmTensorField D(dev(symm(gradU)));

Hope be helpful

Lorenzo
Lorenzo92 is offline   Reply With Quote

Old   February 22, 2017, 04:58
Default
  #85
New Member
 
Bo Kong
Join Date: Oct 2016
Location: China
Posts: 22
Rep Power: 10
huangfei is on a distinguished road
Has anyone compiled this code in version 4.0 and shared for me? I fail to do this .
Yours,
Bo Kong
huangfei is offline   Reply With Quote

Old   February 22, 2017, 20:17
Default
  #86
Member
 
Lorenzo
Join Date: Oct 2015
Location: Graz
Posts: 49
Rep Power: 11
Lorenzo92 is on a distinguished road
Quote:
Originally Posted by huangfei View Post
Has anyone compiled this code in version 4.0 and shared for me? I fail to do this .
Yours,
Bo Kong
Compiling procedure between OF 4.0 and previous versions are quite different. Try switching back to OF 2.4.0 for instance. I compiled Alberto's model with success on such this version
Lorenzo92 is offline   Reply With Quote

Old   November 6, 2017, 08:36
Default
  #87
Member
 
Yeru
Join Date: Jul 2014
Location: UK
Posts: 36
Rep Power: 12
shang is on a distinguished road
Hi Alberto,Thank you very much for sharing the model.

I just read your code and compared with homogeneousDynSmagorinsky in OF230. I got some questions hope to get answer from you:
1. Do you achieve the locally averaging by adding the class "fvc" in front of the function, if yes, can you explain a little bit more why is that?
2. In the code "nuSgs_ = max(cD(D)*sqr(delta())*sqrt(magSqr(D)), -nu());", why you use "-nu()" rather than 0? If cD(D)*sqr(delta())*sqrt(magSqr(D)) < -nu() and -nu() should be a negative value anywhere, this will produce a negative nuSgs value. Am I right?

Kind regards,
Yeru
kakkapriyesh likes this.
shang is offline   Reply With Quote

Old   August 29, 2018, 05:04
Default
  #88
Senior Member
 
Ehsan Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18
syavash is on a distinguished road
For All those who miss dynamicSmagorinsky model on new versions of OpenFOAM,


I have developed and compiled the code for version 4.1. You can find the code at the following link:


https://github.com/syavash20/TurbLab...magorinsky_4.1


Also, a channel395 example has been provided to test the implementation.


Enjoy,


Syavash
caduqued likes this.
syavash is offline   Reply With Quote

Old   August 29, 2018, 09:35
Default OpenFOAM3
  #89
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
Quote:
Originally Posted by syavash View Post
For All those who miss dynamicSmagorinsky model on new versions of OpenFOAM,


I have developed and compiled the code for version 4.1. You can find the code at the following link:


https://github.com/syavash20/TurbLab...magorinsky_4.1


Also, a channel395 example has been provided to test the implementation.


Enjoy,


Syavash
Thanks , i modified it for OpenFOAM 3
Attached Files
File Type: gz dynamicSmagorinsky_3.0.tar.gz (3.2 KB, 30 views)
caduqued likes this.
__________________
My Personal Website (http://nimasamkhaniani.ir/)
Telegram channel (https://t.me/cfd_foam)
nimasam is offline   Reply With Quote

Old   December 20, 2018, 06:07
Default
  #90
Member
 
cyss38's Avatar
 
Cyrille Bonamy
Join Date: Mar 2015
Location: Grenoble, France
Posts: 86
Rep Power: 11
cyss38 is on a distinguished road
For info the 4.1 version can be used with the versions 5.0 and 1806
cyss38 is offline   Reply With Quote

Old   February 5, 2019, 11:35
Default Usage of dynamicSmagorinsky
  #91
Member
 
Jo Mar
Join Date: Jun 2015
Posts: 54
Rep Power: 11
KingKraut is on a distinguished road
I am a bit confused that the during a simulation no output about bounding k is written to the log, as it was done in previous versions of this turbulence model (OF231).
Can anybody confirm this? Or am I doing something plainly wrong?
Or was this taken out of the code?


I am doing a pimpleFoam simulation with a custom solver with the setup of turbulenceProperties as suggested by the creators,

https://github.com/syavash20/TurbLab...magorinsky_4.1


Thanks a lot in advance to anybody clarifying this for me.
Best wishes






Edit: I am using OF1812+

Last edited by KingKraut; February 5, 2019 at 11:36. Reason: I am using Vs OF1812+
KingKraut is offline   Reply With Quote

Old   February 7, 2019, 03:17
Default
  #92
Senior Member
 
Ehsan Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18
syavash is on a distinguished road
Quote:
Originally Posted by KingKraut View Post
I am a bit confused that the during a simulation no output about bounding k is written to the log, as it was done in previous versions of this turbulence model (OF231).
Can anybody confirm this? Or am I doing something plainly wrong?
Or was this taken out of the code?


I am doing a pimpleFoam simulation with a custom solver with the setup of turbulenceProperties as suggested by the creators,

https://github.com/syavash20/TurbLab...magorinsky_4.1


Thanks a lot in advance to anybody clarifying this for me.
Best wishes






Edit: I am using OF1812+
Dear Johannes,

AFAIK, k is bounded only when its value is smaller than SMALL=1e-20, otherwise its minimum value would be read from the field.

But in general, bounding k to a minimum value should not affect the solution procedure as k is an independent quantity. It is considered in the SGS stress tensor only. It will become more noticeable if you would like to calculate the ratio of resolved to total turbulent kinetic energy.

Regards,
Syavash
syavash is offline   Reply With Quote

Old   February 13, 2019, 10:18
Default
  #93
Member
 
Jo Mar
Join Date: Jun 2015
Posts: 54
Rep Power: 11
KingKraut is on a distinguished road
Dear syavash,


thanks a lot for the fast reply.
So I understand correctly that no output from bounding k is written since this is simply not applicable?


By the way thanks again for this implementation of dynamic smagorinsky for the versions OF4 and upwards. The results are practically identical to my previous simulations with OF231.


Best wishes
Johannes
KingKraut is offline   Reply With Quote

Old   February 13, 2019, 18:19
Default
  #94
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 16
Santiago is on a distinguished road
Quote:
Originally Posted by syavash View Post
Dear Johannes,

AFAIK, k is bounded only when its value is smaller than SMALL=1e-20, otherwise its minimum value would be read from the field.

But in general, bounding k to a minimum value should not affect the solution procedure as k is an independent quantity. It is considered in the SGS stress tensor only. It will become more noticeable if you would like to calculate the ratio of resolved to total turbulent kinetic energy.

Regards,
Syavash
It is true that k is not being used for any further calculation, but the sole fact that k is being bounded it means that something is going wrong on the way your algorithm is calculating things. It is simply not possible to have k<0 by using a purely dissipative smagorinsky model. In the case where deconvolution (eg, bardina) are used for reconstructing L, k<0 MIGHT occur, but rarely, and should be clipped away.
Santiago is offline   Reply With Quote

Old   February 14, 2019, 06:45
Default
  #95
Senior Member
 
Ehsan Asgari
Join Date: Apr 2010
Posts: 473
Rep Power: 18
syavash is on a distinguished road
Quote:
Originally Posted by KingKraut View Post
Dear syavash,


thanks a lot for the fast reply.
So I understand correctly that no output from bounding k is written since this is simply not applicable?


By the way thanks again for this implementation of dynamic smagorinsky for the versions OF4 and upwards. The results are practically identical to my previous simulations with OF231.


Best wishes
Johannes
Dear Johannes,

You're welcome.
You don't see the output since the function "bound" is not used anymore.

Best Regards,
Syavash
syavash is offline   Reply With Quote

Old   July 18, 2019, 07:49
Default
  #96
New Member
 
Adam
Join Date: Jan 2019
Posts: 21
Rep Power: 7
boundary93 is on a distinguished road
Could somebody please explain what I have to change if I want to use it with a compressible solver. I tried to compare the Smagorinsky model to see what to change but if I start it still tells me the dynamic model is not available.

I want to use the version of syavash: https://github.com/syavash20/TurbLab



Thanks in advance
boundary93 is offline   Reply With Quote

Old   July 18, 2019, 09:24
Default
  #97
New Member
 
Adam
Join Date: Jan 2019
Posts: 21
Rep Power: 7
boundary93 is on a distinguished road
Quote:
Originally Posted by boundary93 View Post
Could somebody please explain what I have to change if I want to use it with a compressible solver. I tried to compare the Smagorinsky model to see what to change but if I start it still tells me the dynamic model is not available.

I want to use the version of syavash: https://github.com/syavash20/TurbLab



Thanks in advance

I had to change the makeTurbulence.C to this



Code:
// Copyright held by original authors

#include "CompressibleTurbulenceModel.H"
#include "compressibleTransportModel.H"
#include "fluidThermo.H"
#include "addToRunTimeSelectionTable.H"
#include "makeTurbulenceModel.H"

#include "ThermalDiffusivity.H"
#include "EddyDiffusivity.H"

#include "LESModel.H"

#define makeLESModel(Type)                                                     \
    makeTemplatedTurbulenceModel                                               \
    (fluidThermoCompressibleTurbulenceModel, LES, Type)
    
namespace Foam
{
    typedef ThermalDiffusivity<CompressibleTurbulenceModel<fluidThermo> >  fluidThermoCompressibleTurbulenceModel;    

    typedef LESModel<EddyDiffusivity<fluidThermoCompressibleTurbulenceModel> >  LESfluidThermoCompressibleTurbulenceModel;       
}

#include "dynamicSmagorinsky.H"
makeLESModel(dynamicSmagorinsky);


and the Make file to this



Code:
EXE_INC = \
    -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
    -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
    -I$(LIB_SRC)/transportModels/compressible/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/solidSpecie/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \

LIB_LIBS = \
    -lcompressibleTransportModels \
    -lfluidThermophysicalModels \
    -lsolidThermo \
    -lsolidSpecie \
    -lturbulenceModels \
    -lspecie \
    -lfiniteVolume \
    -lmeshTools

my mistake was a missing LIB but with this changes it works
boundary93 is offline   Reply With Quote

Old   December 4, 2020, 10:41
Default
  #98
New Member
 
Tian Jin
Join Date: Aug 2020
Posts: 10
Rep Power: 6
Tian Jin is on a distinguished road
Hello.

I want to employ the dynamic procedure on the scalar flux, but I don't know if we can get dynamic diffusivity or Schmidt number in the dynamic Smagorinsky model.

Is there anyone doing this before?

For now, I use the dynamic Smagorinsky model for the flow, but for the scalar transport, I use the function scalartransport in OpenFOAM, they need alpha_t and alpha, and this is the constant value, I want to use dynamic diffusivity/Schmidt number in the scalar transport equation. Does anyone have the good idea?
Tian Jin is offline   Reply With Quote

Old   December 5, 2020, 05:10
Default
  #99
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 16
Santiago is on a distinguished road
Quote:
Originally Posted by Tian Jin View Post
Hello.

I want to employ the dynamic procedure on the scalar flux, but I don't know if we can get dynamic diffusivity or Schmidt number in the dynamic Smagorinsky model.

Is there anyone doing this before?

For now, I use the dynamic Smagorinsky model for the flow, but for the scalar transport, I use the function scalartransport in OpenFOAM, they need alpha_t and alpha, and this is the constant value, I want to use dynamic diffusivity/Schmidt number in the scalar transport equation. Does anyone have the good idea?
If you mean whether someone has done it, yes. Check Armenio & Piomelli (2000). If what you mean is whether such a model has been implemented in OpenFOAM, then also yes, check this article:

https://www.mdpi.com/2311-5521/4/3/171
Santiago is offline   Reply With Quote

Old   December 5, 2020, 18:09
Default
  #100
New Member
 
Tian Jin
Join Date: Aug 2020
Posts: 10
Rep Power: 6
Tian Jin is on a distinguished road
Quote:
Originally Posted by Santiago View Post
If you mean whether someone has done it, yes. Check Armenio & Piomelli (2000). If what you mean is whether such a model has been implemented in OpenFOAM, then also yes, check this article:

https://www.mdpi.com/2311-5521/4/3/171
Thanks very much, Santiago.

I am a beginner and I don't know how to translate your formula to OpenFOAM code. Would you be kind enough to share with me your OpenFOAM code about the dynamic scalar flux?
Tian Jin 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 01:04.