CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Basic question in coding

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 7, 2019, 12:19
Default Basic question in coding
  #1
Member
 
Stanley John
Join Date: Sep 2018
Posts: 79
Rep Power: 7
sjohn2 is on a distinguished road
What does the & operator do in this line of code:
volScalarField gh("gh", (g & mesh.C()) - ghRef);

g is the gravity fied, mesh.C() is the volVectorField and ghRef is a scalar.

Also while learning the coding part of OpenFoam, which part of the C++ programming should I focus on?
sjohn2 is offline   Reply With Quote

Old   November 7, 2019, 13:36
Default
  #2
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
The inner product -- see e.g. https://pingpong.chalmers.se/public/...gramming-1.pdf.

Caelan
clapointe is offline   Reply With Quote

Old   November 7, 2019, 13:42
Default
  #3
Member
 
Stanley John
Join Date: Sep 2018
Posts: 79
Rep Power: 7
sjohn2 is on a distinguished road
Thanks,

Basically you are taking a dot product of a vector with a volVectorfield, so does openFoam automatically multiplies the one vector with the vector in each of the control volume?
sjohn2 is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic question on motorBike tutorial newToOpenFoam OpenFOAM Running, Solving & CFD 2 July 14, 2011 09:50
Basic question forsumit OpenFOAM 0 April 7, 2010 10:46
Basic Question Abhi FLUENT 1 August 4, 2007 08:07
Basic question: UDF for wall heat flux Carl FLUENT 1 August 5, 2006 19:01
A Basic Question on ducted Flows! CFD User Main CFD Forum 4 January 8, 2005 06:17


All times are GMT -4. The time now is 19:42.