Browse Source

First Demo

master
mahmood19227 1 year ago
parent
commit
bd6f1be650
7 changed files with 171 additions and 10 deletions
  1. +1
    -1
      Makefile
  2. BIN
     
  3. +3
    -3
      Simulator.f90
  4. +3
    -3
      Simulator.i90
  5. +1
    -3
      TorqueDrag/TD_DrillingSubs/TD_WellGeoConfiguration.f90
  6. +51
    -0
      TorqueDrag/TD_DrillingSubs/TD_WellGeoConfiguration.i90
  7. +112
    -0
      TorqueDrag/TD_Modules/TD_DrillStem.i90

+ 1
- 1
Makefile View File

@@ -392,7 +392,7 @@ all: $(TARGET)
$(TARGET): $(OBJS_F)
@echo "make TARGET"
cc Redis/redis_io.c -c -o obj/redis_io.o
$(FC) -o $@ $(FCFLAGS) -traceback $(OBJS_F) obj/redis_io.o lib/libjsonfortran.a lib/libhiredis.a $@.f90
$(FC) -o $@ $(FCFLAGS) $(OBJS_F) obj/redis_io.o lib/libjsonfortran.a lib/libhiredis.a $@.f90
writevars: $(OBJS_F)
@echo "make writevars"


BIN
View File


+ 3
- 3
Simulator.f90 View File

@@ -177,7 +177,7 @@ module Simulator
!!Tarmigh. Step must rewrittem
call TopDrive_Step()
t(10) = time_ms()
t_modules(10) = t_modules(10)+t(10)-t(9)
t_modules(10) = t_modules(10)+t(10)-t(9)
! call Geo_Step()
!!Ahmadi
@@ -186,7 +186,7 @@ module Simulator
t_modules(11) = t_modules(11)+t(11)-t(10)
!! Sheikh
! call FluidFlow_Step()
call FluidFlow_Step()
!! Ahmadi
call OperationScenarios_Step()
!! Write variables to shared files
@@ -380,7 +380,7 @@ module Simulator
! call Annular_Step()
!! Sheikh
! call FluidFlow_Init()
call FluidFlow_Init()
! print *,"Mudsystem initialized"
!! Ahmadi


+ 3
- 3
Simulator.i90 View File

@@ -178,7 +178,7 @@ module Simulator
!!Tarmigh. Step must rewrittem
call TopDrive_Step()
t(10) = time_ms()
t_modules(10) = t_modules(10)+t(10)-t(9)
t_modules(10) = t_modules(10)+t(10)-t(9)

! call Geo_Step()
!!Ahmadi
@@ -187,7 +187,7 @@ module Simulator
t_modules(11) = t_modules(11)+t(11)-t(10)

!! Sheikh
! call FluidFlow_Step()
call FluidFlow_Step()
!! Ahmadi
call OperationScenarios_Step()
!! Write variables to shared files
@@ -381,7 +381,7 @@ module Simulator
! call Annular_Step()
!! Sheikh
! call FluidFlow_Init()
call FluidFlow_Init()
! print *,"Mudsystem initialized"
!! Ahmadi


+ 1
- 3
TorqueDrag/TD_DrillingSubs/TD_WellGeoConfiguration.f90 View File

@@ -1,9 +1,7 @@
subroutine TD_WellGeoConfiguration
Use TD_DrillStemComponents
use SimulationVariables !@
use SimulationVariables !@
use SimulationVariables !@
use SimulationVariables
Use sROP_Variables
use CDataDisplayConsole
use SimulationVariables


+ 51
- 0
TorqueDrag/TD_DrillingSubs/TD_WellGeoConfiguration.i90 View File

@@ -0,0 +1,51 @@
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/TorqueDrag/TD_DrillingSubs/TD_WellGeoConfiguration.f90"
subroutine TD_WellGeoConfiguration
Use TD_DrillStemComponents
use SimulationVariables
Use sROP_Variables
use CDataDisplayConsole
use SimulationVariables
use CWarnings

