module CPumps use SimulationVariables use json_module implicit none public contains subroutine PumpsFromJson(parent) use json_module,IK =>json_ik type(json_value),pointer :: parent type(json_core) :: json type(json_value),pointer :: p,pitems,pitem,pval,pbit call json%get(parent,'Pumps',p) call json%get(p,"MudPump1LinerDiameter",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1LinerDiameter) call json%get(p,"MudPump1Stroke",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1Stroke) call json%get(p,"MudPump1MechanicalEfficiency",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1MechanicalEfficiency) call json%get(p,"MudPump1Output",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1Output) call json%get(p,"MudPump1OutputBblStroke",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1OutputBblStroke) call json%get(p,"MudPump1Maximum",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1Maximum) call json%get(p,"MudPump1ReliefValvePressure",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1ReliefValvePressure) call json%get(p,"MudPump2LinerDiameter",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2LinerDiameter) call json%get(p,"MudPump2Stroke",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2Stroke) call json%get(p,"MudPump2MechanicalEfficiency",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2MechanicalEfficiency) call json%get(p,"MudPump2Output",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2Output) call json%get(p,"MudPump2OutputBblStroke",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2OutputBblStroke) call json%get(p,"MudPump2Maximum",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2Maximum) call json%get(p,"MudPump2ReliefValvePressure",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2ReliefValvePressure) call json%get(p,"CementPumpLinerDiameter",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpLinerDiameter) call json%get(p,"CementPumpStroke",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpStroke) call json%get(p,"CementPumpMechanicalEfficiency",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpMechanicalEfficiency) call json%get(p,"CementPumpOutput",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpOutput) call json%get(p,"CementPumpOutputBblStroke",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpOutputBblStroke) call json%get(p,"CementPumpMaximum",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpMaximum) call json%get(p,"CementPumpReliefValvePressure",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpReliefValvePressure) call json%get(p,"MudPump1ReliefValveIsSet",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1ReliefValveIsSet) call json%get(p,"MudPump2ReliefValveIsSet",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2ReliefValveIsSet) call json%get(p,"CementPumpReliefValveIsSet",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpReliefValveIsSet) call json%get(p,"ManualPumpPower",pitem) ! Newly added call json%get(p,"MudPump1VolumetricOutput",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1VolumetricOutput) call json%get(p,"MudPump2VolumetricOutput",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2VolumetricOutput) call json%get(p,"CementPumpVolumetricOutput",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpVolumetricOutput) call json%get(p,"MudPump1MaximumPressure",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1MaximumPressure) call json%get(p,"MudPump1PumpRateChange",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1PumpRateChange) call json%get(p,"MudPump1SurfaceLineLength",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1SurfaceLineLength) call json%get(p,"MudPump1DelayToShutdown",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump1DelayToShutdown) call json%get(p,"MudPump2MaximumPressure",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2MaximumPressure) call json%get(p,"MudPump2PumpRateChange",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2PumpRateChange) call json%get(p,"MudPump2SurfaceLineLength",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2SurfaceLineLength) call json%get(p,"MudPump2DelayToShutdown",pitem) call json%get(pitem,data%Configuration%Pumps%MudPump2DelayToShutdown) call json%get(p,"CementPumpMaximumPressure",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpMaximumPressure) call json%get(p,"CementPumpPumpRateChange",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpPumpRateChange) call json%get(p,"CementPumpSurfaceLineLength",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpSurfaceLineLength) call json%get(p,"CementPumpDelayToShutdown",pitem) call json%get(pitem,data%Configuration%Pumps%CementPumpDelayToShutdown) end subroutine subroutine OpenPump1() use CManifolds implicit none call ChangeValve(16, .true.) end subroutine subroutine ClosePump1() use CManifolds implicit none call ChangeValve(16, .false.) end subroutine subroutine OpenPump2() use CManifolds implicit none call ChangeValve(17, .true.) end subroutine subroutine ClosePump2() use CManifolds implicit none call ChangeValve(17, .false.) end subroutine subroutine OpenCementPump() use CManifolds implicit none call ChangeValve(18, .true.) end subroutine subroutine CloseCementPump() use CManifolds implicit none call ChangeValve(18, .false.) end subroutine ! subroutine SetMudPump1LinerDiameterN(a) ! implicit none ! real(8) :: a ! if(associated(MudPump1LinerDiameterPtr)) call MudPump1LinerDiameterPtr(a) ! end subroutine ! subroutine SetMudPump2LinerDiameterN(a) ! implicit none ! real(8) :: a ! if(associated(MudPump2LinerDiameterPtr)) call MudPump2LinerDiameterPtr(a) ! end subroutine ! subroutine SetMudPump3LinerDiameterN(a) ! implicit none ! real(8) :: a ! if(associated(MudPump3LinerDiameterPtr)) call MudPump3LinerDiameterPtr(a) ! end subroutine ! subroutine SetMudPump1OutputBblStrokeN(a) ! implicit none ! real(8) :: a ! if(associated(MudPump1OutputBblStrokePtr)) call MudPump1OutputBblStrokePtr(a) ! end subroutine ! subroutine SetMudPump2OutputBblStrokeN(a) ! implicit none ! real(8) :: a ! if(associated(MudPump2OutputBblStrokePtr)) call MudPump2OutputBblStrokePtr(a) ! end subroutine ! subroutine SetMudPump3OutputBblStrokeN(a) ! implicit none ! real(8) :: a ! if(associated(MudPump3OutputBblStrokePtr)) call MudPump3OutputBblStrokePtr(a) ! end subroutine ! subroutine CalcMudPump1LinerDiameter() ! use, intrinsic :: IEEE_ARITHMETIC ! implicit none ! real(8) :: a ! a = (MathPI / 4.d0) * data%Configuration%Pumps%MudPump1Stroke * 3.0d0 * data%Configuration%Pumps%MudPump1VolumetricEfficiency / 9702.03d0 ! a = dsqrt(data%Configuration%Pumps%MudPump1OutputBblStroke / a) ! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then ! data%Configuration%Pumps%MudPump1LinerDiameter = 0.0 ! else ! data%Configuration%Pumps%MudPump1LinerDiameter = a ! endif ! call SetMudPump1LinerDiameterN(data%Configuration%Pumps%MudPump1LinerDiameter) ! end subroutine ! subroutine CalcMudPump2LinerDiameter() ! use, intrinsic :: IEEE_ARITHMETIC ! implicit none ! real(8) :: a ! a = (MathPI / 4.d0) * data%Configuration%Pumps%MudPump2Stroke * 3.0d0 * data%Configuration%Pumps%MudPump2VolumetricEfficiency / 9702.03d0 ! a = dsqrt(data%Configuration%Pumps%MudPump2OutputBblStroke / a) ! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then ! data%Configuration%Pumps%MudPump2LinerDiameter = 0.0 ! else ! data%Configuration%Pumps%MudPump2LinerDiameter = a ! endif ! call SetMudPump2LinerDiameterN(data%Configuration%Pumps%MudPump2LinerDiameter) ! end subroutine ! subroutine CalcMudPump3LinerDiameter() ! use, intrinsic :: IEEE_ARITHMETIC ! implicit none ! real(8) :: a ! a = (MathPI / 4.d0) * data%Configuration%Pumps%CementPumpStroke * 3.0d0 * data%Configuration%Pumps%CementPumpVolumetricEfficiency / 9702.03d0 ! a = dsqrt(data%Configuration%Pumps%CementPumpOutputBblStroke / a) ! if (.not.IEEE_IS_FINITE(a) .or. IEEE_IS_NAN(a)) then ! data%Configuration%Pumps%CementPumpLinerDiameter = 0.0 ! else ! data%Configuration%Pumps%CementPumpLinerDiameter = a ! endif ! call SetMudPump3LinerDiameterN(data%Configuration%Pumps%CementPumpLinerDiameter) ! end subroutine ! subroutine CalcPump1OutputBblStroke() ! implicit none ! data%Configuration%Pumps%MudPump1OutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%MudPump1LinerDiameter**2) * data%Configuration%Pumps%MudPump1Stroke * 3.0d0 * data%Configuration%Pumps%MudPump1VolumetricEfficiency / 9702.03d0 ! call SetMudPump1OutputBblStrokeN(data%Configuration%Pumps%MudPump1OutputBblStroke) ! end subroutine ! subroutine CalcPump2OutputBblStroke() ! implicit none ! data%Configuration%Pumps%MudPump2OutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%MudPump2LinerDiameter**2) * data%Configuration%Pumps%MudPump2Stroke * 3.0d0 * data%Configuration%Pumps%MudPump2VolumetricEfficiency / 9702.03d0 ! call SetMudPump2OutputBblStrokeN(data%Configuration%Pumps%MudPump2OutputBblStroke) ! end subroutine ! subroutine CalcPump3OutputBblStroke() ! implicit none ! data%Configuration%Pumps%CementPumpOutputBblStroke = (MathPI / 4.d0) * (data%Configuration%Pumps%CementPumpLinerDiameter**2) * data%Configuration%Pumps%CementPumpStroke * 3.0d0 * data%Configuration%Pumps%CementPumpVolumetricEfficiency / 9702.03d0 ! call SetMudPump3OutputBblStrokeN(data%Configuration%Pumps%CementPumpOutputBblStroke) ! end subroutine end module CPumps