Hello devs, I need some help. I planning on simulating lift and drag coefficent to a better degree by also using the AoA and the resulting changing Cl and Cd defind in an matrix. I found in the jbeam_main.lua the code for setting the triangle properties. At the moment the Cl and Cd is fixed and is not affected by the AoA, is that right? So the lift force is propably calculated by (Cl*L)/q=l q=dynamic pressure,L= constant as it would be the cord length but I don“t see any code for calculating that. I could set the liftcoef and dragcoef by obj:setTriagleLiftceof(triangle.id1, triangle.id2, triangle.id3, lieftcoef) and the same for drag. I am a mechanical engineering student and want to practice some coding and as I am pretty invested in the planes of Beamng, I want to improve the the flight characteristics.
The triangle drag/lift is calculated based on a model of a tilted plate using the triangle area. Given a lift and drag coef of 100, it will approximate the lift and drag of the plate of that size. If liftCoef is not specified, it is made = to dragCoef in the engine. I guess you could emprically change the lift and drag coef using the above setting function until your test matches reality but it would be difficult/expensive to get an accurate angle of attack for each triangle. Maybe a per vehicle angle of attack is good enough, you can compare the vehicle orientation with velocity vector for that.
Thanks, figured that out few hours ago by by using a testbed and analysing data. https://www.beamng.com/threads/lift-and-drag-forces-analysed.36171/#post-539085 Took some time to do this, but I liked the idea of it.