From e2a2ba7f4105d0f1d8f4ead6e32657960c924fc9 Mon Sep 17 00:00:00 2001 From: tarmigh Date: Sun, 30 Apr 2023 23:35:57 -0700 Subject: [PATCH] Pump module data structures added --- .../Kick_Expansion_and_Contraction.f90 | 2 +- Equipments/MudSystem/Kick_Migration.f90 | 2 +- Equipments/MudSystem/MudSystem.f90 | 4 +- Equipments/MudSystem/MudSystemStartup.f90 | 4 +- Equipments/Pumps/Pump1_MainSolver.f90 | 45 +++----- Equipments/Pumps/Pump2_MainSolver.f90 | 57 ++++++++++ Equipments/Pumps/Pump3_MainSolver.f90 | 41 +++++++ Equipments/Pumps/Pump_OffMode_Solver.f90 | 76 ++++++------- Equipments/Pumps/Pump_OnMode_Solver.f90 | 61 ++++------ Equipments/Pumps/PumpsMain.f90 | 75 +++++------- Equipments/Pumps/Pumps_Inputs.f90 | 107 +++++++++++++----- Equipments/Pumps/Pumps_MainSolver.f90 | 28 +++++ Equipments/Pumps/Pumps_Outputs.f90 | 101 ++++++++++++----- Equipments/Pumps/Pumps_StartUp.f90 | 93 +++++++-------- Equipments/Pumps/Pumps_TotalSolver.f90 | 14 +++ Equipments/Pumps/Pumps_VARIABLES.f90 | 28 +++-- Equipments/RotaryTable/Rtable_MainSolver.f90 | 4 +- SimulationCore2.v12.suo | Bin 16384 -> 53248 bytes SimulationCore2.vfproj | 4 + 19 files changed, 465 insertions(+), 281 deletions(-) create mode 100644 Equipments/Pumps/Pump2_MainSolver.f90 create mode 100644 Equipments/Pumps/Pump3_MainSolver.f90 create mode 100644 Equipments/Pumps/Pumps_MainSolver.f90 create mode 100644 Equipments/Pumps/Pumps_TotalSolver.f90 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 d3e12caad4d6479b1061140d5cc0dad115d1f21d..c07c86adfcbe48847f3f6a9f24f35ae4ad0be5e2 100644 GIT binary patch literal 53248 zcmeHQeRNyJm6t=HKp;Q}X`m3C5Woa%{FTHBX~4D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