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.
 
 
 
 
 
 

120 lines
4.3 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 FricPressDropVarsModule
  11. Use MudSystemVARIABLES
  12. implicit none
  13. Integer :: i
  14. !Integer :: TD_SolDuration
  15. !integer,dimension(8) :: TD_StartTime , TD_EndTime
  16. TD_General%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 TD_WellGeoConfiguration
  28. Call TD_WellElementsConfiguration
  29. Call TD_StringConnectionModes
  30. Call TD_DrillStemConfiguration
  31. Call TD_ForceReadData
  32. !===> Mud properties Read_Data from Fluid Module
  33. !!TD_StringNoHorizontalMudElements = TDNoHorizontalMudElements
  34. !!TD_String%NoStringMudElements = TDNoStringMudElements
  35. !!TD_String%NoCasingMudElements = TDNoCasingMudElements
  36. !!
  37. !!if (allocated(TDDensity_MudElementArray) .and. (TD_StringNoHorizontalMudElements+TD_String%NoStringMudElements+TD_String%NoCasingMudElements)/=0) then
  38. !! if (Allocated(TD_String%FluidMudDensity)) Deallocate(TD_String%FluidMudDensity)
  39. !! Allocate(TD_String%FluidMudDensity(TD_StringNoHorizontalMudElements+TD_String%NoStringMudElements+TD_String%NoCasingMudElements))
  40. !! TD_String%FluidMudDensity(:) = TDDensity_MudElementArray(:)
  41. !!end if
  42. !!
  43. !!if (allocated(TDXend_MudElementArray)) then
  44. !! if (Allocated(TD_String%FluidMudEndX)) Deallocate(TD_String%FluidMudEndX)
  45. !! Allocate(TD_String%FluidMudEndX(TD_StringNoHorizontalMudElements+TD_String%NoStringMudElements+TD_String%NoCasingMudElements))
  46. !! TD_String%FluidMudEndX(:) = TDXend_MudElementArray(:)
  47. !!end if
  48. !!
  49. !!if (allocated(TDXstart_MudElementArray)) then
  50. !! if (Allocated(TD_String%FluidMudStartX)) Deallocate(TD_String%FluidMudStartX)
  51. !! Allocate(TD_String%FluidMudStartX(TD_StringNoHorizontalMudElements+TD_String%NoStringMudElements+TD_String%NoCasingMudElements))
  52. !! TD_String%FluidMudStartX(:) = TDXstart_MudElementArray(:)
  53. !!end if
  54. if (TD_DrillStem(1)%ComponentType==0) then
  55. Do i = 2 , TD_String%DrillStemComponentsNumbs
  56. Call TD_MudPropertiesReadData(i)
  57. Call TD_BouyancyFactor(i)
  58. Call TD_CombinedMotionData(i)
  59. End Do
  60. TD_DrillStems(1)%MudDensityIn = TD_DrillStems(2)%MudDensityIn !(1): bit mud properties
  61. TD_DrillStems(1)%MudDensityOut = TD_DrillStems(2)%MudDensityOut
  62. TD_DrillStems(1)%MudWeight = TD_DrillStems(2)%MudWeight
  63. TD_DrillStems(1)%MudPlasticVis = 5.d0+(5.d0*(TD_DrillStems(1)%MudWeight-8.3d0))
  64. TD_DrillStems(1)%MudViscosity = 0.2d0 !TD_DrillStems(i)%MudPlasticVis
  65. TD_DrillStems(1)%MudYieldPoint = 10.d0+(TD_DrillStems(1)%MudWeight-8.3d0)
  66. Call TD_BouyancyFactor(1)
  67. Call TD_CombinedMotionData(1)
  68. else
  69. Do i = 1 , TD_String%DrillStemComponentsNumbs
  70. Call TD_MudPropertiesReadData(i)
  71. Call TD_BouyancyFactor(i)
  72. Call TD_CombinedMotionData(i)
  73. End Do
  74. end if
  75. !================================================
  76. Call TD_BOPDiamCalculation
  77. Call TD_StaticHookLoadCalculation
  78. Call TD_WeightOnBitCalculation
  79. if (abs(TD_String%DrillStemAxialVelocity)>3.2808d0) then !1[m/s]=3.2808[ft/s]
  80. Call TD_ViscousDragForce
  81. else
  82. TD_DrillStems%Drag = 0.d0
  83. TD_String%DrillStemForceType = 5
  84. end if
  85. Call TD_ForceCalculation
  86. Call TD_HookLoadCalculation
  87. TD_StConn%HookHeightOld = TD_StConn%HookHeight
  88. end subroutine TD_MainCalculations