Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RTable_OffModeSolver.f90 2.6 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. subroutine RTable_OffMode
  2. use RTable_VARIABLES
  3. IMPLICIT NONE
  4. REAL :: RT_OldSpeed, RT_OldRpmGauge
  5. RT_OldSpeed = RTable%Speed
  6. RT_OldRpmGauge = RTable%RpmGaugeOutput
  7. RTable%N_new = 0.d0
  8. !======================= Rotary Table Rate_limit =======================
  9. if (((RTable%N_new-RTable%N_old)/RTable%time_step)>RTable%RateChange) then
  10. RTable%N_ref = (RTable%RateChange*RTable%time_step)+RTable%N_old
  11. else if (((RTable%N_old-RTable%N_new)/RTable%time_step)>RTable%RateChange) then
  12. RTable%N_ref = (-RTable%RateChange*RTable%time_step)+RTable%N_old
  13. else
  14. RTable%N_ref = RTable%N_new
  15. end if
  16. !=======================================================================
  17. if ( any(RTable%RotaryMode==(/1,4/)) ) then !if rotary connected to string
  18. !==> RPM
  19. RTable%Speed = RTable%N_ref/RTable%Conv_Ratio
  20. RTable%Speed = min(RTable%Speed,RTable%MaxRPM) !Speed [RPM]
  21. RTable%RpmGaugeOutput = RTable%Speed
  22. !==> Sound
  23. RTable%SoundRPM = INT(RTable%Speed)
  24. !==> Torque
  25. RTable%Torque = ( ((RTable%J_coef+RTable%String_JCoef)*((((pi*RTable%Speed)/30.d0)-((pi*RT_OldSpeed)/30.d0))/RTable%time_step))+(RTable%String_Torque) )*0.73756215d0 ![N.m]*0.73756215 = [ft.lbf] ![kg.m^2]*[radians/s^2]+[N.m]=[N.m]
  26. RTable%Torque = min(RTable%Torque,RTable%MaxTorque)
  27. RTable%TorqueGaugeOutput = RTable%Torque
  28. else if ( any(RTable%RotaryMode==(/2,5/)) ) then
  29. !==> RPM
  30. RTable%Speed = 0.d0
  31. RTable%RpmGaugeOutput = RTable%N_ref/RTable%Conv_Ratio
  32. RTable%RpmGaugeOutput = min(RTable%RpmGaugeOutput,RTable%MaxRPM)
  33. !==> Sound
  34. RTable%SoundRPM = INT(RTable%RpmGaugeOutput)
  35. !==> Torque
  36. RTable%Torque = 0.d0
  37. RTable%TorqueGaugeOutput = ( ((RTable%J_coef+RTable%String_JCoef)*((((pi*RTable%RpmGaugeOutput)/30.d0)-((pi*RT_OldRpmGauge)/30.d0))/RTable%time_step))+(RTable%String_Torque) )*0.73756215d0 ![N.m]*0.73756215 = [ft.lbf] ![kg.m^2]*[radians/s^2]+[N.m]=[N.m]
  38. RTable%TorqueGaugeOutput = min(RTable%TorqueGaugeOutput,RTable%MaxTorque)
  39. else if ( RTable%RotaryMode==3 ) then
  40. !==> RPM
  41. RTable%Speed = 0.d0
  42. RTable%RpmGaugeOutput = 0.d0
  43. !==> Sound
  44. RTable%SoundRPM = INT(RTable%RpmGaugeOutput)
  45. !==> Torque
  46. RTable%Torque = 0.d0
  47. RTable%TorqueGaugeOutput = 0.d0
  48. end if
  49. end subroutine RTable_OffMode