Simulation Core
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 
 

149 righe
3.8 KiB

  1. # 1 "/mnt/c/Projects/VSIM/SimulationCore2/FluidFlow/FluidFlowMain.f90"
  2. module FluidFlowMain
  3. implicit none
  4. public
  5. contains
  6. !
  7. ! subroutine FluidFlow_Setup()
  8. ! ! use CSimulationVariables
  9. ! implicit none
  10. ! !call OnSimulationInitialization%Add(FluidFlow_Init)
  11. ! call OnSimulationStop%Add(FluidFlow_Stop)
  12. ! call OnFluidFlowStart%Add(FluidFlow_Start)
  13. ! call OnFluidFlowStep%Add(FluidFlow_Step)
  14. ! !call OnFluidFlowOutput%Add(FluidFlow_Output)
  15. ! call OnFluidFlowMain%Add(FluidFlowMainBody)
  16. ! end subroutine
  17. ! subroutine FluidFlow_Stop
  18. ! implicit none
  19. ! !WRITE (*,*) ' fluid flow done_Stop'
  20. ! call DEALLOCATE_ARRAYS_NormalCirculation()
  21. ! CALL DeallocateFlowTypes
  22. ! end subroutine FluidFlow_Stop
  23. subroutine FluidFlow_Init
  24. USE Fluid_Flow_Startup_Vars
  25. implicit none
  26. !WRITE (*,*) ' fluid flow done_Start'
  27. CALL NormalCirculation_StartUp()
  28. CALL FlowStartup
  29. Call TD_StartUp
  30. Call TD_WellReadData
  31. Call TD_WellElementsReadData
  32. Call TD_DrillStemReadData
  33. Call TD_PipePropertiesReadData
  34. end subroutine FluidFlow_Init
  35. subroutine FluidFlow_Step
  36. implicit none
  37. integer :: i, FlowDuration, SimulationStateOld
  38. integer,dimension(8) :: FlowStartTime,FlowEndTime
  39. !WRITE (*,*) ' fluid flow done_Step'
  40. !call Fluid_Flow_Solver
  41. CALL DATE_AND_TIME(values=FlowStartTime)
  42. call Fluid_Flow_Solver
  43. CALL DATE_AND_TIME(values=FlowEndTime)
  44. FlowDuration = 3600000 * (FlowEndTime(5) - FlowStartTime(5)) + 60000 * (FlowEndTime(6) - FlowStartTime(6)) + 1000 * (FlowEndTime(7) - FlowStartTime(7)) + (FlowEndTime(8) - FlowStartTime(8))
  45. WRITE (*,*) 'FlowDuration (ms)=' , FlowDuration
  46. end subroutine FluidFlow_Step
  47. !subroutine FluidFlow_Output
  48. ! implicit none
  49. !end subroutine FluidFlow_Output
  50. ! subroutine FluidFlowMainBody
  51. ! !
  52. ! use ifport
  53. ! use ifmt
  54. ! ! use CSimulationVariables
  55. ! USE Fluid_Flow_Startup_Vars
  56. ! !use general_info, only : reset_data
  57. ! !use well_info
  58. ! !use drilling_info
  59. ! use CLog1
  60. ! !
  61. ! implicit none
  62. !integer :: i, FlowDuration, SimulationStateOld
  63. !integer,dimension(8) :: FlowStartTime,FlowEndTime
  64. !
  65. !
  66. !CALL NormalCirculation_StartUp()
  67. !CALL FlowStartup
  68. !
  69. !Call TD_StartUp
  70. !Call TD_WellReadData
  71. !Call TD_WellElementsReadData
  72. !Call TD_DrillStemReadData
  73. !Call TD_PipePropertiesReadData
  74. !
  75. !
  76. !LoopSimulation: do
  77. ! !WRITE (*,*) ' fluid flow done 0'
  78. !!
  79. ! CALL DATE_AND_TIME(values=FlowStartTime)
  80. ! !WRITE (*,*) 'FlowStartTime=', FlowStartTime
  81. !!
  82. ! call Fluid_Flow_Solver
  83. !
  84. !!
  85. ! CALL DATE_AND_TIME(values=FlowEndTime)
  86. !!
  87. ! !WRITE (*,*) ' fluid flow done 1'
  88. !
  89. !
  90. !
  91. ! FlowDuration = 3600000 * (FlowEndTime(5) - FlowStartTime(5)) + 60000 * (FlowEndTime(6) - FlowStartTime(6)) + 1000 * (FlowEndTime(7) - FlowStartTime(7)) + (FlowEndTime(8) - FlowStartTime(8))
  92. !
  93. !
  94. ! !call Log_1('FlowDuration=', FlowDuration)
  95. ! !WRITE (*,*) 'FlowDuration (ms)=' , FlowDuration
  96. !
  97. ! if ((100 - FlowDuration) > 0) then
  98. ! !WRITE (*,*) 'fluid flow done 2'
  99. ! call sleepqq(100 - FlowDuration)
  100. ! !WRITE (*,*) ' fluid flow done 3'
  101. !
  102. ! end if
  103. ! !WRITE (*,*) ' fluid flow done 4'
  104. !
  105. !
  106. !
  107. ! !WRITE (*,*) "FlowDuration", FlowDuration
  108. ! !if(IsStopped) then
  109. ! ! EXIT LoopSimulation
  110. ! !ENDIF
  111. ! !write(*,*) 'IsStopped=' , IsStopped
  112. !
  113. ! if(IsStopped) then
  114. ! !write(*,*) '44444444444'
  115. !
  116. ! call DEALLOCATE_ARRAYS_NormalCirculation()
  117. ! CALL DeallocateFlowTypes
  118. ! call Quit()
  119. ! end if
  120. ! !
  121. ! ! if(IsStopped) exit LoopSimulation
  122. ! !
  123. !end do LoopSimulation
  124. !!call DEALLOCATE_ARRAYS_NormalCirculation()
  125. !!CALL DeallocateFlowTypes
  126. !
  127. !
  128. ! end subroutine FluidFlowMainBody
  129. end module FluidFlowMain