CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM

bitwise and operator usage in dsmcFields function object

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

LinkBack Thread Tools Display Modes
Old   November 16, 2010, 14:58
Default bitwise and operator usage in dsmcFields function object
Join Date: Jul 2010
Location: California
Posts: 39
Rep Power: 9
hyperion is on a distinguished road
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
hyperion is offline   Reply With Quote


bitwise, dsmc, dsmcfields

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 19:25.