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.5 KiB

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