CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   tmp<volScalarField> sr(strainRate())??? (https://www.cfd-online.com/Forums/openfoam-programming-development/122482-tmp-volscalarfield-sr-strainrate.html)

sharonyue August 20, 2013 21:51

tmp<volScalarField> sr(strainRate())???
 
Hi guys,

In Herschel-Bulkley.C it has:

Code:

Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::HerschelBulkley::calcNu() const
{
    dimensionedScalar tone("tone", dimTime, 1.0);
    dimensionedScalar rtone("rtone", dimless/dimTime, 1.0);

    tmp<volScalarField> sr(strainRate());

    return
    (
        min
        (
            nu0_,
            (tau0_ + k_*rtone*pow(tone*sr(), n_))
          /(max(sr(), dimensionedScalar ("VSMALL", dimless/dimTime, VSMALL)))
        )
    );
}

Can I change it into this:
Code:

Foam::tmp<Foam::volScalarField>
Foam::viscosityModels::HerschelBulkley::calcNu() const
{
    dimensionedScalar tone("tone", dimTime, 1.0);
    dimensionedScalar rtone("rtone", dimless/dimTime, 1.0);

    return
    (
        min
        (
            nu0_,
            (tau0_ + k_*rtone*pow(tone*strainRate(), n_))
          /(max(sr(), dimensionedScalar ("VSMALL", dimless/dimTime, VSMALL)))
        )
Thanks in advance guys!
    );
}


sharonyue August 22, 2013 23:59

Yeah, It works.


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