CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   bitwise and operator usage in dsmcFields function object (http://www.cfd-online.com/Forums/openfoam/82091-bitwise-operator-usage-dsmcfields-function-object.html)

hyperion November 16, 2010 14:58

bitwise and operator usage in dsmcFields function object
 
Hi foamers - in the function object dsmcFields.C some of the calculations make usage of the bitwise and (&) operator to compute new fields. It seems to somehow involve converting a vector field into a scaler field.

Info<< " Calculating translationalT field." << endl;
00163 volScalarField translationalT
00164 (
00165 IOobject
00166 (
00167 "translationalT",
00168 obr_.time().timeName(),
00169 obr_,
00170 IOobject::NO_READ
00171 ),
00172 2.0/(3.0*dsmcCloud::kb*rhoNMean)
00173 *(linearKEMean - 0.5*rhoMMean*(UMean & UMean))
00174 );
In the above code, UMean is a vector field. I'm new to C++ and the books that I have picked up only describe bitwise and in terms of bit by bit modification. Does anyone understand the usage of the operator in the code above.


Many Thanks


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