
[Sponsors] 
February 4, 2014, 10:01 

#21 
Senior Member
n/a
Join Date: Sep 2009
Posts: 198
Rep Power: 9 
Here is an updated compressible dynamic smagorinsky LES model with the inclusion of a SGS K equation solved by feeding the locally dynamic muSgs coefficient into the K equation.
This code was utilized for OpenFOAM 1.7, and it needs to be slightly modified for OpenFOAM 2.1. Cheers, Deji 

February 4, 2014, 16:26 

#22 
New Member
Sagnik
Join Date: Oct 2012
Posts: 27
Rep Power: 6 
Thanks a lot. We implemented your old version in OpenFOAM 2.1 and it works great. We would surely modify it and use this new version. I undertand that this is exactly the same at the previous 'dynLocalAverageSmagorinsky' except for the change you specified. Is there something else that's new in this new version !
Thanks again for all the help. Sagnik 

February 5, 2014, 05:52 

#23 
New Member
Join Date: Jan 2014
Posts: 16
Rep Power: 4 
Dear Deji,
Could you please also nicely share us the Make folder (files and options) for the dynamic Smag Model: dynLocalAverageSmagorinsky.C Thank you so much! flames 

February 8, 2014, 19:20 

#24 
New Member
Join Date: Jan 2014
Posts: 16
Rep Power: 4 
Hello, everyone!
I tried to complied the dynLocalAverageSmagorinsky Model into openfoam 2.1.1. But I still met some problem when I run my case. I put the .H and .C in the following path: Code:
/home/user/OpenFOAM/user2.1.1/src/turbulenceModels/compressible/LES/dynLocalAverageSmagorinsky Code:
dynLocalAverageSmagorinsky (folder), Make (folder) Code:
dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.C LIB = $(FOAM_USER_LIBBIN)/libcompressibleLESModels_user Code:
EXE_INC = \ I$(LIB_SRC)/turbulenceModels \ I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ I$(LIB_SRC)/turbulenceModels/LES/LESfilters/lnInclude \ I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ I$(LIB_SRC)/meshTools/lnInclude \ I$(LIB_SRC)/finiteVolume/lnInclude \ I$(LIB_SRC)/turbulenceModels/compressible/LES/GenEddyVisc \ I$(LIB_SRC)/turbulenceModels/compressible/LES/LESModel \ I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude LIB_LIBS = \ lcompressibleTurbulenceModel \ lLESdeltas \ lLESfilters \ lfiniteVolume \ lmeshTools Code:
/home/user/OpenFOAM/user2.1.1/platforms/linux64IccDPOpt/lib Code:
libs ("libcompressibleLESModels_user.so"); Code:
LESModel dynLocalAverageSmagorinsky; //Smagorinsky; //oneEqEddy; delta cubeRootVol; printCoeffs on; dynLocalAverageSmagorinskyCoeffs { ce 1.048; filter simple; } ......... Code:
[0] [0] [0] > FOAM FATAL ERROR: [1] [2] [2] [2] > FOAM FATAL ERROR: [2] Unknown LESModel type dynLocalAverageSmagorinsky Valid LESModel types: 15 ( DeardorffDiffStress LRRDiffStress Smagorinsky SpalartAllmaras SpalartAllmarasDDES SpalartAllmarasIDDES dynLagrangian dynOneEqEddy homogeneousDynOneEqEddy homogeneousDynSmagorinsky kOmegaSSTSAS laminar mixedSmagorinsky oneEqEddy spectEddyVisc ) [2] [2] [2] From function LESModel::New(const volVectorField&, const surfaceScalarField& ,transportModel&, const word&) [2] in file LESModel/LESModel.C at line [0] Unknown LESModel type dynLocalAverageSmagorinsky best regards, f ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++= The above procedure should be correct. The reason why the error comes from is that I use pisoFoam to test the LES model, which obviously cannot be found by pisoFoam. A stupid error. Last edited by flames; February 10, 2014 at 08:11. 

February 8, 2014, 21:03 

#25 
New Member
Join Date: Jan 2014
Posts: 16
Rep Power: 4 
Dear Deji,
In the source code of dynLocalAverageSmagorinsky.C, the resolved turbulent stresses L_ij is calculated as: Code:
volSymmTensorField Lij = filter_(rho()*sqr(U()))  sqr(filter_(rho()*U()))/filter_(rho()); Did you test this assumption? I know that in compressible L_ij is easy to calculate in compressible LES, but as you know in openfoam it is not actually compressible. At least in my case it is Low Ma solver. I ask this just for curiosity. Thanks. Last edited by flames; February 9, 2014 at 11:36. 

