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.

CPumpsVariables.f90 9.1 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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. module CPumpsVariables
  2. use CIActionReference
  3. implicit none
  4. public
  5. ! Pumps Specifications
  6. Type::PumpSpecificationType
  7. real(8) :: MudPump1LinerDiameter
  8. real(8) :: MudPump1Stroke
  9. real(8) :: MudPump1MechanicalEfficiency
  10. real(8) :: MudPump1VolumetricEfficiency
  11. real(8) :: MudPump1Output
  12. real(8) :: MudPump1OutputBblStroke
  13. real(8) :: MudPump1Maximum
  14. real(8) :: MudPump1ReliefValvePressure
  15. real(8) :: MudPump2LinerDiameter
  16. real(8) :: MudPump2Stroke
  17. real(8) :: MudPump2MechanicalEfficiency
  18. real(8) :: MudPump2VolumetricEfficiency
  19. real(8) :: MudPump2Output
  20. real(8) :: MudPump2OutputBblStroke
  21. real(8) :: MudPump2Maximum
  22. real(8) :: MudPump2ReliefValvePressure
  23. real(8) :: CementPumpLinerDiameter
  24. real(8) :: CementPumpStroke
  25. real(8) :: CementPumpMechanicalEfficiency
  26. real(8) :: CementPumpVolumetricEfficiency
  27. real(8) :: CementPumpOutput
  28. real(8) :: CementPumpOutputBblStroke
  29. real(8) :: CementPumpMaximum
  30. real(8) :: CementPumpReliefValvePressure
  31. logical :: MudPump1ReliefValveIsSet
  32. logical :: MudPump2ReliefValveIsSet
  33. logical :: CementPumpReliefValveIsSet
  34. logical :: ManualPumpPower
  35. logical :: Valve1
  36. logical :: Valve2
  37. logical :: Valve3
  38. logical :: Valve4
  39. logical :: Valve5
  40. End type PumpSpecificationType
  41. Type(PumpSpecificationType)::PumpsSpecification
  42. procedure (ActionDouble), pointer :: MudPump1LinerDiameterPtr
  43. procedure (ActionDouble), pointer :: MudPump2LinerDiameterPtr
  44. procedure (ActionDouble), pointer :: MudPump3LinerDiameterPtr
  45. procedure (ActionDouble), pointer :: MudPump1OutputBblStrokePtr
  46. procedure (ActionDouble), pointer :: MudPump2OutputBblStrokePtr
  47. procedure (ActionDouble), pointer :: MudPump3OutputBblStrokePtr
  48. real(8) :: MathPI = 3.14159265358979d0
  49. contains
  50. subroutine OpenPump1()
  51. use CManifolds
  52. implicit none
  53. call ChangeValve(16, .true.)
  54. end subroutine
  55. subroutine ClosePump1()
  56. use CManifolds
  57. implicit none
  58. call ChangeValve(16, .false.)
  59. end subroutine
  60. subroutine OpenPump2()
  61. use CManifolds
  62. implicit none
  63. call ChangeValve(17, .true.)
  64. end subroutine
  65. subroutine ClosePump2()
  66. use CManifolds
  67. implicit none
  68. call ChangeValve(17, .false.)
  69. end subroutine
  70. subroutine OpenCementPump()
  71. use CManifolds
  72. implicit none
  73. call ChangeValve(18, .true.)
  74. end subroutine
  75. subroutine CloseCementPump()
  76. use CManifolds
  77. implicit none
  78. call ChangeValve(18, .false.)
  79. end subroutine
  80. subroutine SubscribeMudPump1LinerDiameter(a)
  81. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeMudPump1LinerDiameter
  82. !DEC$ ATTRIBUTES ALIAS: 'SubscribeMudPump1LinerDiameter' :: SubscribeMudPump1LinerDiameter
  83. implicit none
  84. procedure (ActionDouble) :: a
  85. MudPump1LinerDiameterPtr => a
  86. end subroutine
  87. subroutine SubscribeMudPump2LinerDiameter(a)
  88. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeMudPump2LinerDiameter
  89. !DEC$ ATTRIBUTES ALIAS: 'SubscribeMudPump2LinerDiameter' :: SubscribeMudPump2LinerDiameter
  90. implicit none
  91. procedure (ActionDouble) :: a
  92. MudPump2LinerDiameterPtr => a
  93. end subroutine
  94. subroutine SubscribeMudPump3LinerDiameter(a)
  95. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeMudPump3LinerDiameter
  96. !DEC$ ATTRIBUTES ALIAS: 'SubscribeMudPump3LinerDiameter' :: SubscribeMudPump3LinerDiameter
  97. implicit none
  98. procedure (ActionDouble) :: a
  99. MudPump3LinerDiameterPtr => a
  100. end subroutine
  101. subroutine SubscribeMudPump1OutputBblStroke(a)
  102. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeMudPump1OutputBblStroke
  103. !DEC$ ATTRIBUTES ALIAS: 'SubscribeMudPump1OutputBblStroke' :: SubscribeMudPump1OutputBblStroke
  104. implicit none
  105. procedure (ActionDouble) :: a
  106. MudPump1OutputBblStrokePtr => a
  107. end subroutine
  108. subroutine SubscribeMudPump2OutputBblStroke(a)
  109. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeMudPump2OutputBblStroke
  110. !DEC$ ATTRIBUTES ALIAS: 'SubscribeMudPump2OutputBblStroke' :: SubscribeMudPump2OutputBblStroke
  111. implicit none
  112. procedure (ActionDouble) :: a
  113. MudPump2OutputBblStrokePtr => a
  114. end subroutine
  115. subroutine SubscribeMudPump3OutputBblStroke(a)
  116. !DEC$ ATTRIBUTES DLLEXPORT :: SubscribeMudPump3OutputBblStroke
  117. !DEC$ ATTRIBUTES ALIAS: 'SubscribeMudPump3OutputBblStroke' :: SubscribeMudPump3OutputBblStroke
  118. implicit none
  119. procedure (ActionDouble) :: a
  120. MudPump3OutputBblStrokePtr => a
  121. end subroutine
  122. subroutine SetMudPump1LinerDiameterN(a)
  123. implicit none
  124. real(8) :: a
  125. if(associated(MudPump1LinerDiameterPtr)) call MudPump1LinerDiameterPtr(a)
  126. end subroutine
  127. subroutine SetMudPump2LinerDiameterN(a)
  128. implicit none
  129. real(8) :: a
  130. if(associated(MudPump2LinerDiameterPtr)) call MudPump2LinerDiameterPtr(a)
  131. end subroutine
  132. subroutine SetMudPump3LinerDiameterN(a)
  133. implicit none
  134. real(8) :: a
  135. if(associated(MudPump3LinerDiameterPtr)) call MudPump3LinerDiameterPtr(a)
  136. end subroutine
  137. subroutine SetMudPump1OutputBblStrokeN(a)
  138. implicit none
  139. real(8) :: a
  140. if(associated(MudPump1OutputBblStrokePtr)) call MudPump1OutputBblStrokePtr(a)
  141. end subroutine
  142. subroutine SetMudPump2OutputBblStrokeN(a)
  143. implicit none
  144. real(8) :: a
  145. if(associated(MudPump2OutputBblStrokePtr)) call MudPump2OutputBblStrokePtr(a)
  146. end subroutine
  147. subroutine SetMudPump3OutputBblStrokeN(a)
  148. implicit none
  149. real(8) :: a
  150. if(associated(MudPump3OutputBblStrokePtr)) call MudPump3OutputBblStrokePtr(a)
  151. end subroutine
  152. subroutine CalcMudPump1LinerDiameter()
  153. use, intrinsic :: IEEE_ARITHMETIC
  154. implicit none
  155. real(8) :: a
  156. a = (MathPI / 4.d0) * PumpsSpecification%MudPump1Stroke * 3.0d0 * PumpsSpecification%MudPump1VolumetricEfficiency / 9702.03d0
  157. a = dsqrt(PumpsSpecification%MudPump1OutputBblStroke / a)
  158. if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then
  159. PumpsSpecification%MudPump1LinerDiameter = 0.0
  160. else
  161. PumpsSpecification%MudPump1LinerDiameter = a
  162. endif
  163. call SetMudPump1LinerDiameterN(PumpsSpecification%MudPump1LinerDiameter)
  164. end subroutine
  165. subroutine CalcMudPump2LinerDiameter()
  166. use, intrinsic :: IEEE_ARITHMETIC
  167. implicit none
  168. real(8) :: a
  169. a = (MathPI / 4.d0) * PumpsSpecification%MudPump2Stroke * 3.0d0 * PumpsSpecification%MudPump2VolumetricEfficiency / 9702.03d0
  170. a = dsqrt(PumpsSpecification%MudPump2OutputBblStroke / a)
  171. if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then
  172. PumpsSpecification%MudPump2LinerDiameter = 0.0
  173. else
  174. PumpsSpecification%MudPump2LinerDiameter = a
  175. endif
  176. call SetMudPump2LinerDiameterN(PumpsSpecification%MudPump2LinerDiameter)
  177. end subroutine
  178. subroutine CalcMudPump3LinerDiameter()
  179. use, intrinsic :: IEEE_ARITHMETIC
  180. implicit none
  181. real(8) :: a
  182. a = (MathPI / 4.d0) * PumpsSpecification%CementPumpStroke * 3.0d0 * PumpsSpecification%CementPumpVolumetricEfficiency / 9702.03d0
  183. a = dsqrt(PumpsSpecification%CementPumpOutputBblStroke / a)
  184. if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then
  185. PumpsSpecification%CementPumpLinerDiameter = 0.0
  186. else
  187. PumpsSpecification%CementPumpLinerDiameter = a
  188. endif
  189. call SetMudPump3LinerDiameterN(PumpsSpecification%CementPumpLinerDiameter)
  190. end subroutine
  191. subroutine CalcPump1OutputBblStroke()
  192. implicit none
  193. PumpsSpecification%MudPump1OutputBblStroke = (MathPI / 4.d0) * (PumpsSpecification%MudPump1LinerDiameter**2) * PumpsSpecification%MudPump1Stroke * 3.0d0 * PumpsSpecification%MudPump1VolumetricEfficiency / 9702.03d0
  194. call SetMudPump1OutputBblStrokeN(PumpsSpecification%MudPump1OutputBblStroke)
  195. end subroutine
  196. subroutine CalcPump2OutputBblStroke()
  197. implicit none
  198. PumpsSpecification%MudPump2OutputBblStroke = (MathPI / 4.d0) * (PumpsSpecification%MudPump2LinerDiameter**2) * PumpsSpecification%MudPump2Stroke * 3.0d0 * PumpsSpecification%MudPump2VolumetricEfficiency / 9702.03d0
  199. call SetMudPump2OutputBblStrokeN(PumpsSpecification%MudPump2OutputBblStroke)
  200. end subroutine
  201. subroutine CalcPump3OutputBblStroke()
  202. implicit none
  203. PumpsSpecification%CementPumpOutputBblStroke = (MathPI / 4.d0) * (PumpsSpecification%CementPumpLinerDiameter**2) * PumpsSpecification%CementPumpStroke * 3.0d0 * PumpsSpecification%CementPumpVolumetricEfficiency / 9702.03d0
  204. call SetMudPump3OutputBblStrokeN(PumpsSpecification%CementPumpOutputBblStroke)
  205. end subroutine
  206. end module CPumpsVariables