subroutine TD_MainCalculations Use CCasingLinerChokeVariables Use CStringConfigurationVariables Use CSimulationVariables Use TD_DrillStemComponents Use TD_WellElements Use TD_WellGeometry Use TD_GeneralData Use TD_StringConnectionData Use FricPressDropVars Use MudSystemVARIABLES implicit none Integer :: i !Integer :: TD_SolDuration !integer,dimension(8) :: TD_StartTime , TD_EndTime TD_TimeStep = 0.1d0 ! Unit: [s] !Call TD_StartUp !Call TD_WellReadData !Call TD_WellElementsReadData !Call TD_DrillStemReadData !Call TD_PipePropertiesReadData !!Call TD_WellGeoConfiguration !!Call TD_WellElementsConfiguration !!Call TD_StringConnectionModes !!Call TD_DrillStemConfiguration !loop1: do !CALL DATE_AND_TIME(values=TD_StartTime) Call TD_WellGeoConfiguration Call TD_WellElementsConfiguration Call TD_StringConnectionModes Call TD_DrillStemConfiguration Call TD_ForceReadData !===> Mud properties Read_Data from Fluid Module !!TD_NoHorizontalMudElements = TDNoHorizontalMudElements !!TD_NoStringMudElements = TDNoStringMudElements !!TD_NoCasingMudElements = TDNoCasingMudElements !! !!if (allocated(TDDensity_MudElementArray) .and. (TD_NoHorizontalMudElements+TD_NoStringMudElements+TD_NoCasingMudElements)/=0) then !! if (Allocated(TD_FluidMudDensity)) Deallocate(TD_FluidMudDensity) !! Allocate(TD_FluidMudDensity(TD_NoHorizontalMudElements+TD_NoStringMudElements+TD_NoCasingMudElements)) !! TD_FluidMudDensity(:) = TDDensity_MudElementArray(:) !!end if !! !!if (allocated(TDXend_MudElementArray)) then !! if (Allocated(TD_FluidMudEndX)) Deallocate(TD_FluidMudEndX) !! Allocate(TD_FluidMudEndX(TD_NoHorizontalMudElements+TD_NoStringMudElements+TD_NoCasingMudElements)) !! TD_FluidMudEndX(:) = TDXend_MudElementArray(:) !!end if !! !!if (allocated(TDXstart_MudElementArray)) then !! if (Allocated(TD_FluidMudStartX)) Deallocate(TD_FluidMudStartX) !! Allocate(TD_FluidMudStartX(TD_NoHorizontalMudElements+TD_NoStringMudElements+TD_NoCasingMudElements)) !! TD_FluidMudStartX(:) = TDXstart_MudElementArray(:) !!end if if (TD_DrillStem(1)%ComponentType==0) then Do i = 2 , TD_DrillStemComponentsNumbs Call TD_MudPropertiesReadData(i) Call TD_BouyancyFactor(i) Call TD_CombinedMotionData(i) End Do TD_DrillStems(1)%MudDensityIn = TD_DrillStems(2)%MudDensityIn !(1): bit mud properties TD_DrillStems(1)%MudDensityOut = TD_DrillStems(2)%MudDensityOut TD_DrillStems(1)%MudWeight = TD_DrillStems(2)%MudWeight TD_DrillStems(1)%MudPlasticVis = 5.d0+(5.d0*(TD_DrillStems(1)%MudWeight-8.3d0)) TD_DrillStems(1)%MudViscosity = 0.2d0 !TD_DrillStems(i)%MudPlasticVis TD_DrillStems(1)%MudYieldPoint = 10.d0+(TD_DrillStems(1)%MudWeight-8.3d0) Call TD_BouyancyFactor(1) Call TD_CombinedMotionData(1) else Do i = 1 , TD_DrillStemComponentsNumbs Call TD_MudPropertiesReadData(i) Call TD_BouyancyFactor(i) Call TD_CombinedMotionData(i) End Do end if !================================================ Call TD_BOPDiamCalculation Call TD_StaticHookLoadCalculation Call TD_WeightOnBitCalculation if (abs(TD_DrillStemAxialVelocity)>3.2808d0) then !1[m/s]=3.2808[ft/s] Call TD_ViscousDragForce else TD_DrillStems%Drag = 0.d0 TD_DrillStemForceType = 5 end if Call TD_ForceCalculation Call TD_HookLoadCalculation !!!!!!print*, 'TD_StringVelocity=' , TD_StringVelocity !!!!!!print*, 'TD_HookLoad=' , TD_HookLoad !print*, 'TD_WellTotalLength=' , TD_WellTotalLength !print*, 'TD_ConnectionHeight_main=' , TD_ConnectionHeight !!!!!!!!print*, 'TD_DrillStems(1)%StartAngle=' , TD_DrillStems(1)%StartAngle !!!!!!print*, 'TD_DrillStems(1)%Force2=' , TD_DrillStems(1)%Force2 !!!!!!print*, 'TD_DrillStems(1)%Force1=' , TD_DrillStems(1)%Force1 !!!!!print*, 'TD_WeightIndicator=' , TD_WeightIndicator !!!!!print*, 'TD_DlTotal=' , TD_DlTotal !!!!!print*, 'TD_DlMax=' , TD_DlMax !!!!!!print*, 'TD_DrillStems(n)%Force2=' , TD_DrillStems(TD_DrillStemComponentsNumbs)%Force2 !!!!!!print*, 'TD_DrillStems(n)%Force1=' , TD_DrillStems(TD_DrillStemComponentsNumbs)%Force1 !print*, 'TD_DrillStems(1)%Drag=' , TD_DrillStems(1)%Drag !!!!!!!!! !print*, 'TD_WeightOnBit=' , TD_WeightOnBit !!print*, 'TD_StringTorque=' , TD_StringTorque !!print*, 'TD_DrillStems(1)%Torque=' , TD_DrillStems(1)%Torque !!print*, 'TD_DrillStems(n)%Torque=' , TD_DrillStems(TD_DrillStemComponentsNumbs)%Torque !!!!!!!!! !print*, 'TD_DrillStemComponentsNumbs_main =' ,TD_DrillStemComponentsNumbs !print*, 'TD_DrillStemTotalLength=' ,TD_DrillStemTotalLength !!print*, 'TD_StringConfigurationCount=' ,TD_StringConfigurationCount !print*, 'TD_HookHeight=' ,TD_HookHeight !!!!!!print*, 'TD_HookVelocity=' ,TD_HookVelocity !print*, 'TD_DrillStems(1)%DownDepth=' ,TD_DrillStems(1)%DownDepth !print*, 'TD_DrillStems(1)%DownDepthIni_main=' ,TD_DrillStems(1)%DownDepthIni !!!!!!print*, 'TD_DrillStems(1)%DownDepth=' ,TD_DrillStems(335)%DownDepth !!print*, 'TD_DrillStems(n)%DownDepth=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%DownDepth !!!print*, 'TD_DrillStems(n)%ID=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%ID !!!print*, 'TD_DrillStems(n)%OD=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%OD !!!print*, 'TD_DrillStem(n)%ID=' ,TD_DrillStem(TD_StringConfigurationCount)%ID !!!print*, 'TD_DrillStem(n)%OD=' ,TD_DrillStem(TD_StringConfigurationCount)%OD !!!print*, 'TD_DrillStem(1)%ID=' ,TD_DrillStem(1)%ID !!!print*, 'TD_DrillStem(1)%OD=' ,TD_DrillStem(1)%OD !!!!!print*, 'TD_StaticHookLoad=' ,TD_StaticHookLoad !!!!print*, 'TD_DrillStems(n)%Dl=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%Dl !!!!!print*, 'TD_DrillStems(n)%Length=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%Length !!!!!print*, 'TD_DrillStem(1)%Length=' ,TD_DrillStem(1)%Length !!!!!print*, 'TD_DrillStems(n)%Area=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%Area !!!!!print*, 'TD_DrillStems(n)%ElasticModule=' ,TD_DrillStems(TD_DrillStemComponentsNumbs)%ElasticModule TD_HookHeightOld = TD_HookHeight ! if(IsStopped == .true.) then ! EXIT loop1 ! end if ! ! ! CALL DATE_AND_TIME(values=TD_EndTime) ! TD_SolDuration=100-(TD_EndTime(6)*60000+TD_EndTime(7)*1000+TD_EndTime(8)-TD_StartTime(6)*60000-TD_StartTime(7)*1000-TD_StartTime(8)) ! !print*, 'TD_SolDuration=' , TD_SolDuration ! !print*, 'TD_exe=' , (TD_EndTime(6)*60000+TD_EndTime(7)*1000+TD_EndTime(8)-TD_StartTime(6)*60000-TD_StartTime(7)*1000-TD_StartTime(8)) ! if(TD_SolDuration > 0.0d0) then ! CALL sleepqq(TD_SolDuration) ! end if ! ! !end do loop1 ! !return end subroutine TD_MainCalculations