|
From: _ __ <rit...@gm...> - 2025-03-05 19:09:28
|
YASim currently calculates ground effect as a linear lift increase starting from one whole wingspan above the ground. In a previous email <https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/CAF9yP-fcYZKR%3DF%2B_j%3DwUeRL4A9s6DuGW1Ndxz8uzYRGNYo_%2BrA%40mail.gmail.com/#msg58834280> I mentioned that this should be a non-linear increase, and custom compiled my own version with a low effort fix. I am now back with a more detailed proposal, following equation 11 from this study <https://www.researchgate.net/publication/269047238_Lifting-Line_Predictions_for_Induced_Drag_and_Lift_in_Ground_Effect>, using the following code (the bolded stuff is the new stuff): from /flightgear-release-2024.1/src/FDM/YASim/Airplane.cpp line 599: if(_wing) { // Ground effect // If a double tapered wing is modelled with wing and mstab, wing must // be outboard to get correct wingspan. float pos[3]; float gespan = 0; gespan = _wing->getSpan(); *float gefactor = pow( gespan, 2) / _wing->getArea(); gefactor = 288 / pow( gefactor, 0.882);* _wing->getBase(pos); if(!isVersionOrNewer( Version::YASIM_VERSION_2017_2 )) { //old code //float span = _length * Math::cos(_sweep) * Math::cos(_dihedral); //span = 2*(span + Math::abs(_base[2])); gespan -= 2*pos[1]; // cut away base (y-distance) gespan += 2*Math::abs(pos[2]); // add (wrong) z-distance } if (baseN != 0) baseN->getChild("wing", 0)->getNode("gnd-eff-span", true)->setFloatValue(gespan); // where does the hard coded factor 0.15 come from? * // changing it to a function of aspect ratio _model.setGroundEffect(pos, gespan, gefactor);* } >From /flightgear-release-2024.1/src/FDM/YASim/Model.cpp line 354: // Account for ground effect by multiplying the vertical force // component by an amount linear with the fraction of the wingspan // above the ground. *// changed to non-linear function* if ((_wingSpan != 0) && (_groundEffect != 0 )) { // distance between ground and wing ref. point float dist = ground[3] - Math::dot3(ground, _geRefPoint); float fz = 0; float geForce[3] = {0, 0, 0}; *float h_over_b = dist / _wingSpan; fz = Math::dot3(faero, ground); fz *= pow( h_over_b, 0.787); fz *= pow( 2.718, -9.14 * pow( h_over_b, 0.327) ); fz *= _groundEffect; Math::mul3(fz, ground, geForce); _body.addForce(geForce);* Regards, Joel |