subroutine Kick_Migration ! 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 CReservoirVariables use KickVARIABLESModule implicit none integer jelement, jmud, jsection,ielement,i,kickNumber integer jopelement,jopmud,jopsection,CuttingValue !MUD(2)%Q= MPumps%Total_Pump_GPM !MudSystem%StringFlowRate= MUD(2)%Q !MudSystem%AnnulusFlowRate= MUD(2)%Q ! !if (NewPipeFilling == 0) then ! MudSystem%StringFlowRate= 0. ! MudSystem%AnnulusFlowRate= 0. !endif !StringFlowRateFinal= MudSystem%StringFlowRate !AnnulusFlowRateFinal= MudSystem%AnnulusFlowRate !write(*,*) 'MUD(2)%Q=====' , MUD(2)%Q !write(*,*) 'Kick Migration,NewInfluxNumber:' , NewInfluxNumber !FirstSetKickMigration !write(*,*) 'NewInfluxNumber=' , NewInfluxNumber DO KickNumber= MudSystem%NewInfluxNumber-NoGasPocket+1 , MudSystem%NewInfluxNumber !write(*,*) 'KickNumber=' , KickNumber if (KickFlux .AND. NOT(KickOffBottom) .and. KickNumber == MudSystem%NewInfluxNumber) cycle if ( KickNumber == MudSystem%Ann_MudOrKick%Last() ) cycle ! when the last element in Annulus is kick, Migration is not called !write(*,*) 'Migration will be done for,KickNumber=' ,KickNumber !=================== Bottom Hole ENTRANCE(due to Kick) =================== !KickDx= (AutoMigrationRate/60.)*DeltaT_Mudline !3600 (ft/min)= 6 ft set in start up MudSystem%Op_KickLoc= 0 MudSystem%Ann_KickLoc= 0 MudSystem%ChokeLine_KickLoc= 0 do i = 1, MudSystem%Op_MudOrKick%Length () if (MudSystem%Op_MudOrKick%Array(i) == KickNumber) then MudSystem%Op_KickLoc = i exit endif end do do i = 1, MudSystem%Ann_MudOrKick%Length () if (MudSystem%Ann_MudOrKick%Array(i) == KickNumber) then MudSystem%Ann_KickLoc = i exit endif end do do i = 1, MudSystem%ChokeLine_MudOrKick%Length () if (MudSystem%ChokeLine_MudOrKick%Array(i) == KickNumber) then MudSystem%ChokeLine_KickLoc = i exit endif end do !write(*,*) 'Op_KickLoc=' , Op_KickLoc !write(*,*) 'Ann_KickLoc=' , Ann_KickLoc !!write(*,*) 'ChokeLine_KickLoc=' , ChokeLine_KickLoc ! ! !write(*,*) 'Op_MudOrKick%Length ()=' , Op_MudOrKick%Length () ! ! !============================== foreheade kick be mate reside bashad *3 ============================== if (MudSystem%Op_KickLoc == MudSystem%Op_MudOrKick%Length () .and. MudSystem%Ann_KickLoc==0 ) then !write(*,*) '****3' MudSystem%iLoc= 2 MudSystem%KickDv= MudSystem%Area_OpSectionFt(MudSystem%Op_Mud_Forehead_section%Array(MudSystem%Op_KickLoc)) * MudSystem%KickDx * 7.48051948d0 ! ft^3 to gal MudSystem%MinKickDv= min( MudSystem%KickDv,MudSystem%Ann_MudDischarged_Volume%Array (1), MudSystem%Op_MudDischarged_Volume%Last () ) MudSystem%NewDensity= MudSystem%Ann_Density%Array (1) MudSystem%NewVolume= MudSystem%MinKickDv if ( MudSystem%MinKickDv == MudSystem%KickDv ) then !eleman bala sari baghi mimund, paeeni(kick) ham baghi mimund MudSystem%Ann_MudDischarged_Volume%Array (1)= MudSystem%Ann_MudDischarged_Volume%Array (1) - MudSystem%MinKickDv call MudSystem%Ann_Density%AddToFirst (MudSystem%Op_Density%Last()) call MudSystem%Ann_MudDischarged_Volume%AddToFirst (MudSystem%MinKickDv) call MudSystem%Ann_Mud_Forehead_X%AddToFirst (MudSystem%Xstart_PipeSection(F_Counts%StringIntervalCounts+1)) call MudSystem%Ann_Mud_Forehead_section%AddToFirst (F_Counts%StringIntervalCounts+1) call MudSystem%Ann_Mud_Backhead_X%AddToFirst (MudSystem%Xstart_PipeSection(F_Counts%StringIntervalCounts+1)) call MudSystem%Ann_Mud_Backhead_section%AddToFirst (F_Counts%StringIntervalCounts+1) call MudSystem%Ann_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call MudSystem%Ann_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call MudSystem%Ann_MudOrKick%AddToFirst (KickNumber) call MudSystem%Ann_CuttingMud%AddToFirst (0) MudSystem%Op_MudDischarged_Volume%Array (MudSystem%Op_KickLoc)= MudSystem%Op_MudDischarged_Volume%Array (MudSystem%Op_KickLoc) - MudSystem%MinKickDv ! backheade kick zire mate bashad if (MudSystem%Op_KickLoc > 1) then !if ( Op_Density%Array (Op_KickLoc-1) /= MudSystem%NewDensity ) then if ( ABS(MudSystem%Op_Density%Array (MudSystem%Op_KickLoc-1) - MudSystem%NewDensity) >= MudSystem%DensityMixTol ) then MudSystem%Old_KickBackHead_X= MudSystem%Op_Mud_Backhead_X%Array (MudSystem%Op_KickLoc) MudSystem%Old_KickBackHead_Section= MudSystem%Op_Mud_Backhead_section%Array (MudSystem%Op_KickLoc) call MudSystem%Op_Density%AddTo (MudSystem%Op_KickLoc,MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddTo (MudSystem%Op_KickLoc,MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_MudOrKick%AddTo (MudSystem%Op_KickLoc,0) else !Op_Density%Array (imudKick-1) == MudSystem%NewDensity MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)= (MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)*MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewDensity*MudSystem%NewVolume)/(MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewVolume) MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)= MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1) + MudSystem%NewVolume endif else !if Op_KickLoc == 1 (*****Migration Start*****) *3-1=============================== !write(*,*) '****3-1' call MudSystem%Op_Density%AddToFirst (MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddToFirst (MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call MudSystem%Op_MudOrKick%AddToFirst (0) endif elseif ( MudSystem%MinKickDv == MudSystem%Ann_MudDischarged_Volume%Array (1) ) then ! eleman bala sari baghi nemimund MudSystem%Ann_Density%Array(1)= MudSystem%Op_Density%Last() MudSystem%Ann_MudOrKick%Array(1)= KickNumber MudSystem%Op_MudDischarged_Volume%Array (MudSystem%Op_KickLoc)= MudSystem%Op_MudDischarged_Volume%Array (MudSystem%Op_KickLoc) - MudSystem%MinKickDv ! backheade kick zire mate bashad if (MudSystem%Op_KickLoc > 1) then !if ( Op_Density%Array (Op_KickLoc-1) /= MudSystem%NewDensity ) then if ( ABS(MudSystem%Op_Density%Array (MudSystem%Op_KickLoc-1) - MudSystem%NewDensity) >= MudSystem%DensityMixTol ) then MudSystem%Old_KickBackHead_X= MudSystem%Op_Mud_Backhead_X%Array (MudSystem%Op_KickLoc) MudSystem%Old_KickBackHead_Section= MudSystem%Op_Mud_Backhead_section%Array (MudSystem%Op_KickLoc) call MudSystem%Op_Density%AddTo (MudSystem%Op_KickLoc,MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddTo (MudSystem%Op_KickLoc,MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_MudOrKick%AddTo (MudSystem%Op_KickLoc,0) else !Op_Density%Array (imudKick-1) == MudSystem%NewDensity MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)= (MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)*MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewDensity*MudSystem%NewVolume)/(MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewVolume) MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)= MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1) + MudSystem%NewVolume endif else !if Op_KickLoc == 1 (*****Migration Start*****) *3-2=============================== !write(*,*) '****3-2' call MudSystem%Op_Density%AddToFirst (MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddToFirst (MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call MudSystem%Op_MudOrKick%AddToFirst (0) endif ! elseif ( MudSystem%MinKickDv == MudSystem%Op_MudDischarged_Volume%Last () ) then ! eleman balaee baghi mimund, kick hazf mishod MudSystem%Ann_MudDischarged_Volume%Array (1)= MudSystem%Ann_MudDischarged_Volume%Array (1) - MudSystem%MinKickDv call MudSystem%Ann_Density%AddToFirst (MudSystem%Op_Density%Last()) call MudSystem%Ann_MudDischarged_Volume%AddToFirst (MudSystem%MinKickDv) call MudSystem%Ann_Mud_Forehead_X%AddToFirst (MudSystem%Xstart_PipeSection(F_Counts%StringIntervalCounts+1)) call MudSystem%Ann_Mud_Forehead_section%AddToFirst (F_Counts%StringIntervalCounts+1) call MudSystem%Ann_Mud_Backhead_X%AddToFirst (MudSystem%Xstart_PipeSection(F_Counts%StringIntervalCounts+1)) call MudSystem%Ann_Mud_Backhead_section%AddToFirst (F_Counts%StringIntervalCounts+1) call MudSystem%Ann_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call MudSystem%Ann_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call MudSystem%Ann_MudOrKick%AddToFirst (KickNumber) call MudSystem%Ann_CuttingMud%AddToFirst (0) MudSystem%Old_KickBackHead_X= MudSystem%Op_Mud_Backhead_X%Array (MudSystem%Op_KickLoc) MudSystem%Old_KickBackHead_Section= MudSystem%Op_Mud_Backhead_section%Array (MudSystem%Op_KickLoc) call MudSystem%Op_MudDischarged_Volume%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_Mud_Backhead_X%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_Mud_Backhead_section%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_Mud_Forehead_X%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_Mud_Forehead_section%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_Density%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_RemainedVolume_in_LastSection%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_EmptyVolume_inBackheadLocation%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_MudOrKick%Remove (MudSystem%Op_KickLoc) ! backheade kick zire mate bashad if (MudSystem%Op_KickLoc > 1) then !if ( Op_Density%Array (Op_KickLoc-1) /= MudSystem%NewDensity ) then if ( ABS(MudSystem%Op_Density%Array (MudSystem%Op_KickLoc-1) - MudSystem%NewDensity) >= MudSystem%DensityMixTol ) then call MudSystem%Op_Density%AddTo (MudSystem%Op_KickLoc,MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddTo (MudSystem%Op_KickLoc,MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_MudOrKick%AddTo (MudSystem%Op_KickLoc,0) else !Op_Density%Array (imudKick-1) == MudSystem%NewDensity MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)= (MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)*MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewDensity*MudSystem%NewVolume)/(MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewVolume) MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)= MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1) + MudSystem%NewVolume endif else !if Op_KickLoc == 1 (*****Migration Start*****) *3-3=============================== !write(*,*) '****3-3' call MudSystem%Op_Density%AddToFirst (MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddToFirst (MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call MudSystem%Op_MudOrKick%AddToFirst (0) endif endif endif !======================================================================================== !============================== foreheade kick be mate reside bashad *3 with pump ============================== ! if (Op_KickLoc == Op_MudOrKick%Length () .and. Ann_KickLoc==0 .and. MudSystem%AnnulusFlowRate /= 0.0 ) then ! write(*,*) '****3 with pump' ! ! KickMigration_2SideBit= .true. ! !iloc= 2 ! ! !KickDv= Area_OpSectionFt(Op_Mud_Forehead_section%Array(Op_KickLoc)) * KickDx * 7.48051948 ! ft^3 to gal ! !!farz mikonam baraye in yek iteration kick az OP hazf nemishavad va hajme aan bishtar az pump flow ast ! ! KickDv= ((MudSystem%AnnulusFlowRate/60.0d0)*DeltaT_Mudline) ! ! call Ann_Density%AddToFirst (Kick_Density) ! call Ann_MudDischarged_Volume%AddToFirst (KickDv) ! call Ann_Mud_Forehead_X%AddToFirst (Xstart_PipeSection(F_Counts%StringIntervalCounts+1)) ! call Ann_Mud_Forehead_section%AddToFirst (F_StringIntervalCounts+1) ! call Ann_Mud_Backhead_X%AddToFirst (Xstart_PipeSection(F_StringIntervalCounts+1)) ! call Ann_Mud_Backhead_section%AddToFirst (F_StringIntervalCounts+1) ! call Ann_RemainedVolume_in_LastSection%AddToFirst (0.0d0) ! call Ann_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) ! call Ann_MudOrKick%AddToFirst (KickNumber) ! call Ann_CuttingMud%AddToFirst (0) ! ! Op_MudDischarged_Volume%Array (Op_KickLoc)= Op_MudDischarged_Volume%Array (Op_KickLoc) - MinKickDv ! ! ! ! !if ( ((MudSystem%AnnulusFlowRate/60.)*DeltaT_Mudline) >= KickDv ) then ! sorate pump bishtar az kick bashad ! ! ! ! KickDv= ((MudSystem%AnnulusFlowRate/60.)*DeltaT_Mudline) ! ! ! ! ! BackHead: ! if ( Op_Density%Array (Op_KickLoc-1) /=MudSystem%St_Density%Last() ) then ! ! ! Old_KickBackHead_X= Op_Mud_Backhead_X%Array (Op_KickLoc) ! Old_KickBackHead_Section= Op_Mud_Backhead_section%Array (Op_KickLoc) ! ! call Op_Density%AddTo (Op_KickLocMudSystem%St_Density%Last()) ! call Op_MudDischarged_Volume%AddTo (Op_KickLoc,KickDv) ! call Op_Mud_Forehead_X%AddTo (Op_KickLoc,Old_KickBackHead_X) ! call Op_Mud_Forehead_section%AddTo (Op_KickLoc,Old_KickBackHead_Section) ! call Op_Mud_Backhead_X%AddTo (Op_KickLoc,Old_KickBackHead_X) ! call Op_Mud_Backhead_section%AddTo (Op_KickLoc,Old_KickBackHead_Section) ! call Op_RemainedVolume_in_LastSection%AddTo (Op_KickLoc,0.0d0) ! call Op_EmptyVolume_inBackheadLocation%AddTo (Op_KickLoc,0.0d0) ! call Op_MudOrKick%AddTo (Op_KickLoc,0) ! ! ! else !Op_Density%Array (imudKick-1) == MudSystem%NewDensity ! ! Op_MudDischarged_Volume%Array (Op_KickLoc-1)= Op_MudDischarged_Volume%Array (Op_KickLoc-1) + KickDv ! ! endif ! ! ! ! ! endif !======================================================================================== !============================= tamame kick zire mate bashad *1 ================================ if ( MudSystem%Op_KickLoc>0 .and. MudSystem%Op_KickLoc < MudSystem%Op_MudOrKick%Length () ) then !write(*,*) '****1' !iloc= 1 MudSystem%KickDv= MudSystem%Area_OpSectionFt(MudSystem%Op_Mud_Forehead_section%Array(MudSystem%Op_KickLoc)) * MudSystem%KickDx * 7.48051948d0 ! ft^3 to gal MudSystem%Old_KickBackHead_X= MudSystem%Op_Mud_Backhead_X%Array (MudSystem%Op_KickLoc) MudSystem%Old_KickBackHead_Section= MudSystem%Op_Mud_Backhead_section%Array (MudSystem%Op_KickLoc) if ( MudSystem%KickDv < MudSystem%Op_MudDischarged_Volume%Array (MudSystem%Op_KickLoc+1) ) then !eleman bala sari baghi mimund !write(*,*) 'cond 11111111111111' MudSystem%Op_MudDischarged_Volume%Array (MudSystem%Op_KickLoc+1)= MudSystem%Op_MudDischarged_Volume%Array (MudSystem%Op_KickLoc+1) - MudSystem%KickDv MudSystem%NewDensity= MudSystem%Op_Density%Array (MudSystem%Op_KickLoc+1) MudSystem%NewVolume= MudSystem%KickDv else !KickDv > Op_MudDischarged_Volume%Array (imudKick+1) eleman baghi nemimund ! write(*,*) 'cond 22222222222222222' MudSystem%KickDv= MudSystem%Op_MudDischarged_Volume%Array (MudSystem%Op_KickLoc+1) MudSystem%NewVolume= MudSystem%KickDv MudSystem%NewDensity= MudSystem%Op_Density%Array (MudSystem%Op_KickLoc+1) call MudSystem%Op_MudDischarged_Volume%Remove (MudSystem%Op_KickLoc+1) call MudSystem%Op_Mud_Backhead_X%Remove (MudSystem%Op_KickLoc+1) call MudSystem%Op_Mud_Backhead_section%Remove (MudSystem%Op_KickLoc+1) call MudSystem%Op_Mud_Forehead_X%Remove (MudSystem%Op_KickLoc+1) call MudSystem%Op_Mud_Forehead_section%Remove (MudSystem%Op_KickLoc+1) call MudSystem%Op_Density%Remove (MudSystem%Op_KickLoc+1) call MudSystem%Op_RemainedVolume_in_LastSection%Remove (MudSystem%Op_KickLoc+1) call MudSystem%Op_EmptyVolume_inBackheadLocation%Remove (MudSystem%Op_KickLoc+1) call MudSystem%Op_MudOrKick%Remove (MudSystem%Op_KickLoc+1) endif ! backheade kick zire mate bashad if (MudSystem%Op_KickLoc > 1) then !if ( Op_Density%Array (Op_KickLoc-1) /= MudSystem%NewDensity ) then if ( ABS(MudSystem%Op_Density%Array (MudSystem%Op_KickLoc-1) - MudSystem%NewDensity) >= MudSystem%DensityMixTol ) then call MudSystem%Op_Density%AddTo (MudSystem%Op_KickLoc,MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddTo (MudSystem%Op_KickLoc,MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_MudOrKick%AddTo (MudSystem%Op_KickLoc,0) else !Op_Density%Array (Op_KickLoc-1) == MudSystem%NewDensity MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)= (MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)*MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewDensity*MudSystem%NewVolume)/(MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewVolume) MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)= MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1) + MudSystem%NewVolume endif else !if Op_KickLoc == 1 (*****Migration Start*****) *5-1=============================== !write(*,*) '****5-1' call MudSystem%Op_Density%AddToFirst (MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddToFirst (MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call MudSystem%Op_MudOrKick%AddToFirst (0) endif endif !======================================================================================== !write(*,*) 'a) density and cutting:' , Ann_Density%Length() , Ann_CuttingMud%Length() !=========================== tamame kick balaye mate bashad *2 ================================== if ( MudSystem%Ann_KickLoc > 0 .and. MudSystem%Op_KickLoc==0 ) then !write(*,*) '****2' !iloc= 1 MudSystem%KickDv= MudSystem%Area_PipeSectionFt(MudSystem%Ann_Mud_Forehead_section%Array(MudSystem%Ann_KickLoc)) * MudSystem%KickDx * 7.48051948d0 ! ft^3 to gal MudSystem%NewDensity= MudSystem%Ann_Density%Array (MudSystem%Ann_KickLoc+1) MudSystem%NewVolume= MudSystem%KickDv CuttingValue= MudSystem%Ann_CuttingMud%Array (MudSystem%Ann_KickLoc+1) if ( MudSystem%KickDv < MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc+1) ) then !eleman bala sari baghi mimund MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc+1)= MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc+1) - MudSystem%KickDv else !KickDv > Ann_MudDischarged_Volume%Array (imudKick+1) eleman baghi nemimund MudSystem%KickDv= MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc+1) MudSystem%NewVolume= MudSystem%KickDv call MudSystem%Ann_MudDischarged_Volume%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_Mud_Backhead_X%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_Mud_Backhead_section%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_Mud_Forehead_X%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_Mud_Forehead_section%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_Density%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_RemainedVolume_in_LastSection%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_EmptyVolume_inBackheadLocation%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_MudOrKick%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_CuttingMud%Remove (MudSystem%Ann_KickLoc+1) endif ! backheade kick balaye mate bashad if (MudSystem%Ann_KickLoc > 1) then !if ( Ann_Density%Array (Ann_KickLoc-1) /= MudSystem%NewDensity ) then if ( ABS(MudSystem%Ann_Density%Array (MudSystem%Ann_KickLoc-1) - MudSystem%NewDensity) >= MudSystem%DensityMixTol ) then MudSystem%Old_KickBackHead_X= MudSystem%Ann_Mud_Backhead_X%Array (MudSystem%Ann_KickLoc) MudSystem%Old_KickBackHead_Section= MudSystem%Ann_Mud_Backhead_section%Array (MudSystem%Ann_KickLoc) call MudSystem%Ann_Density%AddTo (MudSystem%Ann_KickLoc,MudSystem%NewDensity) call MudSystem%Ann_MudDischarged_Volume%AddTo (MudSystem%Ann_KickLoc,MudSystem%NewVolume) call MudSystem%Ann_Mud_Forehead_X%AddTo (MudSystem%Ann_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Ann_Mud_Forehead_section%AddTo (MudSystem%Ann_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Ann_Mud_Backhead_X%AddTo (MudSystem%Ann_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Ann_Mud_Backhead_section%AddTo (MudSystem%Ann_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Ann_RemainedVolume_in_LastSection%AddTo (MudSystem%Ann_KickLoc,0.0d0) call MudSystem%Ann_EmptyVolume_inBackheadLocation%AddTo (MudSystem%Ann_KickLoc,0.0d0) call MudSystem%Ann_MudOrKick%AddTo (MudSystem%Ann_KickLoc,0) call MudSystem%Ann_CuttingMud%AddTo (MudSystem%Ann_KickLoc,0) else !Op_Density%Array (imudKick-1) == MudSystem%NewDensity MudSystem%Ann_Density%Array(MudSystem%Ann_KickLoc-1)= (MudSystem%Ann_Density%Array(MudSystem%Ann_KickLoc-1)*MudSystem%Ann_MudDischarged_Volume%Array(MudSystem%Ann_KickLoc-1)+MudSystem%NewDensity*MudSystem%NewVolume)/(MudSystem%Ann_MudDischarged_Volume%Array(MudSystem%Ann_KickLoc-1)+MudSystem%NewVolume) MudSystem%Ann_MudDischarged_Volume%Array(MudSystem%Ann_KickLoc-1)= MudSystem%Ann_MudDischarged_Volume%Array(MudSystem%Ann_KickLoc-1) + MudSystem%NewVolume endif else !if Ann_KickLoc == 1 *6 =============================== !write(*,*) '****6' MudSystem%Old_KickBackHead_X= MudSystem%Ann_Mud_Backhead_X%Array (MudSystem%Ann_KickLoc) MudSystem%Old_KickBackHead_Section= MudSystem%Ann_Mud_Backhead_section%Array (MudSystem%Ann_KickLoc) call MudSystem%Ann_Density%AddToFirst (MudSystem%NewDensity) call MudSystem%Ann_MudDischarged_Volume%AddToFirst (MudSystem%NewVolume) call MudSystem%Ann_Mud_Forehead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Ann_Mud_Forehead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Ann_Mud_Backhead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Ann_Mud_Backhead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Ann_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call MudSystem%Ann_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call MudSystem%Ann_MudOrKick%AddToFirst (0) call MudSystem%Ann_CuttingMud%AddToFirst (CuttingValue) endif endif !======================================================================================== !============================== kick 2 tarafe mate bashad *4 ============================== if ( MudSystem%Ann_KickLoc > 0 .and. MudSystem%Op_KickLoc > 0 ) then !write(*,*) '****4' MudSystem%iLoc= 2 MudSystem%KickDv= MudSystem%Area_PipeSectionFt(MudSystem%Ann_Mud_Forehead_section%Array(MudSystem%Ann_KickLoc)) * MudSystem%KickDx * 7.48051948d0 ! ft^3 to gal MudSystem%MinKickDv= min( MudSystem%KickDv,MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc+1), MudSystem%Op_MudDischarged_Volume%Last () ) ! Ann_KickLoc+1=2 Op_MudDischarged_Volume%Last ()=kick MudSystem%NewDensity= MudSystem%Ann_Density%Array (MudSystem%Ann_KickLoc+1) MudSystem%NewVolume= MudSystem%MinKickDv if ( MudSystem%MinKickDv == MudSystem%KickDv ) then !eleman bala sari baghi mimund, paeeni(kick) dar OP ham baghi mimund !write(*,*) '****4----1' MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc+1)= MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc+1) - MudSystem%MinKickDv MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc)= MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc) + MudSystem%MinKickDv ! Ann_KickLoc= 1 MudSystem%Op_MudDischarged_Volume%Array (MudSystem%Op_KickLoc)= MudSystem%Op_MudDischarged_Volume%Array (MudSystem%Op_KickLoc) - MudSystem%MinKickDv ! Op_KickLoc= last ! backheade kick zire mate bashad if ( MudSystem%Op_KickLoc>1) then !if ( Op_Density%Array (Op_KickLoc-1) /= MudSystem%NewDensity ) then if ( ABS(MudSystem%Op_Density%Array (MudSystem%Op_KickLoc-1) - MudSystem%NewDensity) >= MudSystem%DensityMixTol ) then MudSystem%Old_KickBackHead_X= MudSystem%Op_Mud_Backhead_X%Array (MudSystem%Op_KickLoc) MudSystem%Old_KickBackHead_Section= MudSystem%Op_Mud_Backhead_section%Array (MudSystem%Op_KickLoc) call MudSystem%Op_Density%AddTo (MudSystem%Op_KickLoc,MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddTo (MudSystem%Op_KickLoc,MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_MudOrKick%AddTo (MudSystem%Op_KickLoc,0) else ! merge MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)= (MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)*MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewDensity*MudSystem%NewVolume)/(MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewVolume) MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)= MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1) + MudSystem%NewVolume endif else !if Op_KickLoc == 1 (*****Migration Start*****) *5-2=============================== !write(*,*) '****5-2' MudSystem%Old_KickBackHead_X= MudSystem%Op_Mud_Backhead_X%Array (MudSystem%Op_KickLoc) MudSystem%Old_KickBackHead_Section= MudSystem%Op_Mud_Backhead_section%Array (MudSystem%Op_KickLoc) call MudSystem%Op_Density%AddToFirst (MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddToFirst (MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call MudSystem%Op_MudOrKick%AddToFirst (0) endif elseif ( MudSystem%MinKickDv == MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc+1) ) then ! eleman bala sari baghi nemimund !write(*,*) '****4----2' call MudSystem%Ann_MudDischarged_Volume%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_Mud_Backhead_X%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_Mud_Backhead_section%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_Mud_Forehead_X%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_Mud_Forehead_section%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_Density%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_RemainedVolume_in_LastSection%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_EmptyVolume_inBackheadLocation%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_MudOrKick%Remove (MudSystem%Ann_KickLoc+1) call MudSystem%Ann_CuttingMud%Remove (MudSystem%Ann_KickLoc+1) MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc)= MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc) + MudSystem%MinKickDv ! Ann_KickLoc= 1 MudSystem%Op_MudDischarged_Volume%Array (MudSystem%Op_KickLoc)= MudSystem%Op_MudDischarged_Volume%Array (MudSystem%Op_KickLoc) - MudSystem%MinKickDv ! Op_KickLoc= last ! backheade kick zire mate bashad if (MudSystem%Op_KickLoc > 1) then !if ( Op_Density%Array (Op_KickLoc-1) /= MudSystem%NewDensity ) then if ( ABS(MudSystem%Op_Density%Array (MudSystem%Op_KickLoc-1) - MudSystem%NewDensity) >= MudSystem%DensityMixTol ) then MudSystem%Old_KickBackHead_X= MudSystem%Op_Mud_Backhead_X%Array (MudSystem%Op_KickLoc) MudSystem%Old_KickBackHead_Section= MudSystem%Op_Mud_Backhead_section%Array (MudSystem%Op_KickLoc) call MudSystem%Op_Density%AddTo (MudSystem%Op_KickLoc,MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddTo (MudSystem%Op_KickLoc,MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_MudOrKick%AddTo (MudSystem%Op_KickLoc,0) else !Op_Density%Array (imudKick-1) == MudSystem%NewDensity MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)= (MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)*MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewDensity*MudSystem%NewVolume)/(MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewVolume) MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)= MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1) + MudSystem%NewVolume endif else !if Op_KickLoc == 1 (*****Migration Start*****) *5-2=============================== MudSystem%Old_KickBackHead_X= MudSystem%Op_Mud_Backhead_X%Array (MudSystem%Op_KickLoc) MudSystem%Old_KickBackHead_Section= MudSystem%Op_Mud_Backhead_section%Array (MudSystem%Op_KickLoc) call MudSystem%Op_Density%AddToFirst (MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddToFirst (MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call MudSystem%Op_MudOrKick%AddToFirst (0) endif elseif ( MudSystem%MinKickDv == MudSystem%Op_MudDischarged_Volume%Last () ) then ! eleman balaee baghi mimund, kick az OP kamel kharej mishod !write(*,*) '****4----3' MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc+1)= MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc+1) - MudSystem%MinKickDv MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc)= MudSystem%Ann_MudDischarged_Volume%Array (MudSystem%Ann_KickLoc) + MudSystem%MinKickDv ! Ann_KickLoc= 1 MudSystem%Old_KickBackHead_X= MudSystem%Op_Mud_Backhead_X%Array (MudSystem%Op_KickLoc) MudSystem%Old_KickBackHead_Section= MudSystem%Op_Mud_Backhead_section%Array (MudSystem%Op_KickLoc) call MudSystem%Op_MudDischarged_Volume%Remove (MudSystem%Op_KickLoc) ! Op_KickLoc= last call MudSystem%Op_Mud_Backhead_X%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_Mud_Backhead_section%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_Mud_Forehead_X%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_Mud_Forehead_section%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_Density%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_RemainedVolume_in_LastSection%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_EmptyVolume_inBackheadLocation%Remove (MudSystem%Op_KickLoc) call MudSystem%Op_MudOrKick%Remove (MudSystem%Op_KickLoc) ! backheade kick zire mate bashad if (MudSystem%Op_KickLoc > 1) then !if ( Op_Density%Array (Op_KickLoc-1) /= MudSystem%NewDensity ) then if ( ABS(MudSystem%Op_Density%Array (MudSystem%Op_KickLoc-1) - MudSystem%NewDensity) >= MudSystem%DensityMixTol ) then call MudSystem%Op_Density%AddTo (MudSystem%Op_KickLoc,MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddTo (MudSystem%Op_KickLoc,MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddTo (MudSystem%Op_KickLoc,MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddTo (MudSystem%Op_KickLoc,0.0d0) call MudSystem%Op_MudOrKick%AddTo (MudSystem%Op_KickLoc,0) else !Op_Density%Array (imudKick-1) == MudSystem%NewDensity MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)= (MudSystem%Op_Density%Array(MudSystem%Op_KickLoc-1)*MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewDensity*MudSystem%NewVolume)/(MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)+MudSystem%NewVolume) MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1)= MudSystem%Op_MudDischarged_Volume%Array(MudSystem%Op_KickLoc-1) + MudSystem%NewVolume endif else !if Op_KickLoc == 1 (*****Migration Start*****) *5-2=============================== call MudSystem%Op_Density%AddToFirst (MudSystem%NewDensity) call MudSystem%Op_MudDischarged_Volume%AddToFirst (MudSystem%NewVolume) call MudSystem%Op_Mud_Forehead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Forehead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_Mud_Backhead_X%AddToFirst (MudSystem%Old_KickBackHead_X) call MudSystem%Op_Mud_Backhead_section%AddToFirst (MudSystem%Old_KickBackHead_Section) call MudSystem%Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) call MudSystem%Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) call MudSystem%Op_MudOrKick%AddToFirst (0) endif MudSystem%iLoc= 1 ! ok endif endif !======================================================================================== !============================== kick 2 tarafe mate bashad *4 with pump ============================== ! !if ( Ann_KickLoc > 0 .and. Op_KickLoc > 0 .and. MudSystem%AnnulusFlowRate /= 0.0 ) then ! write(*,*) '****4 with pump' ! ! KickMigration_2SideBit= .true. ! ! !iloc= 2 ! ! KickDv= Area_PipeSectionFt(Ann_Mud_Forehead_section%Array(Ann_KickLoc)) * KickDx * 7.48051948d0 ! ft^3 to gal ! !MinKickDv= min( KickDv,Ann_MudDischarged_Volume%Array (Ann_KickLoc+1), Op_MudDischarged_Volume%Last () ) ! Ann_KickLoc+1=2 Op_MudDischarged_Volume%Last ()=kick ! ! ! !MinKickDv= min( KickDv,Ann_MudDischarged_Volume%Array (Ann_KickLoc+1), Op_MudDischarged_Volume%Last () ) ! Ann_KickLoc+1=2 Op_MudDischarged_Volume%Last ()=kick ! ! ! !MudSystem%NewDensity= Ann_Density%Array (Ann_KickLoc+1) ! !NewVolume= MinKickDv ! ! ! if ( ((MudSystem%AnnulusFlowRate/60.0d0)*DeltaT_Mudline) >= KickDv ) then ! sorate pump bishtar az kick bashad---tu in halat aslan kari be elemane balaiye kick tuye Ann nadarim ! !WRITE(*,*) '*****sorate pump bishtar az kick*******' ! MinKickDv= ((MudSystem%AnnulusFlowRate/60.0d0)*DeltaT_Mudline) ! dar asl maxKickDv ast ! ! ! ! ! ! ! ! ! if ( Op_MudDischarged_Volume%Last () > MinKickDv ) then !eleman paeeni(kick) dar OP baghi mimund ! ! Ann_MudDischarged_Volume%Array (Ann_KickLoc)= Ann_MudDischarged_Volume%Array (Ann_KickLoc) + MinKickDv ! Ann_KickLoc= 1 ! ! Op_MudDischarged_Volume%Array (Op_KickLoc)= Op_MudDischarged_Volume%Array (Op_KickLoc) - MinKickDv ! Op_KickLoc= last ! ! Old_KickBackHead_X= Op_Mud_Backhead_X%Array (Op_KickLoc) ! Old_KickBackHead_Section= Op_Mud_Backhead_section%Array (Op_KickLoc) ! ! backheade kick zire mate bashad ! if ( Op_KickLoc>1) then ! ! if ( Op_Density%Array (Op_KickLoc-1) /=MudSystem%St_Density%Last() ) then ! ! ! Old_KickBackHead_X= Op_Mud_Backhead_X%Array (Op_KickLoc) ! Old_KickBackHead_Section= Op_Mud_Backhead_section%Array (Op_KickLoc) ! ! call Op_Density%AddTo (Op_KickLocMudSystem%St_Density%Last()) ! call Op_MudDischarged_Volume%AddTo (Op_KickLoc,MinKickDv) ! call Op_Mud_Forehead_X%AddTo (Op_KickLoc,Old_KickBackHead_X) ! call Op_Mud_Forehead_section%AddTo (Op_KickLoc,Old_KickBackHead_Section) ! call Op_Mud_Backhead_X%AddTo (Op_KickLoc,Old_KickBackHead_X) ! call Op_Mud_Backhead_section%AddTo (Op_KickLoc,Old_KickBackHead_Section) ! call Op_RemainedVolume_in_LastSection%AddTo (Op_KickLoc,0.0d0) ! call Op_EmptyVolume_inBackheadLocation%AddTo (Op_KickLoc,0.0d0) ! call Op_MudOrKick%AddTo (Op_KickLoc,0) ! ! ! else !Op_Density%Array (imudKick-1) == MudSystem%NewDensity ! ! Op_MudDischarged_Volume%Array (Op_KickLoc-1)= Op_MudDischarged_Volume%Array (Op_KickLoc-1) + NewVolume ! ! endif ! ! else !if Op_KickLoc == 1 (*****Migration Start*****) *5-2=============================== ! write(*,*) '****5-2 with pump' ! ! ! !Old_KickBackHead_X= Op_Mud_Backhead_X%Array (Op_KickLoc) ! !Old_KickBackHead_Section= Op_Mud_Backhead_section%Array (Op_KickLoc) ! ! ! call Op_Density%AddToFirst MudSystem%St_Density%Last()) ! call Op_MudDischarged_Volume%AddToFirst (MinKickDv) ! call Op_Mud_Forehead_X%AddToFirst (Old_KickBackHead_X) ! call Op_Mud_Forehead_section%AddToFirst (Old_KickBackHead_Section) ! call Op_Mud_Backhead_X%AddToFirst (Old_KickBackHead_X) ! call Op_Mud_Backhead_section%AddToFirst (Old_KickBackHead_Section) ! call Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) ! call Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) ! call Op_MudOrKick%AddToFirst (0) ! ! endif ! ! elseif ( Op_MudDischarged_Volume%Last () <= MinKickDv ) then !eleman paeeni(kick) dar OP baghi nemimund yani kick az OP kamel kharej mishod ! ! MinKickDv= Op_MudDischarged_Volume%Last () ! ! ! write(*,*) '****4----3 with pump a' ! ! ! Ann_MudDischarged_Volume%Array (Ann_KickLoc+1)= Ann_MudDischarged_Volume%Array (Ann_KickLoc+1) + ((MudSystem%AnnulusFlowRate/60.0d0)*DeltaT_Mudline)-MinKickDv ! ! Ann_MudDischarged_Volume%Array (Ann_KickLoc)= Ann_MudDischarged_Volume%Array (Ann_KickLoc) + MinKickDv ! Ann_KickLoc= 1 ! ! call Op_MudDischarged_Volume%Remove (Op_KickLoc) ! Op_KickLoc= last ! call Op_Mud_Backhead_X%Remove (Op_KickLoc) ! call Op_Mud_Backhead_section%Remove (Op_KickLoc) ! call Op_Mud_Forehead_X%Remove (Op_KickLoc) ! call Op_Mud_Forehead_section%Remove (Op_KickLoc) ! call Op_Density%Remove (Op_KickLoc) ! call Op_RemainedVolume_in_LastSection%Remove (Op_KickLoc) ! call Op_EmptyVolume_inBackheadLocation%Remove (Op_KickLoc) ! call Op_MudOrKick%Remove (Op_KickLoc) ! ! ! ! backheade kick zire mate bashad ! if (Op_KickLoc > 1) then ! ! if ( Op_Density%Array (Op_KickLoc-1) /=MudSystem%St_Density%Last() ) then ! ! ! !Old_KickBackHead_X= Op_Mud_Backhead_X%Array (Op_KickLoc) ! !Old_KickBackHead_Section= Op_Mud_Backhead_section%Array (Op_KickLoc) ! ! call Op_Density%AddTo (Op_KickLocMudSystem%St_Density%Last()) ! call Op_MudDischarged_Volume%AddTo (Op_KickLoc,MinKickDv) ! call Op_Mud_Forehead_X%AddTo (Op_KickLoc,Old_KickBackHead_X) ! call Op_Mud_Forehead_section%AddTo (Op_KickLoc,Old_KickBackHead_Section) ! call Op_Mud_Backhead_X%AddTo (Op_KickLoc,Old_KickBackHead_X) ! call Op_Mud_Backhead_section%AddTo (Op_KickLoc,Old_KickBackHead_Section) ! call Op_RemainedVolume_in_LastSection%AddTo (Op_KickLoc,0.0d0) ! call Op_EmptyVolume_inBackheadLocation%AddTo (Op_KickLoc,0.0d0) ! call Op_MudOrKick%AddTo (Op_KickLoc,0) ! ! ! ! else !Op_Density%Array (imudKick-1) == MudSystem%NewDensity ! ! ! Op_MudDischarged_Volume%Array (Op_KickLoc-1)= Op_MudDischarged_Volume%Array (Op_KickLoc-1) + MinKickDv ! ! endif ! ! else !if Op_KickLoc == 1 (*****Migration Start*****) *5-2=============================== ! ! ! Old_KickBackHead_X= Op_Mud_Backhead_X%Array (Op_KickLoc) ! Old_KickBackHead_Section= Op_Mud_Backhead_section%Array (Op_KickLoc) ! ! ! call Op_Density%AddToFirst MudSystem%St_Density%Last()) ! call Op_MudDischarged_Volume%AddToFirst (MinKickDv) ! call Op_Mud_Forehead_X%AddToFirst (Old_KickBackHead_X) ! call Op_Mud_Forehead_section%AddToFirst (Old_KickBackHead_Section) ! call Op_Mud_Backhead_X%AddToFirst (Old_KickBackHead_X) ! call Op_Mud_Backhead_section%AddToFirst (Old_KickBackHead_Section) ! call Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) ! call Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) ! call Op_MudOrKick%AddToFirst (0) ! ! endif ! ! ! endif ! ende 2 halat ke kick tuye Op baghi bemune ya namune- dar halati ke ((MudSystem%AnnulusFlowRate/60.)*DeltaT_Mudline) >= KickDv ) ! sorate pump bishtar az kick bashad ! ! ! ! ! else !if( ((MudSystem%AnnulusFlowRate/60.)*DeltaT_Mudline) < KickDv ) then ! sorate pump kamtar az kick bashad ! !WRITE(*,*) '*****sorate pump kamtar az kick*******' ! ! ! ! ! MinKickDv= min( KickDv,Ann_MudDischarged_Volume%Array (Ann_KickLoc+1), Op_MudDischarged_Volume%Last () ) ! Ann_KickLoc+1=2 Op_MudDischarged_Volume%Last ()=kick ! ! ! ! !write(*,*) 'MinKickDv=' , MinKickDv ! ! ! if ( MinKickDv == KickDv ) then !eleman bala sari baghi mimund, paeeni(kick) dar OP ham baghi mimund ! !write(*,*) '****4----1 with pump' ! !write(*,*) MudSystem%St_Density%Last()=' ,MudSystem%St_Density%Last() ! !write(*,*) '((MudSystem%AnnulusFlowRate/60.)*DeltaT_Mudline)=' , ((MudSystem%AnnulusFlowRate/60.)*DeltaT_Mudline) ! !write(*,*) 'Ann_Density%Array(Ann_KickLoc+1)=' , Ann_Density%Array(Ann_KickLoc+1) ! !write(*,*) '(MinKickDv-((MudSystem%AnnulusFlowRate/60.)*DeltaT_Mudline))=' , (MinKickDv-((MudSystem%AnnulusFlowRate/60.)*DeltaT_Mudline)) ! ! ! MudSystem%NewDensity= MudSystem%St_Density%Last()*((MudSystem%AnnulusFlowRate/60.0d0)*DeltaT_Mudline) + Ann_Density%Array(Ann_KickLoc+1)*(MinKickDv-((MudSystem%AnnulusFlowRate/60.0d0)*DeltaT_Mudline))) & ! / (((MudSystem%AnnulusFlowRate/60.0d0)*DeltaT_Mudline) + (MinKickDv-((MudSystem%AnnulusFlowRate/60.0d0)*DeltaT_Mudline))) ! NewVolume= MinKickDv ! ! ! Ann_MudDischarged_Volume%Array (Ann_KickLoc+1)= Ann_MudDischarged_Volume%Array (Ann_KickLoc+1) - (MinKickDv-((MudSystem%AnnulusFlowRate/60.0d0)*DeltaT_Mudline)) ! ! Ann_MudDischarged_Volume%Array (Ann_KickLoc)= Ann_MudDischarged_Volume%Array (Ann_KickLoc) + MinKickDv ! Ann_KickLoc= 1 ! ! Op_MudDischarged_Volume%Array (Op_KickLoc)= Op_MudDischarged_Volume%Array (Op_KickLoc) - MinKickDv ! Op_KickLoc= last ! ! ! ! backheade kick zire mate bashad ! if ( Op_KickLoc>1) then ! ! ! ! if ( ABS(Op_Density%Array (Op_KickLoc-1) - MudSystem%NewDensity) > DensityMixTol) then ! .OR. (Op_MudDischarged_Volume%Array (Op_KickLoc-1)>42.) ) then ! ! ! ! Old_KickBackHead_X= Op_Mud_Backhead_X%Array (Op_KickLoc) ! Old_KickBackHead_Section= Op_Mud_Backhead_section%Array (Op_KickLoc) ! ! call Op_Density%AddTo (Op_KickLoc,MudSystem%NewDensity) ! call Op_MudDischarged_Volume%AddTo (Op_KickLoc,NewVolume) ! call Op_Mud_Forehead_X%AddTo (Op_KickLoc,Old_KickBackHead_X) ! call Op_Mud_Forehead_section%AddTo (Op_KickLoc,Old_KickBackHead_Section) ! call Op_Mud_Backhead_X%AddTo (Op_KickLoc,Old_KickBackHead_X) ! call Op_Mud_Backhead_section%AddTo (Op_KickLoc,Old_KickBackHead_Section) ! call Op_RemainedVolume_in_LastSection%AddTo (Op_KickLoc,0.0d0) ! call Op_EmptyVolume_inBackheadLocation%AddTo (Op_KickLoc,0.0d0) ! call Op_MudOrKick%AddTo (Op_KickLoc,0) ! ! ! else !Merge Condition ! ! Op_MudDischarged_Volume%Array (Op_KickLoc-1)= Op_MudDischarged_Volume%Array (Op_KickLoc-1) + NewVolume ! Op_Density%Array (Op_KickLoc-1)= (Op_MudDischarged_Volume%Array (Op_KickLoc-1)*Op_Density%Array (Op_KickLoc-1)+NewVolume*MudSystem%NewDensity) / & ! (Op_MudDischarged_Volume%Array (Op_KickLoc-1)+NewVolume) ! ! ! endif ! ! else !if Op_KickLoc == 1 (*****Migration Start*****) *5-2=============================== ! write(*,*) '****5-2 with pump' ! ! Old_KickBackHead_X= Op_Mud_Backhead_X%Array (Op_KickLoc) ! Old_KickBackHead_Section= Op_Mud_Backhead_section%Array (Op_KickLoc) ! ! ! call Op_Density%AddToFirst (MudSystem%NewDensity) ! call Op_MudDischarged_Volume%AddToFirst (NewVolume) ! call Op_Mud_Forehead_X%AddToFirst (Old_KickBackHead_X) ! call Op_Mud_Forehead_section%AddToFirst (Old_KickBackHead_Section) ! call Op_Mud_Backhead_X%AddToFirst (Old_KickBackHead_X) ! call Op_Mud_Backhead_section%AddToFirst (Old_KickBackHead_Section) ! call Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) ! call Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) ! call Op_MudOrKick%AddToFirst (0) ! ! endif ! ! ! ! elseif ( MinKickDv == Ann_MudDischarged_Volume%Array (Ann_KickLoc+1) ) then ! eleman bala sari baghi nemimund ! write(*,*) '****4----2 with pump' ! ! MudSystem%NewDensity= MudSystem%St_Density%Last()*((MudSystem%AnnulusFlowRate/60.0d0)*DeltaT_Mudline) + Ann_Density%Array(Ann_KickLoc+1)*(MinKickDv-((MudSystem%AnnulusFlowRate/60.0d0)*DeltaT_Mudline))) & ! / (((MudSystem%AnnulusFlowRate/60.0d0)*DeltaT_Mudline) + Ann_MudDischarged_Volume%Array (Ann_KickLoc+1)) ! NewVolume= MinKickDv ! ! call RemoveAnnulusMudArrays(Ann_KickLoc+1) ! ! Ann_MudDischarged_Volume%Array (Ann_KickLoc)= Ann_MudDischarged_Volume%Array (Ann_KickLoc) + MinKickDv ! Ann_KickLoc= 1 ! ! Op_MudDischarged_Volume%Array (Op_KickLoc)= Op_MudDischarged_Volume%Array (Op_KickLoc) - MinKickDv ! Op_KickLoc= last ! ! ! backheade kick zire mate bashad ! if (Op_KickLoc > 1) then ! ! if ( ABS(Op_Density%Array (Op_KickLoc-1) - MudSystem%NewDensity) > DensityMixTol) then ! .OR. (Op_MudDischarged_Volume%Array (Op_KickLoc-1)>42.) ) then ! ! ! ! Old_KickBackHead_X= Op_Mud_Backhead_X%Array (Op_KickLoc) ! Old_KickBackHead_Section= Op_Mud_Backhead_section%Array (Op_KickLoc) ! ! call Op_Density%AddTo (Op_KickLoc,MudSystem%NewDensity) ! call Op_MudDischarged_Volume%AddTo (Op_KickLoc,NewVolume) ! call Op_Mud_Forehead_X%AddTo (Op_KickLoc,Old_KickBackHead_X) ! call Op_Mud_Forehead_section%AddTo (Op_KickLoc,Old_KickBackHead_Section) ! call Op_Mud_Backhead_X%AddTo (Op_KickLoc,Old_KickBackHead_X) ! call Op_Mud_Backhead_section%AddTo (Op_KickLoc,Old_KickBackHead_Section) ! call Op_RemainedVolume_in_LastSection%AddTo (Op_KickLoc,0.0d0) ! call Op_EmptyVolume_inBackheadLocation%AddTo (Op_KickLoc,0.0d0) ! call Op_MudOrKick%AddTo (Op_KickLoc,0) ! ! ! else !Merge Condition ! ! Op_MudDischarged_Volume%Array (Op_KickLoc-1)= Op_MudDischarged_Volume%Array (Op_KickLoc-1) + NewVolume ! Op_Density%Array (Op_KickLoc-1)= (Op_MudDischarged_Volume%Array (Op_KickLoc-1)*Op_Density%Array (Op_KickLoc-1)+NewVolume*MudSystem%NewDensity) / & ! (Op_MudDischarged_Volume%Array (Op_KickLoc-1)+NewVolume) ! ! ! ! endif ! ! else !if Op_KickLoc == 1 (*****Migration Start*****) *5-2=============================== ! ! Old_KickBackHead_X= Op_Mud_Backhead_X%Array (Op_KickLoc) ! Old_KickBackHead_Section= Op_Mud_Backhead_section%Array (Op_KickLoc) ! ! ! call Op_Density%AddToFirst (MudSystem%NewDensity) ! call Op_MudDischarged_Volume%AddToFirst (NewVolume) ! call Op_Mud_Forehead_X%AddToFirst (Old_KickBackHead_X) ! call Op_Mud_Forehead_section%AddToFirst (Old_KickBackHead_Section) ! call Op_Mud_Backhead_X%AddToFirst (Old_KickBackHead_X) ! call Op_Mud_Backhead_section%AddToFirst (Old_KickBackHead_Section) ! call Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) ! call Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) ! call Op_MudOrKick%AddToFirst (0) ! ! endif ! ! ! elseif ( MinKickDv == Op_MudDischarged_Volume%Last () ) then ! eleman balaee baghi mimund, kick az OP kamel kharej mishod ! write(*,*) '****4----3 with pump b' ! ! MudSystem%NewDensity=MudSystem%St_Density%Last() ! NewVolume= MinKickDv ! ! ! Old_KickBackHead_X= Op_Mud_Backhead_X%Array (Op_KickLoc) ! Old_KickBackHead_Section= Op_Mud_Backhead_section%Array (Op_KickLoc) ! ! ! !Ann_MudDischarged_Volume%Array (Ann_KickLoc+1)= Ann_MudDischarged_Volume%Array (Ann_KickLoc+1) - MinKickDv farz kardam dast be elemane balaee nazanam ! ! Ann_MudDischarged_Volume%Array (Ann_KickLoc)= Ann_MudDischarged_Volume%Array (Ann_KickLoc) + MinKickDv ! Ann_KickLoc= 1 ! !write(*,*) 'pointer 1' ! call Op_MudDischarged_Volume%Remove (Op_KickLoc) ! Op_KickLoc= last ! call Op_Mud_Backhead_X%Remove (Op_KickLoc) ! call Op_Mud_Backhead_section%Remove (Op_KickLoc) ! call Op_Mud_Forehead_X%Remove (Op_KickLoc) ! call Op_Mud_Forehead_section%Remove (Op_KickLoc) ! call Op_Density%Remove (Op_KickLoc) ! call Op_RemainedVolume_in_LastSection%Remove (Op_KickLoc) ! call Op_EmptyVolume_inBackheadLocation%Remove (Op_KickLoc) ! call Op_MudOrKick%Remove (Op_KickLoc) ! ! !write(*,*) 'pointer 2' ! ! ! backheade kick zire mate bashad ! if (Op_KickLoc > 1) then ! ! if ( ABS(Op_Density%Array (Op_KickLoc-1) - MudSystem%NewDensity) > DensityMixTol) then ! .OR. (Op_MudDischarged_Volume%Array (Op_KickLoc-1)>42.) ) then ! !write(*,*) 'pointer 3' ! ! ! ! ! call Op_Density%AddTo (Op_KickLoc,MudSystem%NewDensity) ! call Op_MudDischarged_Volume%AddTo (Op_KickLoc,NewVolume) ! call Op_Mud_Forehead_X%AddTo (Op_KickLoc,Old_KickBackHead_X) ! call Op_Mud_Forehead_section%AddTo (Op_KickLoc,Old_KickBackHead_Section) ! call Op_Mud_Backhead_X%AddTo (Op_KickLoc,Old_KickBackHead_X) ! call Op_Mud_Backhead_section%AddTo (Op_KickLoc,Old_KickBackHead_Section) ! call Op_RemainedVolume_in_LastSection%AddTo (Op_KickLoc,0.0d0) ! call Op_EmptyVolume_inBackheadLocation%AddTo (Op_KickLoc,0.0d0) ! call Op_MudOrKick%AddTo (Op_KickLoc,0) ! ! !write(*,*) 'pointer 4' ! ! else !Merge Condition ! ! Op_MudDischarged_Volume%Array (Op_KickLoc-1)= Op_MudDischarged_Volume%Array (Op_KickLoc-1) + NewVolume ! Op_Density%Array (Op_KickLoc-1)= (Op_MudDischarged_Volume%Array (Op_KickLoc-1)*Op_Density%Array (Op_KickLoc-1)+NewVolume*MudSystem%NewDensity) / & ! (Op_MudDischarged_Volume%Array (Op_KickLoc-1)+NewVolume) ! ! endif ! ! else !if Op_KickLoc == 1 (*****Migration Start*****) *5-2=============================== ! !write(*,*) 'pointer 5' ! ! ! !write(*,*) 'pointer 6' ! ! ! call Op_Density%AddToFirst (MudSystem%NewDensity) ! call Op_MudDischarged_Volume%AddToFirst (NewVolume) ! call Op_Mud_Forehead_X%AddToFirst (Old_KickBackHead_X) ! call Op_Mud_Forehead_section%AddToFirst (Old_KickBackHead_Section) ! call Op_Mud_Backhead_X%AddToFirst (Old_KickBackHead_X) ! call Op_Mud_Backhead_section%AddToFirst (Old_KickBackHead_Section) ! call Op_RemainedVolume_in_LastSection%AddToFirst (0.0d0) ! call Op_EmptyVolume_inBackheadLocation%AddToFirst (0.0d0) ! call Op_MudOrKick%AddToFirst (0) ! !write(*,*) 'pointer 7' ! ! endif ! ! ! endif ! ! ! ! endif !( ((MudSystem%AnnulusFlowRate/60.)*DeltaT_Mudline) < KickDv ) ! sorate pump kamtar az kick bashad ! ! ! ! ! endif !======================================================================================== ENDDO ! KickNumber= 1, NewInfluxNumber MudSystem%KickNumber = kickNumber !write(*,*) 'c)Ann_MudDischarged_Volume%Array(:)=' , sum(Ann_MudDischarged_Volume%Array(:)) end subroutine Kick_Migration