|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- subroutine TD_AddComponents
-
- Use CStringConfigurationVariables
- Use CStringUpdateVariables
- Use CSafetyValveEnumVariables
- Use CIbopEnumVariables
- Use COperationConditionEnumVariables
- Use CKellyConnectionEnumVariables
- Use CElevatorConnectionEnumVariables
- Use CHoistingVariables
- Use CTdsConnectionModesEnumVariables
- Use CTdsElevatorModesEnumVariables
- Use TD_DrillStemComponents
- Use TD_WellGeometry
- Use TD_GeneralData
- Use TD_StringConnectionData
-
-
-
- implicit none
-
- integer :: i , kk , TD_NumOfAddedComponents
-
-
-
-
-
-
-
- !====================================================
- ! Add Single
- !====================================================
-
- if ( Get_StringUpdate() == STRING_UPDATE_ADD_SINGLE ) then
- kk = 0
- Do i= TD_DrillStemComponentsNumbs , 1 , -1
- if (TD_DrillStems(i)%ComponentType==3) then
- kk = i
- exit
- end if
- End Do
- ! DrillStems Array:
- TD_NumOfAddedComponents = 1
- Do i= (TD_DrillStemComponentsNumbs+1) , (TD_DrillStemComponentsNumbs+TD_NumOfAddedComponents)
- TD_DrillStems(i)%ComponentType = 3
- TD_DrillStems(i)%Id = TD_DrillStems(kk)%Id
- TD_DrillStems(i)%Od = TD_DrillStems(kk)%Od
- TD_DrillStems(i)%Area = (pi*((TD_DrillStems(i)%Od**2)-(TD_DrillStems(i)%Id**2)))/4.d0
- TD_DrillStems(i)%RtoolJoint = TD_DrillStems(i)%Od*1.3d0/2.d0
- TD_DrillStems(i)%ToolJointRange = TD_ToolJointRange
- TD_DrillStems(i)%Length = TD_DrillStems(kk)%LengthIni
- TD_DrillStems(i)%LengthIni = TD_DrillStems(kk)%LengthIni
- TD_DrillStems(i)%WeightperLength = TD_DrillStems(kk)%WeightperLength
- TD_DrillStems(i)%Weight = TD_DrillStems(i)%WeightperLength*TD_DrillStems(i)%Length
- TD_DrillStems(i)%Density = TD_DrillStems(kk)%Density
- TD_DrillStems(i)%ElasticModule = TD_DrillStems(kk)%ElasticModule
- End Do
- TD_DrillStemComponentsNumbs = TD_DrillStemComponentsNumbs+TD_NumOfAddedComponents
- ! DrillStem Array:
- i = TD_StringConfigurationCount+1
- TD_DrillStem(i)%ComponentType = 3
- TD_DrillStem(i)%Numbs = 1
- TD_DrillStem(i)%Id = TD_DrillStems(kk)%Id ! [ft]
- TD_DrillStem(i)%Od = TD_DrillStems(kk)%Od ! [ft]
- TD_DrillStem(i)%Length = TD_DrillStems(kk)%LengthIni
- TD_DrillStem(i)%WeightperLength = TD_DrillStems(kk)%WeightperLength
- TD_DrillStem(i)%TotalLength = TD_DrillStem(i)%Numbs*TD_DrillStem(i)%Length
- TD_DrillStem(i)%TotalWeight = TD_DrillStem(i)%TotalLength*TD_DrillStem(i)%WeightperLength
- TD_StringConfigurationCount = TD_StringConfigurationCount+1
-
-
- Call Set_StringUpdate(STRING_UPDATE_NEUTRAL)
- end if
-
-
-
-
-
- !====================================================
- ! Add Stand
- !====================================================
-
- if ( Get_StringUpdate() == STRING_UPDATE_ADD_STAND ) then
- kk = 0
- Do i= TD_DrillStemComponentsNumbs , 1 , -1
- if (TD_DrillStems(i)%ComponentType==3) then
- kk = i
- exit
- end if
- End Do
- ! DrillStems Array:
- TD_NumOfAddedComponents = 3
- Do i= (TD_DrillStemComponentsNumbs+1) , (TD_DrillStemComponentsNumbs+TD_NumOfAddedComponents)
- TD_DrillStems(i)%ComponentType = 3
- TD_DrillStems(i)%Id = TD_DrillStems(kk)%Id
- TD_DrillStems(i)%Od = TD_DrillStems(kk)%Od
- TD_DrillStems(i)%Area = (pi*((TD_DrillStems(i)%Od**2)-(TD_DrillStems(i)%Id**2)))/4.0d0
- TD_DrillStems(i)%RtoolJoint = TD_DrillStems(i)%Od*1.30d0/2.0d0
- TD_DrillStems(i)%ToolJointRange = TD_ToolJointRange
- TD_DrillStems(i)%Length = TD_DrillStems(kk)%LengthIni
- TD_DrillStems(i)%LengthIni = TD_DrillStems(kk)%LengthIni
- TD_DrillStems(i)%WeightperLength = TD_DrillStems(kk)%WeightperLength
- TD_DrillStems(i)%Weight = TD_DrillStems(i)%WeightperLength*TD_DrillStems(i)%Length
- TD_DrillStems(i)%Density = TD_DrillStems(kk)%Density
- TD_DrillStems(i)%ElasticModule = TD_DrillStems(kk)%ElasticModule
- End Do
- TD_DrillStemComponentsNumbs = TD_DrillStemComponentsNumbs+TD_NumOfAddedComponents
-
- ! DrillStem Array:
- i = TD_StringConfigurationCount+1
- TD_DrillStem(i)%ComponentType = 3
- TD_DrillStem(i)%Numbs = 3
- TD_DrillStem(i)%Id = TD_DrillStems(kk)%Id ! [ft]
- TD_DrillStem(i)%Od = TD_DrillStems(kk)%Od ! [ft]
- TD_DrillStem(i)%Length = TD_DrillStems(kk)%LengthIni
- TD_DrillStem(i)%WeightperLength = TD_DrillStems(kk)%WeightperLength
- TD_DrillStem(i)%TotalLength = TD_DrillStem(i)%Numbs*TD_DrillStem(i)%Length
- TD_DrillStem(i)%TotalWeight = TD_DrillStem(i)%TotalLength*TD_DrillStem(i)%WeightperLength
- TD_StringConfigurationCount = TD_StringConfigurationCount+1
-
-
- Call Set_StringUpdate(STRING_UPDATE_NEUTRAL)
- end if
-
-
-
-
-
-
- !====================================================
- ! Add IBOP
- !====================================================
-
- !if ( Get_Ibop()==IBOP_INSTALL ) then
- ! TD_IBOPNewAdd = 1
- !else
- ! TD_IBOPNewAdd = 0
- ! TD_IBOPOldAdd = 0
- ! end if
-
- if ( Get_Ibop()==IBOP_INSTALL .and. TD_IBOPOldAdd==0 ) then
- kk = 0
- Do i= TD_DrillStemComponentsNumbs , 1 , -1
- if (TD_DrillStems(i)%ComponentType==3) then
- kk = i
- exit
- end if
- End Do
- ! DrillStems Array:
- TD_NumOfAddedComponents = 1
- Do i= (TD_DrillStemComponentsNumbs+1) , (TD_DrillStemComponentsNumbs+TD_NumOfAddedComponents)
- TD_DrillStems(i)%ComponentType = 5
- TD_DrillStems(i)%Id = TD_DrillStems(kk)%Id
- TD_DrillStems(i)%Od = TD_DrillStems(kk)%RtoolJoint
- TD_DrillStems(i)%Area = (pi*((TD_DrillStems(i)%Od**2)-(TD_DrillStems(i)%Id**2)))/4.0d0
- TD_DrillStems(i)%RtoolJoint = TD_DrillStems(kk)%RtoolJoint
- TD_DrillStems(i)%ToolJointRange = 0.0d0
- TD_DrillStems(i)%Length = TD_IBOPLength ! [ft]
- TD_DrillStems(i)%LengthIni = TD_IBOPLength ! [ft]
- TD_DrillStems(i)%WeightperLength = 55.0d0 ! [lb/ft]
- TD_DrillStems(i)%Weight = TD_DrillStems(i)%WeightperLength*TD_DrillStems(i)%Length
- TD_DrillStems(i)%Density = TD_DrillStems(kk)%Density !????????????
- TD_DrillStems(i)%ElasticModule = TD_DrillStems(kk)%ElasticModule !????????????
- End Do
- TD_DrillStemComponentsNumbs = TD_DrillStemComponentsNumbs+TD_NumOfAddedComponents
-
- ! DrillStem Array:
- i = TD_StringConfigurationCount+1
- TD_DrillStem(i)%ComponentType = 5
- TD_DrillStem(i)%Numbs = 1
- TD_DrillStem(i)%Id = TD_DrillStems(kk)%Id ! [ft]
- TD_DrillStem(i)%Od = TD_DrillStems(kk)%RtoolJoint ! [ft]
- TD_DrillStem(i)%Length = 1.540d0 ! [ft]
- TD_DrillStem(i)%WeightperLength = 55.0d0 ! [lb/ft]
- TD_DrillStem(i)%TotalLength = TD_DrillStem(i)%Numbs*TD_DrillStem(i)%Length
- TD_DrillStem(i)%TotalWeight = TD_DrillStem(i)%TotalLength*TD_DrillStem(i)%WeightperLength
- TD_StringConfigurationCount = TD_StringConfigurationCount+1
-
-
- !TD_IBOPOldAdd = TD_IBOPNewAdd
-
- if ( Get_ElevatorConnection() /= ELEVATOR_CONNECTION_STRING .or. (Get_TdsConnectionModes()/=TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()/=TDS_ELEVATOR_CONNECTION_STRING) ) then
- TD_ConnectionHeight = TD_ConnectionHeight+TD_DrillStem(i)%Length
- end if
-
- end if
-
- if ( Get_Ibop()==IBOP_INSTALL ) then
- TD_IBOPOldAdd = 1
- else
- TD_IBOPOldAdd = 0
- end if
-
-
-
-
- !====================================================
- ! Add Safety Valve & Kelly (OPERATION_DRILL)
- !====================================================
-
- if ( DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL .and. Get_KellyConnection() == KELLY_CONNECTION_STRING ) then
- TD_KellyNewAdd = 1
- else
- TD_KellyNewAdd = 0
- TD_KellyOldAdd = 0
- end if
-
- if ( DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL .and. Get_KellyConnection() == KELLY_CONNECTION_STRING .and. TD_KellyNewAdd/=TD_KellyOldAdd ) then
- ! DrillStems Array:
- TD_NumOfAddedComponents = 1
- Do i= (TD_DrillStemComponentsNumbs+1) , (TD_DrillStemComponentsNumbs+TD_NumOfAddedComponents)
- TD_DrillStems(i)%ComponentType = 6
- TD_DrillStems(i)%Id = TD_KellyElementID ! [ft]
- TD_DrillStems(i)%Od = TD_KellyElementOD ! [ft]
- TD_DrillStems(i)%Area = (pi*((TD_DrillStems(i)%Od**2)-(TD_DrillStems(i)%Id**2)))/4.0d0
- TD_DrillStems(i)%RtoolJoint = TD_DrillStems(i)%Od*1.30d0/2.0d0
- TD_DrillStems(i)%ToolJointRange = 0.0d0
- TD_DrillStems(i)%Length = TD_KellyElementConst ! [ft]
- TD_DrillStems(i)%LengthIni = TD_KellyElementConst ! [ft]
- TD_DrillStems(i)%WeightperLength = 55.0d0 ! [lb/ft]
- TD_DrillStems(i)%Weight = TD_DrillStems(i)%WeightperLength*TD_DrillStems(i)%Length
- TD_DrillStems(i)%Density = 7850.d0*0.06242796d0 ! [kg/m3]*0.06242796=[lb/ft3]
- TD_DrillStems(i)%ElasticModule = 200.0d9*0.02088543d0 ! [lb/ft2] !200GPa=29Mpsi (steel)
- End Do
- TD_DrillStemComponentsNumbs = TD_DrillStemComponentsNumbs+TD_NumOfAddedComponents
-
- ! DrillStem Array:
- i = TD_StringConfigurationCount+1
- TD_DrillStem(i)%ComponentType = 6
- TD_DrillStem(i)%Numbs = 1
- TD_DrillStem(i)%Id = 3.0d0/12.d0 ! [ft]
- TD_DrillStem(i)%Od = 5.90d0/12.d0 ! [ft]
- TD_DrillStem(i)%Length = TD_KellyElementConst ! [ft]
- TD_DrillStem(i)%WeightperLength = 55.0d0 ! [lb/ft]
- TD_DrillStem(i)%TotalLength = TD_DrillStem(i)%Numbs*TD_DrillStem(i)%Length
- TD_DrillStem(i)%TotalWeight = TD_DrillStem(i)%TotalLength*TD_DrillStem(i)%WeightperLength
- TD_StringConfigurationCount = TD_StringConfigurationCount+1
-
-
- TD_KellyOldAdd = TD_KellyNewAdd
-
- end if
-
-
-
-
-
- !====================================================
- ! Add Safety Valve (OPERATION_TRIP)
- !====================================================
-
- !if ( Get_OperationCondition()==OPERATION_TRIP .and. Get_SafetyValve()==SAFETY_VALVE_INSTALL ) then
- ! TD_SafetyValveNewAdd = 1
- !else
- ! TD_SafetyValveNewAdd = 0
- ! TD_SafetyValveOldAdd = 0
- !end if
-
- if ( TD_KellyDriveTypeMode/=0 .and. TD_OldOperationCondition/=0 .and. Get_SafetyValve()==SAFETY_VALVE_INSTALL .and. TD_SafetyValveOldAdd==0 ) then
- kk = 0
- Do i= TD_DrillStemComponentsNumbs , 1 , -1
- if (TD_DrillStems(i)%ComponentType==3) then
- kk = i
- exit
- end if
- End Do
- ! DrillStems Array:
- TD_NumOfAddedComponents = 1
- Do i= (TD_DrillStemComponentsNumbs+1) , (TD_DrillStemComponentsNumbs+TD_NumOfAddedComponents)
- TD_DrillStems(i)%ComponentType = 7
- TD_DrillStems(i)%Id = TD_DrillStems(kk)%Id
- TD_DrillStems(i)%Od = TD_DrillStems(kk)%RtoolJoint
- TD_DrillStems(i)%Area = (pi*((TD_DrillStems(i)%Od**2)-(TD_DrillStems(i)%Id**2)))/4.0d0
- TD_DrillStems(i)%RtoolJoint = TD_DrillStems(kk)%RtoolJoint
- TD_DrillStems(i)%ToolJointRange = 0.0d0
- TD_DrillStems(i)%Length = TD_SafetyValveLength ! [ft]
- TD_DrillStems(i)%LengthIni = TD_SafetyValveLength ! [ft]
- TD_DrillStems(i)%WeightperLength = 55.0d0 ! [lb/ft]
- TD_DrillStems(i)%Weight = TD_DrillStems(i)%WeightperLength*TD_DrillStems(i)%Length
- TD_DrillStems(i)%Density = TD_DrillStems(kk)%Density !????????????
- TD_DrillStems(i)%ElasticModule = TD_DrillStems(kk)%ElasticModule !????????????
- End Do
- TD_DrillStemComponentsNumbs = TD_DrillStemComponentsNumbs+TD_NumOfAddedComponents
-
- ! DrillStem Array:
- i = TD_StringConfigurationCount+1
- TD_DrillStem(i)%ComponentType = 7
- TD_DrillStem(i)%Numbs = 1
- TD_DrillStem(i)%Id = TD_DrillStems(kk)%Id ! [ft]
- TD_DrillStem(i)%Od = TD_DrillStems(kk)%RtoolJoint ! [ft]
- TD_DrillStem(i)%Length = 1.540d0 ! [ft]
- TD_DrillStem(i)%WeightperLength = 55.0d0 ! [lb/ft]
- TD_DrillStem(i)%TotalLength = TD_DrillStem(i)%Numbs*TD_DrillStem(i)%Length
- TD_DrillStem(i)%TotalWeight = TD_DrillStem(i)%TotalLength*TD_DrillStem(i)%WeightperLength
- TD_StringConfigurationCount = TD_StringConfigurationCount+1
-
-
- !TD_SafetyValveOldAdd = TD_SafetyValveNewAdd
-
- if ( Get_ElevatorConnection() /= ELEVATOR_CONNECTION_STRING .or. (Get_TdsConnectionModes()/=TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()/=TDS_ELEVATOR_CONNECTION_STRING) ) then
- TD_ConnectionHeight = TD_ConnectionHeight+TD_DrillStem(i)%Length
- end if
-
- end if
-
- if ( Get_SafetyValve()==SAFETY_VALVE_INSTALL ) then
- TD_SafetyValveOldAdd = 1
- else
- TD_SafetyValveOldAdd = 0
- end if
-
-
-
- end subroutine
|