From: Bertrand <bco...@us...> - 2017-06-03 12:06:17
|
Update of /cvsroot/jsbsim/JSBSim/src/models In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18048/src/models Modified Files: FGLGear.cpp FGSurface.cpp Log Message: Fixes to the trim on ground feature. * Skip the gears when located over water. They will be skipped by the ground reactions anyway making the trim irrelevant. * Ignore the ground bumpiness during the trim. The trim algorithm seems not to be robust enough to handle that. This does not make much difference to the converged solution anyway since the bumpiness is generally low. * Fixed the WOW status for contacts over water (was 'false' is now 'true'). * All the gear/contact data are now properly reset when WOW==false. The reset code is now common to all the case where WOW is false. Index: FGLGear.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGLGear.cpp,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -r1.125 -r1.126 *** FGLGear.cpp 21 Feb 2017 21:14:13 -0000 1.125 --- FGLGear.cpp 3 Jun 2017 12:06:14 -0000 1.126 *************** *** 299,303 **** // Does this surface contact point interact with another surface? if (surface) { ! height -= (*surface).GetBumpHeight(); staticFFactor = (*surface).GetStaticFFactor(); rollingFFactor = (*surface).GetRollingFFactor(); --- 299,304 ---- // Does this surface contact point interact with another surface? if (surface) { ! if (!fdmex->GetTrimStatus()) ! height -= (*surface).GetBumpHeight(); staticFFactor = (*surface).GetStaticFFactor(); rollingFFactor = (*surface).GetRollingFFactor(); *************** *** 306,311 **** } if (height < 0.0) { ! WOW = isSolid; vGroundNormal = in.Tec2b * normal; --- 307,315 ---- } + FGColumnVector3 vWhlDisplVec; + double LGearProj = 1.0; + if (height < 0.0) { ! WOW = true; vGroundNormal = in.Tec2b * normal; *************** *** 315,320 **** // direction to the ground (STRUCTURE) double normalZ = (in.Tec2l*normal)(eZ); ! double LGearProj = -(mTGear.Transposed() * vGroundNormal)(eZ); ! FGColumnVector3 vWhlDisplVec; // The following equations use the vector to the tire contact patch --- 319,323 ---- // direction to the ground (STRUCTURE) double normalZ = (in.Tec2l*normal)(eZ); ! LGearProj = -(mTGear.Transposed() * vGroundNormal)(eZ); // The following equations use the vector to the tire contact patch *************** *** 327,332 **** } else { // Gears don't (or hardly) compress in liquids ! compressLength = 0.0; ! vWhlDisplVec = 0.0 * vGroundNormal; } break; --- 330,334 ---- } else { // Gears don't (or hardly) compress in liquids ! WOW = false; } break; *************** *** 336,352 **** break; } FGColumnVector3 vWhlContactVec = vWhlBodyVec + vWhlDisplVec; vActingXYZn = vXYZn + Tb2s * vWhlDisplVec; FGColumnVector3 vBodyWhlVel = in.PQR * vWhlContactVec; vBodyWhlVel += in.UVW - in.Tec2b * terrainVel; ! ! if (isSolid) { ! vWhlVelVec = mTGear.Transposed() * vBodyWhlVel; ! } else { ! // wheels don't spin up in liquids: let wheel spin down slowly ! vWhlVelVec(eX) -= 13.0 * in.TotalDeltaT; ! if (vWhlVelVec(eX) < 0.0) vWhlVelVec(eX) = 0.0; ! } InitializeReporting(); --- 338,351 ---- break; } + } + else + WOW = false; + if (WOW) { FGColumnVector3 vWhlContactVec = vWhlBodyVec + vWhlDisplVec; vActingXYZn = vXYZn + Tb2s * vWhlDisplVec; FGColumnVector3 vBodyWhlVel = in.PQR * vWhlContactVec; vBodyWhlVel += in.UVW - in.Tec2b * terrainVel; ! vWhlVelVec = mTGear.Transposed() * vBodyWhlVel; InitializeReporting(); *************** *** 376,387 **** // forces calculations. ComputeJacobian(vWhlContactVec); - } else { // Gear is NOT compressed - - WOW = false; compressLength = 0.0; compressSpeed = 0.0; WheelSlip = 0.0; StrutForce = 0.0; LMultiplier[ftRoll].value = 0.0; --- 375,384 ---- // forces calculations. ComputeJacobian(vWhlContactVec); } else { // Gear is NOT compressed compressLength = 0.0; compressSpeed = 0.0; WheelSlip = 0.0; StrutForce = 0.0; + vWhlDisplVec.InitMatrix(); LMultiplier[ftRoll].value = 0.0; *************** *** 398,406 **** ResetReporting(); } - - } else if (gearPos < 0.01) { // Gear UP - - WOW = false; - vWhlVelVec.InitMatrix(); } --- 395,398 ---- Index: FGSurface.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/FGSurface.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** FGSurface.cpp 28 Jan 2014 09:42:21 -0000 1.5 --- FGSurface.cpp 3 Jun 2017 12:06:14 -0000 1.6 *************** *** 80,83 **** --- 80,86 ---- bumpiness = 0.0; isSolid = true; + pos[0] = 0.0; + pos[1] = 0.0; + pos[2] = 0.0; } |