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.
 
 
 
 
 
 

77 lines
3.4 KiB

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