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.
 
 
 
 
 
 

80 lines
3.5 KiB

  1. subroutine RTable_INPUTS
  2. use CDrillingConsoleVariables
  3. use SimulationVariables
  4. use SimulationVariables
  5. ! use CSimulationVariables
  6. use UnitySignalsModule
  7. ! use CTdsElevatorModesEnumVariables
  8. use CHoistingVariables
  9. use SimulationVariables
  10. use SimulationVariables !@
  11. use TD_DrillStemComponents
  12. use CUnityInputs
  13. use CWarnings
  14. use UnitySignalVariables
  15. use UnitySignalsModule
  16. IMPLICIT NONE
  17. integer :: i
  18. data%State%RTable%AssignmentSwitch = data%EquipmentControl%DrillingConsole%AssignmentSwitch
  19. data%State%RTable%Switch = data%EquipmentControl%DrillingConsole%RTSwitch
  20. !data%State%RTable%GearsAbuse = RotaryGearsAbuse
  21. data%State%RTable%Throttle = data%EquipmentControl%DrillingConsole%RTThrottle ![RPM]
  22. data%State%RTable%String_Torque = data%State%TD_String%StringTorque*12.d0 ![lb.ft]*12 ---> [lb.in] ?????????
  23. !data%State%RTable%RpmGaugeMalf !:dar module haye C meghdardehi mishe
  24. data%State%RTable%N_new = data%State%RTable%Throttle
  25. if ( data%State%RTable%MotorFaileMalf==1 ) then
  26. data%State%RTable%N_new = 0.d0
  27. end if
  28. data%State%RTable%String_Torque = 0.112984d0*data%State%RTable%String_Torque ![N.m]
  29. !===> String_JCoef Calculation
  30. if ( data%Configuration%Hoisting%DriveType==0 ) then
  31. if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_NOTHING ) then
  32. data%State%RTable%RotaryMode = 1
  33. data%State%RTable%String_JCoef = 0.d0
  34. Do i = 1,data%State%TD_String%StringConfigurationCount
  35. data%State%RTable%String_JCoef = data%State%RTable%String_JCoef+( (data%State%TD_DrillStem(i)%TotalWeight*((data%State%TD_DrillStem(i)%Id**2.d0)+(data%State%TD_DrillStem(i)%Od**2.d0)))/8.d0 ) ![lb.ft^2] , Jz=(1/2)*m*(r1^2+r2^2)
  36. End Do
  37. data%State%RTable%String_JCoef = data%State%RTable%String_JCoef*0.0421401d0 ![kg.m^2]
  38. else if ( Get_Slips() /= SLIPS_SET_END ) then
  39. data%State%RTable%RotaryMode = 2
  40. data%State%RTable%String_JCoef = 0.d0
  41. data%State%RTable%String_Torque = 0.d0
  42. else
  43. data%State%RTable%RotaryMode = 3
  44. data%State%RTable%String_JCoef = 0.d0
  45. data%State%RTable%String_Torque = 0.d0
  46. end if
  47. else if ( data%Configuration%Hoisting%DriveType==1 ) then
  48. if ( Get_IsKellyBushingSetInTable() .or. Get_Slips() == SLIPS_SET_END ) then !if rotary connected to string
  49. data%State%RTable%RotaryMode = 4
  50. data%State%RTable%String_JCoef = 0.d0
  51. Do i = 1,data%State%TD_String%StringConfigurationCount
  52. data%State%RTable%String_JCoef = data%State%RTable%String_JCoef+( (data%State%TD_DrillStem(i)%TotalWeight*((data%State%TD_DrillStem(i)%Id**2.d0)+(data%State%TD_DrillStem(i)%Od**2.d0)))/8.d0 ) ![lb.ft^2] , Jz=(1/2)*m*(r1^2+r2^2)
  53. End Do
  54. data%State%RTable%String_JCoef = data%State%RTable%String_JCoef*0.0421401e0 ![kg.m^2]
  55. else
  56. data%State%RTable%RotaryMode = 5
  57. data%State%RTable%String_JCoef = 0.d0
  58. data%State%RTable%String_Torque = 0.d0
  59. end if
  60. end if
  61. !===> Transmission Mode
  62. data%State%RTable%Conv_Ratio = data%State%RTable%High_Conv_Ratio
  63. end subroutine RTable_INPUTS