Skip to content

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:

AlmNodeIndices

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?

Edited by Anna Wellmann

Merge request reports

Loading