// Damping force
convert["LBS/FT/SEC"]["N/M/SEC"] = 14.5939;
convert["N/M/SEC"]["LBS/FT/SEC"] = 1.0/convert["LBS/FT/SEC"]["N/M/SEC"];
+ // Damping force (Square Law)
+ convert["LBS/FT/SEC2"]["N/M/SEC2"] = 14.5939;
+ convert["N/M/SEC2"]["LBS/FT/SEC2"] = 1.0/convert["LBS/FT/SEC2"]["N/M/SEC2"];
// Power
convert["WATTS"]["HP"] = 0.001341022;
convert["HP"]["WATTS"] = 1.0/convert["WATTS"]["HP"];
// Damping force
convert["LBS/FT/SEC"]["LBS/FT/SEC"] = 1.00;
convert["N/M/SEC"]["N/M/SEC"] = 1.00;
+ // Damping force (Square law)
+ convert["LBS/FT/SEC2"]["LBS/FT/SEC2"] = 1.00;
+ convert["N/M/SEC2"]["N/M/SEC2"] = 1.00;
// Power
convert["HP"]["HP"] = 1.00;
convert["WATTS"]["WATTS"] = 1.00;
GearNumber(number)
{
Element *force_table=0;
+ Element *dampCoeff=0;
+ Element *dampCoeffRebound=0;
string force_type="";
kSpring = bDamp = bDampRebound = dynamicFCoeff = staticFCoeff = rollingFCoeff = maxSteerAngle = 0;
sSteerType = sBrakeGroup = sSteerType = "";
isRetractable = 0;
+ eDampType = dtLinear;
+ eDampTypeRebound = dtLinear;
name = el->GetAttributeValue("name");
sContactType = el->GetAttributeValue("type");
if (el->FindElement("spring_coeff"))
kSpring = el->FindElementValueAsNumberConvertTo("spring_coeff", "LBS/FT");
- if (el->FindElement("damping_coeff"))
- bDamp = el->FindElementValueAsNumberConvertTo("damping_coeff", "LBS/FT/SEC");
+ if (el->FindElement("damping_coeff")) {
+ dampCoeff = el->FindElement("damping_coeff");
+ if (dampCoeff->GetAttributeValue("type") == "SQUARE") {
+ eDampType = dtSquare; // default is dtLinear
+ bDamp = el->FindElementValueAsNumberConvertTo("damping_coeff", "LBS/FT/SEC2");
+ } else {
+ bDamp = el->FindElementValueAsNumberConvertTo("damping_coeff", "LBS/FT/SEC");
+ }
+ }
- if (el->FindElement("damping_coeff_rebound"))
- bDampRebound = el->FindElementValueAsNumberConvertTo("damping_coeff_rebound", "LBS/FT/SEC");
- else
+ if (el->FindElement("damping_coeff_rebound")) {
+ dampCoeffRebound = el->FindElement("damping_coeff_rebound");
+ if (dampCoeffRebound->GetAttributeValue("type") == "SQUARE") {
+ eDampTypeRebound = dtSquare; // default is dtLinear
+ bDampRebound = el->FindElementValueAsNumberConvertTo("damping_coeff_rebound", "LBS/FT/SEC2");
+ } else {
+ bDampRebound = el->FindElementValueAsNumberConvertTo("damping_coeff_rebound", "LBS/FT/SEC");
+ }
+ } else {
bDampRebound = bDamp;
+ eDampTypeRebound = eDampType;
+ }
if (el->FindElement("dynamic_friction"))
dynamicFCoeff = el->FindElementValueAsNumber("dynamic_friction");
springForce = -compressLength * kSpring;
if (compressSpeed >= 0.0) {
- dampForce = -compressSpeed * bDamp;
+
+ if (eDampType == dtLinear) dampForce = -compressSpeed * bDamp;
+ else dampForce = -compressSpeed * compressSpeed * bDamp;
+
} else {
- dampForce = -compressSpeed * bDampRebound;
+
+ if (eDampTypeRebound == dtLinear)
+ dampForce = -compressSpeed * bDampRebound;
+ else
+ dampForce = compressSpeed * compressSpeed * bDampRebound;
+
}
vLocalForce(eZ) = min(springForce + dampForce, (double)0.0);
cout << " " << sContactType << " " << name << endl;
cout << " Location: " << vXYZ << endl;
cout << " Spring Constant: " << kSpring << endl;
- cout << " Damping Constant: " << bDamp << endl;
+
+ if (eDampType == dtLinear)
+ cout << " Damping Constant: " << bDamp << " (linear)" << endl;
+ else
+ cout << " Damping Constant: " << bDamp << " (square law)" << endl;
+
+ if (eDampTypeRebound == dtLinear)
+ cout << " Rebound Damping Constant: " << bDampRebound << " (linear)" << endl;
+ else
+ cout << " Rebound Damping Constant: " << bDampRebound << " (square law)" << endl;
+
cout << " Dynamic Friction: " << dynamicFCoeff << endl;
cout << " Static Friction: " << staticFCoeff << endl;
if (eContactType == ctBOGEY) {
enum ContactType {ctBOGEY, ctSTRUCTURE, ctUNKNOWN};
/// Report type enumerators
enum ReportType {erNone=0, erTakeoff, erLand};
+ /// Damping types
+ enum DampType {dtLinear=0, dtSquare};
/** Constructor
@param el a pointer to the XML element that contains the CONTACT info.
@param Executive a pointer to the parent executive object
BrakeGroup eBrakeGrp;
ContactType eContactType;
SteerType eSteerType;
+ DampType eDampType;
+ DampType eDampTypeRebound;
double maxSteerAngle;
double RFRV; // Rolling force relaxation velocity
double SFRV; // Side force relaxation velocity