implicit none

!====================================================
! Well Geometry Data Modification
!====================================================
!=====> ROP Calculation
if ( data%State%TD_DrillStems(1)%ComponentType==0 .and. data%Warnings%MaximumWellDepthExceeded==.false. ) then
Call ROP_MainCalculation
else
data%State%ROP_Bit%RateOfPenetration = 0.d0
Call Set_ROP(data%State%ROP_Bit%RateOfPenetration)
end if
!=====> ROPHole Data correction
data%State%TD_WellEl%ROP = (data%State%ROP_Bit%RateOfPenetration/3600.d0) ! [ft/s]
data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%VerticalDepth = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%VerticalDepth++((data%State%TD_WellEl%ROP*data%State%TD_General%TimeStep)*cos(data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%StartAngle))
data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%IntervalLength = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%IntervalLength+(data%State%TD_WellEl%ROP*data%State%TD_General%TimeStep) !????????check
data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%DownDepth = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%TopDepth+data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%IntervalLength
!=====> Well Total Length Calculation
data%State%TD_WellGeneral%WellTotalLength = data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%DownDepth
data%State%TD_WellGeneral%WellTotalVerticalLength = data%State%TD_WellGeneral%WellTotalVerticalLength+((data%State%TD_WellEl%ROP*data%State%TD_General%TimeStep)*cos(data%State%TD_WellGeo(data%State%TD_WellGeneral%WellIntervalsCount)%StartAngle))
Call Set_TotalDepth(real(data%State%TD_WellGeneral%WellTotalLength,8))
end subroutine

+ 112
- 0
TorqueDrag/TD_Modules/TD_DrillStem.i90 View File

@@ -0,0 +1,112 @@
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/TorqueDrag/TD_Modules/TD_DrillStem.f90"
MODULE TD_DrillStemComponents
Use CDownHoleVariables
IMPLICIT NONE
PUBLIC
!************************************************************************************************************************************
TYPE, PUBLIC :: TD_StringInfo
INTEGER :: StringConfigurationCount , DrillStemComponentsNumbs , DrillStemForceType
INTEGER :: NoHorizontalMudElements , NoStringMudElements , NoCasingMudElements
REAL(8) :: DrillStemTotalLength , DrillStemTotalLengthIni , OutOfWellLength , DrillStemTotalWeight , DrillStemBottom
REAL(8) :: DrillStemAxialVelocity , DrillStemRotVelocity , TopJointHeight
REAL(8) :: WeightOnBit , BitTorque , TotalTorque , StaticHookLoad , DlMax , DlTotal , DlTouch
REAL(8) :: HookLoad , StringTorque
REAL(8) :: ToolJointRange
real(8) , allocatable :: FluidMudDensity(:) , FluidMudEndX(:) , FluidMudStartX(:)
!====================================================
! Separated Parts of the Drill Stem
INTEGER :: NearFloorConnectionNo
REAL(8) :: NearFloorConnectionHeight
!====================================================
END TYPE TD_StringInfo
!************************************************************************************************************************************

!************************************************************************************************************************************
!====================================================
! Drill Stem Components Info
!====================================================
TYPE, PUBLIC :: TD_DrillStemInfo
INTEGER :: Numbs , ComponentType
REAL(8) :: Length , TopDepth , DownDepth , Od , Id , WeightperLength , TotalLength , TotalWeight
END TYPE TD_DrillStemInfo
!************************************************************************************************************************************

