diff --git a/src/modules/simu/simuv4/car.cpp b/src/modules/simu/simuv4/car.cpp index 9cc638cf9..726047233 100644 --- a/src/modules/simu/simuv4/car.cpp +++ b/src/modules/simu/simuv4/car.cpp @@ -57,6 +57,11 @@ SimCarConfig(tCar *car) if (strcmp(enabling, VAL_YES) == 0) { car->features = car->features | FEAT_REVLIMIT; } + enabling = GfParmGetStr(hdle, SECT_FEATURES, PRM_TIRETEMPDEG, VAL_NO); + if (strcmp(enabling, VAL_YES) == 0) { + car->features = car->features | FEAT_TIRETEMPDEG; + } + /* continue with car parameters */ car->dimension.x = GfParmGetNum(hdle, SECT_CAR, PRM_LEN, (char*)NULL, 4.7f); car->dimension.y = GfParmGetNum(hdle, SECT_CAR, PRM_WIDTH, (char*)NULL, 1.9f); diff --git a/src/modules/simu/simuv4/wheel.cpp b/src/modules/simu/simuv4/wheel.cpp index 2483fc649..9e74a20c3 100644 --- a/src/modules/simu/simuv4/wheel.cpp +++ b/src/modules/simu/simuv4/wheel.cpp @@ -24,6 +24,9 @@ static const char *WheelSect[4] = {SECT_FRNTRGTWHEEL, SECT_FRNTLFTWHEEL, SECT_RE static const char *SuspSect[4] = {SECT_FRNTRGTSUSP, SECT_FRNTLFTSUSP, SECT_REARRGTSUSP, SECT_REARLFTSUSP}; static const char *BrkSect[4] = {SECT_FRNTRGTBRAKE, SECT_FRNTLFTBRAKE, SECT_REARRGTBRAKE, SECT_REARLFTBRAKE}; +tdble Tair = 273; //air temperature in K +tdble Ttrack = 283; //track temperature in K + void SimWheelConfig(tCar *car, int index) { @@ -80,6 +83,16 @@ SimWheelConfig(tCar *car, int index) wheel->relPos.z = wheel->radius - wheel->susp.spring.x0; wheel->relPos.ay = wheel->relPos.az = 0.0f; wheel->steer = 0.0f; + + /* temperature and degradation */ + wheel->Ttire = Tair; + wheel->Topt = GfParmGetNum(hdle, WheelSect[index], PRM_OPTTEMP, (char*)NULL, 350.0f); + tdble coldmufactor = GfParmGetNum(hdle, WheelSect[index], PRM_COLDMUFACTOR, (char*)NULL, 1.0f); + coldmufactor = MIN(MAX(coldmufactor, 0.0f), 1.0f); + wheel->muTmult = (1 - coldmufactor) / ((wheel->Topt - Tair) * (wheel->Topt - Tair)); + wheel->heatingm = GfParmGetNum(hdle, WheelSect[index], PRM_HEATINGMULT, (char*)NULL, 6e-5); + wheel->aircoolm = GfParmGetNum(hdle, WheelSect[index], PRM_AIRCOOLINGMULT, (char*)NULL, 12e-4); + wheel->speedcoolm = GfParmGetNum(hdle, WheelSect[index], PRM_SPEEDCOOLINGMULT, (char*)NULL, 0.25); /* components */ SimSuspConfig(hdle, SuspSect[index], &(wheel->susp), wheel->weight0, x0); @@ -158,6 +171,7 @@ void SimWheelUpdateForce(tCar *car, int index) tdble s, sa, sx, sy; // slip vector tdble stmp, F, Bx; tdble mu; + tdble tireCond = 1.0; tdble reaction_force = 0.0f; wheel->state = 0; @@ -245,6 +259,12 @@ void SimWheelUpdateForce(tCar *car, int index) // load sensitivity mu = wheel->mu * (wheel->lfMin + (wheel->lfMax - wheel->lfMin) * exp(wheel->lfK * wheel->forces.z / wheel->opLoad)); + + //temperature and degradation + if (car->features & FEAT_TIRETEMPDEG) { + tireCond = 1 - wheel->muTmult * (wheel->Ttire - wheel->Topt)*(wheel->Ttire - wheel->Topt); + mu *= tireCond; + } F *= wheel->forces.z * mu * wheel->trkPos.seg->surface->kFriction; /* coeff */ @@ -280,6 +300,24 @@ void SimWheelUpdateForce(tCar *car, int index) car->carElt->_wheelSlipSide(index) = sy*v; car->carElt->_wheelSlipAccel(index) = sx*v; car->carElt->_reaction[index] = reaction_force; + car->carElt->_tyreEffMu(index) = mu; + + tdble Work = 0.0; + /* update tire temperature and degradation */ + if (car->features & FEAT_TIRETEMPDEG) { + //heat from the work of friction + Work = (wheel->forces.x * (wrl * CosA - wheel->bodyVel.x) + + wheel->forces.y * (wrl * SinA - wheel->bodyVel.y)) * SimDeltaTime; + wheel->Ttire += Work * wheel->heatingm; + //air cooling + wheel->Ttire -= wheel->aircoolm * (1 + wheel->speedcoolm * v) * (wheel->Ttire - Tair) * SimDeltaTime; + //filling carElt + car->carElt->_tyreT_in(index) = wheel->Ttire; + car->carElt->_tyreT_mid(index) = wheel->Ttire; + car->carElt->_tyreT_out(index) = wheel->Ttire; + car->carElt->_tyreCondition(index) = tireCond; + } + printf("T=%g, W=%g\n",wheel->Ttire,Work); } diff --git a/src/modules/simu/simuv4/wheel.h b/src/modules/simu/simuv4/wheel.h index e49aaf514..2893d5a5d 100644 --- a/src/modules/simu/simuv4/wheel.h +++ b/src/modules/simu/simuv4/wheel.h @@ -77,6 +77,13 @@ typedef struct tdble camber; /* camber, negative toward exterior on both sides */ tdble pressure; /* tire pressure */ tdble rel_vel; /* relative velocity - used for realstic suspension movement*/ + + tdble Ttire; /* tire temperature in K */ + tdble Topt; /* optimal temperature in K, where mu maximal */ + tdble muTmult; /* mu = mumax * (1 - muTmult*(T-Topt)^2) */ + tdble heatingm; /* heating multiplier */ + tdble aircoolm; /* air cooling multiplier */ + tdble speedcoolm; /* how aircoolm increases with speed */ tDynAxis in; tDynAxis feedBack;