CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

interior and the wall-bounded cells

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   November 4, 2009, 20:42
Default interior and the wall-bounded cells
  #1
Member
 
Sven Schweikert
Join Date: Jun 2009
Posts: 38
Rep Power: 8
svens is on a distinguished road
Dear FOAMer community

Regarding the Reynolds-stress turbulence model implementation in OF, is there a difference in the way in which dev(P) is calculated in the interior and the wall-bounded cells? I guess if there is a difference then it will be in the way in which the velocity gradients (specifically the gradients normal to the wall) are calculated. Can anyone tell if there are such differences and, if so, where can they be found?

Thanks for your ideas and oppinions,
Sven
svens is offline   Reply With Quote

Old   November 6, 2009, 13:51
Default
  #2
Member
 
Sven Schweikert
Join Date: Jun 2009
Posts: 38
Rep Power: 8
svens is on a distinguished road
Dear FOAMer community

Perhaps a little bit more background information to my previous question:

I ajusted OpenFOAMs standard LaunderGibsonRSTM in a way so that I can have 4 different RSTMs with just one formulation just by changing some constants. This formulation is published by Younis et al. in 'Heat Mass Transfer' under the titel 'Prediction of momentum and scalar transport in turbulent swirling flows with an objective Reynolds-stress transport closure'. The necessary inovations are done at the pressure-shear-corellation which is located in the REqn in OpenFOAMs LaunderGibsonRSTM.

One of the 4 possible RSTMs is as well the LaunderGibsonRSTM. The results should therefore be the same for both formulations. They are but sadly not in the near wall regions.
For example - the dev(P) which is used in the 'reflect' term for the wall reflection correction should be absloutly the same like our equivalent for it. And yes it is but not for the cells directly at the wall boundaries.
All the initial and boundary conditions are the same for both formulation of the LG-RSTM.

New formualtion for the REqn of the LaunderGibsonRSTM:

Code:
    volSymmTensorField b = R_/(2.0*k_) - 1.0/3.0*I;     
    
    volSymmTensorField bb = (b & b);

    volScalarField trace_bb = tr(bb);

    volSymmTensorField S = symm(fvc::grad(U_)().T());

    volTensorField W = skew(fvc::grad(U_)().T());

    volSymmTensorField bS = (b & S);

    volSymmTensorField Sb = (S & b);

    volTensorField bW = (b & W);

    volTensorField Wb = (W & b); 

    volSymmTensorField reflect = C1Ref_*epsilon_/k_*R_ + C2Ref_*dev((C3new_ - C3newStar_*(pow(trace_bb, 0.5)))*k_*S
      + C4new_*k_*((bS + Sb) - 2.0/3.0*tr(bS)*I)
      + C5new_*k_*symm(Wb-bW));

    tmp<fvSymmTensorMatrix> REqn
    (
        fvm::ddt(R_)
      + fvm::div(phi_, R_)
    //- fvm::laplacian(Cs_*(k_/epsilon_)*R_, R_)
      - fvm::laplacian(DREff(), R_)
      + fvm::Sp(C1new_*epsilon_/(2*k_) + C1newStar_*G/(2*k_), R_)
      ==
        P
      + (1.0/3.0)*(C1new_*epsilon_ + C1newStar_*G)*I
      + C2new_*epsilon_*(bb - 1.0/3.0*trace_bb*I)
      + (C3new_ - C3newStar_*(pow(trace_bb, 0.5)))*k_*S
      + C4new_*k_*((bS + Sb) - 2.0/3.0*tr(bS)*I)
      + C5new_*k_*symm(Wb-bW)
      - (2.0/3.0)*epsilon_*I

      // wall reflection terms
      + symm
        (
            I*((yr_.n() & reflect) & yr_.n())
          - 1.5*(yr_.n()*(reflect & yr_.n())
          + (yr_.n() & reflect)*yr_.n())
        )*pow(Cmu_, 0.75)*pow(k_, 1.5)/(kappa_*yr_*epsilon_)
    );
and the original REqn of the LaunderGibsonRSTM:

