CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   dynLagrangian SGS model (http://www.cfd-online.com/Forums/openfoam-solving/90351-dynlagrangian-sgs-model.html)

tidal_Tom July 7, 2011 10:20

dynLagrangian SGS model
 
I am trying to set up a LES model using the pisoFoam solver and the dynLagrangian SGS model that is included in the latest release of OpenFOAM 2.0.0.

I am struggling to set up the model as I am unsure what the dimensions of the flm and fmm fields should be?

Has anyone managed to get this model to run?

thanks
Tom

Bernhard July 8, 2011 14:19

Did you check the reference that is given in the .H source file?
Otherwise you can get it out of the equations, since flm and fmm should have the same dimension, and they are used in the expression for the timescale.

tidal_Tom July 12, 2011 05:29

Sorted
 
Hi, thanks for your response.

I resorted to going through the reference given in the source code and worked the dimensions out from the equations for flm and fmm. Both have the same units of m^4 s^-4.

The model now works.

Tom

prasanth August 9, 2011 01:51

Quote:

Originally Posted by tidal_Tom (Post 315804)
Hi, thanks for your response.

I resorted to going through the reference given in the source code and worked the dimensions out from the equations for flm and fmm. Both have the same units of m^4 s^-4.

The model now works.

Tom

Hello Tom,

I am also in need of this new Sgs model. What should I Need to do for flm and fmm fields, In the source code, It is mentioned like these two are relaxtion equations for soloving the nuSgs. Could you please telll me how you manage to run this Sgs model?

tidal_Tom August 11, 2011 06:46

Include files in the '0' directory of flm and fmm fileds, in the same way there are files for 'U' and 'p'. Set the dimensions of these fields as per my previous post.

The model should now run.

Refer to 'A lagrangian dynamic subgrid-scale model of turbulence' by Charles Meneveau 1996 for more details about the model.

hope this helps,

Tom

prasanth August 11, 2011 14:44

Hello Tom,

I added the flm and fmm files as per your suggestion. I am getting print stack errors. Did you also facing this issue. I am giving those errors over here:
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.0.1
Exec : pisoFoam
Date : Aug 12 2011
Time : 00:05:01
Host : ubuntu
PID : 4732
Case : /media/CFDSOFT/CFD/CFD_Projects/openFoam/OF-2.0/LES
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type LESModel
Selecting LES turbulence model dynLagrangian
#0 Foam::error::printStack(Foam::Ostream&) in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/libc.so.6"
#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4 void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libincompressibleRASModels.so"
#6 Foam::incompressible::LESModels::dynLagrangian::up dateSubGridScaleFields(Foam::tmp<Foam::GeometricFi eld<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> > const&) in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#7 Foam::incompressible::LESModels::dynLagrangian::dy nLagrangian(Foam::GeometricField<Foam::Vector<doub le>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&, Foam::word const&) in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#8 Foam::incompressible::LESModel::adddictionaryConst ructorToTable<Foam::incompressible::LESModels::dyn Lagrangian>::New(Foam::GeometricField<Foam::Vector <double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#9 Foam::incompressible::LESModel::New(Foam::Geometri cField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#10 Foam::incompressible::turbulenceModel::addturbulen ceModelConstructorToTable<Foam::incompressible::LE SModel>::NewturbulenceModel(Foam::GeometricField<F oam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libincompressibleLESModels.so"
#11 Foam::incompressible::turbulenceModel::New(Foam::G eometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel&, Foam::word const&) in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libincompressibleTurbulenceModel.so"
#12
in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/bin/pisoFoam"
#13 __libc_start_main in "/lib/libc.so.6"
#14
in "/home/prasanth/OpenFOAM/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/bin/pisoFoam"

I have given the units like m^4/s^4 for both the files. and I am using simple filter for the dynLagrangianCoeffs. Could you please give some idea about working on this.
In mean while, I am also looking in to that paper which you have send.

tidal_Tom August 12, 2011 03:54

I do not know what is causing your errors. I am a relatively novice user so it is beyond me. below are my files I used for flm and fmm. I don't think fmm can be zero, as the calculation for turbulent viscosity divides by fmm, I set this to a value of 1. flm can be zero as it is the nominator.

Have you added flm and fmm in the fvSolution and fvSchemes? lines I added are below.

fvSolution:

flm
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}

fmm
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}

fvSchemes:

divSchemes
{
default none;
div(phi,U) Gauss linear;
div(phi,flm) Gauss limitedLinear 1;
div(phi,fmm) Gauss limitedLinear 1;
div(phi,B) Gauss limitedLinear 1;
div(B) Gauss linear;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}

and I added:

dynLagrangianCoeffs
{
filter simple;
ce 1.048;
theta 1.5;
}

in the LESProperties dictionary.

flm:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.0 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object flm;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 4 -4 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet
{
type fixedValue;
value uniform 0;
}

outlet
{
type zeroGradient;
}

outside
{
type fixedValue;
value uniform 0;
}

