Simulation Core
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

133 wiersze
6.3 KiB

  1. subroutine TD_WellElementsReadData
  2. Use CCasingLinerChokeVariables
  3. use CStringConfigurationVariables
  4. use SimulationVariables
  5. use SimulationVariables !@
  6. use SimulationVariables !@
  7. implicit none
  8. Integer :: i
  9. Real(8) :: TD_OpenHoleLength
  10. !====================================================
  11. ! Set Casing Data
  12. !====================================================
  13. data%State%TD_WellEl%CasingNumbs = 1
  14. if (Allocated(data%State%TD_Casing)) deAllocate (data%State%TD_Casing)
  15. Allocate (data%State%TD_Casing(data%State%TD_WellEl%CasingNumbs))
  16. Do i=1, data%State%TD_WellEl%CasingNumbs
  17. data%State%TD_Casing(i)%Length = data%Configuration%CasingLinerChoke%CasingDepth ! unit: [ft]
  18. data%State%TD_Casing(i)%TopDepth = 0.d0
  19. data%State%TD_Casing(i)%DownDepth = data%State%TD_Casing(i)%Length
  20. data%State%TD_Casing(i)%Od = data%Configuration%CasingLinerChoke%CasingOd/12.d0 ! unit: [ft]
  21. data%State%TD_Casing(i)%Id = data%Configuration%CasingLinerChoke%CasingId/12.d0 ! unit: [ft]
  22. data%State%TD_Casing(i)%Weight = data%Configuration%CasingLinerChoke%CasingWeight
  23. data%State%TD_Casing(i)%CollapsePressure = data%Configuration%CasingLinerChoke%CasingCollapsePressure
  24. data%State%TD_Casing(i)%TensileStrength = data%Configuration%CasingLinerChoke%CasingTensileStrength
  25. End Do
  26. !====================================================
  27. ! Set Liner Data
  28. !====================================================
  29. data%State%TD_WellEl%LinerNumbs = 0
  30. if(data%Configuration%CasingLinerChoke%LinerLength > 0.d0) then
  31. data%State%TD_WellEl%LinerNumbs = 1
  32. !if (data%State%TD_WellEl%LinerNumbs>0) then
  33. if (Allocated(data%State%TD_Liner)) deAllocate (data%State%TD_Liner)
  34. Allocate (data%State%TD_Liner(data%State%TD_WellEl%LinerNumbs))
  35. Do i=1, data%State%TD_WellEl%LinerNumbs
  36. data%State%TD_Liner(i)%TopDepth = data%Configuration%CasingLinerChoke%LinerTopDepth ! unit: [ft]
  37. if (data%State%TD_Liner(i)%TopDepth<data%State%TD_Casing(i)%DownDepth) then
  38. data%State%TD_Casing(data%State%TD_WellEl%CasingNumbs)%DownDepth = data%State%TD_Liner(i)%TopDepth
  39. end if
  40. data%State%TD_Liner(i)%Length = data%Configuration%CasingLinerChoke%LinerLength ! unit: [ft]
  41. data%State%TD_Liner(i)%DownDepth = data%State%TD_Liner(i)%TopDepth+data%State%TD_Liner(i)%Length
  42. data%State%TD_Liner(i)%Od = data%Configuration%CasingLinerChoke%LinerOd/12.d0 ! unit: [ft]
  43. data%State%TD_Liner(i)%Id = data%Configuration%CasingLinerChoke%LinerId/12.d0 ! unit: [ft]
  44. data%State%TD_Liner(i)%Weight = data%Configuration%CasingLinerChoke%LinerWeight
  45. data%State%TD_Liner(i)%CollapsePressure = data%Configuration%CasingLinerChoke%LinerCollapsePressure
  46. data%State%TD_Liner(i)%TensileStrength = data%Configuration%CasingLinerChoke%LinerTensileStrength
  47. End Do
  48. else
  49. if (Allocated(data%State%TD_Liner)) deAllocate (data%State%TD_Liner)
  50. Allocate (data%State%TD_Liner(1))
  51. data%State%TD_WellEl%LinerNumbs = 1
  52. data%State%TD_Liner%Length = 0.d0
  53. data%State%TD_Liner%TopDepth = data%State%TD_Casing(data%State%TD_WellEl%CasingNumbs)%DownDepth
  54. data%State%TD_Liner%DownDepth = data%State%TD_Liner%TopDepth
  55. end if
  56. !====================================================
  57. ! Set Open_Hole Data
  58. !====================================================
  59. data%State%TD_WellEl%OpenHoleNumbs = 0
  60. TD_OpenHoleLength=data%State%TD_WellGeneral%WellTotalLength-(data%State%TD_Liner(data%State%TD_WellEl%LinerNumbs)%DownDepth)
  61. if(TD_OpenHoleLength > 0.d0) data%State%TD_WellEl%OpenHoleNumbs=1
  62. if (data%State%TD_WellEl%OpenHoleNumbs>0) then
  63. if (Allocated(data%State%TD_OpenHole)) deAllocate (data%State%TD_OpenHole)
  64. Allocate (data%State%TD_OpenHole(data%State%TD_WellEl%OpenHoleNumbs)) !!!??????????????????check
  65. Do i = 1, data%State%TD_WellEl%OpenHoleNumbs
  66. data%State%TD_OpenHole(i)%TopDepth = data%State%TD_Liner(data%State%TD_WellEl%LinerNumbs)%DownDepth
  67. data%State%TD_OpenHole(i)%Length = TD_OpenHoleLength ! unit: [ft]
  68. data%State%TD_OpenHole(i)%DownDepth = data%State%TD_OpenHole(i)%TopDepth+data%State%TD_OpenHole(i)%Length
  69. data%State%TD_OpenHole(i)%Id = data%Configuration%CasingLinerChoke%OpenHoleId/12.d0 ! unit: [ft]
  70. End Do
  71. else
  72. if (Allocated(data%State%TD_OpenHole)) deAllocate (data%State%TD_OpenHole)
  73. Allocate (data%State%TD_OpenHole(1))
  74. data%State%TD_WellEl%OpenHoleNumbs = 1
  75. data%State%TD_OpenHole%Length = 0.d0
  76. data%State%TD_OpenHole%TopDepth = data%State%TD_Liner(data%State%TD_WellEl%LinerNumbs)%DownDepth
  77. data%State%TD_OpenHole%DownDepth = data%State%TD_OpenHole%TopDepth
  78. end if
  79. !====================================================
  80. ! Set ROP_Hole Data
  81. !====================================================
  82. data%State%TD_WellEl%ROPHoleNumbs = 1
  83. if (Allocated(data%State%TD_ROPHole)) deAllocate (data%State%TD_ROPHole)
  84. Allocate (data%State%TD_ROPHole(data%State%TD_WellEl%ROPHoleNumbs))
  85. Do i = 1, data%State%TD_WellEl%ROPHoleNumbs
  86. data%State%TD_ROPHole(i)%TopDepth = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%TopDepth
  87. data%State%TD_ROPHole(i)%DownDepth = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%DownDepth
  88. data%State%TD_ROPHole(i)%Length = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%IntervalLength
  89. data%State%TD_ROPHole(i)%Id = data%Configuration%StringConfiguration%BitDefinition%BitSize/12.d0 ! unit: [ft]
  90. End Do
  91. end subroutine