Code:
    volSymmTensorField reflect = C1Ref_*epsilon_/k_*R_ - C2Ref_*Clg2_*dev(P);

    tmp<fvSymmTensorMatrix> REqn
    (
        fvm::ddt(R_)
      + fvm::div(phi_, R_)
      - fvm::Sp(fvc::div(phi_), R_)
    //- fvm::laplacian(Cs*(k_/epsilon_)*R_, R_)
      - fvm::laplacian(DREff(), R_)
      + fvm::Sp(Clg1_*epsilon_/k_, R_)
      ==
        P
      + (2.0/3.0*(Clg1_ - 1)*I)*epsilon_
      - Clg2_*dev(P)

        // wall reflection terms
      + symm
        (
            I*((yr_.n() & reflect) & yr_.n())
          - 1.5*(yr_.n()*(reflect & yr_.n())
          + (yr_.n() & reflect)*yr_.n())
        )*pow(Cmu_, 0.75)*pow(k_, 1.5)/(kappa_*yr_*epsilon_)
    );
I would be glad to hear all your oppinion and ideas where the problem could come from.

Thanks pretty much,
Sven
svens is offline   Reply With Quote

Old   November 14, 2009, 16:28
Default Problem Solved!
  #3
Member
 
Sven Schweikert
Join Date: Jun 2009
Posts: 38
Rep Power: 8
svens is on a distinguished road
Hey you interested FOAMer.

The key to the problem had been the near wall correction directly in front of the REqn:

Code:
    const fvPatchList& patches = mesh_.boundary();

    forAll(patches, patchi)
    {
        const fvPatch& curPatch = patches[patchi];

        if (typeid(curPatch) == typeid(wallFvPatch))
        {
            forAll(curPatch, facei)
            {
                label faceCelli = curPatch.faceCells()[facei];
                P[faceCelli] *=
                    min(G[faceCelli]/(0.5*mag(tr(P[faceCelli])) + SMALL), 1.0);
            }
        }
    }
We established a new formulation for PHIij,2 (pressure-strain-correlation) which of course also have to be corrected in the same way:

Code:
    // Reynolds stress equation


    volSymmTensorField b = R_/(2.0*k_) - 1.0/3.0*I;     
    
    volSymmTensorField bb = (b & b);

    volScalarField trace_bb = tr(bb);

    volSymmTensorField S = symm(fvc::grad(U_)().T());

    volTensorField W = skew(fvc::grad(U_)().T());

    volSymmTensorField bS = (b & S);

    volSymmTensorField Sb = (S & b);

    volTensorField bW = (b & W);

    volTensorField Wb = (W & b); 

   volSymmTensorField PHIij2 = ((C3new_ - C3newStar_*(pow(trace_bb, 0.5)))*k_*S
                    + C4new_*k_*((bS + Sb) - 2.0/3.0*tr(bS)*I)
                  + C5new_*k_*symm(Wb-bW));

    const fvPatchList& patches = mesh_.boundary();

    forAll(patches, patchi)
    {
        const fvPatch& curPatch = patches[patchi];

        if (typeid(curPatch) == typeid(wallFvPatch))
        {
            forAll(curPatch, facei)
            {
                label faceCelli = curPatch.faceCells()[facei];
                P[faceCelli] *=
                    min(G[faceCelli]/(0.5*mag(tr(P[faceCelli])) + SMALL), 1.0);
            }
            forAll(curPatch, facei)
            {
                label faceCelli = curPatch.faceCells()[facei];
                PHIij2[faceCelli] *=
                    min(G[faceCelli]/(0.5*mag(tr(P[faceCelli])) + SMALL), 1.0);
            }
        }
    }


    volSymmTensorField reflect = C1Ref_*epsilon_/k_*R_ + C2Ref_*PHIij2;

    tmp<fvSymmTensorMatrix> REqn
    (
        fvm::ddt(R_)
      + fvm::div(phi_, R_)
    //- fvm::laplacian(Cs_*(k_/epsilon_)*R_, R_)
      - fvm::laplacian(DREff(), R_)
      + fvm::Sp(C1new_*epsilon_/(2*k_) + C1newStar_*G/(2*k_), R_)
      ==
        P
      + (1.0/3.0)*(C1new_*epsilon_ + C1newStar_*G)*I
      + C2new_*epsilon_*(bb - 1.0/3.0*trace_bb*I)
      + PHIij2
      - (2.0/3.0)*epsilon_*I

      // wall reflection terms
      + symm
        (
            I*((yr_.n() & reflect) & yr_.n())
          - 1.5*(yr_.n()*(reflect & yr_.n())
          + (yr_.n() & reflect)*yr_.n())
        )*pow(Cmu_, 0.75)*pow(k_, 1.5)/(kappa_*yr_*epsilon_)
    );

    REqn().relax();
    solve(REqn);
Testing the new formulation with constants for LG leads to absolutly the same reults like OpenFOAMs standard LG-RSTM.

Thanks for your interest - Sven
svens is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:53.