object
{
type fixedValue;
value uniform 0;
}

wedge1
{
type wedge;
}

wedge2
{
type wedge;
}
}

// ************************************************** *********************** //

fmm:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.0 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object fmm;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 4 -4 0 0 0 0];

internalField uniform 1;

boundaryField
{
inlet
{
type fixedValue;
value uniform 1;
}

outlet
{
type zeroGradient;
}

outside
{
type zeroGradient;
}

object
{
type zeroGradient;
}

wedge1
{
type wedge;
}

wedge2
{
type wedge;
}
}

// ************************************************** *********************** //

prasanth August 12, 2011 14:38

Quote:

Originally Posted by tidal_Tom (Post 319852)
I do not know what is causing your errors. I am a relatively novice user so it is beyond me. below are my files I used for flm and fmm. I don't think fmm can be zero, as the calculation for turbulent viscosity divides by fmm, I set this to a value of 1. flm can be zero as it is the nominator.

Have you added flm and fmm in the fvSolution and fvSchemes? lines I added are below.

fvSolution:

flm
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}

fmm
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}

fvSchemes:

divSchemes
{
default none;
div(phi,U) Gauss linear;
div(phi,flm) Gauss limitedLinear 1;
div(phi,fmm) Gauss limitedLinear 1;
div(phi,B) Gauss limitedLinear 1;
div(B) Gauss linear;
div((nuEff*dev(T(grad(U))))) Gauss linear;
}

and I added:

dynLagrangianCoeffs
{
filter simple;
ce 1.048;
theta 1.5;
}

in the LESProperties dictionary.

flm:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.0 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object flm;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 4 -4 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet
{
type fixedValue;
value uniform 0;
}

outlet
{
type zeroGradient;
}

outside
{
type fixedValue;
value uniform 0;
}

object
{
type fixedValue;
value uniform 0;
}

wedge1
{
type wedge;
}

wedge2
{
type wedge;
}
}

// ************************************************** *********************** //

fmm:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.0.0 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object fmm;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 4 -4 0 0 0 0];

internalField uniform 1;

boundaryField
{
inlet
{
type fixedValue;
value uniform 1;
}

outlet
{
type zeroGradient;
}

outside
{
type zeroGradient;
}

object
{
type zeroGradient;
}

wedge1
{
type wedge;
}

wedge2
{
type wedge;
}
}

// ************************************************** *********************** //


Hello Tom,

Thank you very much. Now I can able to run the lagrangian Sgs model.

Regards
Prasanth.

vonboett November 21, 2012 06:44

Since the SGS model constant ce is defined as ceČ = flm/fmm you just kill the model konstant when setting flm to zero, so I expect your results to be the same if you run it without SGS model at all. I would suggest to give flm a very small value, such that the average for flm written at the end the first timestep is close to 1. Dependent on your grid resolution, flm will become quite large in the following calculations. I use
div(phi,U) Gauss LUST unlimitedGrad(U); which is suitable for LES in complex geometries and smoothSolver for flm, and I apply relaxation to flm and fmm.

Since the authors of the SGS model themselves point out that the dynamic Mixed Scale Similarity model has some better representation than the Smagorinsky model, (aswell a finding of the LTT Rostock that led to their dynamicMixedModel SGS implementation for OpenFOAM), I am looking forward to the day someone implements the first Lagrangian Dynamic Mixed Model in OF.

