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.
 
 
 
 
 
 

51 lines
2.1 KiB

  1. subroutine RTable_OnModeSolver
  2. Use RTable_VARIABLES
  3. IMPLICIT NONE
  4. REAL :: RT_OldSpeed, RT_OldRpmGauge
  5. RT_OldSpeed = RTable%Speed
  6. RT_OldRpmGauge = RTable%RpmGaugeOutput
  7. if ( any(RTable%RotaryMode==(/1,4/)) ) then !if rotary connected to string
  8. !==> RPM
  9. RTable%Speed = RTable%N_ref/RTable%Conv_Ratio
  10. RTable%Speed = min(RTable%Speed,RTable%MaxRPM) !Speed [RPM]
  11. RTable%RpmGaugeOutput = RTable%Speed
  12. !==> Sound
  13. RTable%SoundRPM = INT(RTable%Speed)
  14. !==> Torque
  15. 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]
  16. RTable%Torque = min(RTable%Torque,RTable%MaxTorque)
  17. RTable%TorqueGaugeOutput = RTable%Torque
  18. else if ( any(RTable%RotaryMode==(/2,5/)) ) then
  19. !==> RPM
  20. RTable%Speed = 0.d0
  21. RTable%RpmGaugeOutput = RTable%N_ref/RTable%Conv_Ratio
  22. RTable%RpmGaugeOutput = min(RTable%RpmGaugeOutput,RTable%MaxRPM) !inja bayad bashe ya na???
  23. !==> Sound
  24. RTable%SoundRPM = INT(RTable%RpmGaugeOutput)
  25. !==> Torque
  26. RTable%Torque = 0.d0
  27. 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]
  28. RTable%TorqueGaugeOutput = min(RTable%TorqueGaugeOutput,RTable%MaxTorque)
  29. else if ( RTable%RotaryMode==3 ) then
  30. !==> RPM
  31. RTable%Speed = 0.d0
  32. RTable%RpmGaugeOutput = 0.d0
  33. !==> Sound
  34. RTable%SoundRPM = INT(RTable%RpmGaugeOutput)
  35. !==> Torque
  36. RTable%Torque = 0.d0
  37. RTable%TorqueGaugeOutput = 0.d0
  38. end if
  39. END subroutine RTable_OnModeSolver