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

pTraits

Register Blogs Community New Posts Updated Threads Search

Rate this Entry

pTraits

Posted September 14, 2017 at 06:05 by kindle

Code:
int(pTraits<arg1>::rank)
just gives flexibility to all types that pTraits wapped. And rank is another static member like "one" and "zero"


Quote:
Originally Posted by openfoammaofnepo View Post
Dear ngj,

Thank you so much. Today I met the pTraits in the turbulentInlet.C again. So I had a look at thread again. The codes are as follows:

Code:
        scalar rmsCorr = sqrt(12*(2*alpha_ - sqr(alpha_)))/alpha_;

        patchField =
            (1 - alpha_)*patchField
          + alpha_*
            (
                referenceField_
              + rmsCorr*cmptMultiply
                (
                    randomField - 0.5*pTraits<Type>::one,
                    fluctuationScale_
                )*mag(referenceField_)
            );
So here when patchField is vector (actually it is velocity becase it is a boundary type for velocity), is "pTraits<Type>:ne" the vector [1 1 1]?

Thank you so much. OFFO
Posted in Uncategorized
Views 1662 Comments 0 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 0

Comments

 

All times are GMT -4. The time now is 23:36.