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/)
-   -   twoPhaseEulerFoam and LES (https://www.cfd-online.com/Forums/openfoam-solving/63667-twophaseeulerfoam-les.html)

GerhardHolzinger June 14, 2012 12:20

twoPhaseEulerFoam with LES - a quick (and dirty) shot
 
2 Attachment(s)
I gave it a try to hack a large eddy turbulence model into twoPhaseEulerFoam.

My approach is based on the assumption, that with LES only nuEffa and nuEffb are directly influenced. So I changed the definition of them. Also the large eddy model is calculated for the mixture like it is done in multiPhaseEulerFoam.

I added this code to createFields.H

Code:

// new for LES
    singlePhaseTransportModel fluid(U, phi);

    autoPtr<incompressible::LESModel> sgsModel
    (
        incompressible::LESModel::New(U, phi, fluid)
    );

    Info<< "Calculating field nuEffa\n" << endl;
    volScalarField nuEffa
    (
        IOobject
        (
            "nuEffa",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        sgsModel->nut() + nua
        //sqr(Ct)*nutb + nua
    );

    Info<< "Calculating field nuEffb\n" << endl;
    volScalarField nuEffb
    (
        IOobject
        (
            "nuEffb",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        sgsModel->nut() + nub
        //nutb + nub
    );

To the file twoPhaseEulerFoam.C two lines were added

Code:

#include "singlePhaseTransportModel.H"
#include "LESModel.H"

In the file UEqns.H the following changes were made

Code:

        //nuEffa = sqr(Ct)*nutb + nua;
        nuEffa = sgsModel->nut() + nua;

        /*volTensorField Rca
        (
            "Rca",
            ((2.0/3.0)*I)*(sqr(Ct)*k + nuEffa*tr(gradUaT)) - nuEffa*gradUaT
        );*/
        volTensorField Rca
        (
            "Rca",
            ((2.0/3.0)*I)*(nuEffa*tr(gradUaT)) - nuEffa*gradUaT
        );

nuEffb and Rcb were altered accordingly.


I attached the source files, from which I removed stuff related to kinetic theory (which I do not need). For reasons of file size limitation the folders Make, interfacialModels and phaseModel are not included in the archive.

There is also a modified case based on the pitzDaily tutorial of pisoFoam included. The initial condition on alpha is that alpha is zero everywhere. This should guarantee a certain level of similarity to the pitzDaily case of pisoFoam. Viscosity is set to match the value of the pitzDaily case of pisoFoam, alos gravity is set to zero. I used in both cases the dynamicSmagorinsky LESModel of Alberto (https://github.com/AlbertoPa/dynamicSmagorinsky/)

The qualitative behaviour looks similar to the results of pisoFoam, but I did no validation yet.

What do you think of all this?

vonboett June 15, 2012 04:17

Looks good to me so far. I am looking forward to someone validating your code with DNS or Experimental Data.

Maybe a possible step would be to ask Saffari/Hosseinnia for their OpenFOAM model they used in "Two-phase Euler-Lagrange CFD simulation of evaporative cooling in a Wind Tower" In: Energy and Buildings, vol. 41 issue 9, 2009, and compare your simulation to their figure 6 which compares the simulation with analytical data. The setup allows to compare lots of single aspects like drop size, velocity, tower diameter etc.

In September it will be decided if my project treating sediment transport is accepted, if yes I will try out your code.

m00nmun November 9, 2013 03:18

Quote:

Originally Posted by GerhardHolzinger (Post 366473)
I gave it a try to hack a large eddy turbulence model into twoPhaseEulerFoam.

My approach is based on the assumption, that with LES only nuEffa and nuEffb are directly influenced. So I changed the definition of them. Also the large eddy model is calculated for the mixture like it is done in multiPhaseEulerFoam.

I added this code to createFields.H

Code:

// new for LES
    singlePhaseTransportModel fluid(U, phi);

    autoPtr<incompressible::LESModel> sgsModel
    (
        incompressible::LESModel::New(U, phi, fluid)
    );

    Info<< "Calculating field nuEffa\n" << endl;
    volScalarField nuEffa
    (
        IOobject
        (
            "nuEffa",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        sgsModel->nut() + nua
        //sqr(Ct)*nutb + nua
    );

    Info<< "Calculating field nuEffb\n" << endl;
    volScalarField nuEffb
    (
        IOobject
        (
            "nuEffb",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        sgsModel->nut() + nub
        //nutb + nub
    );

To the file twoPhaseEulerFoam.C two lines were added

Code:

#include "singlePhaseTransportModel.H"
#include "LESModel.H"

In the file UEqns.H the following changes were made

Code:

        //nuEffa = sqr(Ct)*nutb + nua;
        nuEffa = sgsModel->nut() + nua;

        /*volTensorField Rca
        (
            "Rca",
            ((2.0/3.0)*I)*(sqr(Ct)*k + nuEffa*tr(gradUaT)) - nuEffa*gradUaT
        );*/
        volTensorField Rca
        (
            "Rca",
            ((2.0/3.0)*I)*(nuEffa*tr(gradUaT)) - nuEffa*gradUaT
        );

nuEffb and Rcb were altered accordingly.


I attached the source files, from which I removed stuff related to kinetic theory (which I do not need). For reasons of file size limitation the folders Make, interfacialModels and phaseModel are not included in the archive.

There is also a modified case based on the pitzDaily tutorial of pisoFoam included. The initial condition on alpha is that alpha is zero everywhere. This should guarantee a certain level of similarity to the pitzDaily case of pisoFoam. Viscosity is set to match the value of the pitzDaily case of pisoFoam, alos gravity is set to zero. I used in both cases the dynamicSmagorinsky LESModel of Alberto (https://github.com/AlbertoPa/dynamicSmagorinsky/)

The qualitative behaviour looks similar to the results of pisoFoam, but I did no validation yet.

What do you think of all this?



I have tried the file pitzDailyTwoPhaseLES. However I am getting following error:

--> FOAM FATAL IO ERROR:
keyword Ct is undefined in dictionary "/home/mj/Desktop/twoPhaseEulerFoamLES/constant/transportProperties"

file: /home/mj/Desktop/twoPhaseEulerFoamLES/constant/transportProperties from line 21 to line 41.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 400.

FOAM exiting


I am new to OpenFOAM kindly advised.

GerhardHolzinger November 11, 2013 05:07

Quote:

Originally Posted by m00nmun (Post 461280)
I have tried the file pitzDailyTwoPhaseLES. However I am getting following error:

--> FOAM FATAL IO ERROR:
keyword Ct is undefined in dictionary "/home/mj/Desktop/twoPhaseEulerFoamLES/constant/transportProperties"

file: /home/mj/Desktop/twoPhaseEulerFoamLES/constant/transportProperties from line 21 to line 41.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 400.

FOAM exiting


I am new to OpenFOAM kindly advised.


The error message says, that you need to specify a constant named "Ct" in the file transportProperties. Believe it or not, most of the times the error messages reported by OpenFOAM are very meaningful.

openfoammaofnepo November 16, 2017 23:48

Dear Alberto,

Do you have any publication using LES twoPhaseEulerFoam for me to refer to? Thanks!

OFFO

Quote:

Originally Posted by alberto (Post 213085)
Hi,

yes, I worked on that during my PhD. I essentially used Smagorynsky type models for the gas phase to simulated gas-particle flows. The work was done with OF 1.4.0, and does not compile with more recent versions of OpenFOAM. I did not port it to OpenFOAM 1.5.x for lack of time (I'm working on a different topic right now).

What I can suggest to you is to reuse the single phase classes for LES, and adapt them at the multiphase case, which is essentially what I did.

Best regards,



All times are GMT -4. The time now is 01:03.