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.

CPumps.i90 10 KiB

1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. # 1 "/home/admin/SimulationCore2/CSharp/BasicInputs/RigSpecifications/CPumps.f90"
  2. module CPumps
  3. use SimulationVariables
  4. use json_module
  5. implicit none
  6. public
  7. contains
  8. subroutine PumpsFromJson(parent)
  9. use json_module,IK =>json_ik
  10. type(json_value),pointer :: parent
  11. type(json_core) :: json
  12. type(json_value),pointer :: p,pitems,pitem,pval,pbit
  13. call json%get(parent,'Pumps',p)
  14. call json%get(p,"MudPump1LinerDiameter",pitem)
  15. call json%get(pitem,data%Configuration%Pumps%MudPump1LinerDiameter)
  16. call json%get(p,"MudPump1Stroke",pitem)
  17. call json%get(pitem,data%Configuration%Pumps%MudPump1Stroke)
  18. call json%get(p,"MudPump1MechanicalEfficiency",pitem)
  19. call json%get(pitem,data%Configuration%Pumps%MudPump1MechanicalEfficiency)
  20. call json%get(p,"MudPump1Output",pitem)
  21. call json%get(pitem,data%Configuration%Pumps%MudPump1Output)
  22. call json%get(p,"MudPump1OutputBblStroke",pitem)
  23. call json%get(pitem,data%Configuration%Pumps%MudPump1OutputBblStroke)
  24. call json%get(p,"MudPump1Maximum",pitem)
  25. call json%get(pitem,data%Configuration%Pumps%MudPump1Maximum)
  26. call json%get(p,"MudPump1ReliefValvePressure",pitem)
  27. call json%get(pitem,data%Configuration%Pumps%MudPump1ReliefValvePressure)
  28. call json%get(p,"MudPump2LinerDiameter",pitem)
  29. call json%get(pitem,data%Configuration%Pumps%MudPump2LinerDiameter)
  30. call json%get(p,"MudPump2Stroke",pitem)
  31. call json%get(pitem,data%Configuration%Pumps%MudPump2Stroke)
  32. call json%get(p,"MudPump2MechanicalEfficiency",pitem)
  33. call json%get(pitem,data%Configuration%Pumps%MudPump2MechanicalEfficiency)
  34. call json%get(p,"MudPump2Output",pitem)
  35. call json%get(pitem,data%Configuration%Pumps%MudPump2Output)
  36. call json%get(p,"MudPump2OutputBblStroke",pitem)
  37. call json%get(pitem,data%Configuration%Pumps%MudPump2OutputBblStroke)
  38. call json%get(p,"MudPump2Maximum",pitem)
  39. call json%get(pitem,data%Configuration%Pumps%MudPump2Maximum)
  40. call json%get(p,"MudPump2ReliefValvePressure",pitem)
  41. call json%get(pitem,data%Configuration%Pumps%MudPump2ReliefValvePressure)
  42. call json%get(p,"CementPumpLinerDiameter",pitem)
  43. call json%get(pitem,data%Configuration%Pumps%CementPumpLinerDiameter)
  44. call json%get(p,"CementPumpStroke",pitem)
  45. call json%get(pitem,data%Configuration%Pumps%CementPumpStroke)
  46. call json%get(p,"CementPumpMechanicalEfficiency",pitem)
  47. call json%get(pitem,data%Configuration%Pumps%CementPumpMechanicalEfficiency)
  48. call json%get(p,"CementPumpOutput",pitem)
  49. call json%get(pitem,data%Configuration%Pumps%CementPumpOutput)
  50. call json%get(p,"CementPumpOutputBblStroke",pitem)
  51. call json%get(pitem,data%Configuration%Pumps%CementPumpOutputBblStroke)
  52. call json%get(p,"CementPumpMaximum",pitem)
  53. call json%get(pitem,data%Configuration%Pumps%CementPumpMaximum)
  54. call json%get(p,"CementPumpReliefValvePressure",pitem)
  55. call json%get(pitem,data%Configuration%Pumps%CementPumpReliefValvePressure)
  56. call json%get(p,"MudPump1ReliefValveIsSet",pitem)
  57. call json%get(pitem,data%Configuration%Pumps%MudPump1ReliefValveIsSet)
  58. call json%get(p,"MudPump2ReliefValveIsSet",pitem)
  59. call json%get(pitem,data%Configuration%Pumps%MudPump2ReliefValveIsSet)
  60. call json%get(p,"CementPumpReliefValveIsSet",pitem)
  61. call json%get(pitem,data%Configuration%Pumps%CementPumpReliefValveIsSet)
  62. call json%get(p,"ManualPumpPower",pitem)
  63. ! Newly added
  64. call json%get(p,"MudPump1VolumetricOutput",pitem)
  65. call json%get(pitem,data%Configuration%Pumps%MudPump1VolumetricOutput)
  66. call json%get(p,"MudPump2VolumetricOutput",pitem)
  67. call json%get(pitem,data%Configuration%Pumps%MudPump2VolumetricOutput)
  68. call json%get(p,"CementPumpVolumetricOutput",pitem)
  69. call json%get(pitem,data%Configuration%Pumps%CementPumpVolumetricOutput)
  70. call json%get(p,"MudPump1MaximumPressure",pitem)
  71. call json%get(pitem,data%Configuration%Pumps%MudPump1MaximumPressure)
  72. call json%get(p,"MudPump1PumpRateChange",pitem)
  73. call json%get(pitem,data%Configuration%Pumps%MudPump1PumpRateChange)
  74. call json%get(p,"MudPump1SurfaceLineLength",pitem)
  75. call json%get(pitem,data%Configuration%Pumps%MudPump1SurfaceLineLength)
  76. call json%get(p,"MudPump1DelayToShutdown",pitem)
  77. call json%get(pitem,data%Configuration%Pumps%MudPump1DelayToShutdown)
  78. call json%get(p,"MudPump2MaximumPressure",pitem)
  79. call json%get(pitem,data%Configuration%Pumps%MudPump2MaximumPressure)
  80. call json%get(p,"MudPump2PumpRateChange",pitem)
  81. call json%get(pitem,data%Configuration%Pumps%MudPump2PumpRateChange)
  82. call json%get(p,"MudPump2SurfaceLineLength",pitem)
  83. call json%get(pitem,data%Configuration%Pumps%MudPump2SurfaceLineLength)
  84. call json%get(p,"MudPump2DelayToShutdown",pitem)
  85. call json%get(pitem,data%Configuration%Pumps%MudPump2DelayToShutdown)
  86. call json%get(p,"CementPumpMaximumPressure",pitem)
  87. call json%get(pitem,data%Configuration%Pumps%CementPumpMaximumPressure)
  88. call json%get(p,"CementPumpPumpRateChange",pitem)
  89. call json%get(pitem,data%Configuration%Pumps%CementPumpPumpRateChange)
  90. call json%get(p,"CementPumpSurfaceLineLength",pitem)
  91. call json%get(pitem,data%Configuration%Pumps%CementPumpSurfaceLineLength)
  92. call json%get(p,"CementPumpDelayToShutdown",pitem)
  93. call json%get(pitem,data%Configuration%Pumps%CementPumpDelayToShutdown)
  94. end subroutine
  95. subroutine OpenPump1()
  96. use CManifolds
  97. implicit none
  98. call ChangeValve(16, .true.)
  99. end subroutine
  100. subroutine ClosePump1()
  101. use CManifolds
  102. implicit none
  103. call ChangeValve(16, .false.)
  104. end subroutine
  105. subroutine OpenPump2()
  106. use CManifolds
  107. implicit none
  108. call ChangeValve(17, .true.)
  109. end subroutine
  110. subroutine ClosePump2()
  111. use CManifolds
  112. implicit none
  113. call ChangeValve(17, .false.)
  114. end subroutine
  115. subroutine OpenCementPump()
  116. use CManifolds
  117. implicit none
  118. call ChangeValve(18, .true.)
  119. end subroutine
  120. subroutine CloseCementPump()
  121. use CManifolds
  122. implicit none
  123. call ChangeValve(18, .false.)
  124. end subroutine
  125. ! subroutine SetMudPump1LinerDiameterN(a)
  126. ! implicit none
  127. ! real(8) :: a
  128. ! if(associated(MudPump1LinerDiameterPtr)) call MudPump1LinerDiameterPtr(a)
  129. ! end subroutine
  130. ! subroutine SetMudPump2LinerDiameterN(a)
  131. ! implicit none
  132. ! real(8) :: a
  133. ! if(associated(MudPump2LinerDiameterPtr)) call MudPump2LinerDiameterPtr(a)
  134. ! end subroutine
  135. ! subroutine SetMudPump3LinerDiameterN(a)
  136. ! implicit none
  137. ! real(8) :: a
  138. ! if(associated(MudPump3LinerDiameterPtr)) call MudPump3LinerDiameterPtr(a)
  139. ! end subroutine
  140. ! subroutine SetMudPump1OutputBblStrokeN(a)
  141. ! implicit none
  142. ! real(8) :: a
  143. ! if(associated(MudPump1OutputBblStrokePtr)) call MudPump1OutputBblStrokePtr(a)
  144. ! end subroutine
  145. ! subroutine SetMudPump2OutputBblStrokeN(a)
  146. ! implicit none
  147. ! real(8) :: a
  148. ! if(associated(MudPump2OutputBblStrokePtr)) call MudPump2OutputBblStrokePtr(a)
  149. ! end subroutine
  150. ! subroutine SetMudPump3OutputBblStrokeN(a)
  151. ! implicit none
  152. ! real(8) :: a
  153. ! if(associated(MudPump3OutputBblStrokePtr)) call MudPump3OutputBblStrokePtr(a)
  154. ! end subroutine
  155. ! subroutine CalcMudPump1LinerDiameter()
  156. ! use, intrinsic :: IEEE_ARITHMETIC
  157. ! implicit none
  158. ! real(8) :: a
  159. ! a = (MathPI / 4.d0) * data%Configuration%Pumps%MudPump1Stroke * 3.0d0 * data%Configuration%Pumps%MudPump1VolumetricEfficiency / 9702.03d0
  160. ! a = dsqrt(data%Configuration%Pumps%MudPump1OutputBblStroke / a)
  161. ! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then
  162. ! data%Configuration%Pumps%MudPump1LinerDiameter = 0.0
  163. ! else
  164. ! data%Configuration%Pumps%MudPump1LinerDiameter = a
  165. ! endif
  166. ! call SetMudPump1LinerDiameterN(data%Configuration%Pumps%MudPump1LinerDiameter)
  167. ! end subroutine
  168. ! subroutine CalcMudPump2LinerDiameter()
  169. ! use, intrinsic :: IEEE_ARITHMETIC
  170. ! implicit none
  171. ! real(8) :: a
  172. ! a = (MathPI / 4.d0) * data%Configuration%Pumps%MudPump2Stroke * 3.0d0 * data%Configuration%Pumps%MudPump2VolumetricEfficiency / 9702.03d0
  173. ! a = dsqrt(data%Configuration%Pumps%MudPump2OutputBblStroke / a)
  174. ! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then
  175. ! data%Configuration%Pumps%MudPump2LinerDiameter = 0.0
  176. ! else
  177. ! data%Configuration%Pumps%MudPump2LinerDiameter = a
  178. ! endif
  179. ! call SetMudPump2LinerDiameterN(data%Configuration%Pumps%MudPump2LinerDiameter)
  180. ! end subroutine
  181. ! subroutine CalcMudPump3LinerDiameter()
  182. ! use, intrinsic :: IEEE_ARITHMETIC
  183. ! implicit none
  184. ! real(8) :: a
  185. ! a = (MathPI / 4.d0) * data%Configuration%Pumps%CementPumpStroke * 3.0d0 * data%Configuration%Pumps%CementPumpVolumetricEfficiency / 9702.03d0
  186. ! a = dsqrt(data%Configuration%Pumps%CementPumpOutputBblStroke / a)
  187. ! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then
  188. ! data%Configuration%Pumps%CementPumpLinerDiameter = 0.0
  189. ! else
  190. ! data%Configuration%Pumps%CementPumpLinerDiameter = a
  191. ! endif
  192. ! call SetMudPump3LinerDiameterN(data%Configuration%Pumps%CementPumpLinerDiameter)
  193. ! end subroutine
  194. ! subroutine CalcPump1OutputBblStroke()
  195. ! implicit none
  196. ! data%Configuration%Pumps%MudPump1OutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%MudPump1LinerDiameter**2) * data%Configuration%Pumps%MudPump1Stroke * 3.0d0 * data%Configuration%Pumps%MudPump1VolumetricEfficiency / 9702.03d0
  197. ! call SetMudPump1OutputBblStrokeN(data%Configuration%Pumps%MudPump1OutputBblStroke)
  198. ! end subroutine
  199. ! subroutine CalcPump2OutputBblStroke()
  200. ! implicit none
  201. ! data%Configuration%Pumps%MudPump2OutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%MudPump2LinerDiameter**2) * data%Configuration%Pumps%MudPump2Stroke * 3.0d0 * data%Configuration%Pumps%MudPump2VolumetricEfficiency / 9702.03d0
  202. ! call SetMudPump2OutputBblStrokeN(data%Configuration%Pumps%MudPump2OutputBblStroke)
  203. ! end subroutine
  204. ! subroutine CalcPump3OutputBblStroke()
  205. ! implicit none
  206. ! data%Configuration%Pumps%CementPumpOutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%CementPumpLinerDiameter**2) * data%Configuration%Pumps%CementPumpStroke * 3.0d0 * data%Configuration%Pumps%CementPumpVolumetricEfficiency / 9702.03d0
  207. ! call SetMudPump3OutputBblStrokeN(data%Configuration%Pumps%CementPumpOutputBblStroke)
  208. ! end subroutine
  209. end module CPumps