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