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_INPUTS.f90 3.6 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. subroutine RTable_INPUTS
  2. use CDrillingConsoleVariables
  3. use CDataDisplayConsoleVariables
  4. ! use CSimulationVariables
  5. use CTdsConnectionModesEnumVariables
  6. use CTdsElevatorModesEnumVariables
  7. use CHoistingVariables
  8. use RTable_VARIABLES
  9. use TD_DrillStemComponents
  10. use CUnityInputs
  11. use UnitySignalVariables
  12. ! use CSlipsEnumVariables
  13. IMPLICIT NONE
  14. integer :: i
  15. !===> String Torque
  16. !print* , 'TD_StringTorquert=' , TD_StringTorque
  17. RTable%String_Torque = TD_StringTorque*12.d0 ![lb.ft]*12 ---> [lb.in] ?????????
  18. !RTable%String_Torque = 20000.
  19. RTable%String_Torque = 0.112984829*RTable%String_Torque ![N.m]
  20. !print* , 'TD_StringTorquert2=' , RTable%String_Torque
  21. !===> String_JCoef Calculation
  22. if ( Hoisting%DriveType==0 ) then
  23. if ( Get_TdsConnectionModes()==TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()==TDS_ELEVATOR_CONNECTION_NOTHING ) then
  24. RT_RotaryMode = 1
  25. RTable%String_JCoef = 0.0
  26. Do i = 1,TD_StringConfigurationCount
  27. RTable%String_JCoef = RTable%String_JCoef+( (TD_DrillStem(i)%TotalWeight*((TD_DrillStem(i)%Id**2)+(TD_DrillStem(i)%Od**2)))/8.0 ) ![lb.ft^2] , Jz=(1/2)*m*(r1^2+r2^2)
  28. End Do
  29. RTable%String_JCoef = RTable%String_JCoef*0.0421401 ![kg.m^2]
  30. else if ( Get_Slips() /= SLIPS_SET_END ) then
  31. RT_RotaryMode = 2
  32. RTable%String_JCoef = 0.0
  33. RTable%String_Torque = 0.0
  34. else
  35. RT_RotaryMode = 3
  36. RTable%String_JCoef = 0.0
  37. RTable%String_Torque = 0.0
  38. end if
  39. else if ( Hoisting%DriveType==1 ) then
  40. if ( Get_IsKellyBushingSetInTable() .or. Get_Slips() == SLIPS_SET_END ) then !if rotary connected to string
  41. RT_RotaryMode = 4
  42. RTable%String_JCoef = 0.0
  43. Do i = 1,TD_StringConfigurationCount
  44. RTable%String_JCoef = RTable%String_JCoef+( (TD_DrillStem(i)%TotalWeight*((TD_DrillStem(i)%Id**2)+(TD_DrillStem(i)%Od**2)))/8.0 ) ![lb.ft^2] , Jz=(1/2)*m*(r1^2+r2^2)
  45. End Do
  46. RTable%String_JCoef = RTable%String_JCoef*0.0421401 ![kg.m^2]
  47. else
  48. RT_RotaryMode = 5
  49. RTable%String_JCoef = 0.0
  50. RTable%String_Torque = 0.0
  51. end if
  52. end if
  53. !print*, 'DriveType=', DriveType , RT_RotaryMode , Get_IsKellyBushingSetInTable() , Get_Slips()
  54. !if ( Get_IsKellyBushingSetInTable() .or. Get_Slips() == SLIPS_SET_END ) then !if rotary connected to string
  55. ! RTable%String_JCoef = 0.0
  56. ! Do i = 1,TD_StringConfigurationCount
  57. ! RTable%String_JCoef = RTable%String_JCoef+( (TD_DrillStem(i)%TotalWeight*((TD_DrillStem(i)%Id**2)+(TD_DrillStem(i)%Od**2)))/8.0 ) ![lb.ft^2] , Jz=(1/2)*m*(r1^2+r2^2)
  58. ! End Do
  59. ! RTable%String_JCoef = RTable%String_JCoef*0.0421401 ![kg.m^2]
  60. !else
  61. ! RTable%String_JCoef = 0.0
  62. ! RTable%String_Torque = 0.0
  63. !end if
  64. !RTable%String_JCoef = RTable%String_JCoef/10. !???????? /10: with no reason, check it
  65. !===> Transmission Mode
  66. if (DrillingConsole%RTTransmissionLever==1) then ! in high mode
  67. RTable%Conv_Ratio = RTable%High_Conv_Ratio
  68. else if (DrillingConsole%RTTransmissionLever==-1) then ! in low mode
  69. RTable%Conv_Ratio = RTable%Low_Conv_Ratio
  70. else if (DrillingConsole%RTTransmissionLever==0) then ! in low mode
  71. RTable%Conv_Ratio = RTable%Low_Conv_Ratio
  72. end if
  73. end subroutine RTable_INPUTS