Fix bug in calcTurbineBladeAndBladeNode
The calculation of the blade and the bladeNode in calcTurbineBladeAndBladeNode()
was incorrect. The image below shows the node indices of the ActuatorLine:
In calcTurbineBladeAndBladeNode()
turbine, blade and blade node are calculated from node.
The corrected version is:
__host__ __device__ __inline__ void calcTurbineBladeAndBladeNode(uint node, uint &bladeNode, uint numberOfNodesPerBlade, uint &blade, uint numberOfBlades, uint &turbine, uint numberOfTurbines)
{
turbine = node / (numberOfNodesPerBlade * numberOfBlades);
uint x_off = turbine * numberOfNodesPerBlade * numberOfBlades;
blade = (node - x_off) / numberOfNodesPerBlade;
uint y_off = numberOfNodesPerBlade * blade + x_off;
bladeNode = node - y_off;
}
In the previous, incorrect version, the blade was calculated as follows blade = (node - x_off) / numberOfBlades;
Some tests for these calculations were added. I also extracted some functions from ActuatorFarm.cu.
@HenrikAsmuth @Hkorb The incorrect values were not used in the current version. So this bug probably did not cause any problems for you. Can one of you check whether the calculation is correct now?
Merge request reports
Activity
added Bug label
assigned to @a.wellmann
mentioned in merge request !249 (merged)
added 95 commits
-
5536dc3f...f9da1338 - 93 commits from branch
irmb:develop
- e3ad8356 - Add license and some comments
- ff1122db - Merge branch 'develop' into refactorActuatorFarm
-
5536dc3f...f9da1338 - 93 commits from branch
enabled an automatic merge when the pipeline for ff1122db succeeds
mentioned in commit b81740f8