February 10, 2014, 06:39 

#26 
New Member
Join Date: Jan 2014
Posts: 16
Rep Power: 4 
Nobody knows something about the errors which make the compiliation not successfully? Thanks.


February 10, 2014, 09:08 
Dynamic SGS model

#27 
Senior Member
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 212
Rep Power: 9 
Since it seems you are interested in more sophisticated SGS models, please have a look at the LEMOS extensions for OpenFOAM: Dynamic Mixed Model, Lagrangian Dynamic Mixed Model and Hybrid URANSLES models with dynamic Smagorinsky :)
http://www.lemos.unirostock.de/en/d...nfoamcontent/ 

February 10, 2014, 09:25 

#28 
New Member
Join Date: Jan 2014
Posts: 16
Rep Power: 4 
Thank you for your information. Are they for compressible or incompressible LES?
cheers, f 

February 10, 2014, 09:47 

#29 
Senior Member
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 212
Rep Power: 9 
sorry, my mistake, only incompressible as far as I know


February 24, 2014, 18:04 

#30  
New Member
Join Date: Jan 2014
Posts: 16
Rep Power: 4 
Dear Deji,
About the calculating the dynamic parameters Cd and Ci for the Smagorinksy compressible LES SGS model, I think I have the following difference for my implementation: First CI, the beta should be calculated as: Code:
volScalarField beta = 2*sqr(2*delta())*filter_(rho())*sqr(mag(filter_(rho()*D)/filter_(rho()))); thank you so much! For clearance, I post the function I am using to predict Cd and Ci: Code:
volScalarField dynLocalAverageSmagorinsky::cD_(const volSymmTensorField& D) const { volSymmTensorField Dfilter = filter_(rho()*D)/filter_(rho()); volScalarField magSijfilter = sqrt(2.0*(Dfilter && Dfilter)); volScalarField magSij = sqrt(2*(D && D)); volSymmTensorField Lij = filter_(rho()*sqr(U()))  sqr(filter_(rho()*U()))/filter_(rho()); // volSymmTensorField Bij = 2*sqr(2*delta())*filter_(rho())*filter_(magSij)*(filter_(D)filter_(tr(D))*I/3); // volSymmTensorField Bij = 2*sqr(2*delta())*filter_(rho())*magSijfilter*(Dfilter  Dtrfilter*I/3); volSymmTensorField Bij = 2*sqr(2*delta())*filter_(rho())*magSijfilter*dev(Dfilter); volSymmTensorField Aij = 2*sqr(delta())*rho()*magSij*dev(D); volSymmTensorField Mij = Bij  filter_(Aij); volScalarField LijMij = Lij && Mij; volScalarField MklMkl = Mij && Mij; // Performing local average on cell faces on return return fvc::average(LijMij)/fvc::average(MklMkl); } Code:
volScalarField dynLocalAverageSmagorinsky::cI_(const volSymmTensorField& D) const { volSymmTensorField Dfilter = filter_(rho()*D)/filter_(rho()); volScalarField magSij = sqrt(2.0*(Dfilter && Dfilter)); volSymmTensorField Lij = filter_(rho()*sqr(U()))  sqr(filter_(rho()*U()))/filter_(rho()); volScalarField Lkk = tr(Lij); volScalarField beta = 2*sqr(2*delta())*filter_(rho())*sqr(magSij); volScalarField alpha = filter_(2*rho()*sqr(delta())*sqr(magSij)); // Performing local average on cell faces on return return (fvc::average(Lkk))/(fvc::average(beta  alpha)); } Quote:


April 3, 2014, 10:33 
Problem in compiling dynLocalAverageSmagorinsky in OF 2.0.1

#31 
New Member
Join Date: Jan 2014
Location: IIT Kanpur, India
Posts: 1
Rep Power: 0 
Hello everyone,
I am having problem in compiling the dynLocalAverageSmagorinsky model in openfoam 2.0.1. Following is the error trace [narya@localhost dynLocalAverageSmagorinsky]$ wmake libso SOURCE=dynLocalAverageSmagorinsky.C ; g++ m64 Dlinux64 DWM_DP Wall Wextra Wnounusedparameter Woldstylecast Wnonvirtualdtor O3 DNoRepository ftemplatedepth100 I/home1/narya/OpenFOAM/OpenFOAM2.0.1/src/turbulenceModels I/home1/narya/OpenFOAM/OpenFOAM2.0.1/src/turbulenceModels/LES/LESdeltas/lnInclude I/home1/narya/OpenFOAM/OpenFOAM2.0.1/src/turbulenceModels/LES/LESfilters/lnInclude I/home1/narya/OpenFOAM/OpenFOAM2.0.1/src/thermophysicalModels/basic/lnInclude I/home1/narya/OpenFOAM/OpenFOAM2.0.1/src/turbulenceModels/compressible/LES/lnInclude I/home1/narya/OpenFOAM/OpenFOAM2.0.1/src/finiteVolume/lnInclude I/home1/narya/OpenFOAM/OpenFOAM2.0.1/src/meshTools/lnInclude IlnInclude I. I/home1/narya/OpenFOAM/OpenFOAM2.0.1/src/OpenFOAM/lnInclude I/home1/narya/OpenFOAM/OpenFOAM2.0.1/src/OSspecific/POSIX/lnInclude fPIC c $SOURCE o Make/linux64GccDPOpt/dynLocalAverageSmagorinsky.o dynLocalAverageSmagorinsky.C: In constructor âFoam::compressible::LESModels::dynLocalAverageSma gorinsky::dynLocalAverageSmagorinsky(const Foam::volScalarField&, const Foam::volVectorField&, const Foam::surfaceScalarField&, const Foam::basicThermo&, const Foam::word&, const Foam::word&)â: dynLocalAverageSmagorinsky.C:142: error: no matching function for call to âFoam::compressible::LESModel::LESModel(const Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, const Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&, const Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&, const Foam::basicThermo&, const Foam::word&, const Foam::word&)â /home1/narya/OpenFOAM/OpenFOAM2.0.1/src/turbulenceModels/compressible/LES/lnInclude/LESModel.H:134: note: candidates are: Foam::compressible::LESModel::LESModel(const Foam::word&, const Foam::volScalarField&, const Foam::volVectorField&, const Foam::surfaceScalarField&, const Foam::basicThermo&, const Foam::word&) /home1/narya/OpenFOAM/OpenFOAM2.0.1/src/turbulenceModels/compressible/LES/lnInclude/LESModel.H:101: note: Foam::compressible::LESModel::LESModel(const Foam::compressible::LESModel&) make: *** [Make/linux64GccDPOpt/dynLocalAverageSmagorinsky.o] Error 1.. anyone please help. Kafka. 

April 7, 2014, 08:57 

#32  
New Member
Join Date: Feb 2011
Location: Amirkabir University of TechnologyTehran,Iran
Posts: 4
Rep Power: 7 
Quote:
Dear Deji, I tried to complied the dynLocalAverageSmagorinsky Model into openfoam 2.1.1. But I am having problem.Following is the error: wmakeLnInclude: linking include files to ./lnInclude SOURCE=dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.C ; g++ m64 Dlinux64 DWM_DP Wall Wextra Wnounusedparameter Woldstylecast Wnonvirtualdtor O3 DNoRepository ftemplatedepth100 I/opt/openfoam211/src/turbulenceModels I/opt/openfoam211/src/turbulenceModels/LES/LESdeltas/lnInclude I/opt/openfoam211/src/turbulenceModels/LES/LESfilters/lnInclude I/opt/openfoam211/src/thermophysicalModels/basic/lnInclude I/opt/openfoam211/src/meshTools/lnInclude I/opt/openfoam211/src/finiteVolume/lnInclude I/opt/openfoam211/src/turbulenceModels/compressible/LES/GenEddyVisc I/opt/openfoam211/src/turbulenceModels/compressible/LES/LESModel I/opt/openfoam211/src/turbulenceModels/compressible/LES/lnInclude IlnInclude I. I/opt/openfoam211/src/OpenFOAM/lnInclude I/opt/openfoam211/src/OSspecific/POSIX/lnInclude fPIC c $SOURCE o Make/linux64GccDPOpt/dynLocalAverageSmagorinsky.o dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.C: In member function ‘Foam::volScalarField Foam::compressible::LESModels::dynLocalAverageSmag orinsky::cQ_(const volSymmTensorField&) const’: dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.C:104:31: error: reference to ‘db’ is ambiguous In file included from /opt/openfoam211/src/OpenFOAM/lnInclude/regIOobject.H:41:0, from /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricField.H:42, from /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricScalarField.H:38, from /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricFields.H:34, from /opt/openfoam211/src/finiteVolume/lnInclude/volFields.H:37, from /opt/openfoam211/src/thermophysicalModels/basic/lnInclude/basicThermo.H:39, from /opt/openfoam211/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H:51, from /opt/openfoam211/src/turbulenceModels/compressible/LES/LESModel/LESModel.H:51, from /opt/openfoam211/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H:42, from dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.H:53, from dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.C:24: /opt/openfoam211/src/OpenFOAM/lnInclude/IOobject.H:246:35: error: candidates are: const Foam:bjectRegistry& Foam::IOobject::db() const /opt/openfoam211/src/OpenFOAM/lnInclude/IOobject.H:246:35: error: const Foam:bjectRegistry& Foam::IOobject::db() const dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.C:104:63: error: expected primaryexpression before ‘>’ token In file included from /opt/openfoam211/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H:42:0, from dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.H:53, from dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.C:24: /opt/openfoam211/src/turbulenceModels/compressible/LES/LESModel/LESModel.H: In instantiation of ‘static Foam::autoPtr<Foam::compressible::LESModel> Foam::compressible::LESModel::adddictionaryConstru ctorToTable<LESModelType>::New(const volScalarField&, const volVectorField&, const surfaceScalarField&, const Foam::basicThermo&, const Foam::word&) [with LESModelType = Foam::compressible::LESModels::dynLocalAverageSmag orinsky; Foam::volScalarField = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]’: /opt/openfoam211/src/turbulenceModels/compressible/LES/LESModel/LESModel.H:128:1: required from ‘Foam::compressible::LESModel::adddictionaryConstr uctorToTable<LESModelType>::adddictionaryConstruct orToTable(const Foam::word&) [with LESModelType = Foam::compressible::LESModels::dynLocalAverageSmag orinsky]’ dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.C:39:1: required from here /opt/openfoam211/src/turbulenceModels/compressible/LES/LESModel/LESModel.H:115:9: error: no matching function for call to ‘Foam::compressible::LESModels::dynLocalAverageSma gorinsky::dynLocalAverageSmagorinsky(const volScalarField&, const volVectorField&, const surfaceScalarField&, const Foam::basicThermo&, const Foam::word&)’ /opt/openfoam211/src/turbulenceModels/compressible/LES/LESModel/LESModel.H:115:9: note: candidates are: dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.C:115:1: note: Foam::compressible::LESModels::dynLocalAverageSmag orinsky::dynLocalAverageSmagorinsky(const volScalarField&, const volVectorField&, const surfaceScalarField&, const Foam::basicThermo&) dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.C:115:1: note: candidate expects 4 arguments, 5 provided In file included from dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.C:24:0: dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.H:91:9: note: Foam::compressible::LESModels::dynLocalAverageSmag orinsky::dynLocalAverageSmagorinsky(const Foam::compressible::LESModels::dynLocalAverageSmag orinsky&) dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.H:91:9: note: candidate expects 1 argument, 5 provided In file included from /opt/openfoam211/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H:42:0, from dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.H:53, from dynLocalAverageSmagorinsky/dynLocalAverageSmagorinsky.C:24: /opt/openfoam211/src/turbulenceModels/compressible/LES/LESModel/LESModel.H: In static member function ‘static Foam::autoPtr<Foam::compressible::LESModel> Foam::compressible::LESModel::adddictionaryConstru ctorToTable<LESModelType>::New(const volScalarField&, const volVectorField&, const surfaceScalarField&, const Foam::basicThermo&, const Foam::word&) [with LESModelType = Foam::compressible::LESModels::dynLocalAverageSmag orinsky; Foam::volScalarField = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]’: /opt/openfoam211/src/turbulenceModels/compressible/LES/LESModel/LESModel.H:115:9: warning: control reaches end of nonvoid function [Wreturntype] make: *** [Make/linux64GccDPOpt/dynLocalAverageSmagorinsky.o] Error 1 plz help me 

April 13, 2014, 09:55 

#33 
Senior Member
Join Date: Jan 2013
Posts: 311
Rep Power: 6 
Dear All,
In dynLocalAverageSmagorinsky and other dynamic LES model, when we need to calculate the model constants using a dynamic way, we will do the averaging, like i.e. <Lij*Mij>/<Mkl*Mkl>. In principle, this kind of averaging is performed in the homogeneous direction in the flows. I do not know how this is implemented in other flow solvers. In openfoam, this is done using fvc::average(), this operation is only based on weighting of areas of all the faces belonging to one cell. So this is LOCAL dynamic method. Could anyone say something about if such implementation is really reflecting the averaging in the original sense (i.e. averaging in one homogeneous direction)? OFFO Thank you 

April 14, 2014, 06:21 

#34 
New Member
Join Date: Feb 2011
Location: Amirkabir University of TechnologyTehran,Iran
Posts: 4
Rep Power: 7 
Hello, flames,
I also try to compile the dynLocalAverageSmagorinsky Model into openfoam 2.1.1. But when i use wmake libso, i see error message. Could you please share with me your folders for the dynLocalAverageSmagorinsky Model. Could you tell me whats that error? Thank you 

September 2, 2014, 09:06 

#35 
Senior Member
Join Date: Jan 2013
Posts: 311
Rep Power: 6 
Hi All,
When I use this dynamic model, for the regions having large mesh size, I found there are negative muSGS appearing there. So I cannot confirm if this is acceptable results or not. The flow fields and pressure seem still fine even if the mySGS is negative there. Anybody has such kind of experience using dynamic Smagorinsky model? OFFO 

November 18, 2014, 09:21 

#36 
Member
Ferdinand Pfender
Join Date: May 2013
Location: Berlin, Germany
Posts: 34
Rep Power: 5 
deji, could you please share your literature reference for the compressible dyn smagorinsky with k equation (you call it hybridsgs)?
Thank you in advance! 

November 19, 2014, 11:14 

#37 
Member
Ferdinand Pfender
Join Date: May 2013
Location: Berlin, Germany
Posts: 34
Rep Power: 5 
got it:
local dyn compressible Smagorinsky: Martin, M. Pino; Piomelli, Ugo; Candler, Graham V.  SubgridScale Models for Compressible LargeEddy Simulations  Theoret. Comput. Fluid Dynamics, 2000 13, p:361376 And Martin, M. Pino; Piomelli, Ugo; Candler, Graham V.  A priori tests of SGS models in compressible turbulence  3rd ASME/JSME Joint Fluids Engineering Conference  1999  Army High Performance Computing Research Center kEquation is based on oneEqEddy: kEquation: Yoshizawa, Akira; Horiuti, Kiyosi  A StatisticallyDerived SubgridScale Kinetic Energy Model for the LargeEddy Simulation of Turbulent Flows  Journal of the Physical Society of Japan  1985  Vol. 54  Issue 8  pages 28342839  doi: 10.1143/JPSJ.54.2834 p, li k_sgstransport: Menon, S; Yeung, P.K.; Kim, W.W.  Effect of subgrid models on the computed interscale energy transfer in isotropic turbulence  Computers & Fluids  1996  Volume 25  Issue 2  pages: 165180  doi: 10.1016/00457930(95)000364 where the parameter c_k = 0.0094 is defined like in oneEqEddy by: Nakayama, A.; Vengadesan, S. N.  On the influence of numerical schemes and subgridstress models on large eddy simulation of turbulent flow past a square cylinder  International Journal for Numerical Methods of Fluids  2002  Volume 38  Issue 3  pages: 227253  doi: 10.1002/fld.214 

November 19, 2014, 13:30 

#38 
Member

Thank You, I was also looking for the source of literature. And also this is a good reference:
http://www.aem.umn.edu/~kmahesh/publ...aiaa10_les.pdf Also which version of OpenFOAM could you compile the code with? Cheers! 

November 20, 2014, 04:04 

#39 
Member
Ferdinand Pfender
Join Date: May 2013
Location: Berlin, Germany
Posts: 34
Rep Power: 5 
i compiled it with 2.3.x and it works well.
but you need to modify some small parts. just diff the comp. Smagorinsky from 1.6 or 1.7 with the actual one. Thats all. 

November 20, 2014, 14:32 

#40 
Member

Thanks! Also you can have a look at following for other compressible LEs subgrid implementations:
https://github.com/fireFoamdev/fire...mpressible/LES 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
LES Compressible Smagorinsky Model  iyer_arvind  OpenFOAM Running, Solving & CFD  26  September 9, 2014 07:22 
LowRe turbulence model for compressible flow  volker  OpenFOAM Programming & Development  0  March 15, 2010 11:20 
LES and combustion model  Margherita Cadorin  CFX  0  October 29, 2008 06:24 
Problem calculate Y in compressible turbulence model  luca  OpenFOAM Running, Solving & CFD  5  June 1, 2006 05:53 
simulation of RSM in compressible mixing layer  lars  Main CFD Forum  0  February 19, 2004 23:40 