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.
 
 
 
 
 
 

180 lines
7.9 KiB

  1. subroutine TD_MainCalculations
  2. Use CCasingLinerChokeVariables
  3. Use CStringConfigurationVariables
  4. ! use CSimulationVariables
  5. Use TD_DrillStemComponents
  6. Use TD_WellElements
  7. Use TD_WellGeometry
  8. Use TD_GeneralData
  9. Use TD_StringConnectionData
  10. Use FricPressDropVars
  11. Use MudSystemVARIABLES
  12. implicit none
  13. Integer :: i
  14. !Integer :: TD_SolDuration
  15. !integer,dimension(8) :: TD_StartTime , TD_EndTime
  16. TD_TimeStep = 0.1d0 ! Unit: [s]
  17. !Call TD_StartUp
  18. !Call TD_WellReadData
  19. !Call TD_WellElementsReadData
  20. !Call TD_DrillStemReadData
  21. !Call TD_PipePropertiesReadData
  22. !!Call TD_WellGeoConfiguration
  23. !!Call TD_WellElementsConfiguration
  24. !!Call TD_StringConnectionModes
  25. !!Call TD_DrillStemConfiguration
  26. !loop1: do
  27. !CALL DATE_AND_TIME(values=TD_StartTime)
  28. Call TD_WellGeoConfiguration
  29. Call TD_WellElementsConfiguration
  30. Call TD_StringConnectionModes
  31. Call TD_DrillStemConfiguration
  32. Call TD_ForceReadData
  33. !===> Mud properties Read_Data from Fluid Module
  34. !!TD_NoHorizontalMudElements = TDNoHorizontalMudElements
  35. !!TD_NoStringMudElements = TDNoStringMudElements
  36. !!TD_NoCasingMudElements = TDNoCasingMudElements
  37. !!
  38. !!if (allocated(TDDensity_MudElementArray) .and. (TD_NoHorizontalMudElements+TD_NoStringMudElements+TD_NoCasingMudElements)/=0) then
  39. !! if (Allocated(TD_FluidMudDensity)) Deallocate(TD_FluidMudDensity)
  40. !! Allocate(TD_FluidMudDensity(TD_NoHorizontalMudElements+TD_NoStringMudElements+TD_NoCasingMudElements))
  41. !! TD_FluidMudDensity(:) = TDDensity_MudElementArray(:)
  42. !!end if
  43. !!
  44. !!if (allocated(TDXend_MudElementArray)) then
  45. !! if (Allocated(TD_FluidMudEndX)) Deallocate(TD_FluidMudEndX)
  46. !! Allocate(TD_FluidMudEndX(TD_NoHorizontalMudElements+TD_NoStringMudElements+TD_NoCasingMudElements))
  47. !! TD_FluidMudEndX(:) = TDXend_MudElementArray(:)
  48. !!end if
  49. !!
  50. !!if (allocated(TDXstart_MudElementArray)) then
  51. !! if (Allocated(TD_FluidMudStartX)) Deallocate(TD_FluidMudStartX)
  52. !! Allocate(TD_FluidMudStartX(TD_NoHorizontalMudElements+TD_NoStringMudElements+TD_NoCasingMudElements))
  53. !! TD_FluidMudStartX(:) = TDXstart_MudElementArray(:)
  54. !!end if
  55. if (TD_DrillStem(1)%ComponentType==0) then
  56. Do i = 2 , TD_DrillStemComponentsNumbs
  57. Call TD_MudPropertiesReadData(i)
  58. Call TD_BouyancyFactor(i)
  59. Call TD_CombinedMotionData(i)
  60. End Do
  61. TD_DrillStems(1)%MudDensityIn = TD_DrillStems(2)%MudDensityIn !(1): bit mud properties
  62. TD_DrillStems(1)%MudDensityOut = TD_DrillStems(2)%MudDensityOut
  63. TD_DrillStems(1)%MudWeight = TD_DrillStems(2)%MudWeight
  64. TD_DrillStems(1)%MudPlasticVis = 5.d0+(5.d0*(TD_DrillStems(1)%MudWeight-8.3d0))
  65. TD_DrillStems(1)%MudViscosity = 0.2d0 !TD_DrillStems(i)%MudPlasticVis
  66. TD_DrillStems(1)%MudYieldPoint = 10.d0+(TD_DrillStems(1)%MudWeight-8.3d0)
  67. Call TD_BouyancyFactor(1)
  68. Call TD_CombinedMotionData(1)
  69. else
  70. Do i = 1 , TD_DrillStemComponentsNumbs
  71. Call TD_MudPropertiesReadData(i)
  72. Call TD_BouyancyFactor(i)
  73. Call TD_CombinedMotionData(i)
  74. End Do
  75. end if
  76. !================================================
  77. Call TD_BOPDiamCalculation
  78. Call TD_StaticHookLoadCalculation
  79. Call TD_WeightOnBitCalculation
  80. if (abs(TD_DrillStemAxialVelocity)>3.2808d0) then !1[m/s]=3.2808[ft/s]
  81. Call TD_ViscousDragForce
  82. else
  83. TD_DrillStems%Drag = 0.d0
  84. TD_DrillStemForceType = 5
  85. end if
  86. Call TD_ForceCalculation
  87. Call TD_HookLoadCalculation
  88. !!!!!!print*, 'TD_StringVelocity=' , TD_StringVelocity
  89. !!!!!!print*, 'TD_HookLoad=' , TD_HookLoad
  90. !print*, 'TD_WellTotalLength=' , TD_WellTotalLength
  91. !print*, 'TD_ConnectionHeight_main=' , TD_ConnectionHeight
  92. !!!!!!!!print*, 'TD_DrillStems(1)%StartAngle=' , TD_DrillStems(1)%StartAngle
  93. !!!!!!print*, 'TD_DrillStems(1)%Force2=' , TD_DrillStems(1)%Force2
  94. !!!!!!print*, 'TD_DrillStems(1)%Force1=' , TD_DrillStems(1)%Force1
  95. !!!!!print*, 'TD_WeightIndicator=' , TD_WeightIndicator
  96. !!!!!print*, 'TD_DlTotal=' , TD_DlTotal
  97. !!!!!print*, 'TD_DlMax=' , TD_DlMax
  98. !!!!!!print*, 'TD_DrillStems(n)%Force2=' , TD_DrillStems(TD_DrillStemComponentsNumbs)%Force2
  99. !!!!!!print*, 'TD_DrillStems(n)%Force1=' , TD_DrillStems(TD_DrillStemComponentsNumbs)%Force1
  100. !print*, 'TD_DrillStems(1)%Drag=' , TD_DrillStems(1)%Drag
  101. !!!!!!!!!
  102. !print*, 'TD_WeightOnBit=' , TD_WeightOnBit
  103. !!print*, 'TD_StringTorque=' , TD_StringTorque
  104. !!print*, 'TD_DrillStems(1)%Torque=' , TD_DrillStems(1)%Torque
  105. !!print*, 'TD_DrillStems(n)%Torque=' , TD_DrillStems(TD_DrillStemComponentsNumbs)%Torque
  106. !!!!!!!!!
  107. !print*, 'TD_DrillStemComponentsNumbs_main =' ,TD_DrillStemComponentsNumbs
  108. !print*, 'TD_DrillStemTotalLength=' ,TD_DrillStemTotalLength
  109. !!print*, 'TD_StringConfigurationCount=' ,TD_StringConfigurationCount
  110. !print*, 'TD_HookHeight=' ,TD_HookHeight
  111. !!!!!!print*, 'TD_HookVelocity=' ,TD_HookVelocity
  112. !print*, 'TD_DrillStems(1)%DownDepth=' ,TD_DrillStems(1)%DownDepth
  113. !print*, 'TD_DrillStems(1)%DownDepthIni_main=' ,TD_DrillStems(1)%DownDepthIni
  114. !!!!!!print*, 'TD_DrillStems(1)%DownDepth=' ,TD_DrillStems(335)%DownDepth
  115. !!print*, 'TD_DrillStems(n)%DownDepth=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%DownDepth
  116. !!!print*, 'TD_DrillStems(n)%ID=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%ID
  117. !!!print*, 'TD_DrillStems(n)%OD=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%OD
  118. !!!print*, 'TD_DrillStem(n)%ID=' ,TD_DrillStem(TD_StringConfigurationCount)%ID
  119. !!!print*, 'TD_DrillStem(n)%OD=' ,TD_DrillStem(TD_StringConfigurationCount)%OD
  120. !!!print*, 'TD_DrillStem(1)%ID=' ,TD_DrillStem(1)%ID
  121. !!!print*, 'TD_DrillStem(1)%OD=' ,TD_DrillStem(1)%OD
  122. !!!!!print*, 'TD_StaticHookLoad=' ,TD_StaticHookLoad
  123. !!!!print*, 'TD_DrillStems(n)%Dl=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%Dl
  124. !!!!!print*, 'TD_DrillStems(n)%Length=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%Length
  125. !!!!!print*, 'TD_DrillStem(1)%Length=' ,TD_DrillStem(1)%Length
  126. !!!!!print*, 'TD_DrillStems(n)%Area=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%Area
  127. !!!!!print*, 'TD_DrillStems(n)%ElasticModule=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%ElasticModule
  128. TD_HookHeightOld = TD_HookHeight
  129. ! if(IsStopped == .true.) then
  130. ! EXIT loop1
  131. ! end if
  132. !
  133. !
  134. ! CALL DATE_AND_TIME(values=TD_EndTime)
  135. ! TD_SolDuration=100-(TD_EndTime(6)*60000+TD_EndTime(7)*1000+TD_EndTime(8)-TD_StartTime(6)*60000-TD_StartTime(7)*1000-TD_StartTime(8))
  136. ! !print*, 'TD_SolDuration=' , TD_SolDuration
  137. ! !print*, 'TD_exe=' , (TD_EndTime(6)*60000+TD_EndTime(7)*1000+TD_EndTime(8)-TD_StartTime(6)*60000-TD_StartTime(7)*1000-TD_StartTime(8))
  138. ! if(TD_SolDuration > 0.0d0) then
  139. ! CALL sleepqq(TD_SolDuration)
  140. ! end if
  141. !
  142. !
  143. !end do loop1
  144. !
  145. !return
  146. end subroutine TD_MainCalculations