CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Access to ck or ce of the Smagorinsky in a new solver (http://www.cfd-online.com/Forums/openfoam-programming-development/125490-access-ck-ce-smagorinsky-new-solver.html)

zxj160 October 26, 2013 13:12

Access to ck or ce of the Smagorinsky in a new solver
 
Dear Foamer,

I am trying to set different values of ck or ce of Smagorinsky model in different regions of the domain. I am not sure whether it is possible to access to ck in the main code of a new solver. Does anyone have an idea?

My best regards,
Jian

wyldckat October 26, 2013 13:21

Greetings Jian,

Quick question: do you mean you want to access the values for the turbulence model in general or the one on a specific patch?

I ask this because I honestly haven't checked which Smagorinsky model you're referring to...

Best regards,
Bruno

zxj160 October 26, 2013 18:17

Hi Bruno,

I mean the incompressible::turbulence::LES models::Smagorinsky. Just like using setFields for 'alpha'. I want to select a region (BoxtoCell) and specify a set value of ck/ce. The remaining region are set to another set of value. I am not sure whether it is possible.

My best regards,
Jian

wyldckat October 26, 2013 18:40

Hi Jian,

From what I can see in the source code:
Both "ce_" and "ck_" are simple scalars and not scalar fields. Which means that as the code is currently defined, it's uniform on all of the domain.


You will have to create a variant of those two classes for them to use "ce" and/or "ck" as scalar fields. Only then will you be able to set values specific to certain locations of the mesh.


Have a look into the code "src/turbulenceModels/compressible/LES/SpalartAllmaras": https://github.com/OpenFOAM/OpenFOAM...palartAllmaras - it uses scalar fields for these variables:
Quote:

Code:

        volScalarField nuTilda_;
        volScalarField dTilda_;
        volScalarField muSgs_;
        volScalarField alphaSgs_;


Best regards,
Bruno


All times are GMT -4. The time now is 08:59.