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.i90 3.5 KiB

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