subroutine Kick_Influx ! is called in subroutine CirculationCodeSelect Use GeoElements_FluidModule USE CMudPropertiesVariables USE MudSystemVARIABLES USE Pumps_VARIABLES use CDrillWatchVariables !use CTanksVariables, TripTankVolume2 => DrillingWatch%TripTankVolume, TripTankDensity2 => TripTankDensity USE sROP_Other_Variables USE sROP_Variables use KickVARIABLESModule implicit none !===========================================================WELL============================================================ !===========================================================WELL============================================================ !write(*,*) 'Kick Influx' !=================== Bottom Hole Kick Influx ENTRANCE(due to Kick) =================== MudSystem%Kick_Density= 2 MudSystem%NewInflux_Density= MudSystem%Kick_Density if ( MudSystem%NewInfluxElementCreated==0 ) then ! new kick is pumped- (it is set to zero in sheykh subroutine after a new kick influx) call MudSystem%Op_Density%AddToFirst (MudSystem%NewInflux_Density) call MudSystem%Op_MudDischarged_Volume%AddToFirst (0.0d0) call MudSystem%Op_Mud_Forehead_X%AddToFirst (MudSystem%Xstart_OpSection(1)) call MudSystem%Op_Mud_Forehead_section%AddToFirst (1) call MudSystem%Op_Mud_Backhead_X%AddToFirst (MudSystem%Xstart_OpSection(1)) call MudSystem%Op_Mud_Backhead_section%AddToFirst (1) call MudSystem%Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call MudSystem%Op_MudOrKick%AddToFirst (MudSystem%NewInfluxNumber) ! KickNumber= NewInfluxNumber MudSystem%NewInfluxElementCreated= 1 endif MudSystem%Op_MudDischarged_Volume%Array(1)= MudSystem%Op_MudDischarged_Volume%Array(1)+ ((GasKickPumpFlowRate/60.0d0)*MudSystem%DeltaT_Mudline) !(gal) due to KickFlux !write(*,*) 'kick volume ok=' , Op_MudDischarged_Volume%Array(1) end subroutine Kick_Influx subroutine Instructor_CirculationMud_Edit ! is called in subroutine CirculationCodeSelect use KickVARIABLESModule Use MudSystemVARIABLES USE TD_DrillStemComponents Use CUnityInputs Use CUnityOutputs USE CKellyConnectionEnumVariables use UTUBEVARSModule use sROP_Variables use sROP_Other_Variables use CDownHoleVariables implicit none if ( DownHole%AnnDrillMud == .true. .and. (ROP_Bit%RateOfPenetration>0. .and. MudSystem%DeltaVolumeOp>0.0) ) then do imud= 1, MudSystem%Ann_Density%Length() if ( MudSystem%Ann_MudOrKick%Array(imud) == 0 ) then MudSystem%Ann_Density%Array(imud)= (MudSystem%St_Density%Last() * MudSystem%AnnulusFlowRate + 141.4296E-4*ROP_Bit%RateOfPenetration*ROP_Spec%DiameterOfBit**2)/(MudSystem%AnnulusFlowRate+6.7995E-4*ROP_Bit%RateOfPenetration*ROP_Spec%DiameterOfBit**2) MudSystem%Ann_CuttingMud%Array(imud)= 1 endif enddo endif if ( DownHole%AnnCirculateMud == .true. ) then do imud= 1, MudSystem%Ann_Density%Length() if ( MudSystem%Ann_MudOrKick%Array(imud) == 0 ) then MudSystem%Ann_Density%Array(imud)= MudSystem%ActiveTankDensity MudSystem%Ann_CuttingMud%Array(imud)= 0 endif enddo do imud= 1, MudSystem%St_Density%Length() MudSystem%St_Density%Array(imud)= MudSystem%ActiveTankDensity enddo endif end subroutine Instructor_CirculationMud_Edit subroutine ShoeLostSub ! is called in subroutine CirculationCodeSelect use KickVARIABLESModule Use MudSystemVARIABLES USE TD_DrillStemComponents Use CUnityInputs Use CUnityOutputs USE CKellyConnectionEnumVariables use UTUBEVARSModule use sROP_Variables use sROP_Other_Variables use CDownHoleVariables use CShoeVariables use PressureDisplayVARIABLESModule Use CWarningsVariables implicit none MudSystem%ShoeLost= .false. MudSystem%Kickexpansion_DueToMudLost= .false. MudSystem%ShoeMudPressure= PressureGauges(5) MudSystem%UGBOSuccessionCounter = MudSystem%UGBOSuccessionCounter + 1 !write(*,*) 'check point 1' if (Shoe%InactiveFracture == .FALSE. .AND. ((MudSystem%ShoeMudPressure >= MudSystem%FormationLostPressure) .or. MudSystem%ShoeFractured )) then !write(*,*) 'check point 2 ,UGBOSuccessionCounter' , UGBOSuccessionCounter ! if ShoeFractured changed to true , then time counter is not needed more if ( MudSystem%UGBOSuccessionCounter /= MudSystem%UGBOSuccessionCounterOld+1 .and. MudSystem%ShoeFractured==.false. ) then MudSystem%UGBOSuccessionCounter = 0 ! also in starup MudSystem%UGBOSuccessionCounterOld = 0 ! also in starup return else MudSystem%UGBOSuccessionCounterOld= MudSystem%UGBOSuccessionCounter endif if ( MudSystem%UGBOSuccessionCounter < 10 .and. MudSystem%ShoeFractured==.false.) then return endif !write(*,*) 'check point 3 ,UGBOSuccessionCounter' , UGBOSuccessionCounter MudSystem%ShoeFractured= .true. MudSystem%ShoeMudViscosity= MAX(MudSystem%ShoeMudViscosity, 12.d0) !write(*,*) 'ShoeMudDensity , ShoeMudViscosity' , ShoeMudDensity , ShoeMudViscosity MudSystem%ShoeLostCoef = 10.**(-8) * 1.15741d0 * 7.08d0 * 1000000.d0 * 1.d0 * MudSystem%ShoeMudDensity / & (MudSystem%ShoeMudViscosity * LOG(10000.d0)) !write(*,*) 'lost parameters 1' , ShoeMudPressure , FormationLostPressure MudSystem%Qlost = MAX( (MudSystem%ShoeLostCoef * (MudSystem%ShoeMudPressure - (MudSystem%FormationLostPressure/2.0))) , 0.d0 ) if (MudSystem%Qlost > 0.0) then MudSystem%ShoeLost= .true. else MudSystem%ShoeLost= .false. endif !write(*,*) 'Qlost=' , Qlost, ShoeMudPressure, FormationLostPressure call Activate_UndergroundBlowout() do imud= 1, MudSystem%Ann_Mud_Forehead_X%Length() IF ( MudSystem%ShoeLost .and. Shoe%ShoeDepth < MudSystem%Ann_Mud_Backhead_X%Array(imud) .and. Shoe%ShoeDepth >= MudSystem%Ann_Mud_Forehead_X%Array(imud) & .and. MudSystem%Ann_MudOrKick%Array(imud) == 0 .and. MudSystem%WellHeadIsOpen == .FALSE. ) then MudSystem%Kickexpansion_DueToMudLost= .true. write(*,*) 'Kickexpansion_DueToMudLost' EXIT ENDIF enddo endif if (Warmings%UndergroundBlowout == .false.) MudSystem%ShoeLost= .false. end subroutine ShoeLostSub