SUBROUTINE NormalCirculation_StartUp() ! is called in module FluidFlowMain USE MudSystemVARIABLES use CTanksVariables USE CMudPropertiesVariables Use GeoElements_FluidModule Use KickVariables Use CUnityOutputs Use CShoeVariables USE Pumps_VARIABLES implicit none ! temporary varibales for solving pressure jerks -- 1399-11-09 !Pump1BlownInTimeStep = 0 !Pump2BlownInTimeStep = 0 !Pump3BlownInTimeStep = 0 !Pump1BlownStarted = .FALSE. !Pump2BlownStarted = .FALSE. !Pump3BlownStarted = .FALSE. MudSystemDotPump1BlownCount = 0 MudSystemDotPump2BlownCount = 0 MudSystemDotPump3BlownCount = 0 MudSystemDotDeltaWellCap=0. MudSystemDotWellCapOld = 0. MudSystemDotAnnCapOld=0. MudSystemDotDeltaAnnCap=0. MPumps%Total_Stroke_Counter_For_Plot = 0.0 DeltaT_Mudline=0.1 !second Call Set_FlowKellyDisconnect(.false.) Call Set_FlowPipeDisconnect(.false.) !HZ_ADD= 0.d0 MudSystemDotFlow_timeCounter= 0 MudSystemDotMudSys_timeCounter= 0 MudSystemDotFluidFlowCounter = 0 !======================================================================== ! MUD CIRCULATION STARTUP !======================================================================== MudSystemDotFormationLostPressure= Shoe%LeakOff * Shoe%ShoeDepth MudSystemDotShoeFractured= .false. MudSystemDotUGBOSuccessionCounter = 0 ! also in starup MudSystemDotUGBOSuccessionCounterOld = 0 ! also in starup MudSystemDotChokeLineFlowRate= 0.0 MudSystemDotStringFlowRate= 0.0 MudSystemDotAnnulusFlowRate= 0.0 MudVolume_InjectedFromAnn= 0.D0 MudSystemDotMudVolume_InjectedToBH= 0.D0 MudSystemDotDensityMixTol= 0.1 !(ppg) MudSystemDotCuttingDensityMixTol= 0.5 MudSystemDotNewPipeFilling= 1 MudSystemDotUtubeFilling= 1 MudSystemDotUtubeEmptyVolume= 0.0 MudSystemDotUtubeMode1Activated= .false. MudSystemDotUtubeMode2Activated= .false. MudSystemDotUtubePossibility= .false. !KickMigration_2SideBit = .FALSE. MudSystemDotKickDx= (Reservoir%AutoMigrationRate/3600.)*DeltaT_Mudline !AutoMigrationRate (ft/h)= ft per DeltaT_Mudline MudSystemDotNewInfluxElementCreated= 0 MudSystemDotNewInfluxNumber= 0 !KickVolumeinAnnulus= 0.0 MudSystemDotKickDeltaVinAnnulus= 0.0 GasKickPumpFlowRate= 0.0 MudSystemDotFirstMudSet= 0 MudSystemDotFirstSetUtube1=0 MudSystemDotFirstSetUtube2=0 MudSystemDotSuctionMud=1 MudSystemDotImudCount= 1 MudSystemDotimud=1 MudSystemDotiLoc= 1 ! for Kick Suction_Density_MudSystem= MudProperties%ActiveDensity SuctionDensity_Old= MudProperties%ActiveDensity ! initial(ppg) StringDensity_Old= MudProperties%ActiveDensity ! initial(ppg) AnnulusSuctionDensity_Old= MudProperties%ActiveDensity ! initial(ppg) ChokeLineDensity_Old= MudProperties%ActiveDensity ! initial(ppg) MudSystemDotTotalAddedVolume= 0. MudSystemDotxx=0. END SUBROUTINE NormalCirculation_StartUp SUBROUTINE MudSystem_StartUp() USE CMudPropertiesVariables USE MudSystemVARIABLES USE CDataDisplayConsoleVariables USE CHOKEVARIABLES USE Pumps_VARIABLES USE CBopStackVariables USE CPumpsVariables use CTanksVariables USE KickVariables implicit none CALL MUDLINE_LOSS_INPUTS() !MPumps%Total_Pump_GPM=10. ! Initial Value MUD%Q=0. ! Initial Value Q_flow32=0. Q_flow33=0. Q_flow34=0. Q_flow35=0. DeltaT_Mudline=0.1 !second GasKickPumpFlowRate= 0. BellNippleVolume= 0. BellNippleDensity= 0. MudBucketVolume= 0. MudBucketDensity= 0. BellNippleDumpVolume= 0. !BellNippleDumpRate= 0. !BellNippleToPitsRate= 0.0 MudChecked= .true. condition32Final= .TRUE. condition33Final= .TRUE. condition34Final= .TRUE. PressureGauge75= 0.0 PressureGauge76 = 0.0 !!====================================================================== !! TRIP TANK !!====================================================================== TripTank_MinVol_Allowded= 50.*42. !(bbl to gal, initial value) TripTank_MaxVol_Allowded= 50. *42. !(bbl to gal, initial value) ActiveTankFloorArea= (MudProperties%ActiveTotalTankCapacityGal) / (7.48051948*100./12.) ! (ft^2) - Tank Height= 100 inch , 12=inch to ft 7.48051948=gal to ft^3 TripTankFloorArea= (50.*42.) / (7.48051948*100./12.) ! (ft^2) - 50.*42.=Trip Tank Capacity in BBl*42= Gal , Tank Height= 100 inch , 12=inch to ft 7.48051948=gal to ft^3 TripTank_Vol= MudProperties%InitialTripTankMudVolumeGal !(gal) TripTank_Dens= 1. DataDisplayConsole%TripTankGauge=0. ReturnToTrip_Q= 1. ActiveToTrip_Q= 1. TripTankPump_Q= .8 ReturnToTrip_Dens=1.0 ! ppg(lbm/gal) ActiveToTrip_Dens=1.0 !!====================================================================== !! MUD VOLUME TOTALIZER !!====================================================================== Mp1Density= 0.0 !(VALVE82) Mp2Density= 0.0 !(VALVE83) Mp3Density= 0.0 !(VALVE84) ReserveTankVolume= MudProperties%ReserveMudVolumeGal ! initial volume (gal) ReserveTankDensity= MudProperties%ReserveDensity ! initial CementTankVolumeCalc= Tank%CementTankVolume !movaghat--- initial volume (gal) CementTankDensityCalc= Tank%CementTankDensity !movaghat--- initial PumpsDumpVolume=0.0 PumpsDumpFlowRate= 0.0 ActiveTankVolume= MudProperties%ActiveMudVolumeGal ! initial volume (gal) RefrencePitVolume= ActiveTankVolume/42. !(bbl) RefrencePitVolume_DrillWatch= ActiveTankVolume/42. !(bbl) MVT_MinVol_Allowded= 0. MVT_MaxVol_Allowded= 0. MudTank1_vol= MudProperties%ActiveMudVolumeGal/3. ! (gal) MudTank2_vol= MudProperties%ActiveMudVolumeGal/3. ! (gal) MudTank3_vol= MudProperties%ActiveMudVolumeGal/3. ! (gal) ActiveTankSettled= MudProperties%ActiveSettledContentsGal ! (gal) MudTank4_vol= MudProperties%InitialTripTankMudVolumeGal ! (gal) TripTankVolumeCalc= MudProperties%InitialTripTankMudVolumeGal ! initial volume (gal) ActiveTankDensity= MudProperties%ActiveDensity ! initial(ppg) TripTankDensityCalc= Tank%TripTankDensity ! initial(ppg) ChokeManifoldDumpVolume= 0.0 PitGainLossZero= 0. PitGainLossZero_Old= PitGainLossZero MVTCoarseKnob_Old= DataDisplayConsole%MVTCoarseKnob MVTFineKnob_Old= DataDisplayConsole%MVTFineKnob FirstSet_Time= .true. PedalMeter= MudProperties%PedalFlowMeter !1600. !(gpm) ReturnFlowRate=0. TotalStrokes1MFFI =0. TotalStrokes2MFFI =0. TotalStrokesPump1=0. TotalStrokesPump2=0. GraphTotalStrokes=0. Choke%TotalStrokes1 =0. Choke%TotalStrokes2 =0. end SUBROUTINE MUDLINE_LOSS_INPUTS() USE MudSystemVARIABLES USE CBopStackVariables USE CPumpsVariables implicit none INTEGER I !=========================================================================== ! MUDLINE MINOR LOSSES INPUT !=========================================================================== NO_MudMinors=4 ALLOCATE (MudMinors(NO_MudMinors,4)) ! ID(INCH) LF CV NOTE(BAR) DESCRIPTION MudMinors(1,1)= PumpsSpecification%MudPump1Output MudMinors(1,2:4)= (/1.5*8., 0., 0./) !elbow (MLnumber=1,,PumpsToString) MudMinors(2,1)= PumpsSpecification%MudPump1Output MudMinors(2,2:4)= (/1.5*6., 0., 0./) !elbow (MLnumber=2,,STGaugeToString) MudMinors(3,1:4)= (/0., 0., 0., 0./) !elbow (MLnumber=3,,WellToPits) MudMinors(4,1)= BopStackSpecification%ChokeLineId MudMinors(4,2:4)= (/1.5*7., 0., 0./) !elbow (MLnumber=4,,WellToChokeManifold) ALLOCATE (MINORDIAMETER_MUDLINE(NO_MudMinors),AREAMINOR_MUDLINE(NO_MudMinors),LF_MUDLINE(NO_MudMinors),CV_MUDLINE(NO_MudMinors) & ,NOTE_MUDLINE(NO_MudMinors)) DO I=1,NO_MudMinors MINORDIAMETER_MUDLINE(I)=MudMinors(I,1) LF_MUDLINE(I)=MudMinors(I,2) CV_MUDLINE(I)=MudMinors(I,3) NOTE_MUDLINE(I)=MudMinors(I,4) AREAMINOR_MUDLINE(I)=PII*(MINORDIAMETER_MUDLINE(I)*0.0254)**2/4. !D(in), AREA(m^2) ENDDO !=========================================================================== ! MUDLINE PIPNING LOSSES INPUT !=========================================================================== NO_PIPINGSMUDLINE=4 ALLOCATE (PIPINGS_MUDLINE(NO_PIPINGSMUDLINE,3)) ! ID(INCH) L(FEET) ROUGHNESS(MM)=e DESCRIPTION PIPINGS_MUDLINE(1,1)= PumpsSpecification%MudPump1Output PIPINGS_MUDLINE(1,2:3)= (/265., 0.03/) !(MLnumber=1,,PumpsToString) PIPINGS_MUDLINE(2,1)= PumpsSpecification%MudPump1Output PIPINGS_MUDLINE(2,2:3)= (/100., 0.03/) !(MLnumber=2,,STGaugeToString) PIPINGS_MUDLINE(3,1:3)= (/0., 0., 0./) !(MLnumber=3,,WellToPits) PIPINGS_MUDLINE(4,1)= BopStackSpecification%ChokeLineId PIPINGS_MUDLINE(4,2)= BopStackSpecification%ChokeLineLength PIPINGS_MUDLINE(4,3)= 0.03 !(MLnumber=4,,WellToChokeManifold) MudSystemDotArea_ChokeLineFt= PII*((BopStackSpecification%ChokeLineId/12.)**2)/4. !D(in), AREA(ft^2) MudSystemDotChokeLine_VolumeCapacity= MudSystemDotArea_ChokeLineFt* BopStackSpecification%ChokeLineLength* 7.48051948 ! (gal) ALLOCATE (DIAM_MUDLINE_INCH(NO_PIPINGSMUDLINE), & AREA_MUDLINE(NO_PIPINGSMUDLINE),LENGT_MUDLINE(NO_PIPINGSMUDLINE),ROUGHNESS_MUDLINE(NO_PIPINGSMUDLINE),RELROUGH_MUDLINE(NO_PIPINGSMUDLINE)) DO I=1,NO_PIPINGSMUDLINE DIAM_MUDLINE_INCH(I)=PIPINGS_MUDLINE(I,1) LENGT_MUDLINE(I)=PIPINGS_MUDLINE(I,2) ROUGHNESS_MUDLINE(I)=PIPINGS_MUDLINE(I,3) AREA_MUDLINE(I)=PII*(DIAM_MUDLINE_INCH(I)*0.0254)**2/4 !D(in), AREA(m^2) RELROUGH_MUDLINE(I)=ROUGHNESS_MUDLINE(I)/(DIAM_MUDLINE_INCH(I)*25.4) !e/D !DIAM_MUDLINE_MM(I)=DIAM_MUDLINE_MM(I)*.001 ! (m) LENGT_MUDLINE(I)=LENGT_MUDLINE(I)*.3048 ! (m) ENDDO !=========================================================================== ! MUDLINE STATIC LOSSES INPUT !=========================================================================== ! Height are in (meter) Pumps_Height= 0. STpipeGauge_Height= 2. !(m) Pits_Height= 1. !(m) ChokeManifold_Height= 1.*0.3048 !(ft to meter) WellChokeExit_Height= BopStackSpecification%GroundLevel-BopStackSpecification%KillHeight END SUBROUTINE MUDLINE_LOSSES(MLnumber) USE MudSystemVARIABLES implicit none integer I INTEGER MLnumber !===============================PIPE LOSS=================================== MUD(MLnumber)%Re_MUDline=MUD(MLnumber)%Q*6.30902e-5*DIAM_MUDLINE_INCH(MLnumber)*0.0254/(AREA_MUDLINE(MLnumber)*MUD(MLnumber)%nu) !<<<<<< nu: DOROST SHAVAD.ALAN DAR STARTUP SET SHODE !write(*,*) 'MUD(MLnumber)%Re_MUDline=' , MUD(MLnumber)%Re_MUDline ! Q*6.30902e-5 for (gpm) to (m^3/sec) if ( MUD(MLnumber)%Re_MUDline