diff --git a/Equipments/MudSystem/Kick_Expansion_and_Contraction.f90 b/Equipments/MudSystem/Kick_Expansion_and_Contraction.f90
index 1166d23..76e9a1b 100644
--- a/Equipments/MudSystem/Kick_Expansion_and_Contraction.f90
+++ b/Equipments/MudSystem/Kick_Expansion_and_Contraction.f90
@@ -151,7 +151,7 @@ subroutine Kick_Contraction ! is called in subroutine CirculationCodeSelect
!*********************************************************
!write(*,*) 'Kick Contraction'
- !MUD(2)%Q= total_pumps%Total_Pump_GPM
+ !MUD(2)%Q= MPumps%Total_Pump_GPM
StringFlowRate= MUD(2)%Q
AnnulusFlowRate= MUD(2)%Q
diff --git a/Equipments/MudSystem/Kick_Migration.f90 b/Equipments/MudSystem/Kick_Migration.f90
index f8d9040..171b8d3 100644
--- a/Equipments/MudSystem/Kick_Migration.f90
+++ b/Equipments/MudSystem/Kick_Migration.f90
@@ -18,7 +18,7 @@ subroutine Kick_Migration ! is called in subroutine CirculationCodeSelect
integer jopelement,jopmud,jopsection,CuttingValue
- !MUD(2)%Q= total_pumps%Total_Pump_GPM
+ !MUD(2)%Q= MPumps%Total_Pump_GPM
!StringFlowRate= MUD(2)%Q
!AnnulusFlowRate= MUD(2)%Q
!
diff --git a/Equipments/MudSystem/MudSystem.f90 b/Equipments/MudSystem/MudSystem.f90
index 37bf145..8827063 100644
--- a/Equipments/MudSystem/MudSystem.f90
+++ b/Equipments/MudSystem/MudSystem.f90
@@ -2189,9 +2189,9 @@ module MudSystem
GraphTotalStrokes=GraphTotalStrokes+((DataDisplayConsole%MP1SPMGauge)/60.)*DeltaT_Mudline+((DataDisplayConsole%MP2SPMGauge)/60.)*DeltaT_Mudline
- total_pumps%Total_Stroke_Counter_For_Plot = total_pumps%Total_Stroke_Counter_For_Plot + ((DataDisplayConsole%MP1SPMGauge + DataDisplayConsole%MP2SPMGauge) / 60.0) * DeltaT_Mudline
+ MPumps%Total_Stroke_Counter_For_Plot = MPumps%Total_Stroke_Counter_For_Plot + ((DataDisplayConsole%MP1SPMGauge + DataDisplayConsole%MP2SPMGauge) / 60.0) * DeltaT_Mudline
- CALL SetTotalStrokes(INT(total_pumps%Total_Stroke_Counter_For_Plot))
+ CALL SetTotalStrokes(INT(MPumps%Total_Stroke_Counter_For_Plot))
DataDisplayConsole%TotalStrokeCounter= real(nint(TotalStrokesPump1+TotalStrokesPump2)) !for drilling data display
diff --git a/Equipments/MudSystem/MudSystemStartup.f90 b/Equipments/MudSystem/MudSystemStartup.f90
index 153bc25..cf55d0b 100644
--- a/Equipments/MudSystem/MudSystemStartup.f90
+++ b/Equipments/MudSystem/MudSystemStartup.f90
@@ -31,7 +31,7 @@ AnnCapOld=0.
DeltaAnnCap=0.
-total_pumps%Total_Stroke_Counter_For_Plot = 0.0
+MPumps%Total_Stroke_Counter_For_Plot = 0.0
DeltaT_Mudline=0.1 !second
@@ -131,7 +131,7 @@ FluidFlowCounter = 0
CALL MUDLINE_LOSS_INPUTS()
-!total_pumps%Total_Pump_GPM=10. ! Initial Value
+!MPumps%Total_Pump_GPM=10. ! Initial Value
MUD%Q=0. ! Initial Value
Q_flow32=0.
diff --git a/Equipments/Pumps/Pump1_MainSolver.f90 b/Equipments/Pumps/Pump1_MainSolver.f90
index cc18a39..3e78477 100644
--- a/Equipments/Pumps/Pump1_MainSolver.f90
+++ b/Equipments/Pumps/Pump1_MainSolver.f90
@@ -1,66 +1,57 @@
subroutine Pump1_MainSolver
- use Pumps_VARIABLES
+ Use Pumps_VARIABLES
+
+ Implicit none
- implicit none
- !Call DrillingConsole_ScrLEDs
- Call Pumps_Inputs
-
- if (PUMP(1)%Throttle<=0.e0) then
+ if (PUMP(1)%Throttle<=0.d0) then
PUMP(1)%K_throttle = 1
end if
-
-
- if((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (PUMP(1)%Switch==-1) .and. (PUMP(1)%K_throttle==1) .and. (PUMP(1)%PowerFailMalf==0) .and. (PUMP(1)%Failure==0) .and. (Pumps_IsStopped == .false.)) then
- !!print*, 'pumps on'
+
+
+ if((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (PUMP(1)%Switch==-1) .and. (PUMP(1)%K_throttle==1) .and. (PUMP(1)%PowerFailMalf==0) .and. (PUMP(1)%Failure==0)) then
+
PUMP(1)%SoundBlower = .true.
- !Call SetSoundBlowerMP1(PUMP(1)%SoundBlower)
- !MP1BLWR = 1
-
+ PUMP(1)%BLWR = 1
+
!========================== Pump 1 Rate limit ==========================
if (((PUMP(1)%N_new-PUMP(1)%N_old)/PUMP(1)%time_step)>PUMP(1)%RateChange) then
- PUMP(1)%Speed =(PUMP(1)%RateChange*PUMP(1)%time_step)+PUMP(1)%N_old
+ PUMP(1)%Speed =(PUMP(1)%RateChange*PUMP(1)%time_step)+PUMP(1)%N_old ![RPM]
else if (((PUMP(1)%N_old-PUMP(1)%N_new)/PUMP(1)%time_step)>PUMP(1)%RateChange) then
PUMP(1)%Speed = (-PUMP(1)%RateChange*PUMP(1)%time_step)+PUMP(1)%N_old
else
PUMP(1)%Speed = PUMP(1)%N_new
end if
!=======================================================================
-
+
Call Pump_OnMode_Solver(1)
+ else
- else
- if ((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (PUMP(1)%Switch==-1) .and. (Pumps_IsStopped == .false.)) then
+ if ((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (PUMP(1)%Switch==-1)) then
PUMP(1)%SoundBlower = .true.
- !Call SetSoundBlowerMP1(PUMP(1)%SoundBlower)
else
PUMP(1)%SoundBlower = .false.
- !Call SetSoundBlowerMP1(PUMP(1)%SoundBlower)
end if
- if ((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (PUMP(1)%Switch==-1) .and. (Pumps_IsStopped == .false.) .and. (PUMP(1)%PowerFailMalf==0) .and. (PUMP(1)%Failure==0)) then
- !MP1BLWR = 1
+ if ((any(PUMP(1)%AssignmentSwitchh==(/1,2,3,4,9,10/))) .and. (PUMP(1)%Switch==-1) .and. (PUMP(1)%PowerFailMalf==0) .and. (PUMP(1)%Failure==0)) then
+ PUMP(1)%BLWR = 1
else
- !MP1BLWR = 0
+ PUMP(1)%BLWR = 0
end if
Call Pump_OffMode_Solver(1)
- !Call ClosePump1()
PUMP(1)%K_throttle = 0
end if
- PUMP(1)%N_old = PUMP(1)%Speed
+ PUMP(1)%N_old = PUMP(1)%Speed
- print*, 'Q , P , Hp , N='
- print*, PUMP(1)%Flow_Rate , PUMP(1)%StandPipe_Pressure , PUMP(1)%Hydraulic_HorsePower , PUMP(1)%Speed
- ! pause
end subroutine Pump1_MainSolver
\ No newline at end of file
diff --git a/Equipments/Pumps/Pump2_MainSolver.f90 b/Equipments/Pumps/Pump2_MainSolver.f90
new file mode 100644
index 0000000..98d32a6
--- /dev/null
+++ b/Equipments/Pumps/Pump2_MainSolver.f90
@@ -0,0 +1,57 @@
+subroutine Pump2_MainSolver
+
+ Use Pumps_VARIABLES
+
+ Implicit none
+
+
+
+
+ if (PUMP(2)%Throttle<=0.d0) then
+ PUMP(2)%K_throttle = 1
+ end if
+
+
+ if((any(PUMP(2)%AssignmentSwitchh==(/1,2,3,4,5,7,8,11/))) .and. (PUMP(2)%Switch==-1) .and. (PUMP(2)%K_throttle==1) .and. (PUMP(2)%PowerFailMalf==0) .and. (PUMP(2)%Failure==0)) then
+
+ PUMP(2)%SoundBlower = .true.
+ PUMP(2)%BLWR = 1
+
+ !========================== Pump 2 Rate limit ==========================
+ if (((PUMP(2)%N_new-PUMP(2)%N_old)/PUMP(2)%time_step)>PUMP(2)%RateChange) then
+ PUMP(2)%Speed =(PUMP(2)%RateChange*PUMP(2)%time_step)+PUMP(2)%N_old
+ else if (((PUMP(2)%N_old-PUMP(2)%N_new)/PUMP(2)%time_step)>PUMP(2)%RateChange) then
+ PUMP(2)%Speed = (-PUMP(2)%RateChange*PUMP(2)%time_step)+PUMP(2)%N_old
+ else
+ PUMP(2)%Speed = PUMP(2)%N_new
+ end if
+ !=======================================================================
+
+ Call Pump_OnMode_Solver(2)
+
+ else
+
+ if ((any(PUMP(2)%AssignmentSwitchh==(/1,2,3,4,5,7,8,11/))) .and. (PUMP(2)%Switch==-1)) then
+ PUMP(2)%SoundBlower = .true.
+ else
+ PUMP(2)%SoundBlower = .false.
+ end if
+
+ if ((any(PUMP(2)%AssignmentSwitchh==(/1,2,3,4,5,7,8,11/))) .and. (PUMP(2)%Switch==-1) .and. (PUMP(2)%PowerFailMalf==0) .and. (PUMP(2)%Failure==0)) then
+ PUMP(2)%BLWR = 1
+ else
+ PUMP(2)%BLWR = 0
+ end if
+
+
+ Call Pump_OffMode_Solver(2)
+ PUMP(2)%K_throttle = 0
+
+ end if
+
+
+ PUMP(2)%N_old = PUMP(2)%Speed
+
+
+
+end subroutine Pump2_MainSolver
\ No newline at end of file
diff --git a/Equipments/Pumps/Pump3_MainSolver.f90 b/Equipments/Pumps/Pump3_MainSolver.f90
new file mode 100644
index 0000000..28bc99b
--- /dev/null
+++ b/Equipments/Pumps/Pump3_MainSolver.f90
@@ -0,0 +1,41 @@
+subroutine Pump3_MainSolver
+
+ Use Pumps_VARIABLES
+
+ Implicit none
+
+
+
+
+ if (PUMP(3)%Throttle<=0.d0) then
+ PUMP(3)%K_throttle = 1
+ end if
+
+
+ if((PUMP(3)%Switch==1) .and. (PUMP(3)%K_throttle==1) .and. (PUMP(3)%PowerFailMalf==0) .and. (PUMP(3)%Failure==0)) then
+
+ !========================== Pump 3 Rate limit ==========================
+ if (((PUMP(3)%N_new-PUMP(3)%N_old)/PUMP(3)%time_step)>PUMP(3)%RateChange) then
+ PUMP(3)%Speed =(PUMP(3)%RateChange*PUMP(3)%time_step)+PUMP(3)%N_old ![RPM]
+ else if (((PUMP(3)%N_old-PUMP(3)%N_new)/PUMP(3)%time_step)>PUMP(3)%RateChange) then
+ PUMP(3)%Speed = (-PUMP(3)%RateChange*PUMP(3)%time_step)+PUMP(3)%N_old
+ else
+ PUMP(3)%Speed = PUMP(3)%N_new
+ end if
+ !=======================================================================
+
+ Call Pump_OnMode_Solver(3)
+
+ else
+
+ Call Pump_OffMode_Solver(3)
+ PUMP(3)%K_throttle = 0
+
+ end if
+
+
+ PUMP(3)%N_old = PUMP(3)%Speed
+
+
+
+end subroutine Pump3_MainSolver
\ No newline at end of file
diff --git a/Equipments/Pumps/Pump_OffMode_Solver.f90 b/Equipments/Pumps/Pump_OffMode_Solver.f90
index 81691da..cb0708d 100644
--- a/Equipments/Pumps/Pump_OffMode_Solver.f90
+++ b/Equipments/Pumps/Pump_OffMode_Solver.f90
@@ -1,52 +1,46 @@
subroutine Pump_OffMode_Solver(Pump_No)
- use Pumps_VARIABLES
- !use CPumpsVariables
- !use CDrillingConsoleVariables
- !use CDataDisplayConsoleVariables
- !! use CSimulationVariables
- !use CDrillWatchVariables
- !use CSounds
-
+ Use Pumps_VARIABLES
IMPLICIT NONE
INTEGER :: Pump_No
- PUMP(1)%N_new = 0.e0
- !========================== Pump 1 Rate limit ==========================
- if (((PUMP(1)%N_new-PUMP(1)%N_old)/PUMP(1)%time_step)>PUMP(1)%RateChange) then
- PUMP(1)%Speed =(PUMP(1)%RateChange*PUMP(1)%time_step)+PUMP(1)%N_old
- else if (((PUMP(1)%N_old-PUMP(1)%N_new)/PUMP(1)%time_step)>PUMP(1)%RateChange) then
- PUMP(1)%Speed = (-PUMP(1)%RateChange*PUMP(1)%time_step)+PUMP(1)%N_old
- else
- PUMP(1)%Speed = PUMP(1)%N_new
- end if
- !=======================================================================
-
-
-
- PUMP(Pump_No)%Flow_Rate = PUMP(1)%FlowRatePerSTK*4118.e0*0.01e0*(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio) ![gpm]
- PUMP(Pump_No)%Hydraulic_HorsePower = ( (PUMP(Pump_No)%Flow_Rate/0.01e0)*PUMP(Pump_No)%Max_Pressure)/(168067.e0*PUMP(Pump_No)%Mech_Efficiency) ![HHP]
- if ( PUMP(Pump_No)%StandPipe_Pressure>=PUMP(Pump_No)%Max_Pressure ) then
- !print*, 'pumps critical'
- PUMP(Pump_No)%Flow_Rate = (1714.e0*PUMP(Pump_No)%Hydraulic_HorsePower)/PUMP(Pump_No)%Max_Pressure ![gpm]
- PUMP(Pump_No)%Speed = ( PUMP(Pump_No)%Flow_Rate/(PUMP(1)%FlowRatePerSTK*4118.e0*0.01e0) )*PUMP(Pump_No)%Trans_Ratio ![rpm]
- end if
-
- total_pumps%Total_Pump_GPM = PUMP(1)%Flow_Rate+PUMP(2)%Flow_Rate+PUMP(3)%Flow_Rate
- total_pumps%Total_Pump_SPM = (PUMP(1)%Speed/PUMP(1)%Trans_Ratio)+(PUMP(2)%Speed/PUMP(2)%Trans_Ratio)+(PUMP(3)%Speed/PUMP(3)%Trans_Ratio)
-
-
-
- !Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) )
- !SPM1 = MP1SPMGauge
- !PUMP(1)%SoundSPM = INT(PUMP(1)%Speed/PUMP(1)%Trans_Ratio)
- !Call SetSoundMP1( PUMP(1)%SoundSPM )
-
-
-
+ PUMP(Pump_No)%N_new = 0.d0
+
+ !========================== Pump Rate limit ==========================
+ if (((PUMP(Pump_No)%N_new-PUMP(Pump_No)%N_old)/PUMP(Pump_No)%time_step)>PUMP(Pump_No)%RateChange) then
+ PUMP(Pump_No)%Speed =(PUMP(Pump_No)%RateChange*PUMP(Pump_No)%time_step)+PUMP(Pump_No)%N_old
+ else if (((PUMP(Pump_No)%N_old-PUMP(Pump_No)%N_new)/PUMP(Pump_No)%time_step)>PUMP(Pump_No)%RateChange) then
+ PUMP(Pump_No)%Speed = (-PUMP(Pump_No)%RateChange*PUMP(Pump_No)%time_step)+PUMP(Pump_No)%N_old
+ else
+ PUMP(Pump_No)%Speed = PUMP(Pump_No)%N_new
+ end if
+ !=======================================================================
+
+
+ PUMP(Pump_No)%Flow_Rate = PUMP(Pump_No)%FlowRatePerSTK*4118.d0*0.01d0*(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio) ![gpm]
+ PUMP(Pump_No)%HorsePower = ((PUMP(Pump_No)%Flow_Rate/0.01d0)*PUMP(Pump_No)%StandPipe_Pressure)/(168067.d0*PUMP(Pump_No)%Mech_Efficiency) ![HHP]
+ !PUMP(Pump_No)%Max_Horsepower = ((PUMP(Pump_No)%Flow_Rate/0.01d0)*PUMP(Pump_No)%Max_Pressure)/(168067.d0*PUMP(Pump_No)%Mech_Efficiency) ![HHP]
+ PUMP(Pump_No)%Max_Horsepower = (PUMP(Pump_No)%Flow_Rate*PUMP(Pump_No)%Max_Pressure)/(1714.d0*PUMP(Pump_No)%Mech_Efficiency)
+ if ( PUMP(Pump_No)%StandPipe_Pressure>PUMP(Pump_No)%Max_Pressure ) then ! in shart check shavad
+ !if ( (PUMP(Pump_No)%StandPipe_Pressure*PUMP(Pump_No)%Flow_Rate)>(1714.d0*PUMP(Pump_No)%Max_Horsepower*PUMP(Pump_No)%Mech_Efficiency) ) then
+ PUMP(Pump_No)%Flow_Rate = (1714.d0*PUMP(Pump_No)%Mech_Efficiency*PUMP(Pump_No)%Max_Horsepower)/PUMP(Pump_No)%StandPipe_Pressure ![gpm]
+ PUMP(Pump_No)%Speed = ( PUMP(Pump_No)%Flow_Rate/(PUMP(Pump_No)%FlowRatePerSTK*4118.d0*0.01d0) )*PUMP(Pump_No)%Trans_Ratio ![rpm]
+ end if
+
+ PUMP(Pump_No)%SoundSPM = INT(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio)
+
+ If (PUMP(Pump_No)%Flow_Rate>0.d0) Then
+ PUMP(Pump_No)%Open_Close = 1
+ Else
+ PUMP(Pump_No)%Open_Close = 0
+ End if
+
+
+
+
end subroutine Pump_OffMode_Solver
\ No newline at end of file
diff --git a/Equipments/Pumps/Pump_OnMode_Solver.f90 b/Equipments/Pumps/Pump_OnMode_Solver.f90
index 3e2e619..4bf3712 100644
--- a/Equipments/Pumps/Pump_OnMode_Solver.f90
+++ b/Equipments/Pumps/Pump_OnMode_Solver.f90
@@ -1,55 +1,32 @@
subroutine Pump_OnMode_Solver(Pump_No)
- use Pumps_VARIABLES
- !use CPumpsVariables
- !use CDrillingConsoleVariables
- !use CDataDisplayConsoleVariables
- !! use CSimulationVariables
- !use CDrillWatchVariables
- !use equipments_PowerLimit
- !use CSounds
- !use CWarningsVariables
-
+ Use Pumps_VARIABLES
IMPLICIT NONE
INTEGER :: Pump_No
- PUMP(Pump_No)%Flow_Rate = PUMP(1)%FlowRatePerSTK*4118.e0*0.01e0*(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio) ![gpm]
- PUMP(Pump_No)%Max_FlowRate = PUMP(1)%FlowRatePerSTK*4118.e0*0.01e0*PUMP(1)%MaxSPM ![gpm]
- PUMP(Pump_No)%Hydraulic_HorsePower = ( (PUMP(Pump_No)%Flow_Rate/0.01e0)*PUMP(Pump_No)%Max_Pressure)/(168067.e0*PUMP(Pump_No)%Mech_Efficiency) ![HHP]
- if ( PUMP(Pump_No)%StandPipe_Pressure>=PUMP(Pump_No)%Max_Pressure ) then ! in shart check shavad
- !print*, 'pumps critical'
- PUMP(Pump_No)%Flow_Rate = (1714.e0*PUMP(Pump_No)%Hydraulic_HorsePower)/PUMP(Pump_No)%Max_Pressure ![gpm]
- PUMP(Pump_No)%Speed = ( PUMP(Pump_No)%Flow_Rate/(PUMP(1)%FlowRatePerSTK*4118.e0*0.01e0) )*PUMP(Pump_No)%Trans_Ratio ![rpm]
- end if
+ PUMP(Pump_No)%Flow_Rate = PUMP(Pump_No)%FlowRatePerSTK*4118.d0*0.01d0*(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio) ![gpm]
+ PUMP(Pump_No)%Max_FlowRate = PUMP(Pump_No)%FlowRatePerSTK*4118.d0*0.01d0*PUMP(Pump_No)%MaxSPM ![gpm]
+ PUMP(Pump_No)%HorsePower = ((PUMP(Pump_No)%Flow_Rate/0.01d0)*PUMP(Pump_No)%StandPipe_Pressure)/(168067.d0*PUMP(Pump_No)%Mech_Efficiency) ![HHP]
+ !PUMP(Pump_No)%Max_Horsepower = ((PUMP(Pump_No)%Flow_Rate/0.01d0)*PUMP(Pump_No)%Max_Pressure)/(168067.d0*PUMP(Pump_No)%Mech_Efficiency) ![HHP]
+ PUMP(Pump_No)%Max_Horsepower = (PUMP(Pump_No)%Flow_Rate*PUMP(Pump_No)%Max_Pressure)/(1714.d0*PUMP(Pump_No)%Mech_Efficiency)
+ if ( PUMP(Pump_No)%StandPipe_Pressure>PUMP(Pump_No)%Max_Pressure ) then ! in shart check shavad
+ !if ( (PUMP(Pump_No)%StandPipe_Pressure*PUMP(Pump_No)%Flow_Rate)>(1714.d0*PUMP(Pump_No)%Max_Horsepower*PUMP(Pump_No)%Mech_Efficiency) ) then
+ PUMP(Pump_No)%Flow_Rate = (1714.d0*PUMP(Pump_No)%Mech_Efficiency*PUMP(Pump_No)%Max_Horsepower)/PUMP(Pump_No)%StandPipe_Pressure ![gpm]
+ PUMP(Pump_No)%Speed = ( PUMP(Pump_No)%Flow_Rate/(PUMP(Pump_No)%FlowRatePerSTK*4118.d0*0.01d0) )*PUMP(Pump_No)%Trans_Ratio ![rpm]
+ end if
- total_pumps%Total_Pump_GPM = PUMP(1)%Flow_Rate+PUMP(2)%Flow_Rate+PUMP(3)%Flow_Rate
- total_pumps%Total_Pump_SPM = (PUMP(1)%Speed/PUMP(1)%Trans_Ratio)+(PUMP(2)%Speed/PUMP(2)%Trans_Ratio)+(PUMP(3)%Speed/PUMP(3)%Trans_Ratio)
+ PUMP(Pump_No)%SoundSPM = INT(PUMP(Pump_No)%Speed/PUMP(Pump_No)%Trans_Ratio) ![spm]
+
+ If (PUMP(Pump_No)%Flow_Rate>0.d0) Then
+ PUMP(Pump_No)%Open_Close = 1
+ Else
+ PUMP(Pump_No)%Open_Close = 0
+ End if
+
-
-
-
- !Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) )
- !SPM1 = MP1SPMGauge
- !PUMP(1)%SoundSPM = INT(PUMP(1)%Speed/PUMP(1)%Trans_Ratio)
- !Call SetSoundMP1( PUMP(1)%SoundSPM )
- !
- !
- !
- !IF (PUMP(1)%Flow_Rate>0.) Then
- ! Call OpenPump1()
- !Else
- ! Call ClosePump1()
- !End if
-
-
- !IF (PUMP(2)%Flow_Rate>0.) Then
- ! Call OpenPump2()
- !Else
- ! Call ClosePump2()
- !End if
diff --git a/Equipments/Pumps/PumpsMain.f90 b/Equipments/Pumps/PumpsMain.f90
index 36fd9c4..a548b1e 100644
--- a/Equipments/Pumps/PumpsMain.f90
+++ b/Equipments/Pumps/PumpsMain.f90
@@ -1,11 +1,6 @@
module PumpsMain
- use CPumpsVariables
- use CDrillingConsoleVariables
- use CDataDisplayConsoleVariables
- ! use CSimulationVariables
- use Pumps_VARIABLES
- use CSounds
+ Use Pumps_VARIABLES
implicit none
public
@@ -18,15 +13,15 @@ module PumpsMain
! ***** subroutine Pump1MainBody *****
! ****************************
- ! subroutine Pump1_Setup()
- ! ! use CSimulationVariables
- ! implicit none
- ! call OnSimulationInitialization%Add(Pump1_Init)
- ! call OnSimulationStop%Add(Pump1_Init)
- ! call OnPump1Step%Add(Pump1_Step)
- ! call OnPump1Output%Add(Pump1_Output)
- ! call OnPump1Main%Add(Pump1MainBody)
- ! end subroutine
+ subroutine Pump1_Setup()
+ use CSimulationVariables
+ implicit none
+ call OnSimulationInitialization%Add(Pump1_Init)
+ call OnSimulationStop%Add(Pump1_Init)
+ call OnPump1Step%Add(Pump1_Step)
+ call OnPump1Output%Add(Pump1_Output)
+ call OnPump1Main%Add(Pump1MainBody)
+ end subroutine
subroutine Pump1_Init
Call Pumps_StartUp
@@ -36,41 +31,27 @@ module PumpsMain
Call Pump1_MainSolver
end subroutine Pump1_Step
- ! subroutine Pump1_Output
- ! implicit none
- ! end subroutine Pump1_Output
-
- ! subroutine Pump1MainBody
- ! use ifport
- ! use ifmt
- ! !use Pump1_MainSolver
- ! use CWarningsVariables
- ! !use equipments_PowerLimit
- ! implicit none
+ subroutine Pump1_Output
+ implicit none
+ end subroutine Pump1_Output
+
+ subroutine Pump1MainBody
+ use ifport
+ use ifmt
+ implicit none
+
- ! integer,dimension(8) :: MP_START_TIME, MP_END_TIME
- ! INTEGER :: MP_SolDuration
+ Call Pumps_StartUp
- ! Call Pumps_StartUp
- ! loop1 : do
- ! !!Call sleepqq(10)
- ! !!Call DATE_AND_TIME(values=MP_START_TIME)
-
- ! Call Pump1_MainSolver
-
- ! if (Pumps_IsStopped == .true.) then
- ! exit loop1
- ! end if
+ loop1 : do
+
+ Call Pumps_MainSolver
- ! !!Call DATE_AND_TIME(values=MP_END_TIME)
- ! !!MP_SolDuration = 100-(MP_END_TIME(5)*3600000+MP_END_TIME(6)*60000+MP_END_TIME(7)*1000+MP_END_TIME(8)-MP_START_TIME(5)*3600000-MP_START_TIME(6)*60000-MP_START_TIME(7)*1000-MP_START_TIME(8))
- ! !!if(MP_SolDuration > 0.0) then
- ! !! Call sleepqq(MP_SolDuration)
- ! !!end if
- ! end do loop1
+ end do loop1
+
- ! end subroutine Pump1MainBody
+ end subroutine Pump1MainBody
@@ -80,7 +61,7 @@ module PumpsMain
! ***** subroutine Pump2MainBody *****
! ****************************
! subroutine Pump2_Setup()
-! ! use CSimulationVariables
+! use CSimulationVariables
! implicit none
! call OnSimulationInitialization%Add(Pump2_Init)
! call OnSimulationStop%Add(Pump2_Init)
@@ -140,7 +121,7 @@ module PumpsMain
!! ***** subroutine Pump3MainBody *****
!! ****************************
! subroutine Pump3_Setup()
-! ! use CSimulationVariables
+! use CSimulationVariables
! implicit none
! call OnSimulationInitialization%Add(Pump3_Init)
! call OnSimulationStop%Add(Pump3_Init)
diff --git a/Equipments/Pumps/Pumps_Inputs.f90 b/Equipments/Pumps/Pumps_Inputs.f90
index f6d76a7..104ce36 100644
--- a/Equipments/Pumps/Pumps_Inputs.f90
+++ b/Equipments/Pumps/Pumps_Inputs.f90
@@ -1,55 +1,110 @@
subroutine Pumps_Inputs
- !use CPumpsVariables
- !use CDrillingConsoleVariables
- !use CDataDisplayConsoleVariables
- !! use CSimulationVariables
- use Pumps_VARIABLES
- !use MudSystem
-
+ Use CDrillingConsoleVariables
+ Use Pumps_VARIABLES
+ Use MudSystem
+
IMPLICIT NONE
- !>>>>>>>>>>>>>>>>>>>>>>> PUMP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+!>>>>>>>>>>>>>>>>>>>>>>> PUMP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<<
- PUMP(1)%StandPipe_Pressure = 25.e0!PumpPressure1 ![psi]
+ !PUMP(1)%BlowPopOffMalf = 0 !??????? motaghayere voroudi
- PUMP(1)%AssignmentSwitchh = 1!AssignmentSwitch
+ if ( PUMP(1)%BlowPopOffMalf==1 ) then ! Pump1 Malfunction ----> Blow Pop-offs (Relief Valves)
+ PUMP(1)%StandPipe_Pressure = 0.d0
+ else
+ PUMP(1)%StandPipe_Pressure = PumpPressure1 ![psi]
+ if ( PUMP(1)%StandPipe_Pressure<=14.d0 ) then
+ PUMP(1)%StandPipe_Pressure = 14.d0
+ end if
+ end if
- PUMP(1)%Switch = -1!MP1CPSwitch
+ PUMP(1)%AssignmentSwitchh = DrillingConsole%AssignmentSwitch
- PUMP(1)%Throttle = 0.e0!MP1Throttle ![RPM]
+ PUMP(1)%Switch = DrillingConsole%MP1CPSwitch
- PUMP(1)%PowerFailMalf = 1 !??????? motaghayere voroudi (Pump1 Malfunction ----> Power Failure)
+ PUMP(1)%Throttle = DrillingConsole%MP1Throttle ![RPM]
- PUMP(1)%Failure = 0!Pump1Failure (Pump1 Warning ----> Failure)
+ !PUMP(1)%PowerFailMalf = 0 !??????? motaghayere voroudi (Pump1 Malfunction ----> Power Failure) !dar CPumpProblemsVariables meghdardehi mishavad
- Pumps_IsStopped = .false.!IsStopped
+ PUMP(1)%Failure = Pump1Failure !(Pump1 Warning ----> Failure)
+
+ PUMP(1)%N_new = PUMP(1)%Throttle
- PUMP(1)%N_new = PUMP(1)%Throttle
+
+
+!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<<
+ !PUMP(2)%BlowPopOffMalf = 0 !??????? motaghayere voroudi
+
+ if ( PUMP(2)%BlowPopOffMalf==1 ) then ! Pump2 Malfunction ----> Blow Pop-offs (Relief Valves)
+ PUMP(2)%StandPipe_Pressure = 0.d0
+ else
+ PUMP(2)%StandPipe_Pressure = PumpPressure2 ![psi]
+ if ( PUMP(2)%StandPipe_Pressure<=14.d0 ) then
+ PUMP(2)%StandPipe_Pressure = 14.d0
+ end if
+ end if
+
+ PUMP(2)%AssignmentSwitchh = DrillingConsole%AssignmentSwitch
+
+ PUMP(2)%Switch = DrillingConsole%MP2Switch
+
+ PUMP(2)%Throttle = DrillingConsole%MP2Throttle ![RPM]
+
+ !PUMP(2)%PowerFailMalf = 0 !??????? motaghayere voroudi (Pump2 Malfunction ----> Power Failure) !dar CPumpProblemsVariables meghdardehi mishavad
+
+ PUMP(2)%Failure = Pump2Failure !(Pump2 Warning ----> Failure)
+
+ PUMP(2)%N_new = PUMP(2)%Throttle
+
+
+
-!!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<<
-!
-! PUMP(2)%StandPipe_Pressure = PumpPressure2 ![psi]
-!
-!
-!
-!
-!
!!>>>>>>>>>>>>>>>>>>>>>>> PUMP 3 <<<<<<<<<<<<<<<<<<<<<<<<<<<
-!
-! PUMP(3)%StandPipe_Pressure = PumpPressure3 ![psi]
+
+ !PUMP(3)%BlowPopOffMalf = 0 !??????? motaghayere voroudi
+
+ if ( PUMP(3)%BlowPopOffMalf==1 ) then ! Pump3 Malfunction ----> Blow Pop-offs (Relief Valves)
+ PUMP(3)%StandPipe_Pressure = 0.d0
+ else
+ PUMP(3)%StandPipe_Pressure = PumpPressure3 ![psi]
+ if ( PUMP(3)%StandPipe_Pressure<=14.d0 ) then
+ PUMP(3)%StandPipe_Pressure = 14.d0
+ end if
+ end if
+
+ PUMP(3)%Switch = DrillingConsole%MP1CPSwitch
+
+ PUMP(3)%Throttle = DrillingConsole%MP1Throttle ![RPM]
+
+ !PUMP(3)%PowerFailMalf = 0 !??????? motaghayere voroudi (Pump3 Malfunction ----> Power Failure) !dar CPumpProblemsVariables meghdardehi mishavad
+
+ PUMP(3)%Failure = Pump3Failure !(Pump1 Warning ----> Failure)
+
+ PUMP(3)%N_new = PUMP(3)%Throttle
+
+!>>>>>>>>>>>>>>>>>>>>>>> Total Pumps <<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+
+
+
+
+
+
+
end subroutine Pumps_Inputs
\ No newline at end of file
diff --git a/Equipments/Pumps/Pumps_MainSolver.f90 b/Equipments/Pumps/Pumps_MainSolver.f90
new file mode 100644
index 0000000..f5666c0
--- /dev/null
+++ b/Equipments/Pumps/Pumps_MainSolver.f90
@@ -0,0 +1,28 @@
+subroutine Pumps_MainSolver
+
+ Use Pumps_VARIABLES
+
+ Implicit none
+
+
+
+ Call DrillingConsole_ScrLEDs !koja bezaramesh?????
+
+ Call Pumps_Inputs
+
+
+
+ Call Pump1_MainSolver
+
+ Call Pump2_MainSolver
+
+ Call Pump3_MainSolver
+
+ Call Pumps_TotalSolver
+
+
+
+ Call Pumps_Outputs
+
+
+end subroutine Pumps_MainSolver
\ No newline at end of file
diff --git a/Equipments/Pumps/Pumps_Outputs.f90 b/Equipments/Pumps/Pumps_Outputs.f90
index 3720ed3..ff07bb8 100644
--- a/Equipments/Pumps/Pumps_Outputs.f90
+++ b/Equipments/Pumps/Pumps_Outputs.f90
@@ -1,51 +1,94 @@
subroutine Pumps_Outputs
- use CPumpsVariables
- use CDrillingConsoleVariables
- use CDataDisplayConsoleVariables
- ! use CSimulationVariables
- use Pumps_VARIABLES
- use MudSystem
+ Use CDataDisplayConsoleVariables
+ Use CSimulationVariables
+ Use Pumps_VARIABLES
+ Use MudSystem
+ Use CDrillWatchVariables
IMPLICIT NONE
- !>>>>>>>>>>>>>>>>>>>>>>> PUMP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<<
- !Call SetSoundBlowerMP1(PUMP(1)%SoundBlower)
- ! DrillingConsole%MP1BLWR = 1
- ! Call OpenPump1()
- ! Call ClosePump1()
- ! total_pumps%Total_Pump_GPM = 100
- ! total_pumps%Total_Pump_SPM =
- ! Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) )
- ! DrillingWatch%SPM1 = MP1SPMGauge
- ! Call SetSoundMP1( PUMP(1)%SoundSPM )
- ! SCR1LED=1
- ! SCR2LED=1
- ! SCR3LED=1
- ! SCR4LED=1
+!>>>>>>>>>>>>>>>>>>>>>>> PUMP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<<
+ If (PUMP(1)%Open_Close==1) then
+ Call OpenPump1()
+ Else if (PUMP(1)%Open_Close==0) then
+ Call ClosePump1()
+ End if
+ DrillingConsole%MP1BLWR = PUMP(1)%BLWR
+
+ Call SetSoundBlowerMP1( PUMP(1)%SoundBlower ) !.true. or .false.
+ Call SetSoundMP1( PUMP(1)%SoundSPM ) ![spm] , integer
+
+ if ((PUMP(1)%Switch==-1) .or. (PUMP(1)%Switch==0)) then
+ Call Set_MP1SPMGauge( sngl(1-PUMP(1)%SPMGaugeMalf)*real((PUMP(1)%Speed/PUMP(1)%Trans_Ratio),8) ) ![spm] , real
+ DrillingWatch%SPM1 = DataDisplayConsole%MP1SPMGauge
+ end if
+
+ !PUMP(1)%Flow_Rate !to other modules , [gpm]
+
+
+
+
+
+
+
+!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+ If (PUMP(2)%Open_Close==1) then
+ Call OpenPump2()
+ Else if (PUMP(2)%Open_Close==0) then
+ Call ClosePump2()
+ End if
+
+ DrillingConsole%MP2BLWR = PUMP(2)%BLWR
+
+ Call SetSoundBlowerMP2( PUMP(2)%SoundBlower )
+ Call SetSoundMP2( PUMP(2)%SoundSPM )
+
+ Call Set_MP2SPMGauge( sngl(1-PUMP(2)%SPMGaugeMalf)*real((PUMP(2)%Speed/PUMP(2)%Trans_Ratio),8) )
+ DrillingWatch%SPM2 = DataDisplayConsole%MP2SPMGauge
+
+ !PUMP(2)%Flow_Rate !to other modules
-
-!!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<<
-!
-!
-!
-!
-!
-!
!!>>>>>>>>>>>>>>>>>>>>>>> PUMP 3 <<<<<<<<<<<<<<<<<<<<<<<<<<<
-!
+
+ If (PUMP(3)%Open_Close==1) then
+ Call OpenCementPump()
+ Else if (PUMP(3)%Open_Close==0) then
+ Call CloseCementPump()
+ End if
+
+ Call SetSoundMP3( PUMP(3)%SoundSPM )
+
+ if (PUMP(3)%Switch==1) then
+ Call Set_MP1SPMGauge( real((PUMP(3)%Speed/PUMP(3)%Trans_Ratio),8) )
+ DrillingWatch%SPM1 = DataDisplayConsole%MP1SPMGauge
+ end if
+
+ !PUMP(3)%Flow_Rate !to other modules
+!>>>>>>>>>>>>>>>>>>>>>>> Total Pumps <<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+ !MPumps%Total_Pump_Gpm = 100.d0 !???????????
+ !MPumps%Total_Pump_SPM = 1000.d0 !?????????????
+
+ !SCR1LED=1
+ !SCR2LED=1
+ !SCR3LED=1
+ !SCR4LED=1
+
+
end subroutine Pumps_Outputs
\ No newline at end of file
diff --git a/Equipments/Pumps/Pumps_StartUp.f90 b/Equipments/Pumps/Pumps_StartUp.f90
index 41e9a9a..ed65ea6 100644
--- a/Equipments/Pumps/Pumps_StartUp.f90
+++ b/Equipments/Pumps/Pumps_StartUp.f90
@@ -1,12 +1,7 @@
subroutine Pumps_StartUp
- !use CPumpsVariables
- !use CDrillingConsoleVariables
- !use CDataDisplayConsoleVariables
- !! use CSimulationVariables
- !use CPowerVariables
- use Pumps_VARIABLES
-
+ Use CPumpsVariables
+ Use Pumps_VARIABLES
IMPLICIT NONE
@@ -14,61 +9,59 @@ subroutine Pumps_StartUp
!>>>>>>>>>>>>>>>>>>>>>>> PUMP 1 <<<<<<<<<<<<<<<<<<<<<<<<<<<
- PUMP(1)%FlowRatePerSTK = 7000.e0 ![bbl] !??????? motaghayere voroudi
- !PUMP(1)%FlowRatePerSTK = PUMP(1)%FlowRatePerSTK*0.0292e0 ![gpm]
- PUMP(1)%RateChange = 4.e0 ! [stk/min2] !??????? motaghayere voroudi
- PUMP(1)%Stroke_Length = 12.e0!MudPump1Stroke ! bayad hazf beshe ?
- PUMP(1)%Piston_Diameter = 4.e0!MudPump1LinerDiameter ! bayad hazf beshe ?
- PUMP(1)%Piston_Area = (pi*(PUMP(1)%Piston_Diameter**2.e0))/4.e0 ! bayad hazf beshe ?
- PUMP(1)%Mech_Efficiency = 0.95e0!MudPump1MechanicalEfficiency [dimensionless]
- !PUMP(1)%Vol_Efficiency = MudPump1VolumetricEfficiency ! bayad hazf beshe ?
- !PUMP(1)%Max_Horsepower = MudPump1 ! bayad hazf beshe ?
- PUMP(1)%Max_Pressure = 600.e0 ! [psi] !??????? motaghayere voroudi
- PUMP(1)%MaxSPM = 275.e0!MudPump1Maximum [spm]
- PUMP(1)%Trans_Ratio = 965.e0/PUMP(1)%MaxSPM
- PUMP(1)%time_step = 0.1e0 !?????? niaz hast ya na??
-
- PUMP(1)%RateChange = PUMP(1)%RateChange*PUMP(1)%Trans_Ratio ! [rpm/min2]
+ PUMP(1)%FlowRatePerSTK = 7000.d0 ![bbl] !??????? motaghayere voroudi
+ !PUMP(1)%FlowRatePerSTK = PUMP(1)%FlowRatePerSTK*0.0292d0 ![gpm]
+ PUMP(1)%RateChange = 4.d0 ![stk/min2 ??] !??????? motaghayere voroudi
+ PUMP(1)%Mech_Efficiency = PumpsSpecification%MudPump1MechanicalEfficiency ![dimensionless]
+ !PUMP(1)%Vol_Efficiency = MudPump1VolumetricEfficiency !bayad hazf beshe ?
+ PUMP(1)%Max_Pressure = 600.d0 ![psi] !??????? motaghayere voroudi
+ PUMP(1)%MaxSPM = PumpsSpecification%MudPump1Maximum ![spm]
+ PUMP(1)%Trans_Ratio = 965.d0/PUMP(1)%MaxSPM
+ PUMP(1)%time_step = 0.1d0 !?????? niaz hast ya na??
+
+ PUMP(1)%RateChange = 193.d0!PUMP(1)%RateChange*PUMP(1)%Trans_Ratio ! [rpm/min ??] ??????????????? rpm/s
PUMP(1)%K_throttle = 0
- Pumps_IsStopped = .false.
- PUMP(1)%N_old = 0.e0
+ PUMP(1)%N_old = 0.d0
Call Pump_OffMode_Solver(1)
-!!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<<
- !PUMP(2)%Stroke_Length = MudPump2Stroke
- !PUMP(2)%Piston_Diameter = MudPump2LinerDiameter
- !PUMP(2)%Piston_Area = pi*PUMP(2)%Piston_Diameter*PUMP(2)%Piston_Diameter/4.
- !PUMP(2)%Mech_Efficiency = MudPump2MechanicalEfficiency
- !PUMP(2)%Vol_Efficiency = MudPump2VolumetricEfficiency
- !PUMP(2)%Max_Horsepower = MudPump2
- !PUMP(2)%Inertia_Moment = 23.261341 ! 23.261341 [kg.m^2] = 552 [lb.ft^2]
- !PUMP(2)%J_coef = PUMP(2)%Inertia_Moment+(4.*(PUMP(2)%Inertia_Moment))
- !PUMP(2)%Trans_Ratio = 965.0/MudPump2Maximum
- !PUMP(2)%time_step = .10
- !
- !PUMP(2)%Flow_Rate = 0.
- !Call Pump2_OffMode_Solver(2)
+!>>>>>>>>>>>>>>>>>>>>>>> PUMP 2 <<<<<<<<<<<<<<<<<<<<<<<<<<<
+ PUMP(2)%FlowRatePerSTK = 7000.d0 ![bbl] !??????? motaghayere voroudi
+ !PUMP(2)%FlowRatePerSTK = PUMP(2)%FlowRatePerSTK*0.0292d0 ![gpm]
+ PUMP(2)%RateChange = 4.d0 ![stk/min2 ??] !??????? motaghayere voroudi
+ PUMP(2)%Mech_Efficiency = PumpsSpecification%MudPump2MechanicalEfficiency ![dimensionless]
+ !PUMP(2)%Vol_Efficiency = MudPump2VolumetricEfficiency !bayad hazf beshe ?
+ PUMP(2)%Max_Pressure = 600.d0 ![psi] !??????? motaghayere voroudi
+ PUMP(2)%MaxSPM = PumpsSpecification%MudPump2Maximum ![spm]
+ PUMP(2)%Trans_Ratio = 965.d0/PUMP(2)%MaxSPM
+ PUMP(2)%time_step = 0.1d0 !?????? niaz hast ya na??
+
+ PUMP(2)%RateChange = 193.d0!PUMP(2)%RateChange*PUMP(2)%Trans_Ratio ! [rpm/min ??] ??????????????? rpm/s
+ PUMP(2)%K_throttle = 0
+ PUMP(2)%N_old = 0.d0
+ Call Pump_OffMode_Solver(2)
!!>>>>>>>>>>>>>>>>>>>>>>> PUMP 3 <<<<<<<<<<<<<<<<<<<<<<<<<<<
- !PUMP(3)%Stroke_Length = CementPumpStroke
- !PUMP(3)%Piston_Diameter = CementPumpLinerDiameter
- !PUMP(3)%Piston_Area = pi*PUMP(3)%Piston_Diameter*PUMP(3)%Piston_Diameter/4.
- !PUMP(3)%Mech_Efficiency = CementPumpMechanicalEfficiency
- !PUMP(3)%Vol_Efficiency = CementPumpVolumetricEfficiency
- !PUMP(3)%Max_Horsepower = CementPump
- !PUMP(3)%Inertia_Moment = 23.261341 ! 23.261341 [kg.m^2] = 552 [lb.ft^2]
- !PUMP(3)%Trans_Ratio = 965.0/CementPumpMaximum
- !PUMP(3)%time_step = .10
- !
- !PUMP(3)%Flow_Rate = 0.
- !Call Pump3_OffMode_Solver
+ PUMP(3)%FlowRatePerSTK = 7000.d0 ![bbl] !??????? motaghayere voroudi
+ !PUMP(3)%FlowRatePerSTK = PUMP(3)%FlowRatePerSTK*0.0292d0 ![gpm]
+ PUMP(3)%RateChange = 4.d0 ![stk/min2 ??] !??????? motaghayere voroudi
+ PUMP(3)%Mech_Efficiency = PumpsSpecification%CementPumpMechanicalEfficiency ![dimensionless]
+ !PUMP(3)%Vol_Efficiency = CementPumpVolumetricEfficiency !bayad hazf beshe ?
+ PUMP(3)%Max_Pressure = 600.d0 ![psi] !??????? motaghayere voroudi
+ PUMP(3)%MaxSPM = PumpsSpecification%CementPumpMaximum ![spm]
+ PUMP(3)%Trans_Ratio = 965.d0/PUMP(3)%MaxSPM
+ PUMP(3)%time_step = 0.1d0 !?????? niaz hast ya na??
+
+ PUMP(3)%RateChange = 193.d0!PUMP(3)%RateChange*PUMP(3)%Trans_Ratio ! [rpm/min ??] ??????????????? rpm/s
+ PUMP(3)%K_throttle = 0
+ PUMP(3)%N_old = 0.d0
+ Call Pump_OffMode_Solver(3)
diff --git a/Equipments/Pumps/Pumps_TotalSolver.f90 b/Equipments/Pumps/Pumps_TotalSolver.f90
new file mode 100644
index 0000000..cfaa29a
--- /dev/null
+++ b/Equipments/Pumps/Pumps_TotalSolver.f90
@@ -0,0 +1,14 @@
+subroutine Pumps_TotalSolver
+
+ Use Pumps_VARIABLES
+
+ Implicit none
+
+
+
+ MPumps%Total_Pump_Gpm = PUMP(1)%Flow_Rate+PUMP(2)%Flow_Rate+PUMP(3)%Flow_Rate ![gpm]
+ MPumps%Total_Pump_SPM = (PUMP(1)%Speed/PUMP(1)%Trans_Ratio)+(PUMP(2)%Speed/PUMP(2)%Trans_Ratio)+(PUMP(3)%Speed/PUMP(3)%Trans_Ratio) ![stk/min]
+
+
+
+end subroutine Pumps_TotalSolver
\ No newline at end of file
diff --git a/Equipments/Pumps/Pumps_VARIABLES.f90 b/Equipments/Pumps/Pumps_VARIABLES.f90
index 65123c0..81bb5b6 100644
--- a/Equipments/Pumps/Pumps_VARIABLES.f90
+++ b/Equipments/Pumps/Pumps_VARIABLES.f90
@@ -2,12 +2,17 @@ MODULE Pumps_VARIABLES
IMPLICIT NONE
PUBLIC
- REAL , PARAMETER :: pi=3.14159265e0
- Logical :: Pumps_IsStopped
- Type, public:: Pumps_Type
+
+
+
+
+ REAL , PARAMETER :: pi=3.14159265d0
+
+
+ Type, public:: Pumps_Var
REAL :: Total_Pump_GPM, Total_Pump_SPM, Total_Stroke_Counter_For_Plot
- end Type Pumps_Type
- Type(Pumps_Type)::total_pumps
+ end Type Pumps_Var
+ Type(Pumps_Var) :: MPumps
@@ -20,15 +25,16 @@ MODULE Pumps_VARIABLES
INTEGER :: PowerFailMalf , BlowPopOffMalf , SPMGaugeMalf , Failure
REAL :: Throttle, RateChange
- REAL :: Stroke_Length, Piston_Area, Piston_Diameter, Inertia_Moment
REAL :: Mech_Efficiency, Vol_Efficiency, Trans_Ratio
REAL :: StandPipe_Pressure , Max_Pressure
- REAL :: Torque, Speed, N_new, N_old, MaxSPM
- REAL :: Flow_Rate, Hydraulic_HorsePower, Max_Horsepower, FlowRatePerSTK, Max_FlowRate
- REAL :: simulation_time, time_step
+ REAL :: Speed, N_new, N_old, MaxSPM
+ REAL :: Flow_Rate, Hydraulic_HorsePower, Max_Horsepower, FlowRatePerSTK, Max_FlowRate, HorsePower
+ REAL :: time_step
+
+
- REAL(8) :: START_TIME, END_TIME
- INTEGER :: INT_CPU_TIME, Dt_ref
+ INTEGER :: BLWR ! 1=On , 0=Off
+ INTEGER :: Open_Close ! 1=Open , 0=Close
!************* Sound_VARIABLES **********************
INTEGER :: SoundSPM
diff --git a/Equipments/RotaryTable/Rtable_MainSolver.f90 b/Equipments/RotaryTable/Rtable_MainSolver.f90
index 57afff9..d9bc76b 100644
--- a/Equipments/RotaryTable/Rtable_MainSolver.f90
+++ b/Equipments/RotaryTable/Rtable_MainSolver.f90
@@ -10,7 +10,7 @@ subroutine Rtable_MainSolver
IMPLICIT NONE
-
+
! if (IsPortable) then
! RTable%AssignmentSwitch = 1
! else
@@ -26,7 +26,7 @@ subroutine Rtable_MainSolver
RTable%SoundBlower = .true.
Call SetSoundBlowerRT(RTable%SoundBlower)
DrillingConsole%RTBLWR = 1
-
+
IF ( DrillingConsole%RTTransmissionLever /=0 .and. RotaryGearsAbuse==0 ) THEN !be in clutch mode ??????
RTable%N_new = DrillingConsole%RTThrottle
diff --git a/SimulationCore2.v12.suo b/SimulationCore2.v12.suo
index d3e12ca..c07c86a 100644
Binary files a/SimulationCore2.v12.suo and b/SimulationCore2.v12.suo differ
diff --git a/SimulationCore2.vfproj b/SimulationCore2.vfproj
index 832c976..76193a2 100644
--- a/SimulationCore2.vfproj
+++ b/SimulationCore2.vfproj
@@ -301,11 +301,15 @@
+
+
+
+