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.f90 9.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. module CPumps
  2. use SimulationVariables
  3. use json_module
  4. implicit none
  5. public
  6. contains
  7. subroutine PumpsToJson(parent)
  8. type(json_value),pointer :: parent
  9. type(json_core) :: json
  10. type(json_value),pointer :: p
  11. ! 1. create new node
  12. call json%create_object(p,'Pumps')
  13. ! 2. add member of data type to new node
  14. ! call StringConfigurationToJson(p)
  15. ! call FormationToJson(p)
  16. call json%add(p,"MudPump1LinerDiameter",data%Configuration%Pumps%MudPump1LinerDiameter)
  17. call json%add(p,"MudPump1Stroke",data%Configuration%Pumps%MudPump1Stroke)
  18. call json%add(p,"MudPump1MechanicalEfficiency",data%Configuration%Pumps%MudPump1MechanicalEfficiency)
  19. call json%add(p,"MudPump1VolumetricEfficiency",data%Configuration%Pumps%MudPump1VolumetricEfficiency)
  20. call json%add(p,"MudPump1Output",data%Configuration%Pumps%MudPump1Output)
  21. call json%add(p,"MudPump1OutputBblStroke",data%Configuration%Pumps%MudPump1OutputBblStroke)
  22. call json%add(p,"MudPump1Maximum",data%Configuration%Pumps%MudPump1Maximum)
  23. call json%add(p,"MudPump1ReliefValvePressure",data%Configuration%Pumps%MudPump1ReliefValvePressure)
  24. call json%add(p,"MudPump2LinerDiameter",data%Configuration%Pumps%MudPump2LinerDiameter)
  25. call json%add(p,"MudPump2Stroke",data%Configuration%Pumps%MudPump2Stroke)
  26. call json%add(p,"MudPump2MechanicalEfficiency",data%Configuration%Pumps%MudPump2MechanicalEfficiency)
  27. call json%add(p,"MudPump2VolumetricEfficiency",data%Configuration%Pumps%MudPump2VolumetricEfficiency)
  28. call json%add(p,"MudPump2Output",data%Configuration%Pumps%MudPump2Output)
  29. call json%add(p,"MudPump2OutputBblStroke",data%Configuration%Pumps%MudPump2OutputBblStroke)
  30. call json%add(p,"MudPump2Maximum",data%Configuration%Pumps%MudPump2Maximum)
  31. call json%add(p,"MudPump2ReliefValvePressure",data%Configuration%Pumps%MudPump2ReliefValvePressure)
  32. call json%add(p,"CementPumpLinerDiameter",data%Configuration%Pumps%CementPumpLinerDiameter)
  33. call json%add(p,"CementPumpStroke",data%Configuration%Pumps%CementPumpStroke)
  34. call json%add(p,"CementPumpMechanicalEfficiency",data%Configuration%Pumps%CementPumpMechanicalEfficiency)
  35. call json%add(p,"CementPumpVolumetricEfficiency",data%Configuration%Pumps%CementPumpVolumetricEfficiency)
  36. call json%add(p,"CementPumpOutput",data%Configuration%Pumps%CementPumpOutput)
  37. call json%add(p,"CementPumpOutputBblStroke",data%Configuration%Pumps%CementPumpOutputBblStroke)
  38. call json%add(p,"CementPumpMaximum",data%Configuration%Pumps%CementPumpMaximum)
  39. call json%add(p,"CementPumpReliefValvePressure ",data%Configuration%Pumps%CementPumpReliefValvePressure )
  40. call json%add(p,"MudPump1ReliefValveIsSet",data%Configuration%Pumps%MudPump1ReliefValveIsSet)
  41. call json%add(p,"MudPump2ReliefValveIsSet",data%Configuration%Pumps%MudPump2ReliefValveIsSet)
  42. call json%add(p,"CementPumpReliefValveIsSet",data%Configuration%Pumps%CementPumpReliefValveIsSet)
  43. call json%add(p,"ManualPumpPower",data%Configuration%Pumps%ManualPumpPower)
  44. call json%add(p,"Valve1",data%Configuration%Pumps%Valve1)
  45. call json%add(p,"Valve2",data%Configuration%Pumps%Valve2)
  46. call json%add(p,"Valve3",data%Configuration%Pumps%Valve3)
  47. call json%add(p,"Valve4",data%Configuration%Pumps%Valve4)
  48. call json%add(p,"Valve5",data%Configuration%Pumps%Valve5)
  49. ! 3. add new node to parent
  50. call json%add(parent,p)
  51. end subroutine
  52. subroutine OpenPump1()
  53. use CManifolds
  54. implicit none
  55. call ChangeValve(16, .true.)
  56. end subroutine
  57. subroutine ClosePump1()
  58. use CManifolds
  59. implicit none
  60. call ChangeValve(16, .false.)
  61. end subroutine
  62. subroutine OpenPump2()
  63. use CManifolds
  64. implicit none
  65. call ChangeValve(17, .true.)
  66. end subroutine
  67. subroutine ClosePump2()
  68. use CManifolds
  69. implicit none
  70. call ChangeValve(17, .false.)
  71. end subroutine
  72. subroutine OpenCementPump()
  73. use CManifolds
  74. implicit none
  75. call ChangeValve(18, .true.)
  76. end subroutine
  77. subroutine CloseCementPump()
  78. use CManifolds
  79. implicit none
  80. call ChangeValve(18, .false.)
  81. end subroutine
  82. ! subroutine SetMudPump1LinerDiameterN(a)
  83. ! implicit none
  84. ! real(8) :: a
  85. ! if(associated(MudPump1LinerDiameterPtr)) call MudPump1LinerDiameterPtr(a)
  86. ! end subroutine
  87. ! subroutine SetMudPump2LinerDiameterN(a)
  88. ! implicit none
  89. ! real(8) :: a
  90. ! if(associated(MudPump2LinerDiameterPtr)) call MudPump2LinerDiameterPtr(a)
  91. ! end subroutine
  92. ! subroutine SetMudPump3LinerDiameterN(a)
  93. ! implicit none
  94. ! real(8) :: a
  95. ! if(associated(MudPump3LinerDiameterPtr)) call MudPump3LinerDiameterPtr(a)
  96. ! end subroutine
  97. ! subroutine SetMudPump1OutputBblStrokeN(a)
  98. ! implicit none
  99. ! real(8) :: a
  100. ! if(associated(MudPump1OutputBblStrokePtr)) call MudPump1OutputBblStrokePtr(a)
  101. ! end subroutine
  102. ! subroutine SetMudPump2OutputBblStrokeN(a)
  103. ! implicit none
  104. ! real(8) :: a
  105. ! if(associated(MudPump2OutputBblStrokePtr)) call MudPump2OutputBblStrokePtr(a)
  106. ! end subroutine
  107. ! subroutine SetMudPump3OutputBblStrokeN(a)
  108. ! implicit none
  109. ! real(8) :: a
  110. ! if(associated(MudPump3OutputBblStrokePtr)) call MudPump3OutputBblStrokePtr(a)
  111. ! end subroutine
  112. ! subroutine CalcMudPump1LinerDiameter()
  113. ! use, intrinsic :: IEEE_ARITHMETIC
  114. ! implicit none
  115. ! real(8) :: a
  116. ! a = (MathPI / 4.d0) * data%Configuration%Pumps%MudPump1Stroke * 3.0d0 * data%Configuration%Pumps%MudPump1VolumetricEfficiency / 9702.03d0
  117. ! a = dsqrt(data%Configuration%Pumps%MudPump1OutputBblStroke / a)
  118. ! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then
  119. ! data%Configuration%Pumps%MudPump1LinerDiameter = 0.0
  120. ! else
  121. ! data%Configuration%Pumps%MudPump1LinerDiameter = a
  122. ! endif
  123. ! call SetMudPump1LinerDiameterN(data%Configuration%Pumps%MudPump1LinerDiameter)
  124. ! end subroutine
  125. ! subroutine CalcMudPump2LinerDiameter()
  126. ! use, intrinsic :: IEEE_ARITHMETIC
  127. ! implicit none
  128. ! real(8) :: a
  129. ! a = (MathPI / 4.d0) * data%Configuration%Pumps%MudPump2Stroke * 3.0d0 * data%Configuration%Pumps%MudPump2VolumetricEfficiency / 9702.03d0
  130. ! a = dsqrt(data%Configuration%Pumps%MudPump2OutputBblStroke / a)
  131. ! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then
  132. ! data%Configuration%Pumps%MudPump2LinerDiameter = 0.0
  133. ! else
  134. ! data%Configuration%Pumps%MudPump2LinerDiameter = a
  135. ! endif
  136. ! call SetMudPump2LinerDiameterN(data%Configuration%Pumps%MudPump2LinerDiameter)
  137. ! end subroutine
  138. ! subroutine CalcMudPump3LinerDiameter()
  139. ! use, intrinsic :: IEEE_ARITHMETIC
  140. ! implicit none
  141. ! real(8) :: a
  142. ! a = (MathPI / 4.d0) * data%Configuration%Pumps%CementPumpStroke * 3.0d0 * data%Configuration%Pumps%CementPumpVolumetricEfficiency / 9702.03d0
  143. ! a = dsqrt(data%Configuration%Pumps%CementPumpOutputBblStroke / a)
  144. ! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then
  145. ! data%Configuration%Pumps%CementPumpLinerDiameter = 0.0
  146. ! else
  147. ! data%Configuration%Pumps%CementPumpLinerDiameter = a
  148. ! endif
  149. ! call SetMudPump3LinerDiameterN(data%Configuration%Pumps%CementPumpLinerDiameter)
  150. ! end subroutine
  151. ! subroutine CalcPump1OutputBblStroke()
  152. ! implicit none
  153. ! data%Configuration%Pumps%MudPump1OutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%MudPump1LinerDiameter**2) * data%Configuration%Pumps%MudPump1Stroke * 3.0d0 * data%Configuration%Pumps%MudPump1VolumetricEfficiency / 9702.03d0
  154. ! call SetMudPump1OutputBblStrokeN(data%Configuration%Pumps%MudPump1OutputBblStroke)
  155. ! end subroutine
  156. ! subroutine CalcPump2OutputBblStroke()
  157. ! implicit none
  158. ! data%Configuration%Pumps%MudPump2OutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%MudPump2LinerDiameter**2) * data%Configuration%Pumps%MudPump2Stroke * 3.0d0 * data%Configuration%Pumps%MudPump2VolumetricEfficiency / 9702.03d0
  159. ! call SetMudPump2OutputBblStrokeN(data%Configuration%Pumps%MudPump2OutputBblStroke)
  160. ! end subroutine
  161. ! subroutine CalcPump3OutputBblStroke()
  162. ! implicit none
  163. ! data%Configuration%Pumps%CementPumpOutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%CementPumpLinerDiameter**2) * data%Configuration%Pumps%CementPumpStroke * 3.0d0 * data%Configuration%Pumps%CementPumpVolumetricEfficiency / 9702.03d0
  164. ! call SetMudPump3OutputBblStrokeN(data%Configuration%Pumps%CementPumpOutputBblStroke)
  165. ! end subroutine
  166. end module CPumps