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

muSgsWallFunctionFvPatchField, explanations or bug ?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 22, 2010, 14:19
Exclamation muSgsWallFunctionFvPatchField, explanations or bug ?
  #1
Member
 
Francois Gallard
Join Date: Mar 2010
Location: Edinburgh
Posts: 39
Rep Power: 8
fgal is on a distinguished road
Hi Foamers,

I had a look at the muSgsWallFunctionFvPatchField implementation in order to know which kind of model was used. I am confused about what I found as I think that many formula are not homogeneous, but that could be due to my lack of knowledge of OpenFoam. Also, could anybody tell me where this formulation comes from ?
Code:
void muSgsWallFunctionFvPatchScalarField::evaluate
(
    const Pstream::commsTypes
)
{
    const scalarField& ry = patch().deltaCoeffs();

    const fvPatchVectorField& U =
        patch().lookupPatchField<volVectorField,  vector>(UName_);

    scalarField magUp = mag(U.patchInternalField() - U);

    const scalarField& muw =
        patch().lookupPatchField<volScalarField,  scalar>(muName_);

    const scalarField& rhow =
        patch().lookupPatchField<volScalarField,  scalar>(rhoName_);

    scalarField& muSgsw = *this;

    scalarField magFaceGradU = mag(U.snGrad());

    forAll(muSgsw, facei)
    {
        scalar magUpara = magUp[facei];

        scalar utau =
            sqrt((muSgsw[facei] +  muw[facei])*magFaceGradU[facei]/rhow[facei]);

        if (utau > 0)
        {
            int iter = 0;
            scalar err = GREAT;

            do
            {
                scalar kUu = kappa_*magUpara/utau;
                scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu);

                scalar f =
                    - utau/(ry[facei]*muw[facei]/rhow[facei])
                    + magUpara/utau
                    + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu));

                scalar df =
                    - 1.0/(ry[facei]*muw[facei]/rhow[facei])
                    - magUpara/sqr(utau)
                    - 1/E_*kUu*fkUu/utau;

                scalar utauNew = utau - f/df;
                err = mag((utau - utauNew)/utau);
                utau = utauNew;

            } while (utau > VSMALL && err > 0.01  && ++iter < 10);

            muSgsw[facei] =
                max
                (
                    rhow[facei]*sqr(utau)/magFaceGradU[facei] -  muw[facei],
                    0.0
                );
        }
        else
        {
            muSgsw[facei] = 0;
        }
    }
}
I understand the code until the while loop.
First, if the uTau should be corrected and computed iteratively, why does this loop does not include the updated muSgs as it is used to compute utau ?

Then the following formulas seems not homogeneous:

Code:
  scalar f =
                     - utau/(ry[facei]*muw[facei]/rhow[facei])
                     + magUpara/utau
                     + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu));
If I am right ry is the delta of the LES filter so is in meters, so, with the convention that "~" means "is homogeneous to":

utau/(ry[facei]*muw[facei]/rhow[facei]) ~ m.s-1/(m.m2.s-1) ~ m-2
magUpara/utau ~ 1
1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu)) ~ 1

So the first term seems not to be exact.

Then
Code:
  scalar df =
                     - 1.0/(ry[facei]*muw[facei]/rhow[facei])
                     - magUpara/sqr(utau)
                     - 1/E_*kUu*fkUu/utau;
- 1.0/(ry[facei]*muw[facei]/rhow[facei]) ~1/(m.m2.s-1) ~ m-3.s-1
- magUpara/sqr(utau) ~ 1
- 1/E_*kUu*fkUu/utau; ~ m.s-1

Also, could anybody tell me what these terms mean ?

Finally

Code:
muSgsw[facei] =
                 max
                 (
                     rhow[facei]*sqr(utau)/magFaceGradU[facei] -  muw[facei],
                    0.0
                );
rhow[facei]*sqr(utau)/magFaceGradU[facei]~kg.m-3.(m.s-1)**0.5/(m.s-1.m-1) ~ kg.m-2.5.s0.5
which is not a dynamic viscosity in : kg.m-1.s-1

Thanks in advance for any comment.


Francois
fgal is offline   Reply With Quote

Reply

Tags
wall function

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Serious bug in LES interface fs82 OpenFOAM Bugs 21 November 16, 2009 09:15
On Bug of Fluent 12.0 lzgwhy FLUENT 0 August 26, 2009 06:41
Bug in twoPhaseEulerFoam wallfunctions alberto OpenFOAM Bugs 1 February 9, 2007 15:15
Bug reports Mattijs Janssens (Mattijs) OpenFOAM 0 January 10, 2005 11:05
Forum y2k Bug Jonas Larsson Main CFD Forum 1 January 5, 2000 11:22


All times are GMT -4. The time now is 14:28.