Ground Effect in YASim
_ __ <[email protected]> Wed, 5 Mar 2025 13:08:59 -0600
| Newsgroups | gmane.games.flightgear.devel,gmane.games.flightgear.flightmodel |
|---|---|
| Message-ID | <CAF9yP-dU1FYzWPuqEd-QokYp+=j6dQJ4w2oG1eUYyVSucpnzrQ@mail.gmail.com> |
--===============2613807751296989723==
Content-Type: multipart/alternative; boundary="000000000000d26658062f9d1f60"
--000000000000d26658062f9d1f60
Content-Type: text/plain; charset="UTF-8"
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
--000000000000d26658062f9d1f60
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>YASim currently calculates ground effect as a linear =
lift increase starting from one whole wingspan above the ground. In a <a hr=
ef=3D"https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/=
CAF9yP-fcYZKR%3DF%2B_j%3DwUeRL4A9s6DuGW1Ndxz8uzYRGNYo_%2BrA%40mail.gmail.co=
m/#msg58834280">previous email</a> I mentioned that this should be a non-li=
near increase, and custom compiled my own version with a low effort fix.</d=
iv><div><br></div><div>I am now back with a more detailed proposal, followi=
ng equation 11 from <a href=3D"https://www.researchgate.net/publication/269=
047238_Lifting-Line_Predictions_for_Induced_Drag_and_Lift_in_Ground_Effect"=
>this study</a>, using the following code (the bolded stuff is the new stuf=
f):</div><div><br></div><div>from /flightgear-release-2024.1/src/FDM/YASim/=
Airplane.cpp line 599:</div><div><br></div><div>=C2=A0 =C2=A0 if(_wing) {<b=
r>=C2=A0 =C2=A0 =C2=A0 =C2=A0 // Ground effect<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 // If a double tapered wing is modelled with wing and mstab, wing must =
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 // be outboard to get correct wingspan.<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 float pos[3];<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 fl=
oat gespan =3D 0;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 gespan =3D _wing->getSp=
an();<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 <br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 <b>flo=
at gefactor =3D pow( gespan, 2) / _wing->getArea();<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 gefactor =3D 288 / pow( gefactor, 0.882);</b><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 <br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 _wing->getBase(pos);<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if(!isVersionOrNewer( Version::YASIM_VERSION_20=
17_2 )) {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 //old code<br>=C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 //float span =3D _length * Math::cos(_sweep) * Math::=
cos(_dihedral);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 //span =3D 2*(span + =
Math::abs(_base[2]));<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gespan -=3D 2*p=
os[1]; // cut away base (y-distance)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
gespan +=3D 2*Math::abs(pos[2]); // add (wrong) z-distance<br>=C2=A0 =C2=A0=
=C2=A0 =C2=A0 }<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (baseN !=3D 0)<br>=C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 baseN->getChild("wing", 0)->ge=
tNode("gnd-eff-span", true)->setFloatValue(gespan);<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 // where does the hard coded factor 0.15 come from?<br=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 <br>=C2=A0 <b>=C2=A0 =C2=A0 =C2=A0 // changing=
it to a function of aspect ratio<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 _model.set=
GroundEffect(pos, gespan, gefactor);</b><br>=C2=A0 =C2=A0 }</div><div><br><=
/div><div>From /flightgear-release-2024.1/src/FDM/YASim/Model.cpp line 354:=
</div><div><br></div><div>=C2=A0 =C2=A0 // Account for ground effect by mul=
tiplying the vertical force<br>=C2=A0 =C2=A0 // component by an amount line=
ar with the fraction of the wingspan<br>=C2=A0 =C2=A0 // above the ground.<=
br>=C2=A0 =C2=A0 <br>=C2=A0 =C2=A0 <b>// changed to non-linear function</b>=
<br>=C2=A0 =C2=A0 if ((_wingSpan !=3D 0) && (_groundEffect !=3D 0 )=
)<br>=C2=A0 =C2=A0 {<br>=C2=A0 =C2=A0 =C2=A0 // distance between ground and=
wing ref. point<br>=C2=A0 =C2=A0 =C2=A0 float dist =3D ground[3] - Math::d=
ot3(ground, _geRefPoint); <br>=C2=A0 =C2=A0 =C2=A0 float fz =3D 0;<br>=C2=
=A0 =C2=A0 =C2=A0 float geForce[3] =3D {0, 0, 0};<br>=C2=A0 =C2=A0 =C2=A0 <=
br>=C2=A0 =C2=A0 =C2=A0 <b>float h_over_b =3D dist / _wingSpan;<br>=C2=A0 =
=C2=A0 =C2=A0 <br>=C2=A0 =C2=A0 =C2=A0 fz =3D Math::dot3(faero, ground);<br=
>=C2=A0 =C2=A0 =C2=A0 fz *=3D pow( h_over_b, 0.787);<br>=C2=A0 =C2=A0 =C2=
=A0 fz *=3D pow( 2.718, -9.14 * pow( h_over_b, 0.327) );<br>=C2=A0 =C2=A0 =
=C2=A0 fz *=3D _groundEffect;<br>=C2=A0 =C2=A0 =C2=A0 Math::mul3(fz, ground=
, geForce);<br>=C2=A0 =C2=A0 =C2=A0 _body.addForce(geForce);</b></div><div>=
<b><br></b></div><div>Regards,</div><div>Joel</div></div>
--000000000000d26658062f9d1f60--
--===============2613807751296989723==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============2613807751296989723==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel
--===============2613807751296989723==--