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