ProjectPhysX / FluidX3D

The fastest and most memory efficient lattice Boltzmann CFD software, running on all GPUs via OpenCL. Free for non-commercial use.
https://youtube.com/@ProjectPhysX
Other
3.48k stars 281 forks source link

Extracted lift coefficients are negative #167

Closed wjsjtu123 closed 3 months ago

wjsjtu123 commented 3 months ago

I have successfully performed a coupled propeller-wing simulation, but there is a small problem with the extraction of the wing lift, why is the lift coefficient of the wing negative, according to the theory the wing generates lift upwards and the lift coefficient should be positive. My code for extracting the lift coefficient is as follows

    while(lbm.get_t()<=units.t(si_T)) { // main simulation loop
        lbm.voxelize_mesh_on_device(wing,TYPE_S|TYPE_Y);**
        lbm.voxelize_mesh_on_device(propeller_1, TYPE_S|TYPE_X, propeller_1->get_center(), float3(0.0f), float3(propeller_omega*0.996f, 0.0f, propeller_omega*-0.087f)); // revoxelize mesh on GPU
        lbm.voxelize_mesh_on_device(propeller_2, TYPE_S|TYPE_X|TYPE_X, propeller_2->get_center(), float3(0.0f), float3(propeller_omega*0.996f, 0.0f, propeller_omega*-0.087f));
        lbm.voxelize_mesh_on_device(propeller_3, TYPE_S|TYPE_X|TYPE_X|TYPE_X, propeller_3->get_center(), float3(0.0f), float3(propeller_omega*0.996f, 0.0f, propeller_omega*-0.087f));
        lbm.voxelize_mesh_on_device(propeller_4, TYPE_S|TYPE_X|TYPE_X|TYPE_X|TYPE_X, propeller_4->get_center(), float3(0.0f), float3(propeller_omega*0.996f, 0.0f, propeller_omega*-0.087f));
        lbm.voxelize_mesh_on_device(propeller_5, TYPE_S|TYPE_X|TYPE_X|TYPE_X|TYPE_X|TYPE_X, propeller_5->get_center(), float3(0.0f), float3(propeller_omega*0.996f, 0.0f, propeller_omega*-0.087f));
        lbm.voxelize_mesh_on_device(propeller_6, TYPE_S|TYPE_X|TYPE_X|TYPE_X|TYPE_X|TYPE_X|TYPE_X, propeller_6->get_center(), float3(0.0f), float3(propeller_omega*0.996f, 0.0f, propeller_omega*-0.087f));
        //lbm.voxelize_mesh_on_device(propeller_cr, TYPE_S|TYPE_Y, propeller_cr->get_center(), float3(0.0f), float3(propeller_cruise_omega*0.996f, 0.0f, propeller_cruise_omega*0.087f));

        lbm.run(lbm_dt); // run dt time steps
        propeller_1->rotate(float3x3(float3(0.996f, 0.0f, -0.087f), propeller_domega)); // rotate mesh
        propeller_2->rotate(float3x3(float3(0.996f, 0.0f, -0.087f), propeller_domega));
        propeller_3->rotate(float3x3(float3(0.996f, 0.0f, -0.087f), propeller_domega));
        propeller_4->rotate(float3x3(float3(0.996f, 0.0f, -0.087f), propeller_domega));
        propeller_5->rotate(float3x3(float3(0.996f, 0.0f, -0.087f), propeller_domega));
        propeller_6->rotate(float3x3(float3(0.996f, 0.0f, -0.087f), propeller_domega));
        lbm.calculate_force_on_boundaries();
        lbm.F.read_from_device();
        const float3 lbm_force_w = lbm.calculate_force_on_object(TYPE_S|TYPE_Y);
        const float C_L = units.si_F(lbm_force_w.z)/(0.5*si_rho*sq(si_u)*si_A_w); 
        const float L = units.si_F(lbm_force_w.z);

        write_line(path+"C_L.dat", to_string(units.si_t(lbm.get_t()))+"\t"+to_string(C_L, 3u)+"\n");
        write_line(path+"L.dat", to_string(units.si_t(lbm.get_t()))+"\t"+to_string(L, 3u)+"\n");
    }

The data is shown in the figure 图片1 image-000013470

wjsjtu123 commented 3 months ago

image

gitcnd commented 3 months ago

Hi - I'd be happy to take a look at this for you, while also trying to work on solving a problem of my own... are you able to share everything you've done so-far (a .zip or .tar or something) so I can run it on my PC ?

One thing worth considering is that the airflow accelerating from those props below the wing is going to "suck it down" of course... A "quick check" to see if that's the cause would be to make them all "pusher props" after the wing and see if that changes the C_L ?