I have to admit that Eugene is right:
(http://www.cfd-online.com/Forums/ope...tml#post195652)
the local dynamic SGS models are still somehow unpredictable due to the lack of validation. Never-the-less one needs backscatter to account for the influence of the free surface on turbulence, for all who use interFoam with LES, and the dynamic models together with clipping can allow this.

vonboett January 10, 2013 06:22

The Lagrangian Dynamic Mixed Model is implemented for OF 2.1.x by LEMOS extensions for OpenFOAM, however it is not in the git repository as annaunced here: http://www.lemos.uni-rostock.de/cfd-software/

with the dynLagrangian model, I think about implementing a limitation for fmm, in my simulations it grows larger and larger in some regions which is ok for me since it just makes the subgrid scale viscosity vanish, but I think it causes numerical problems when going towarts infinity.

Actually there is a mistake in the Detailed Description in the programmer's C++ documentation, the equation for fmm should be "= (1/T) * (M && M - fmm)" instead of "= (1/T) * ( M && M - flm)" due to Meneveaus Eq. (3.9).

Anyone has experience with theta different from 1.5 yet?

Uhkoetter May 2, 2013 07:41

Quote:

Originally Posted by vonboett (Post 401156)
The Lagrangian Dynamic Mixed Model is implemented for OF 2.1.x by LEMOS extensions for OpenFOAM, however it is not in the git repository as annaunced here: http://www.lemos.uni-rostock.de/cfd-software/

with the dynLagrangian model, I think about implementing a limitation for fmm, in my simulations it grows larger and larger in some regions which is ok for me since it just makes the subgrid scale viscosity vanish, but I think it causes numerical problems when going towarts infinity.

Actually there is a mistake in the Detailed Description in the programmer's C++ documentation, the equation for fmm should be "= (1/T) * (M && M - fmm)" instead of "= (1/T) * ( M && M - flm)" due to Meneveaus Eq. (3.9).

Anyone has experience with theta different from 1.5 yet?

This mistake is just in the discription and not in the code. (dynLagrangian.C line 164)
By the way, Meneveau recommends a 'first-order expression in time, coupled with linear spatial interpolation to find the values required at the 'upstream' locations'.

Lieven May 2, 2013 08:28

The computation of fmm and flm is correct fine, at least the equations are. There is however a bug in the computation of nuSgs in the dynLagrangian model of OF-2.1.x (and earlier). This has been corrected in 2.2.x (http://www.openfoam.org/mantisbt/view.php?id=816). It is pretty easy to correct it yourself.

And I fully agree with Stephan, the implementation of OF is not really what Meneveau does in his papers...

Cheers,

L

ashvinc9 July 8, 2013 20:07

problem in using dynLagrangian model
 
2 Attachment(s)
Hello,

Can someone comment on my results of open channel flow simulation obtained using Dynamic Lagrangian and One equation eddy SGS models? The solution looks OK when using one eq. model but for the same grid and numerical set-up the solution changes a lot when using the dynamic Lagrangian model. What causes this difference in solutions?
The results are attached here.

Thanks in advance.

- Ashvin

ashvinc9 July 13, 2013 08:56

Can any one please comment on the above issue? I appreciate your help !

- Ashvin

vonboett July 22, 2013 05:02

could you post your fvSolution and dynLagrangianCoeffs ?

ashvinc9 July 22, 2013 05:55

Thank you for your reply. The answers are below:

Code:

dynLagrangianCoeffs
{
filter      simple;
ce        1.048;
theta    1.5;
}

and the fvSolution file is:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{

      p
    {
        solver          PCG;
        preconditioner
        {
            preconditioner  GAMG;
            tolerance      1e-05;
            relTol          0.005;
            smoother        DICGaussSeidel;
            nPreSweeps      0;
            nPostSweeps    2;
            nBottomSweeps  2;
            cacheAgglomeration true;
            nCellsInCoarsestLevel 100;
            agglomerator    faceAreaPair;
            mergeLevels    1;
        }
        tolerance      1e-06;
        relTol          0;
    }


  s
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-06;
        relTol          0;
    }
 

    U
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-05;
        relTol          0;
    }

    k
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-08;
        relTol          0;
    }
    flm
    {
        solver          smoothSolver;
    smoother    DILUGaussSeidel;
        preconditioner  DILU;
        tolerance      1e-06;
        relTol          0;
    }
    fmm
    {
        solver          smoothSolver;
    smoother    DILUGaussSeidel;
        preconditioner  DILU;
        tolerance      1e-06;
        relTol          0;
    }

}

PISO
{
    nCorrectors    2;
    nNonOrthogonalCorrectors 0;
    pRefCell  0;
    pRefValue  0.0;
}


// ************************************************************************* //

Regards,
Ashvin

vonboett July 22, 2013 10:15

... looks O.K. for a general testcase for me. I use solver precisions 10e-8 and courant number 0.25, but this should not make the difference. Do you apply vanDriest damping? And what are your initial values for flm, fmm?

ashvinc9 July 22, 2013 10:43

Hi,

I also used maxCo=0.25 in almost all the simulations. I don't use vanDriest damping function. Do we need in this kind of SGS model ? The initial and boundary conditions for flm and fmm are as follows:

The flm file in 0 dir is:

Code:

dimensions      [0 4 -4 0 0 0 0];

internalField  uniform 0.1;

boundaryField
{
  down
    {
    type            zeroGradient;
    }
   
    top
    {
        type            zeroGradient;
    }
    in
    {
        type            cyclic;
    }
    out
    {
        type            cyclic;
    }
    side1
    {
        type            cyclic;
    }
    side2
    {
        type            cyclic;
    }
}

The fmm file in 0 dir is:

Code:

dimensions      [0 4 -4 0 0 0 0];

internalField  uniform 0.1;

boundaryField
{
  down
    {
      type            zeroGradient;
    }
   
    top
    {
        type            zeroGradient;
    }
    in
    {
        type            cyclic;
    }
    out
    {
        type            cyclic;
    }
    side1
    {
        type            cyclic;
    }
    side2
    {
        type            cyclic;
    }
}

Thanks,

Ashvin

vonboett July 24, 2013 05:29

For me your settings look all right, but I used the Lagrangian DMM only a little. Since the biggest "error" is developing close to the wall, I guess the difference in wallFunctions between your two simulation plays a role.

vut April 3, 2014 03:32

Hi,

I want to use dynLagrangian, too. Just one question:

Which value should we set for flm and fmm at WALL in 0/?

Regards,

vut


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