CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Improved implementation of dynamic Smagorinsky (https://www.cfd-online.com/Forums/openfoam-solving/82780-improved-implementation-dynamic-smagorinsky.html)

alberto May 4, 2013 12:03

A quick checklist:

- Did the code compile successfully?
- Can you run the test case provided with the code?

Best,

babakflame May 4, 2013 14:07

Dear Alberto
Hi
- the code compiled successfully. :)
- I executed the test case, it works successfully :)

My openFoam is 2.1.x . Is it from my openFoam version?:confused::(

I have still the problem in reactingFoam case::

Code:

Selecting turbulence model type LESModel
Selecting LES turbulence model dynamicSmagorinsky


--> 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



Regards
Bobi

alberto May 5, 2013 00:52

Quote:

Originally Posted by babakflame (Post 425235)
My openFoam is 2.1.x . Is it from my openFoam version?:confused::(

I have still the problem in reactingFoam case

The code I wrote is for incompressible flow solvers, and it is added to the library of incompressible LES models. The reactingFoam solver is compressible, and uses the compressible LES models.

Best,

babakflame May 5, 2013 08:41

Hi Alberto

I think that reactingFoam is incompressibe, cause we have another solver called rhoReactingFoam which is compressible:rolleyes:.

Don't you think am I right?:confused::rolleyes::confused:

Regards
Bobi

alberto May 5, 2013 12:43

Quote:

Originally Posted by babakflame (Post 425335)
Hi Alberto

I think that reactingFoam is incompressibe, cause we have another solver called rhoReactingFoam which is compressible:rolleyes:.

Don't you think am I right?:confused::rolleyes::confused:

Regards
Bobi

Looking at the code of the two solvers, they are both compressible, but they use different packages for the thermodynamic properties (see comments in the code).

rkc.cfd July 25, 2013 09:50

Problem with Time Writing of Directories when running in Parallel
 
Hi Alberto,

I was able to compile dynamicSmagorinsky model from your GIT repository and ran a test case on 2D flow over cylinder problem and had no problems.

I have a current 3D case running fine with regular Smagorinsky model running in parallel with pisoFoam. I just changed Smagorinsky model to dynamicSmagorinsky and it is running good but not writing the data out or even making time directories in processor folders. Could you suggest me path to debug this problem. My current version of OpenFOAM is 2.2.x compiled from source.

Cheers

dvcauwe November 13, 2013 11:32

Turbulent Prandtl number?
 
Hi Alberto,

First of all I'd like to thank you for making your code accessible. Compilation ran without problems and our results so far are significantly better than using traditional Smagorinsky or the homogenous version.

I was just wondering if you had ever tried to implement Eq. 17 for the Eddy Prandtl number in the Lilly (1992) modification? I used the method described here, applying cell-face averaging like in your method but unfortunately the values for the Prandtl number are very unstable.

Could you recommend other averaging/limiting methods that might allow more stable computation? Or does anyone else know of articles that may refer me to a practical implementation of a variable subgrid Prandtl/Schmidt number?

Thank you very much in advance.

Best regards,
David

palmerlee December 24, 2013 02:08

Quote:

Originally Posted by feldy77 (Post 343191)
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::open(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

Dear Yuri
I am trying to use buoyantBoussinesqPimleFoam with LES too. I noticed that this solver only works with RANS. I want to know whether or not your simulation succeed to give good results so that I can use this solver with LES confidently.
Thank you!
palmerlee

aylalisa February 24, 2014 16:33

dynamicSmagorinskyModel.so
 
Dear Alberto,

I am happy that u've published dynamicSmagorinskyModel including its actual advantage!

I've run computation with your model.
Though after I've start blockMesh I've received following FOAM Warning :

Code:

--> FOAM Warning :
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : /home/lisa/OpenFOAM/lisa-2.2.2/platforms/linux64GccDPOpt/lib/libdynamicSmagorinskyModel.so: undefined symbol: _ZTIN4Foam14incompressible9LESModels11GenEddyViscE
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libdynamicSmagorinskyModel.so"

Could you comment that warning?





Thank you!


regards,
Aylalisa

aylalisa February 25, 2014 06:31

Sorry, found the answer....very long thread!

vut April 1, 2014 08:17

Dear Alberto,

I would like to implement your model for my study case.

I downloaded the folder "dynLocalAverageSmagorinsky" from your website and I do "wmake libso".

Then I added

in controlDict
libs ( "libOpenFOAM.so" "libdynLocalAverageSmagorinskyModel.so" ) ;
and in LESProperties:
LESModel dynLocalAverageSmagorinsky; delta cubeRootVol;
dynLocalAverageSmagorinskyCoeffs { filter simple; ce 1.048; }
But it didn't work. I had some warnings as shown below:

Create time

--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : libdynLocalAverageSmagorinskyModel.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libdynLocalAverageSmagorinskyModel.so"
Create mesh for time = 0

Additionally, when I compile your model typing wmake libso, I obtained:

SOURCE=dynLocalAverageSmagorinsky.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam230/src/turbulenceModels -I/opt/openfoam230/src/turbulenceModels/LES/LESdeltas/lnInclude -I/opt/openfoam230/src/turbulenceModels/LES/LESfilters/lnInclude -I/opt/openfoam230/src/turbulenceModels/incompressible/LES/lnInclude -I/opt/openfoam230/src/transportModels -I/opt/openfoam230/src/finiteVolume/lnInclude -I/opt/openfoam230/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam230/src/OpenFOAM/lnInclude -I/opt/openfoam230/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/dynLocalAverageSmagorinsky.o



I am waiting to hear from you...

Thanks in advance,

vut

alberto April 1, 2014 13:51

The problem is that the library containing the model cannot be found, as the solver tells you:

Quote:

Originally Posted by vut (Post 483212)
--> FOAM Warning :
From function dlOpen(const fileName&, const bool)
in file POSIX.C at line 1179
dlopen error : libdynLocalAverageSmagorinskyModel.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
From function dlLibraryTable::open(const fileName&, const bool)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libdynLocalAverageSmagorinskyModel.so"
Create mesh for time = 0

You should check where the library is written, and verify that location is accessible.

Note that the code only works with OF 2.0.x. It wasn't tested with recent versions.

alberto April 1, 2014 16:14

I have updated the tutorial to work with 2.3.x (based on the pimpleFoam/channel395 tutorial). The code did not require any change. You find the updated code here:

https://bitbucket.org/albertop/dynamicsmagorinsky

vut April 2, 2014 08:12

Dear Alberto,

Thanks for your generous share.

Actually, I recently tried your sub-grid scale model (last version) and it worked despite of mentioned warnings.

You mentioned that the code was not changed and the test case was modified solely, right? Please confirm because it seems interesting to implemented in my case study:

- your sub-grid scale model
- and homogeneousDynSmagorinsky model available now in OF 2.3.0

and compare them.

Best regards,

vut

vut April 2, 2014 08:44

An other question:

Does your model correspond to an article?

Ghosal et al. 1995 ("A dynamic localization model for LES of turbulent flows" in J. Fluid Mech. vol. 286, pp. 229-255)

or

Lilly et al. 1992 ("A proposed modification of the Germano subgrid-scale closure method")

Thanks in advance,

vut

vut April 5, 2014 06:01

It sound like the dynamic Smagorinsky developed by Alberto might have been followed the article of Lilly 1992.

He repeated many times that a local average over faces of cell is implemented instead of an average over the entire computational domain.

Have a nice weekend,

vut

Sunxing April 17, 2014 22:55

Quote:

Originally Posted by alberto (Post 483308)
I have updated the tutorial to work with 2.3.x (based on the pimpleFoam/channel395 tutorial). The code did not require any change. You find the updated code here:

https://bitbucket.org/albertop/dynamicsmagorinsky

Dear Alberto,

Can I use this model in OF 2.1.1?

Best regards.
xing

huangxianbei June 9, 2014 03:49

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

alpalbayrak August 22, 2014 09:16

Hi Alberto,

Maybe a recurring question, but;

I would like to know why you defined the k field. You could easily avoid the field declaration (B.C conditions etc.) and define it like the objects (cI,cD). Does it really have a hidden reason to declare it as field?

Regards
Alp

LSchind January 12, 2015 09:40

Dear all,

I’ve used the dynamic Smagorinsky model in a large-eddy simulation of a confluence, but I am facing rather negative nuSgs near the walls. I know that there is a physical explanation for negative nuSgs, but in my simulations there is a very large region where nuSgs equals -1E-6 (i.e. minus the fluid viscosity) persistently. Therefore, I don’t think my results are correct.

Because I notice these negative values mainly in the first two cells near the wall, I think the problem is related to how I treat the walls. I should mention that due to computational resources, the wall is not resolved, but rather modeled by means of a wall function (namely nutURoughWallFunction). If I refine near the wall, the region of nuSgs persistently equaling -1E-6 decreases. However, I have only tried limited refinement, as I want to limit the computational costs.

Therefore, the question I want to ask is: do you think this dynamic model is compatible with using wall functions? Is it possible that the calculation of nuSgs by the dynamic Smagorinsky model conflicts with the calculation of nuSgs by the wall function?

Or more in general: does anyone have experience with the combined use of this model and wall functions?

Thanks in advance,
Laurent


All times are GMT -4. The time now is 04:12.