diff --git a/src/gpu/VirtualFluids_GPU/Visitor/ActuatorLine.cu b/src/gpu/VirtualFluids_GPU/Visitor/ActuatorLine.cu index 7996e81d8e324b326daf0f1456ff8f39e207008b..ab2de3cabe83448019f5a78b55c9fdf931df2fb9 100644 --- a/src/gpu/VirtualFluids_GPU/Visitor/ActuatorLine.cu +++ b/src/gpu/VirtualFluids_GPU/Visitor/ActuatorLine.cu @@ -31,8 +31,6 @@ __global__ void interpolateVelocities(real* gridCoordsX, real* gridCoordsY, real real* bladeVelocitiesX, real* bladeVelocitiesY, real* bladeVelocitiesZ, uint* bladeIndices, uint numberOfNodes) { - // Possibly restructure this to check every cell whether it is bsw of some blade node and then do interpolation - // --> no need to save closest nodes and search new closest node const uint x = threadIdx.x; const uint y = blockIdx.x; const uint z = blockIdx.y; @@ -49,10 +47,7 @@ __global__ void interpolateVelocities(real* gridCoordsX, real* gridCoordsY, real real bladePosZ = bladeCoordsZ[node]; uint old_index = bladeIndices[node]; - // if(node==0 or node==90) - // { - // printf("before: blade (%f, %f, %f), node BSW (%f, %f, %f), nodeTNE (%f, %f, %f)\n", bladePosX, bladePosY, bladePosZ, gridCoordsX[old_index], gridCoordsY[old_index], gridCoordsZ[old_index], gridCoordsX[neighborsX[old_index]], gridCoordsY[neighborsY[old_index]], gridCoordsZ[neighborsZ[old_index]]); - // } + uint k, ke, kn, kt; uint kne, kte, ktn, ktne; @@ -79,11 +74,6 @@ __global__ void interpolateVelocities(real* gridCoordsX, real* gridCoordsY, real bladeVelocitiesY[node] = trilinearInterpolation(dW, dE, dN, dS, dT, dB, k, ke, kn, kt, kne, kte, ktn, ktne, vy); bladeVelocitiesZ[node] = trilinearInterpolation(dW, dE, dN, dS, dT, dB, k, ke, kn, kt, kne, kte, ktn, ktne, vz); - // if(node==numberOfNodes-1) - // { - // printf("after: blade (%f, %f, %f), node BSW (%f, %f, %f), nodeTNE (%f, %f, %f)\n", bladePosX, bladePosY, bladePosZ, gridCoordsX[kBSW], gridCoordsY[kBSW], gridCoordsZ[kBSW], gridCoordsX[neighborsX[kBSW]], gridCoordsY[neighborsY[kBSW]], gridCoordsZ[neighborsZ[kBSW]]); - // } - } @@ -138,19 +128,6 @@ __global__ void applyBodyForces(real* gridCoordsX, real* gridCoordsY, real* grid fXYZ_Z += bladeForcesZ[node]*(r-last_r)*eta; last_r = r; - - // if(node==16||node==48||node==80) - // { - // printf("uRTZ: %f %f %f \n", uRTZ_X, uRTZ_Y, uRTZ_Z); - // printf("uXYZ: %f %f %f \n", uXYZ_X, uXYZ_Y, uXYZ_Z); - // printf("omega: %f radius: %f \n", this->omega, r); - // printf("force ratio %f \n", forceRatio); - // printf("u_rel: %f v_rel: %f \n", u_rel, v_rel); - // printf("c: %f, cn: %f ct: %f \n", c, Cn, Ct); - // printf("fXYZ: %f %f %f \n", fXYZ_X, fXYZ_Y, fXYZ_Z); - // printf("fRTZ: %f %f %f \n", fRTZ_X, fRTZ_Y, fRTZ_Z); - // printf("X Y Z: %f %f %f \n", this->bladeCoordsXH[node],this->bladeCoordsYH[node],this->bladeCoordsZH[node]); - // } } fXYZ_X += bladeForcesX[nBladeNodes-1]*(radius-last_r)*eta; @@ -284,30 +261,8 @@ void ActuatorLine::calcForcesEllipticWing(Parameter* para) this->bladeForcesXH[node] = fXYZ_X/forceRatio; this->bladeForcesYH[node] = fXYZ_Y/forceRatio; this->bladeForcesZH[node] = fXYZ_Z/forceRatio; - - // if(node==16||node==48||node==80) - // { - // printf("uRTZ: %f %f %f \n", uRTZ_X, uRTZ_Y, uRTZ_Z); - // printf("uXYZ: %f %f %f \n", uXYZ_X, uXYZ_Y, uXYZ_Z); - // printf("omega: %f radius: %f \n", this->omega, r); - // printf("force ratio %f \n", forceRatio); - // printf("u_rel: %f v_rel: %f \n", u_rel, v_rel); - // printf("c: %f, cn: %f ct: %f \n", c, Cn, Ct); - // printf("fXYZ: %f %f %f \n", fXYZ_X, fXYZ_Y, fXYZ_Z); - // printf("fRTZ: %f %f %f \n", fRTZ_X, fRTZ_Y, fRTZ_Z); - // printf("X Y Z: %f %f %f \n", this->bladeCoordsXH[node],this->bladeCoordsYH[node],this->bladeCoordsZH[node]); - // } } } - // printf("uRTZ: %f %f %f \n", uRTZ_X, uRTZ_Y, uRTZ_Z); - // printf("uXYZ: %f %f %f \n", uXYZ_X, uXYZ_Y, uXYZ_Z); - // printf("omega: %f radius: %f \n", this->omega, r); - - // printf("u_rel: %f v_rel: %f \n", u_rel, v_rel); - // printf("c: %f, cn: %f ct: %f \n", c, Cn, Ct); - // printf("fXYZ: %f %f %f \n", fXYZ_X, fXYZ_Y, fXYZ_Z); - // printf("fRTZ: %f %f %f \n", fRTZ_X, fRTZ_Y, fRTZ_Z); - } void ActuatorLine::rotateBlades(real angle) @@ -357,7 +312,6 @@ void ActuatorLine::initBladeCoords(CudaMemoryManager* cudaManager) this->bladeCoordsXH[node+this->nBladeNodes*blade] = coordX+this->turbinePosX; this->bladeCoordsYH[node+this->nBladeNodes*blade] = coordY+this->turbinePosY; this->bladeCoordsZH[node+this->nBladeNodes*blade] = coordZ+this->turbinePosZ; - // printf("blade: %i, az %f , x %f, y %f , z %f \n", blade, localAzimuth, coordX, coordY, coordZ); } } cudaManager->cudaCopyBladeCoordsHtoD(this); diff --git a/src/gpu/VirtualFluids_GPU/Visitor/Probes/PlaneProbe.cu b/src/gpu/VirtualFluids_GPU/Visitor/Probes/PlaneProbe.cu index e7967691de6a931e7903fa2dc7ab41421a018536..ef7b8cfd435eba8f420904342f48f915369b905f 100644 --- a/src/gpu/VirtualFluids_GPU/Visitor/Probes/PlaneProbe.cu +++ b/src/gpu/VirtualFluids_GPU/Visitor/Probes/PlaneProbe.cu @@ -2,6 +2,10 @@ #include "Kernel/Utilities/CudaGrid.h" +#include <cuda.h> +#include <cuda_runtime.h> +#include <helper_cuda.h> + #include "Parameter/Parameter.h" #include "DataStructureInitializer/GridProvider.h" #include "GPU/CudaMemoryManager.h" @@ -22,7 +26,7 @@ void PlaneProbe::findPoints(Parameter* para, GridProvider* gridProvider, std::ve real distZ = pointCoordZ - this->posZ; if( distX <= this->deltaX && distY <= this->deltaY && distZ <= this->deltaZ && - distX >0.f && distY >0.f && distZ >0.f) + distX >=0.f && distY >=0.f && distZ >=0.f) { probeIndices_level.push_back(j); distX_level.push_back( distX/dx ); @@ -31,7 +35,6 @@ void PlaneProbe::findPoints(Parameter* para, GridProvider* gridProvider, std::ve pointCoordsX_level.push_back( pointCoordX ); pointCoordsY_level.push_back( pointCoordY ); pointCoordsZ_level.push_back( pointCoordZ ); - // printf("x %f y %f z %f", pointCoordX, pointCoordY, pointCoordZ); } } } diff --git a/src/gpu/VirtualFluids_GPU/Visitor/Probes/PlaneProbe.h b/src/gpu/VirtualFluids_GPU/Visitor/Probes/PlaneProbe.h index cf042e662b8ac6fb679ac71e10ea1cd236fcae64..d0ce3aee1ea3d881e369d804a5487c63aaf58c1f 100644 --- a/src/gpu/VirtualFluids_GPU/Visitor/Probes/PlaneProbe.h +++ b/src/gpu/VirtualFluids_GPU/Visitor/Probes/PlaneProbe.h @@ -11,7 +11,11 @@ public: uint _tStartAvg, uint _tStartOut, uint _tOut - ): Probe(_probeName, _tStartAvg, _tStartOut, _tOut){} + ): Probe(_probeName, + _tStartAvg, + _tStartOut, + _tOut) + {} void setProbePlane(real _posX, real _posY, real _posZ, real _deltaX, real _deltaY, real _deltaZ) { diff --git a/src/gpu/VirtualFluids_GPU/Visitor/Probes/PointProbe.cu b/src/gpu/VirtualFluids_GPU/Visitor/Probes/PointProbe.cu index 93503cc41c6bdd5c3f08bcaaf4841b8002054562..7de22cc181f5b2a75b9d522b82c3c4336e562d91 100644 --- a/src/gpu/VirtualFluids_GPU/Visitor/Probes/PointProbe.cu +++ b/src/gpu/VirtualFluids_GPU/Visitor/Probes/PointProbe.cu @@ -1,5 +1,9 @@ #include "PointProbe.h" +#include <cuda.h> +#include <cuda_runtime.h> +#include <helper_cuda.h> + #include "Kernel/Utilities/CudaGrid.h" #include "Parameter/Parameter.h" @@ -33,7 +37,6 @@ void PointProbe::findPoints(Parameter* para, GridProvider* gridProvider, std::ve pointCoordsX_level.push_back( pointCoordX ); pointCoordsY_level.push_back( pointCoordY ); pointCoordsZ_level.push_back( pointCoordZ ); - // printf("x %f y %f z %f", pointCoordX, pointCoordY, pointCoordZ); } } } diff --git a/src/gpu/VirtualFluids_GPU/Visitor/Probes/PointProbe.h b/src/gpu/VirtualFluids_GPU/Visitor/Probes/PointProbe.h index f7f6d91e7477fbd8ec7b38f0faa1fd5858a540a7..ac3d46cc3d6d8d5d18fa75b6090b9df65b14468e 100644 --- a/src/gpu/VirtualFluids_GPU/Visitor/Probes/PointProbe.h +++ b/src/gpu/VirtualFluids_GPU/Visitor/Probes/PointProbe.h @@ -11,7 +11,11 @@ public: uint _tStartAvg, uint _tStartOut, uint _tOut - ): Probe(_probeName, _tStartAvg, _tStartOut, _tOut){} + ): Probe(_probeName, + _tStartAvg, + _tStartOut, + _tOut) + {} void setProbePointsFromList(std::vector<real>& _pointCoordsX, std::vector<real>& _pointCoordsY, std::vector<real>& _pointCoordsZ); void setProbePointsFromXNormalPlane(real pos_x, real pos0_y, real pos0_z, real pos1_y, real pos1_z, real delta_y, real delta_z); diff --git a/src/gpu/VirtualFluids_GPU/Visitor/Probes/Probe.h b/src/gpu/VirtualFluids_GPU/Visitor/Probes/Probe.h index 6e438dafc56cbcbb5c07239d8879fde85d480ee9..0ae5dddc003f68f8f44386d3e4ca3b75cc8660d2 100644 --- a/src/gpu/VirtualFluids_GPU/Visitor/Probes/Probe.h +++ b/src/gpu/VirtualFluids_GPU/Visitor/Probes/Probe.h @@ -6,7 +6,6 @@ enum class PostProcessingVariable{ - // LAST is for counting total number of arrays // HowTo add new PostProcessingVariable: Add enum here, LAST has to stay last // In interpQuantities add computation of quantity in switch statement // In writeGridFiles add lb->rw conversion factor