subroutine TD_DrillStemReadData Use CStringConfigurationVariables Use TD_DrillStemComponents Use TD_WellElements Use TD_WellGeometry Use TD_StringConnectionData Use Drawworks_VARIABLES, only: Drawworks implicit none Integer :: i Integer :: TD_FirstIndex , TD_LastIndex !==================================================== ! Set Drill Stem Components Data !==================================================== TD_StringConfigurationCount = StringConfiguration%StringConfigurationCount TD_DrillStemComponentsNumbs = 0 !########## TD_DrillStem%ComponentType :: !#Bit_ComponentType = 0 !#Stabilizer_ComponentType = 1 !#Collar_ComponentType = 2 !#DrillPipe_ComponentType = 3 !#Heavyweight_ComponentType = 4 !#IBOP = 5 !#Kelly & SafetyValve (DrillMode) = 6 !#SafetyValve (TripMode) = 7 if (Allocated(TD_DrillStem)) deAllocate (TD_DrillStem) Allocate (TD_DrillStem(TD_StringConfigurationCount+100)) Do i=1, TD_StringConfigurationCount TD_DrillStem(i)%ComponentType = StringConfiguration%StringConfigurations(i)%ComponentType TD_DrillStem(i)%Numbs = StringConfiguration%StringConfigurations(i)%NumberOfJoint TD_DrillStem(i)%Id = StringConfiguration%StringConfigurations(i)%NominalId/12.d0 ![ft] TD_DrillStem(i)%Od = StringConfiguration%StringConfigurations(i)%NominalOd/12.d0 ![ft] TD_DrillStem(i)%Length = StringConfiguration%StringConfigurations(i)%LengthPerJoint ![ft] TD_DrillStem(i)%WeightperLength = StringConfiguration%StringConfigurations(i)%WeightPerLength ![lb/ft] TD_DrillStem(i)%TotalLength = StringConfiguration%StringConfigurations(i)%ComponentLength TD_DrillStem(i)%TotalWeight = TD_DrillStem(i)%TotalLength*TD_DrillStem(i)%WeightperLength TD_DrillStemComponentsNumbs = TD_DrillStemComponentsNumbs+StringConfiguration%StringConfigurations(i)%NumberOfJoint !!=========> Set Separated Drill Stem Components Data ! TD_LastIndex = TD_LastIndex+StringConfigurations(i)%NumberOfJoint ! ! TD_DrillStems(TD_FirstIndex:TD_LastIndex)%ComponentType = TD_DrillStem(i)%ComponentType ! TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Id = TD_DrillStem(i)%Id ! TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Od = TD_DrillStem(i)%Od ! TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Length = TD_DrillStem(i)%Length ! TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Weight = TD_DrillStem(i)%Weight ! ! TD_FirstIndex = TD_LastIndex+1 End Do !===> Initial Values of Removed-Volume Variables if (TD_DrillStem(1)%ComponentType==0) then TD_PreCount = TD_StringConfigurationCount-1 else TD_PreCount = TD_StringConfigurationCount end if TD_PreElementVolume = TD_DrillStem(TD_StringConfigurationCount)%TotalLength*(((pi*((TD_DrillStem(TD_StringConfigurationCount)%Id)**2))/4.d0)) ![ft^3] TD_PreElementLength = TD_DrillStem(TD_StringConfigurationCount)%TotalLength !==================================================== ! Set Separated Drill Stem Components Data !==================================================== TD_FirstIndex = 1 TD_LastIndex = 0 if (Allocated(TD_DrillStems)) deAllocate (TD_DrillStems) Allocate (TD_DrillStems(TD_DrillStemComponentsNumbs+300)) ! +300: because of: Add or Remove DrillStem Components Call TD_DrillStemStartUp Do i=1, TD_StringConfigurationCount TD_LastIndex = TD_LastIndex+StringConfiguration%StringConfigurations(i)%NumberOfJoint TD_DrillStems(TD_FirstIndex:TD_LastIndex)%ComponentType = TD_DrillStem(i)%ComponentType TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Id = TD_DrillStem(i)%Id TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Od = TD_DrillStem(i)%Od TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Area = (pi*((TD_DrillStem(i)%Od**2)-(TD_DrillStem(i)%Id**2)))/4.0d0 if (TD_DrillStem(i)%ComponentType == 3 .or. TD_DrillStem(i)%ComponentType == 4) then TD_DrillStems(TD_FirstIndex:TD_LastIndex)%RtoolJoint = TD_DrillStem(i)%Od*1.30d0/2.0d0 TD_DrillStems(TD_FirstIndex:TD_LastIndex)%ToolJointRange = TD_ToolJointRange else if (TD_DrillStem(i)%ComponentType == 1 .or. TD_DrillStem(i)%ComponentType == 2) then TD_DrillStems(TD_FirstIndex:TD_LastIndex)%RtoolJoint = TD_DrillStem(i)%Od/2.0d0 TD_DrillStems(TD_FirstIndex:TD_LastIndex)%ToolJointRange = TD_ToolJointRange else if (TD_DrillStem(i)%ComponentType == 0) then TD_DrillStems(TD_FirstIndex:TD_LastIndex)%RtoolJoint = TD_DrillStem(i)%Od TD_DrillStems(TD_FirstIndex:TD_LastIndex)%ToolJointRange = 0.0d0 end if TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Length = TD_DrillStem(i)%Length TD_DrillStems(TD_FirstIndex:TD_LastIndex)%LengthIni = TD_DrillStem(i)%Length TD_DrillStems(TD_FirstIndex:TD_LastIndex)%WeightperLength= TD_DrillStem(i)%WeightperLength TD_DrillStems(TD_FirstIndex:TD_LastIndex)%Weight = TD_DrillStem(i)%WeightperLength*TD_DrillStem(i)%Length TD_FirstIndex = TD_LastIndex+1 End Do !==================================================== ! Set Hook Height Data !==================================================== TD_HookHeightOld = Drawworks%Hook_Height_ini TD_HookHeight = TD_HookHeightOld end subroutine