!************************************************************************************************************************************
!====================================================
! Separated Parts of the Drill Stem
!====================================================
TYPE , PUBLIC :: TD_SeparatedDrillStemInfo
!=========> Elements Geometry
INTEGER :: HoleType , ComponentType
REAL(8) :: Length , TopDepth , DownDepth , Od , Id , Area , Weight , WeightperLength , StartAngle , EndAngle
REAL(8) :: RCurvature , RtoolJoint , HoleDiameter , ToolJointRange
!=========> Elements initial Geometry
REAL(8) :: LengthIni , TopDepthIni , DownDepthIni , StartAngleIni , EndAngleIni
!=========> Elements initial Geometry (graphic)
REAL(8) :: TopDepthIniG , DownDepthIniG
!=========> Pipes Properties
REAL(8) :: Density , ElasticModule
!=========> Forces Info
REAL(8) :: Force1 , Force2 , Torque , Drag , CombVelRatio
!=========> Mud Properties
REAL(8) :: MudDensityIn , MudDensityOut , MudViscosity , MudVisCorrectCoef , BouyancyFactor , MudWeight , MudPlasticVis , MudYieldPoint
!=========> Viscous Drag Force
REAL(8) :: FricFactor , DiamRatio , MudClingingConst , PipeVelocity , AveEffVelocity , ReNumber , Dp_Dl
!=========> Hook Load
REAL(8) :: StaticHookLoad , TotalSHookLoad , Dl , DlTotal
END TYPE TD_SeparatedDrillStemInfo
!************************************************************************************************************************************

!************************************************************************************************************************************
!====================================================
! Add&Remove DrillStem Components
!====================================================
TYPE , PUBLIC :: TD_AddRemoveInfo
INTEGER :: IBOPNewAdd , IBOPOldAdd , SafetyValveNewAdd , SafetyValveOldAdd , KellyNewAdd , KellyOldAdd
INTEGER :: IBOPNewRemove , IBOPOldRemove , SafetyValveNewRemove , SafetyValveOldRemove , KellyNewRemove , KellyOldRemove
INTEGER , Dimension(19) :: KellyOldStatus , KellyNewStatus
!integer :: TD_KellyOldStatus1 , TD_KellyNewStatus1 , TD_KellyOldStatus2 , TD_KellyNewStatus2 , TD_KellyOldStatus3 , TD_KellyNewStatus3
!integer :: TD_KellyOldStatus4 , TD_KellyNewStatus4 , TD_KellyOldStatus5 , TD_KellyNewStatus5 , TD_KellyOldStatus6 , TD_KellyNewStatus6
!integer :: TD_KellyOldStatus7 , TD_KellyNewStatus7 , TD_KellyOldStatus8 , TD_KellyNewStatus8
!integer :: TD_KellyOldStatus9 , TD_KellyNewStatus9 , TD_KellyOldStatus10 , TD_KellyNewStatus10
!integer :: TD_KellyOldStatus11 , TD_KellyNewStatus11 , TD_KellyOldStatus12 , TD_KellyNewStatus12
!integer :: TD_KellyOldStatus13 , TD_KellyNewStatus13 , TD_KellyOldStatus14 , TD_KellyNewStatus14
!integer :: TD_KellyOldStatus15 , TD_KellyNewStatus15 , TD_KellyOldStatus16 , TD_KellyNewStatus16 , TD_KellyOldStatus17 , TD_KellyNewStatus17
!integer :: TD_KellyOldStatus18 , TD_KellyNewStatus18 , TD_KellyOldStatus19 , TD_KellyNewStatus19
END TYPE TD_AddRemoveInfo
!************************************************************************************************************************************

!************************************************************************************************************************************
!====================================================
! Graphic Output Info
!====================================================
!TYPE, PUBLIC :: CStringComponent
! Integer :: ComponentType
! REAL(8) :: Length , TopDepth , DownDepth , Od , Id
!END TYPE CStringComponent
!************************************************************************************************************************************

!************************************************************************************************************************************
!====================================================
! Removed-Volume Variables
!====================================================
TYPE , PUBLIC :: TD_RemovedVolumeInfo
Integer :: PreCount
REAL(8) :: RemoveVolume , PreElementVolume , PreElementLength
END TYPE TD_RemovedVolumeInfo
!************************************************************************************************************************************
END MODULE TD_DrillStemComponents

Loading…
Cancel
Save