|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316 |
- subroutine TD_AddComponents
-
- Use CStringConfigurationVariables
- use UnitySignalVariables
- use UnitySignalsModule
- ! Use CStringUpdateVariables
- ! Use CSafetyValveEnumVariables
- ! use UnitySignalsModule
- ! use UnitySignalsModuleVariables
- ! use OperationScenariosModule
- use OperationScenariosModule!, only: Get_ElevatorConnection
- ! use OperationScenariosModule !!CElevator...
- use CHoistingVariables
- use SimulationVariables
- ! use UnitySignalsModule
- ! Use CTdsElevatorModesEnumVariables
- Use TD_DrillStemComponents
- use SimulationVariables !@
- use SimulationVariables !@
- Use TD_StringConnectionData
-
- implicit none
-
- integer :: i , kk , TD_NumOfAddedComponents
-
-
-
-
-
-
-
- !====================================================
- ! Add Single
- !====================================================
-
- if ( Get_StringUpdate() == STRING_UPDATE_ADD_SINGLE ) then
- kk = 0
- Do i= data%State%TD_String%DrillStemComponentsNumbs , 1 , -1
- if (data%State%TD_DrillStems(i)%ComponentType==3) then
- kk = i
- exit
- end if
- End Do
- ! DrillStems Array:
- TD_NumOfAddedComponents = 1
- Do i= (data%State%TD_String%DrillStemComponentsNumbs+1) , (data%State%TD_String%DrillStemComponentsNumbs+TD_NumOfAddedComponents)
- data%State%TD_DrillStems(i)%ComponentType = 3
- data%State%TD_DrillStems(i)%Id = data%State%TD_DrillStems(kk)%Id
- data%State%TD_DrillStems(i)%Od = data%State%TD_DrillStems(kk)%Od
- data%State%TD_DrillStems(i)%Area = (pi*((data%State%TD_DrillStems(i)%Od**2)-(data%State%TD_DrillStems(i)%Id**2)))/4.d0
- data%State%TD_DrillStems(i)%RtoolJoint = data%State%TD_DrillStems(i)%Od*1.3d0/2.d0
- data%State%TD_DrillStems(i)%ToolJointRange = data%State%TD_String%ToolJointRange
- data%State%TD_DrillStems(i)%Length = data%State%TD_DrillStems(kk)%LengthIni
- data%State%TD_DrillStems(i)%LengthIni = data%State%TD_DrillStems(kk)%LengthIni
- data%State%TD_DrillStems(i)%WeightperLength = data%State%TD_DrillStems(kk)%WeightperLength
- data%State%TD_DrillStems(i)%Weight = data%State%TD_DrillStems(i)%WeightperLength*data%State%TD_DrillStems(i)%Length
- data%State%TD_DrillStems(i)%Density = data%State%TD_DrillStems(kk)%Density
- data%State%TD_DrillStems(i)%ElasticModule = data%State%TD_DrillStems(kk)%ElasticModule
- End Do
- data%State%TD_String%DrillStemComponentsNumbs = data%State%TD_String%DrillStemComponentsNumbs+TD_NumOfAddedComponents
- ! DrillStem Array:
- i = data%State%TD_String%StringConfigurationCount+1
- data%State%TD_DrillStem(i)%ComponentType = 3
- data%State%TD_DrillStem(i)%Numbs = 1
- data%State%TD_DrillStem(i)%Id = data%State%TD_DrillStems(kk)%Id ! [ft]
- data%State%TD_DrillStem(i)%Od = data%State%TD_DrillStems(kk)%Od ! [ft]
- data%State%TD_DrillStem(i)%Length = data%State%TD_DrillStems(kk)%LengthIni
- data%State%TD_DrillStem(i)%WeightperLength = data%State%TD_DrillStems(kk)%WeightperLength
- data%State%TD_DrillStem(i)%TotalLength = data%State%TD_DrillStem(i)%Numbs*data%State%TD_DrillStem(i)%Length
- data%State%TD_DrillStem(i)%TotalWeight = data%State%TD_DrillStem(i)%TotalLength*data%State%TD_DrillStem(i)%WeightperLength
- data%State%TD_String%StringConfigurationCount = data%State%TD_String%StringConfigurationCount+1
-
-
- Call Set_StringUpdate(STRING_UPDATE_NEUTRAL)
- end if
-
-
-
-
-
- !====================================================
- ! Add Stand
- !====================================================
-
- if ( Get_StringUpdate() == STRING_UPDATE_ADD_STAND ) then
- kk = 0
- Do i= data%State%TD_String%DrillStemComponentsNumbs , 1 , -1
- if (data%State%TD_DrillStems(i)%ComponentType==3) then
- kk = i
- exit
- end if
- End Do
- ! DrillStems Array:
- TD_NumOfAddedComponents = 3
- Do i= (data%State%TD_String%DrillStemComponentsNumbs+1) , (data%State%TD_String%DrillStemComponentsNumbs+TD_NumOfAddedComponents)
- data%State%TD_DrillStems(i)%ComponentType = 3
- data%State%TD_DrillStems(i)%Id = data%State%TD_DrillStems(kk)%Id
- data%State%TD_DrillStems(i)%Od = data%State%TD_DrillStems(kk)%Od
- data%State%TD_DrillStems(i)%Area = (pi*((data%State%TD_DrillStems(i)%Od**2)-(data%State%TD_DrillStems(i)%Id**2)))/4.0d0
- data%State%TD_DrillStems(i)%RtoolJoint = data%State%TD_DrillStems(i)%Od*1.30d0/2.0d0
- data%State%TD_DrillStems(i)%ToolJointRange = data%State%TD_String%ToolJointRange
- data%State%TD_DrillStems(i)%Length = data%State%TD_DrillStems(kk)%LengthIni
- data%State%TD_DrillStems(i)%LengthIni = data%State%TD_DrillStems(kk)%LengthIni
- data%State%TD_DrillStems(i)%WeightperLength = data%State%TD_DrillStems(kk)%WeightperLength
- data%State%TD_DrillStems(i)%Weight = data%State%TD_DrillStems(i)%WeightperLength*data%State%TD_DrillStems(i)%Length
- data%State%TD_DrillStems(i)%Density = data%State%TD_DrillStems(kk)%Density
- data%State%TD_DrillStems(i)%ElasticModule = data%State%TD_DrillStems(kk)%ElasticModule
- End Do
- data%State%TD_String%DrillStemComponentsNumbs = data%State%TD_String%DrillStemComponentsNumbs+TD_NumOfAddedComponents
-
- ! DrillStem Array:
- i = data%State%TD_String%StringConfigurationCount+1
- data%State%TD_DrillStem(i)%ComponentType = 3
- data%State%TD_DrillStem(i)%Numbs = 3
- data%State%TD_DrillStem(i)%Id = data%State%TD_DrillStems(kk)%Id ! [ft]
- data%State%TD_DrillStem(i)%Od = data%State%TD_DrillStems(kk)%Od ! [ft]
- data%State%TD_DrillStem(i)%Length = data%State%TD_DrillStems(kk)%LengthIni
- data%State%TD_DrillStem(i)%WeightperLength = data%State%TD_DrillStems(kk)%WeightperLength
- data%State%TD_DrillStem(i)%TotalLength = data%State%TD_DrillStem(i)%Numbs*data%State%TD_DrillStem(i)%Length
- data%State%TD_DrillStem(i)%TotalWeight = data%State%TD_DrillStem(i)%TotalLength*data%State%TD_DrillStem(i)%WeightperLength
- data%State%TD_String%StringConfigurationCount = data%State%TD_String%StringConfigurationCount+1
-
-
- Call Set_StringUpdate(STRING_UPDATE_NEUTRAL)
- end if
-
-
-
-
-
-
- !====================================================
- ! Add IBOP
- !====================================================
-
- !if ( Get_Ibop()==IBOP_INSTALL ) then
- ! data%State%TD_Count%IBOPNewAdd = 1
- !else
- ! data%State%TD_Count%IBOPNewAdd = 0
- ! data%State%TD_Count%IBOPOldAdd = 0
- ! end if
-
- if ( Get_Ibop()==IBOP_INSTALL .and. data%State%TD_Count%IBOPOldAdd==0 ) then
- kk = 0
- Do i= data%State%TD_String%DrillStemComponentsNumbs , 1 , -1
- if (data%State%TD_DrillStems(i)%ComponentType==3) then
- kk = i
- exit
- end if
- End Do
- ! DrillStems Array:
- TD_NumOfAddedComponents = 1
- Do i= (data%State%TD_String%DrillStemComponentsNumbs+1) , (data%State%TD_String%DrillStemComponentsNumbs+TD_NumOfAddedComponents)
- data%State%TD_DrillStems(i)%ComponentType = 5
- data%State%TD_DrillStems(i)%Id = data%State%TD_DrillStems(kk)%Id
- data%State%TD_DrillStems(i)%Od = data%State%TD_DrillStems(kk)%RtoolJoint
- data%State%TD_DrillStems(i)%Area = (pi*((data%State%TD_DrillStems(i)%Od**2)-(data%State%TD_DrillStems(i)%Id**2)))/4.0d0
- data%State%TD_DrillStems(i)%RtoolJoint = data%State%TD_DrillStems(kk)%RtoolJoint
- data%State%TD_DrillStems(i)%ToolJointRange = 0.0d0
- data%State%TD_DrillStems(i)%Length = data%State%TD_StConn%IBOPLength ! [ft]
- data%State%TD_DrillStems(i)%LengthIni = data%State%TD_StConn%IBOPLength ! [ft]
- data%State%TD_DrillStems(i)%WeightperLength = 55.0d0 ! [lb/ft]
- data%State%TD_DrillStems(i)%Weight = data%State%TD_DrillStems(i)%WeightperLength*data%State%TD_DrillStems(i)%Length
- data%State%TD_DrillStems(i)%Density = data%State%TD_DrillStems(kk)%Density !????????????
- data%State%TD_DrillStems(i)%ElasticModule = data%State%TD_DrillStems(kk)%ElasticModule !????????????
- End Do
- data%State%TD_String%DrillStemComponentsNumbs = data%State%TD_String%DrillStemComponentsNumbs+TD_NumOfAddedComponents
-
- ! DrillStem Array:
- i = data%State%TD_String%StringConfigurationCount+1
- data%State%TD_DrillStem(i)%ComponentType = 5
- data%State%TD_DrillStem(i)%Numbs = 1
- data%State%TD_DrillStem(i)%Id = data%State%TD_DrillStems(kk)%Id ! [ft]
- data%State%TD_DrillStem(i)%Od = data%State%TD_DrillStems(kk)%RtoolJoint ! [ft]
- data%State%TD_DrillStem(i)%Length = 1.540d0 ! [ft]
- data%State%TD_DrillStem(i)%WeightperLength = 55.0d0 ! [lb/ft]
- data%State%TD_DrillStem(i)%TotalLength = data%State%TD_DrillStem(i)%Numbs*data%State%TD_DrillStem(i)%Length
- data%State%TD_DrillStem(i)%TotalWeight = data%State%TD_DrillStem(i)%TotalLength*data%State%TD_DrillStem(i)%WeightperLength
- data%State%TD_String%StringConfigurationCount = data%State%TD_String%StringConfigurationCount+1
-
-
- !data%State%TD_Count%IBOPOldAdd = data%State%TD_Count%IBOPNewAdd
-
- if ( Get_ElevatorConnection() /= ELEVATOR_CONNECTION_STRING .or. (Get_TdsConnectionModes()/=TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()/=TDS_ELEVATOR_CONNECTION_STRING) ) then
- data%State%TD_StConn%ConnectionHeight = data%State%TD_StConn%ConnectionHeight+data%State%TD_DrillStem(i)%Length
- end if
-
- end if
-
- if ( Get_Ibop()==IBOP_INSTALL ) then
- data%State%TD_Count%IBOPOldAdd = 1
- else
- data%State%TD_Count%IBOPOldAdd = 0
- end if
-
-
-
-
- !====================================================
- ! Add Safety Valve & Kelly (OPERATION_DRILL)
- !====================================================
-
- if ( data%Configuration%Hoisting%DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL .and. Get_KellyConnection() == KELLY_CONNECTION_STRING ) then
- data%State%TD_Count%KellyNewAdd = 1
- else
- data%State%TD_Count%KellyNewAdd = 0
- data%State%TD_Count%KellyOldAdd = 0
- end if
-
- if ( data%Configuration%Hoisting%DriveType==1 .and. Get_OperationCondition()==OPERATION_DRILL .and. Get_KellyConnection() == KELLY_CONNECTION_STRING .and. data%State%TD_Count%KellyNewAdd/=data%State%TD_Count%KellyOldAdd ) then
- ! DrillStems Array:
- TD_NumOfAddedComponents = 1
- Do i= (data%State%TD_String%DrillStemComponentsNumbs+1) , (data%State%TD_String%DrillStemComponentsNumbs+TD_NumOfAddedComponents)
- data%State%TD_DrillStems(i)%ComponentType = 6
- data%State%TD_DrillStems(i)%Id = data%State%TD_StConn%KellyElementID ! [ft]
- data%State%TD_DrillStems(i)%Od = data%State%TD_StConn%KellyElementOD ! [ft]
- data%State%TD_DrillStems(i)%Area = (pi*((data%State%TD_DrillStems(i)%Od**2)-(data%State%TD_DrillStems(i)%Id**2)))/4.0d0
- data%State%TD_DrillStems(i)%RtoolJoint = data%State%TD_DrillStems(i)%Od*1.30d0/2.0d0
- data%State%TD_DrillStems(i)%ToolJointRange = 0.0d0
- data%State%TD_DrillStems(i)%Length = data%State%TD_StConn%KellyElementConst ! [ft]
- data%State%TD_DrillStems(i)%LengthIni = data%State%TD_StConn%KellyElementConst ! [ft]
- data%State%TD_DrillStems(i)%WeightperLength = 55.0d0 ! [lb/ft]
- data%State%TD_DrillStems(i)%Weight = data%State%TD_DrillStems(i)%WeightperLength*data%State%TD_DrillStems(i)%Length
- data%State%TD_DrillStems(i)%Density = 7850.d0*0.06242796d0 ! [kg/m3]*0.06242796=[lb/ft3]
- data%State%TD_DrillStems(i)%ElasticModule = 200.0d9*0.02088543d0 ! [lb/ft2] !200GPa=29Mpsi (steel)
- End Do
- data%State%TD_String%DrillStemComponentsNumbs = data%State%TD_String%DrillStemComponentsNumbs+TD_NumOfAddedComponents
-
- ! DrillStem Array:
- i = data%State%TD_String%StringConfigurationCount+1
- data%State%TD_DrillStem(i)%ComponentType = 6
- data%State%TD_DrillStem(i)%Numbs = 1
- data%State%TD_DrillStem(i)%Id = 3.0d0/12.d0 ! [ft]
- data%State%TD_DrillStem(i)%Od = 5.90d0/12.d0 ! [ft]
- data%State%TD_DrillStem(i)%Length = data%State%TD_StConn%KellyElementConst ! [ft]
- data%State%TD_DrillStem(i)%WeightperLength = 55.0d0 ! [lb/ft]
- data%State%TD_DrillStem(i)%TotalLength = data%State%TD_DrillStem(i)%Numbs*data%State%TD_DrillStem(i)%Length
- data%State%TD_DrillStem(i)%TotalWeight = data%State%TD_DrillStem(i)%TotalLength*data%State%TD_DrillStem(i)%WeightperLength
- data%State%TD_String%StringConfigurationCount = data%State%TD_String%StringConfigurationCount+1
-
-
- data%State%TD_Count%KellyOldAdd = data%State%TD_Count%KellyNewAdd
-
- end if
-
-
-
-
-
- !====================================================
- ! Add Safety Valve (OPERATION_TRIP)
- !====================================================
-
- !if ( Get_OperationCondition()==OPERATION_TRIP .and. Get_SafetyValve()==SAFETY_VALVE_INSTALL ) then
- ! data%State%TD_Count%SafetyValveNewAdd = 1
- !else
- ! data%State%TD_Count%SafetyValveNewAdd = 0
- ! data%State%TD_Count%SafetyValveOldAdd = 0
- !end if
-
- if ( data%State%TD_StConn%KellyDriveTypeMode/=0 .and. data%State%TD_StConn%OldOperationCondition/=0 .and. Get_SafetyValve()==SAFETY_VALVE_INSTALL .and. data%State%TD_Count%SafetyValveOldAdd==0 ) then
- kk = 0
- Do i= data%State%TD_String%DrillStemComponentsNumbs , 1 , -1
- if (data%State%TD_DrillStems(i)%ComponentType==3) then
- kk = i
- exit
- end if
- End Do
- ! DrillStems Array:
- TD_NumOfAddedComponents = 1
- Do i= (data%State%TD_String%DrillStemComponentsNumbs+1) , (data%State%TD_String%DrillStemComponentsNumbs+TD_NumOfAddedComponents)
- data%State%TD_DrillStems(i)%ComponentType = 7
- data%State%TD_DrillStems(i)%Id = data%State%TD_DrillStems(kk)%Id
- data%State%TD_DrillStems(i)%Od = data%State%TD_DrillStems(kk)%RtoolJoint
- data%State%TD_DrillStems(i)%Area = (pi*((data%State%TD_DrillStems(i)%Od**2)-(data%State%TD_DrillStems(i)%Id**2)))/4.0d0
- data%State%TD_DrillStems(i)%RtoolJoint = data%State%TD_DrillStems(kk)%RtoolJoint
- data%State%TD_DrillStems(i)%ToolJointRange = 0.0d0
- data%State%TD_DrillStems(i)%Length = data%State%TD_StConn%SafetyValveLength ! [ft]
- data%State%TD_DrillStems(i)%LengthIni = data%State%TD_StConn%SafetyValveLength ! [ft]
- data%State%TD_DrillStems(i)%WeightperLength = 55.0d0 ! [lb/ft]
- data%State%TD_DrillStems(i)%Weight = data%State%TD_DrillStems(i)%WeightperLength*data%State%TD_DrillStems(i)%Length
- data%State%TD_DrillStems(i)%Density = data%State%TD_DrillStems(kk)%Density !????????????
- data%State%TD_DrillStems(i)%ElasticModule = data%State%TD_DrillStems(kk)%ElasticModule !????????????
- End Do
- data%State%TD_String%DrillStemComponentsNumbs = data%State%TD_String%DrillStemComponentsNumbs+TD_NumOfAddedComponents
-
- ! DrillStem Array:
- i = data%State%TD_String%StringConfigurationCount+1
- data%State%TD_DrillStem(i)%ComponentType = 7
- data%State%TD_DrillStem(i)%Numbs = 1
- data%State%TD_DrillStem(i)%Id = data%State%TD_DrillStems(kk)%Id ! [ft]
- data%State%TD_DrillStem(i)%Od = data%State%TD_DrillStems(kk)%RtoolJoint ! [ft]
- data%State%TD_DrillStem(i)%Length = 1.540d0 ! [ft]
- data%State%TD_DrillStem(i)%WeightperLength = 55.0d0 ! [lb/ft]
- data%State%TD_DrillStem(i)%TotalLength = data%State%TD_DrillStem(i)%Numbs*data%State%TD_DrillStem(i)%Length
- data%State%TD_DrillStem(i)%TotalWeight = data%State%TD_DrillStem(i)%TotalLength*data%State%TD_DrillStem(i)%WeightperLength
- data%State%TD_String%StringConfigurationCount = data%State%TD_String%StringConfigurationCount+1
-
-
- !data%State%TD_Count%SafetyValveOldAdd = data%State%TD_Count%SafetyValveNewAdd
-
- if ( Get_ElevatorConnection() /= ELEVATOR_CONNECTION_STRING .or. (Get_TdsConnectionModes()/=TDS_CONNECTION_NOTHING .and. Get_TdsElevatorModes()/=TDS_ELEVATOR_CONNECTION_STRING) ) then
- data%State%TD_StConn%ConnectionHeight = data%State%TD_StConn%ConnectionHeight+data%State%TD_DrillStem(i)%Length
- end if
-
- end if
-
- if ( Get_SafetyValve()==SAFETY_VALVE_INSTALL ) then
- data%State%TD_Count%SafetyValveOldAdd = 1
- else
- data%State%TD_Count%SafetyValveOldAdd = 0
- end if
-
-
-
- end subroutine
|