Simulation Core
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

51 行
2.7 KiB

  1. subroutine RTable_OnModeSolver
  2. use SimulationVariables !@
  3. IMPLICIT NONE
  4. REAL :: RT_OldSpeed, RT_OldRpmGauge
  5. RT_OldSpeed = data%State%RTable%Speed
  6. RT_OldRpmGauge = data%State%RTable%RpmGaugeOutput
  7. if ( any(data%State%RTable%RotaryMode==(/1,4/)) ) then !if rotary connected to string
  8. !==> RPM
  9. data%State%RTable%Speed = data%State%RTable%N_ref/data%State%RTable%Conv_Ratio
  10. data%State%RTable%Speed = min(data%State%RTable%Speed,data%State%RTable%MaxRPM) !Speed [RPM]
  11. data%State%RTable%RpmGaugeOutput = data%State%RTable%Speed
  12. !==> Sound
  13. data%State%RTable%SoundRPM = INT(data%State%RTable%Speed)
  14. !==> Torque
  15. data%State%RTable%Torque = ( ((data%State%RTable%J_coef+data%State%RTable%String_JCoef)*((((pi*data%State%RTable%Speed)/30.d0)-((pi*RT_OldSpeed)/30.d0))/data%State%RTable%time_step))+(data%State%RTable%String_Torque) )*0.73756215d0 ![N.m]*0.73756215 = [ft.lbf] ![kg.m^2]*[radians/s^2]+[N.m]=[N.m]
  16. data%State%RTable%Torque = min(data%State%RTable%Torque,data%State%RTable%MaxTorque)
  17. data%State%RTable%TorqueGaugeOutput = data%State%RTable%Torque
  18. else if ( any(data%State%RTable%RotaryMode==(/2,5/)) ) then
  19. !==> RPM
  20. data%State%RTable%Speed = 0.d0
  21. data%State%RTable%RpmGaugeOutput = data%State%RTable%N_ref/data%State%RTable%Conv_Ratio
  22. data%State%RTable%RpmGaugeOutput = min(data%State%RTable%RpmGaugeOutput,data%State%RTable%MaxRPM) !inja bayad bashe ya na???
  23. !==> Sound
  24. data%State%RTable%SoundRPM = INT(data%State%RTable%RpmGaugeOutput)
  25. !==> Torque
  26. data%State%RTable%Torque = 0.d0
  27. data%State%RTable%TorqueGaugeOutput = ( ((data%State%RTable%J_coef+data%State%RTable%String_JCoef)*((((pi*data%State%RTable%RpmGaugeOutput)/30.d0)-((pi*RT_OldRpmGauge)/30.d0))/data%State%RTable%time_step))+(data%State%RTable%String_Torque) )*0.73756215d0 ![N.m]*0.73756215 = [ft.lbf] ![kg.m^2]*[radians/s^2]+[N.m]=[N.m]
  28. data%State%RTable%TorqueGaugeOutput = min(data%State%RTable%TorqueGaugeOutput,data%State%RTable%MaxTorque)
  29. else if ( data%State%RTable%RotaryMode==3 ) then
  30. !==> RPM
  31. data%State%RTable%Speed = 0.d0
  32. data%State%RTable%RpmGaugeOutput = 0.d0
  33. !==> Sound
  34. data%State%RTable%SoundRPM = INT(data%State%RTable%RpmGaugeOutput)
  35. !==> Torque
  36. data%State%RTable%Torque = 0.d0
  37. data%State%RTable%TorqueGaugeOutput = 0.d0
  38. end if
  39. END subroutine RTable_OnModeSolver