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.

TD_MainCalculations.f90 4.8 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. subroutine TD_MainCalculations
  2. Use CCasingLinerChokeVariables
  3. Use CStringConfigurationVariables
  4. ! Use CSimulationVariables
  5. Use TD_DrillStemComponents
  6. use SimulationVariables !@
  7. use SimulationVariables !@
  8. use SimulationVariables !@
  9. Use TD_StringConnectionData
  10. USE FricPressDropVarsModule
  11. USE MudSystemVARIABLES
  12. use SimulationVariables !@@@
  13. implicit none
  14. Integer :: i
  15. !Integer :: TD_SolDuration
  16. !integer,dimension(8) :: TD_StartTime , TD_EndTime
  17. data%State%TD_General%TimeStep = 0.1d0 ! Unit: [s]
  18. !Call TD_StartUp
  19. !Call TD_WellReadData
  20. !Call TD_WellElementsReadData
  21. !Call TD_DrillStemReadData
  22. !Call TD_PipePropertiesReadData
  23. !!Call TD_WellGeoConfiguration
  24. !!Call TD_WellElementsConfiguration
  25. !!Call TD_StringConnectionModes
  26. !!Call TD_DrillStemConfiguration
  27. !loop1: do
  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_StringNoHorizontalMudElements = TDNoHorizontalMudElements
  35. !!data%State%TD_String%NoStringMudElements = TDNoStringMudElements
  36. !!data%State%TD_String%NoCasingMudElements = TDNoCasingMudElements
  37. !!
  38. !!if (allocated(TDDensity_MudElementArray) .and. (TD_StringNoHorizontalMudElements+data%State%TD_String%NoStringMudElements+data%State%TD_String%NoCasingMudElements)/=0) then
  39. !! if (Allocated(data%State%TD_String%FluidMudDensity)) Deallocate(data%State%TD_String%FluidMudDensity)
  40. !! Allocate(data%State%TD_String%FluidMudDensity(TD_StringNoHorizontalMudElements+data%State%TD_String%NoStringMudElements+data%State%TD_String%NoCasingMudElements))
  41. !! data%State%TD_String%FluidMudDensity(:) = TDDensity_MudElementArray(:)
  42. !!end if
  43. !!
  44. !!if (allocated(TDXend_MudElementArray)) then
  45. !! if (Allocated(data%State%TD_String%FluidMudEndX)) Deallocate(data%State%TD_String%FluidMudEndX)
  46. !! Allocate(data%State%TD_String%FluidMudEndX(TD_StringNoHorizontalMudElements+data%State%TD_String%NoStringMudElements+data%State%TD_String%NoCasingMudElements))
  47. !! data%State%TD_String%FluidMudEndX(:) = TDXend_MudElementArray(:)
  48. !!end if
  49. !!
  50. !!if (allocated(TDXstart_MudElementArray)) then
  51. !! if (Allocated(data%State%TD_String%FluidMudStartX)) Deallocate(data%State%TD_String%FluidMudStartX)
  52. !! Allocate(data%State%TD_String%FluidMudStartX(TD_StringNoHorizontalMudElements+data%State%TD_String%NoStringMudElements+data%State%TD_String%NoCasingMudElements))
  53. !! data%State%TD_String%FluidMudStartX(:) = TDXstart_MudElementArray(:)
  54. !!end if
  55. if (data%State%TD_DrillStem(1)%ComponentType==0) then
  56. Do i = 2 , data%State%TD_String%DrillStemComponentsNumbs
  57. Call TD_MudPropertiesReadData(i)
  58. Call TD_BouyancyFactor(i)
  59. Call TD_CombinedMotionData(i)
  60. End Do
  61. data%State%TD_DrillStems(1)%MudDensityIn = data%State%TD_DrillStems(2)%MudDensityIn !(1): bit mud properties
  62. data%State%TD_DrillStems(1)%MudDensityOut = data%State%TD_DrillStems(2)%MudDensityOut
  63. data%State%TD_DrillStems(1)%MudWeight = data%State%TD_DrillStems(2)%MudWeight
  64. data%State%TD_DrillStems(1)%MudPlasticVis = 5.d0+(5.d0*(data%State%TD_DrillStems(1)%MudWeight-8.3d0))
  65. data%State%TD_DrillStems(1)%MudViscosity = 0.2d0 !data%State%TD_DrillStems(i)%MudPlasticVis
  66. data%State%TD_DrillStems(1)%MudYieldPoint = 10.d0+(data%State%TD_DrillStems(1)%MudWeight-8.3d0)
  67. Call TD_BouyancyFactor(1)
  68. Call TD_CombinedMotionData(1)
  69. else
  70. Do i = 1 , data%State%TD_String%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(data%State%TD_String%DrillStemAxialVelocity)>3.2808d0) then !1[m/s]=3.2808[ft/s]
  81. Call TD_ViscousDragForce
  82. else
  83. data%State%TD_DrillStems%Drag = 0.d0
  84. data%State%TD_String%DrillStemForceType = 5
  85. end if
  86. Call TD_ForceCalculation
  87. Call TD_HookLoadCalculation
  88. data%State%TD_StConn%HookHeightOld = data%State%TD_StConn%HookHeight
  89. end subroutine TD_MainCalculations