|
- subroutine TD_AddComponents
-
- Use CStringConfigurationVariables
- use UnitySignalVariables
- ! Use CStringUpdateVariables
- ! Use CSafetyValveEnumVariables
- ! Use CIbopEnumVariables
- ! Use COperationConditionEnumVariables
- ! Use CKellyConnectionEnumVariables
- use COperationScenariosVariables!, only: Get_ElevatorConnection
- ! 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 ( Hoisting%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 ( Hoisting%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
|