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.
 
 
 
 
 
 

53 lines
2.7 KiB

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