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_MainSolver.i90 2.9 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # 1 "/home/admin/SimulationCore2/Equipments/RotaryTable/RTable_MainSolver.f90"
  2. subroutine RTable_MainSolver
  3. use SimulationVariables !@
  4. IMPLICIT NONE
  5. Call RTable_Inputs
  6. if (data%State%RTable%Throttle<=0.d0) then
  7. data%State%RTable%K_throttle = 1
  8. end if
  9. if ( (any(data%State%RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (data%State%RTable%Switch==-1) ) then
  10. data%State%RTable%SoundBlower = .true.
  11. data%State%RTable%BLWR = 1
  12. !======================= Rotary Table Rate_limit =======================
  13. if (((data%State%RTable%N_new-data%State%RTable%N_old)/data%State%RTable%time_step)>data%State%RTable%RateChange) then
  14. data%State%RTable%N_ref = (data%State%RTable%RateChange*data%State%RTable%time_step)+data%State%RTable%N_old
  15. else if (((data%State%RTable%N_old-data%State%RTable%N_new)/data%State%RTable%time_step)>data%State%RTable%RateChange) then
  16. data%State%RTable%N_ref = (-data%State%RTable%RateChange*data%State%RTable%time_step)+data%State%RTable%N_old
  17. else
  18. data%State%RTable%N_ref = data%State%RTable%N_new
  19. end if
  20. !=======================================================================
  21. CALL RTable_OnModeSolver
  22. else if ( (any(data%State%RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (data%State%RTable%Switch==1) .and. (data%State%RTable%K_throttle==1) ) then
  23. data%State%RTable%SoundBlower = .true.
  24. data%State%RTable%BLWR = 1
  25. !======================= Rotary Table Rate_limit =======================
  26. if (((data%State%RTable%N_new-data%State%RTable%N_old)/data%State%RTable%time_step)>data%State%RTable%RateChange) then
  27. data%State%RTable%N_ref = (data%State%RTable%RateChange*data%State%RTable%time_step)+data%State%RTable%N_old
  28. else if (((data%State%RTable%N_old-data%State%RTable%N_new)/data%State%RTable%time_step)>data%State%RTable%RateChange) then
  29. data%State%RTable%N_ref = (-data%State%RTable%RateChange*data%State%RTable%time_step)+data%State%RTable%N_old
  30. else
  31. data%State%RTable%N_ref = data%State%RTable%N_new
  32. end if
  33. !=======================================================================
  34. CALL RTable_OnModeSolver
  35. else
  36. if((any(data%State%RTable%AssignmentSwitch==(/1,2,3,4,5,8,9,10,11/))) .and. (data%State%RTable%Switch/=0)) then
  37. data%State%RTable%SoundBlower = .true.
  38. data%State%RTable%BLWR = 1
  39. else
  40. data%State%RTable%SoundBlower = .false.
  41. data%State%RTable%BLWR = 0
  42. end if
  43. Call RTable_OffMode
  44. data%State%RTable%K_throttle = 0
  45. end if
  46. Call RTable_Outputs
  47. data%State%RTable%N_old = data%State%RTable%N_ref
  48. end subroutine RTable_MainSolver