# Bug in actuationDiskSource????

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

 July 6, 2018, 07:36 Bug in actuationDiskSource???? #1 New Member   Amadeo Moran Join Date: Jan 2012 Location: Madrid Posts: 10 Rep Power: 10 Dear community, I was trying to perform a simulation of an actuator disk and reviewing the source code C++ in "actuationDiskSourceTemplates.C" there is a line with the calculation of T (total thrust). Code: `scalar T = 2.0*upRho*diskArea_*mag(upU)*a*(1 - a);` if mag() calculates the magnitude of a field, is there is a bug? because the thrust should be: Code: `scalar T = 2.0*upRho*diskArea_*sqr(mag(upU))*a*(1 - a);` Probably I am considering something wrong because is not a new implementation and have been tested a lot but if anybody can help I will appreciate it very much. Thanks and regards from Spain! amg. Last edited by a.morang; July 9, 2018 at 04:06.

 July 7, 2018, 05:11 #2 Senior Member   Michael Alletto Join Date: Jun 2018 Location: Bremen Posts: 334 Rep Power: 6 I think this is correct since mag calculates the magnitude and not the magnitude squared see, e.g. http://foam.sourceforge.net/docs/Gui...mmersGuide.pdf

July 9, 2018, 04:13
#3
New Member

Join Date: Jan 2012
Posts: 10
Rep Power: 10
Quote:
 Originally Posted by mAlletto I think this is correct since mag calculates the magnitude and not the magnitude squared see, e.g. http://foam.sourceforge.net/docs/Gui...mmersGuide.pdf
sqr is the squared:

Code:
`sqr(mag(U)) == mag(U)*mag(U)`
for it my question... In the original code U is not squared and should be because if not the units are not correct unless:

Code:
`mag(U) = Ux^2 + Uy^2 + Uz^2`

 July 9, 2018, 10:28 #4 Senior Member   Michael Alletto Join Date: Jun 2018 Location: Bremen Posts: 334 Rep Power: 6 The units are correct since the complete calculation of the force is: scalar T = 2.0*upRho*diskArea_*mag(upU)*a*(1 - a); forAll(cells, i){Usource[cells[i]] += ((Vcells[cells[i]]/V())*T*E) & upU;}

July 10, 2018, 04:07
#5
New Member

Join Date: Jan 2012
Posts: 10
Rep Power: 10
Quote:
 Originally Posted by mAlletto The units are correct since the complete calculation of the force is: scalar T = 2.0*upRho*diskArea_*mag(upU)*a*(1 - a); forAll(cells, i){Usource[cells[i]] += ((Vcells[cells[i]]/V())*T*E) & upU;}
Do you mean that in C++:

Code:
`upU & upU == upU^2`
Thanks.
amg.

 July 10, 2018, 06:03 #6 Senior Member   Michael Alletto Join Date: Jun 2018 Location: Bremen Posts: 334 Rep Power: 6 yes. The dot product of two vectors is equal to the magnitude squared: u & u = ux*ux + uy*uy + uz*uz a.morang likes this.

July 11, 2018, 13:14
#7
New Member

Join Date: Jan 2012
Posts: 10
Rep Power: 10
Quote:
 Originally Posted by malletto yes. The dot product of two vectors is equal to the magnitude squared: U & u = ux*ux + uy*uy + uz*uz
thanks you very much for your time!!
Regards!

 Tags actuationdisksource