@@ -41,40 +41,16 @@ | |||||
"preLaunchTask": "build" | "preLaunchTask": "build" | ||||
}, | }, | ||||
{ | { | ||||
"name": "Debug (Liara)", | |||||
"name": "Debug Test", | |||||
"type": "cppdbg", | "type": "cppdbg", | ||||
"request": "launch", | "request": "launch", | ||||
"program": "${workspaceRoot}/SimulationCore2", | |||||
"args": ["aberama.iran.liara.ir", "32815", "4YKFnubfFFjfh4yTK7b0Rg9X", "de972886-410b-440e-f8cc-08dba274a00f", "4", "1000","10"], | |||||
"stopAtEntry": false, | |||||
"cwd": "${workspaceRoot}", | |||||
"externalConsole": false, | |||||
"MIMode": "gdb", | |||||
"preLaunchTask": "make", | |||||
}, | |||||
{ | |||||
"name": "Debug (Asiatech)", | |||||
"type": "cppdbg", | |||||
"request": "launch", | |||||
"program": "${workspaceRoot}/SimulationCore2", | |||||
"args": ["85.198.9.229", "6379", "'1qazxsw2$$'", "b6996849-fb69-4076-ca17-08dbea60e4cb", "4", "100","10"], | |||||
"stopAtEntry": false, | |||||
"cwd": "${workspaceRoot}", | |||||
"externalConsole": false, | |||||
"MIMode": "gdb", | |||||
"preLaunchTask": "make", | |||||
}, | |||||
{ | |||||
"name": "Debug write_vars", | |||||
"type": "cppdbg", | |||||
"request": "launch", | |||||
"program": "${workspaceRoot}/write_vars", | |||||
"args": ["Config-debug.json"], | |||||
"program": "${workspaceRoot}/Test_Redis", | |||||
"args": [], | |||||
"stopAtEntry": false, | "stopAtEntry": false, | ||||
"cwd": "${workspaceRoot}", | "cwd": "${workspaceRoot}", | ||||
"externalConsole": false, | "externalConsole": false, | ||||
"MIMode": "gdb", | "MIMode": "gdb", | ||||
// "preLaunchTask": "make debug", | |||||
"preLaunchTask": "make testredis", | |||||
} | } | ||||
] | ] |
@@ -1,6 +1,14 @@ | |||||
{ | { | ||||
"version": "2.0.0", | "version": "2.0.0", | ||||
"tasks": [ | "tasks": [ | ||||
{ | |||||
"label": "make testredis", | |||||
"type": "shell", | |||||
"command": "make testredis", | |||||
"options": { | |||||
"cwd": "${workspaceRoot}" | |||||
} | |||||
}, | |||||
{ | { | ||||
"label": "make", | "label": "make", | ||||
"type": "shell", | "type": "shell", | ||||
@@ -21,6 +21,7 @@ module CFormation | |||||
call json%info(p, n_children=n_children) | call json%info(p, n_children=n_children) | ||||
data%Configuration%Formation%Count = n_children | data%Configuration%Formation%Count = n_children | ||||
if (.not. allocated(data%Configuration%Formation%Formations) .or. size(data%Configuration%Formation%Formations)/=n_children) then | if (.not. allocated(data%Configuration%Formation%Formations) .or. size(data%Configuration%Formation%Formations)/=n_children) then | ||||
ALLOCATE(data%Configuration%Formation%Formations(n_children)) | ALLOCATE(data%Configuration%Formation%Formations(n_children)) | ||||
endif | endif | ||||
@@ -116,9 +116,8 @@ module MudPropertiesModule | |||||
subroutine Set_ActiveMudVolume_StudentStation(v) | subroutine Set_ActiveMudVolume_StudentStation(v) | ||||
implicit none | implicit none | ||||
real*8, intent(in) :: v | real*8, intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%Configuration%Mud%ActiveMudVolume == v) return | |||||
#endif | |||||
# 120 | |||||
data%Configuration%Mud%ActiveMudVolume = v | data%Configuration%Mud%ActiveMudVolume = v | ||||
! if(associated(ActiveMudVolumePtr)) call ActiveMudVolumePtr(data%Configuration%Mud%ActiveMudVolume) | ! if(associated(ActiveMudVolumePtr)) call ActiveMudVolumePtr(data%Configuration%Mud%ActiveMudVolume) | ||||
end subroutine | end subroutine | ||||
@@ -126,9 +125,8 @@ module MudPropertiesModule | |||||
subroutine Set_ActiveDensity_StudentStation(v) | subroutine Set_ActiveDensity_StudentStation(v) | ||||
implicit none | implicit none | ||||
real*8, intent(in) :: v | real*8, intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%Configuration%Mud%ActiveDensity == v) return | |||||
#endif | |||||
# 130 | |||||
data%Configuration%Mud%ActiveDensity = v | data%Configuration%Mud%ActiveDensity = v | ||||
! if(associated(ActiveDensityPtr)) call ActiveDensityPtr(data%Configuration%Mud%ActiveDensity) | ! if(associated(ActiveDensityPtr)) call ActiveDensityPtr(data%Configuration%Mud%ActiveDensity) | ||||
end subroutine | end subroutine | ||||
@@ -136,9 +134,8 @@ module MudPropertiesModule | |||||
subroutine Set_ReserveMudVolume_StudentStation(v) | subroutine Set_ReserveMudVolume_StudentStation(v) | ||||
implicit none | implicit none | ||||
real*8, intent(in) :: v | real*8, intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%Configuration%Mud%ReserveMudVolume == v) return | |||||
#endif | |||||
# 140 | |||||
data%Configuration%Mud%ReserveMudVolume = v | data%Configuration%Mud%ReserveMudVolume = v | ||||
! if(associated(ReserveMudVolumePtr)) call ReserveMudVolumePtr(data%Configuration%Mud%ReserveMudVolume) | ! if(associated(ReserveMudVolumePtr)) call ReserveMudVolumePtr(data%Configuration%Mud%ReserveMudVolume) | ||||
end subroutine | end subroutine | ||||
@@ -146,9 +143,8 @@ module MudPropertiesModule | |||||
subroutine Set_ReserveDensity_StudentStation(v) | subroutine Set_ReserveDensity_StudentStation(v) | ||||
implicit none | implicit none | ||||
real*8, intent(in) :: v | real*8, intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%Configuration%Mud%ReserveDensity == v) return | |||||
#endif | |||||
# 150 | |||||
data%Configuration%Mud%ReserveDensity = v | data%Configuration%Mud%ReserveDensity = v | ||||
! if(associated(ReserveDensityPtr)) call ReserveDensityPtr(data%Configuration%Mud%ReserveDensity) | ! if(associated(ReserveDensityPtr)) call ReserveDensityPtr(data%Configuration%Mud%ReserveDensity) | ||||
end subroutine | end subroutine | ||||
@@ -0,0 +1,106 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/DownHole/CDownHoleActions.f90" | |||||
module CDownHoleActions | |||||
use CIActionReference | |||||
implicit none | |||||
public | |||||
abstract interface | |||||
subroutine ActionFluid(array) | |||||
use CDownHoleTypes | |||||
type(CFluid), allocatable, intent(in), target :: array(:) | |||||
end subroutine | |||||
subroutine ActionComponent(array) | |||||
use CDownHoleTypes | |||||
type(CStringComponent), allocatable, intent(in), target :: array(:) | |||||
end subroutine | |||||
subroutine ActionBopElement(array) | |||||
use CDownHoleTypes | |||||
type(CBopElement), allocatable, intent(in), target :: array(:) | |||||
end subroutine | |||||
end interface | |||||
procedure (ActionInteger), pointer :: AnnalusMudCountPtr | |||||
procedure (ActionFluid), pointer :: AnnalusMudArrayPtr | |||||
procedure (ActionInteger), pointer :: StringMudCountPtr | |||||
procedure (ActionFluid), pointer :: StringMudArrayPtr | |||||
procedure (ActionInteger), pointer :: StringComponentCountPtr | |||||
procedure (ActionComponent), pointer :: StringComponentArrayPtr | |||||
procedure (ActionBopElement), pointer :: BopElementsPtr | |||||
contains | |||||
subroutine SubscribeAnnalusMudCount(a) | |||||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeAnnalusMudCount | |||||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeAnnalusMudCount' :: SubscribeAnnalusMudCount | |||||
implicit none | |||||
procedure (ActionInteger) :: a | |||||
AnnalusMudCountPtr => a | |||||
end subroutine | |||||
subroutine SubscribeAnnalusMudArray(a) | |||||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeAnnalusMudArray | |||||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeAnnalusMudArray' :: SubscribeAnnalusMudArray | |||||
implicit none | |||||
procedure (ActionFluid) :: a | |||||
AnnalusMudArrayPtr => a | |||||
end subroutine | |||||
subroutine SubscribeStringMudCount(a) | |||||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringMudCount | |||||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeStringMudCount' :: SubscribeStringMudCount | |||||
implicit none | |||||
procedure (ActionInteger) :: a | |||||
StringMudCountPtr => a | |||||
end subroutine | |||||
subroutine SubscribeStringMudArray(a) | |||||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringMudArray | |||||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeStringMudArray' :: SubscribeStringMudArray | |||||
implicit none | |||||
procedure (ActionFluid) :: a | |||||
StringMudArrayPtr => a | |||||
end subroutine | |||||
subroutine SubscribeStringComponentCount(a) | |||||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringComponentCount | |||||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeStringComponentCount' :: SubscribeStringComponentCount | |||||
implicit none | |||||
procedure (ActionInteger) :: a | |||||
StringComponentCountPtr => a | |||||
end subroutine | |||||
subroutine SubscribeStringComponentArray(a) | |||||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeStringComponentArray | |||||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeStringComponentArray' :: SubscribeStringComponentArray | |||||
implicit none | |||||
procedure (ActionComponent) :: a | |||||
StringComponentArrayPtr => a | |||||
end subroutine | |||||
subroutine SubscribeBopElements(a) | |||||
!DEC$ ATTRIBUTES DLLEXPORT :: SubscribeBopElements | |||||
!DEC$ ATTRIBUTES ALIAS: 'SubscribeBopElements' :: SubscribeBopElements | |||||
implicit none | |||||
procedure (ActionBopElement) :: a | |||||
BopElementsPtr => a | |||||
end subroutine | |||||
end module CDownHoleActions |
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/DownHole/CDownHoleTypes.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/DownHole/CDownHoleTypes.f90" | |||||
module CDownHoleTypes | module CDownHoleTypes | ||||
implicit none | implicit none | ||||
public | public | ||||
@@ -3,7 +3,7 @@ module CDownHoleVariables | |||||
! use CStringConfigurationVariables | ! use CStringConfigurationVariables | ||||
! use CDownHoleActions | ! use CDownHoleActions | ||||
use CLog4 | use CLog4 | ||||
implicit none | |||||
implicit none | |||||
public | public | ||||
!!!!!!!!!!!!!!!!!!!!! | !!!!!!!!!!!!!!!!!!!!! | ||||
! Outputs to user interface | ! Outputs to user interface | ||||
@@ -1,10 +1,10 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/DownHole/CDownHoleVariables.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/DownHole/CDownHoleVariables.f90" | |||||
module CDownHoleVariables | module CDownHoleVariables | ||||
use CDownHoleTypes | use CDownHoleTypes | ||||
! use CStringConfigurationVariables | ! use CStringConfigurationVariables | ||||
! use CDownHoleActions | ! use CDownHoleActions | ||||
use CLog4 | use CLog4 | ||||
implicit none | |||||
implicit none | |||||
public | public | ||||
!!!!!!!!!!!!!!!!!!!!! | !!!!!!!!!!!!!!!!!!!!! | ||||
! Outputs to user interface | ! Outputs to user interface | ||||
@@ -2,23 +2,16 @@ module DownHoleModule | |||||
use SimulationVariables | use SimulationVariables | ||||
contains | contains | ||||
subroutine MudPropertiesToJson(parent) | |||||
subroutine DownHoleToJson(parent) | |||||
type(json_value),pointer :: parent | type(json_value),pointer :: parent | ||||
type(json_core) :: json | type(json_core) :: json | ||||
type(json_value),pointer :: p | |||||
type(json_value),pointer :: p,jsonarray,pitem | |||||
integer::i | |||||
! 1. create new node | ! 1. create new node | ||||
call json%create_object(p,'DownHole') | call json%create_object(p,'DownHole') | ||||
! 2. add member of data type to new node | ! 2. add member of data type to new node | ||||
! call json%add(p,"AnnalusFluidsCount",data%Equipments%DownHole%AnnalusFluidsCount) | |||||
! call json%add(p,"StringFluidsCount",data%Equipments%DownHole%StringFluidsCount) | |||||
! call json%add(p,"AnnalusFluids(:)",data%Equipments%DownHole%AnnalusFluids(:)) | |||||
! call json%add(p,"StringFluids(:)",data%Equipments%DownHole%StringFluids(:)) | |||||
! call json%add(p,"StringCount",data%Equipments%DownHole%StringCount) | |||||
! call json%add(p,"String(:)",data%Equipments%DownHole%String(:)) | |||||
! call json%add(p,"BopElements(:)",data%Equipments%DownHole%BopElements(:)) | |||||
call json%add(p,"DrillPipePressure",data%Equipments%DownHole%DrillPipePressure) | call json%add(p,"DrillPipePressure",data%Equipments%DownHole%DrillPipePressure) | ||||
call json%add(p,"CasingPressure",data%Equipments%DownHole%CasingPressure) | call json%add(p,"CasingPressure",data%Equipments%DownHole%CasingPressure) | ||||
call json%add(p,"ShoePressure",data%Equipments%DownHole%ShoePressure) | call json%add(p,"ShoePressure",data%Equipments%DownHole%ShoePressure) | ||||
@@ -28,21 +21,58 @@ module DownHoleModule | |||||
call json%add(p,"KickVolume",data%Equipments%DownHole%KickVolume) | call json%add(p,"KickVolume",data%Equipments%DownHole%KickVolume) | ||||
call json%add(p,"SecondKickVolume",data%Equipments%DownHole%SecondKickVolume) | call json%add(p,"SecondKickVolume",data%Equipments%DownHole%SecondKickVolume) | ||||
call json%add(p,"PermeabilityExposedHeight",data%Equipments%DownHole%PermeabilityExposedHeight) | call json%add(p,"PermeabilityExposedHeight",data%Equipments%DownHole%PermeabilityExposedHeight) | ||||
! 3. add new node to parent | |||||
call json%add(parent,p) | |||||
end subroutine | |||||
call json%create_array(jsonarray, 'String') | |||||
do i = 1, data%Equipments%DownHole%StringCount | |||||
call json%create_object(pitem,'') | |||||
call json%add(pitem,'StartMd', data%Equipments%DownHole%String(i)%StartMd) | |||||
call json%add(pitem,'EndMd', data%Equipments%DownHole%String(i)%EndMd) | |||||
call json%add(pitem,'ComponentType', data%Equipments%DownHole%String(i)%ComponentType) | |||||
call json%add(jsonarray,pitem) | |||||
nullify(pitem) | |||||
enddo | |||||
call json%add(p,jsonarray) | |||||
nullify(jsonarray) | |||||
subroutine DownHoleFromJson(parent) | |||||
use json_module,IK =>json_ik | |||||
type(json_value),pointer :: parent | |||||
type(json_core) :: json | |||||
type(json_value),pointer :: p,pitems,pitem,pval,pbit | |||||
call json%create_array(jsonarray, 'StringFluids') | |||||
do i = 1, data%Equipments%DownHole%StringCount | |||||
call json%create_object(pitem,'') | |||||
call json%add(pitem,'StartMd', data%Equipments%DownHole%StringFluids(i)%StartMd) | |||||
call json%add(pitem,'EndMd', data%Equipments%DownHole%StringFluids(i)%EndMd) | |||||
call json%add(pitem,'Density', data%Equipments%DownHole%StringFluids(i)%Density) | |||||
call json%add(pitem,'MudType', data%Equipments%DownHole%StringFluids(i)%MudType) | |||||
call json%add(jsonarray,pitem) | |||||
nullify(pitem) | |||||
enddo | |||||
call json%add(p,jsonarray) | |||||
nullify(jsonarray) | |||||
! call json%create_array(jsonarray, 'AnnalusFluids') | |||||
! do i = 1, data%Equipments%DownHole%AnnalusFluidsCount | |||||
! call json%create_object(pitem,'') | |||||
! call json%add(pitem,'StartMd', data%Equipments%DownHole%AnnalusFluids(i)%StartMd) | |||||
! call json%add(pitem,'EndMd', data%Equipments%DownHole%AnnalusFluids(i)%EndMd) | |||||
! call json%add(pitem,'Density', data%Equipments%DownHole%AnnalusFluids(i)%Density) | |||||
! call json%add(pitem,'MudType', data%Equipments%DownHole%AnnalusFluids(i)%MudType) | |||||
! call json%add(jsonarray,pitem) | |||||
! nullify(pitem) | |||||
! enddo | |||||
! call json%add(p,jsonarray) | |||||
nullify(jsonarray) | |||||
call json%get(parent,'DownHole',p) | |||||
call json%get(p,'AnnDrillMud',pval) | |||||
call json%get(pval,data%Equipments%DownHole%AnnDrillMud) | |||||
call json%get(p,'AnnCirculateMud',pval) | |||||
call json%get(pval,data%Equipments%DownHole%AnnCirculateMud) | |||||
call json%create_array(jsonarray, 'BOPElements') | |||||
do i = 1, 4 | |||||
call json%create_object(pitem,'') | |||||
call json%add(pitem,'ElementType', data%Equipments%DownHole%BOPElements(i)%ElementType) | |||||
call json%add(pitem,'ElementStart', data%Equipments%DownHole%BOPElements(i)%ElementStart) | |||||
call json%add(pitem,'ElementEnd', data%Equipments%DownHole%BOPElements(i)%ElementEnd) | |||||
call json%add(jsonarray,pitem) | |||||
nullify(pitem) | |||||
enddo | |||||
call json%add(p,jsonarray) | |||||
nullify(jsonarray) | |||||
! 3. add new node to parent | |||||
call json%add(parent,p) | |||||
end subroutine | end subroutine | ||||
subroutine SetAnnalusFluids(count, array) | subroutine SetAnnalusFluids(count, array) | ||||
@@ -1,25 +1,18 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/DownHole/DownHole.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/DownHole/DownHole.f90" | |||||
module DownHoleModule | module DownHoleModule | ||||
use SimulationVariables | use SimulationVariables | ||||
contains | contains | ||||
subroutine MudPropertiesToJson(parent) | |||||
subroutine DownHoleToJson(parent) | |||||
type(json_value),pointer :: parent | type(json_value),pointer :: parent | ||||
type(json_core) :: json | type(json_core) :: json | ||||
type(json_value),pointer :: p | |||||
type(json_value),pointer :: p,jsonarray,pitem | |||||
integer::i | |||||
! 1. create new node | ! 1. create new node | ||||
call json%create_object(p,'DownHole') | call json%create_object(p,'DownHole') | ||||
! 2. add member of data type to new node | ! 2. add member of data type to new node | ||||
! call json%add(p,"AnnalusFluidsCount",data%Equipments%DownHole%AnnalusFluidsCount) | |||||
! call json%add(p,"StringFluidsCount",data%Equipments%DownHole%StringFluidsCount) | |||||
! call json%add(p,"AnnalusFluids(:)",data%Equipments%DownHole%AnnalusFluids(:)) | |||||
! call json%add(p,"StringFluids(:)",data%Equipments%DownHole%StringFluids(:)) | |||||
! call json%add(p,"StringCount",data%Equipments%DownHole%StringCount) | |||||
! call json%add(p,"String(:)",data%Equipments%DownHole%String(:)) | |||||
! call json%add(p,"BopElements(:)",data%Equipments%DownHole%BopElements(:)) | |||||
call json%add(p,"DrillPipePressure",data%Equipments%DownHole%DrillPipePressure) | call json%add(p,"DrillPipePressure",data%Equipments%DownHole%DrillPipePressure) | ||||
call json%add(p,"CasingPressure",data%Equipments%DownHole%CasingPressure) | call json%add(p,"CasingPressure",data%Equipments%DownHole%CasingPressure) | ||||
call json%add(p,"ShoePressure",data%Equipments%DownHole%ShoePressure) | call json%add(p,"ShoePressure",data%Equipments%DownHole%ShoePressure) | ||||
@@ -29,21 +22,58 @@ module DownHoleModule | |||||
call json%add(p,"KickVolume",data%Equipments%DownHole%KickVolume) | call json%add(p,"KickVolume",data%Equipments%DownHole%KickVolume) | ||||
call json%add(p,"SecondKickVolume",data%Equipments%DownHole%SecondKickVolume) | call json%add(p,"SecondKickVolume",data%Equipments%DownHole%SecondKickVolume) | ||||
call json%add(p,"PermeabilityExposedHeight",data%Equipments%DownHole%PermeabilityExposedHeight) | call json%add(p,"PermeabilityExposedHeight",data%Equipments%DownHole%PermeabilityExposedHeight) | ||||
! 3. add new node to parent | |||||
call json%add(parent,p) | |||||
end subroutine | |||||
call json%create_array(jsonarray, 'String') | |||||
do i = 1, data%Equipments%DownHole%StringCount | |||||
call json%create_object(pitem,'') | |||||
call json%add(pitem,'StartMd', data%Equipments%DownHole%String(i)%StartMd) | |||||
call json%add(pitem,'EndMd', data%Equipments%DownHole%String(i)%EndMd) | |||||
call json%add(pitem,'ComponentType', data%Equipments%DownHole%String(i)%ComponentType) | |||||
call json%add(jsonarray,pitem) | |||||
nullify(pitem) | |||||
enddo | |||||
call json%add(p,jsonarray) | |||||
nullify(jsonarray) | |||||
subroutine DownHoleFromJson(parent) | |||||
use json_module,IK =>json_ik | |||||
type(json_value),pointer :: parent | |||||
type(json_core) :: json | |||||
type(json_value),pointer :: p,pitems,pitem,pval,pbit | |||||
call json%create_array(jsonarray, 'StringFluids') | |||||
do i = 1, data%Equipments%DownHole%StringCount | |||||
call json%create_object(pitem,'') | |||||
call json%add(pitem,'StartMd', data%Equipments%DownHole%StringFluids(i)%StartMd) | |||||
call json%add(pitem,'EndMd', data%Equipments%DownHole%StringFluids(i)%EndMd) | |||||
call json%add(pitem,'Density', data%Equipments%DownHole%StringFluids(i)%Density) | |||||
call json%add(pitem,'MudType', data%Equipments%DownHole%StringFluids(i)%MudType) | |||||
call json%add(jsonarray,pitem) | |||||
nullify(pitem) | |||||
enddo | |||||
call json%add(p,jsonarray) | |||||
nullify(jsonarray) | |||||
! call json%create_array(jsonarray, 'AnnalusFluids') | |||||
! do i = 1, data%Equipments%DownHole%AnnalusFluidsCount | |||||
! call json%create_object(pitem,'') | |||||
! call json%add(pitem,'StartMd', data%Equipments%DownHole%AnnalusFluids(i)%StartMd) | |||||
! call json%add(pitem,'EndMd', data%Equipments%DownHole%AnnalusFluids(i)%EndMd) | |||||
! call json%add(pitem,'Density', data%Equipments%DownHole%AnnalusFluids(i)%Density) | |||||
! call json%add(pitem,'MudType', data%Equipments%DownHole%AnnalusFluids(i)%MudType) | |||||
! call json%add(jsonarray,pitem) | |||||
! nullify(pitem) | |||||
! enddo | |||||
! call json%add(p,jsonarray) | |||||
nullify(jsonarray) | |||||
call json%get(parent,'DownHole',p) | |||||
call json%get(p,'AnnDrillMud',pval) | |||||
call json%get(pval,data%Equipments%DownHole%AnnDrillMud) | |||||
call json%get(p,'AnnCirculateMud',pval) | |||||
call json%get(pval,data%Equipments%DownHole%AnnCirculateMud) | |||||
call json%create_array(jsonarray, 'BOPElements') | |||||
do i = 1, 4 | |||||
call json%create_object(pitem,'') | |||||
call json%add(pitem,'ElementType', data%Equipments%DownHole%BOPElements(i)%ElementType) | |||||
call json%add(pitem,'ElementStart', data%Equipments%DownHole%BOPElements(i)%ElementStart) | |||||
call json%add(pitem,'ElementEnd', data%Equipments%DownHole%BOPElements(i)%ElementEnd) | |||||
call json%add(jsonarray,pitem) | |||||
nullify(pitem) | |||||
enddo | |||||
call json%add(p,jsonarray) | |||||
nullify(jsonarray) | |||||
! 3. add new node to parent | |||||
call json%add(parent,p) | |||||
end subroutine | end subroutine | ||||
subroutine SetAnnalusFluids(count, array) | subroutine SetAnnalusFluids(count, array) | ||||
@@ -52,8 +82,8 @@ module DownHoleModule | |||||
integer :: i, offset | integer :: i, offset | ||||
type(CFluid), intent(inout), target :: array(count) | type(CFluid), intent(inout), target :: array(count) | ||||
type(CFluid), pointer :: item | type(CFluid), pointer :: item | ||||
data%Equipments%DownHole%AnnalusFluidsCount = count | |||||
if(print_log) print*, 'AnnalusFluidsCount = ', count | |||||
! data%Equipments%DownHole%AnnalusFluidsCount = count | |||||
! if(print_log) print*, 'AnnalusFluidsCount = ', count | |||||
if(size(data%Equipments%DownHole%AnnalusFluids) > 0) then | if(size(data%Equipments%DownHole%AnnalusFluids) > 0) then | ||||
deallocate(data%Equipments%DownHole%AnnalusFluids) | deallocate(data%Equipments%DownHole%AnnalusFluids) | ||||
end if | end if | ||||
@@ -104,7 +134,7 @@ module DownHoleModule | |||||
type(CFluid), intent(inout), target :: array(count) | type(CFluid), intent(inout), target :: array(count) | ||||
type(CFluid), pointer :: item | type(CFluid), pointer :: item | ||||
data%Equipments%DownHole%StringFluidsCount = count | data%Equipments%DownHole%StringFluidsCount = count | ||||
if(print_log) print*, 'StringFluidsCount = ', count | |||||
! if(print_log) print*, 'StringFluidsCount = ', count | |||||
if(size(data%Equipments%DownHole%StringFluids) > 0) then | if(size(data%Equipments%DownHole%StringFluids) > 0) then | ||||
deallocate(data%Equipments%DownHole%StringFluids) | deallocate(data%Equipments%DownHole%StringFluids) | ||||
end if | end if | ||||
@@ -69,7 +69,6 @@ module CBopControlPanel | |||||
! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsStatus) | ! call json%get(pval,data%Equipments%BopControlPanel%MiddleRamsStatus) | ||||
! call json%get(p,'LowerRamsStatus',pval) | ! call json%get(p,'LowerRamsStatus',pval) | ||||
! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsStatus) | ! call json%get(pval,data%Equipments%BopControlPanel%LowerRamsStatus) | ||||
call json%get(p,'AnnularRegulatorSetControl',pval) | call json%get(p,'AnnularRegulatorSetControl',pval) | ||||
call json%get(pval,data%Equipments%BopControlPanel%AnnularRegulatorSetControl) | call json%get(pval,data%Equipments%BopControlPanel%AnnularRegulatorSetControl) | ||||
! 2. get member of data type from node | ! 2. get member of data type from node | ||||
@@ -6,47 +6,24 @@ module CChokeControlPanel | |||||
public | public | ||||
contains | contains | ||||
subroutine ChokeControlPanelFromJson(parent) | |||||
type(json_value),pointer :: parent | |||||
type(json_core) :: json | |||||
type(json_value),pointer :: p,pval | |||||
! 1. get related root | |||||
call json%get(parent,'ChokeControl',p) | |||||
! 2. get member of data type from node | |||||
call json%get(p,'ChokeControlLever',pval) | |||||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokeControlLever) | |||||
call json%get(p,'ChokePanelRigAirSwitch',pval) | |||||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch) | |||||
call json%get(p,'ChokePanelPumpSelectorSwitch',pval) | |||||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch) | |||||
call json%get(p,'ChokePanelStrokeResetSwitch',pval) | |||||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch) | |||||
call json%get(p,'ChokeSelectorSwitch',pval) | |||||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokeSelectorSwitch) | |||||
call json%get(p,'ChokeRateControlKnob',pval) | |||||
call json%get(pval,data%Equipments%ChokeControlPanel%ChokeRateControlKnob) | |||||
! call json%get(p,'EnableAutoChoke',pval) | |||||
! call json%get(pval,data%Equipments%ChokeControlPanel%EnableAutoChoke) | |||||
! call json%get(p,'StandPipePressure',pval) | |||||
! call json%get(pval,data%Equipments%ChokeControlPanel%StandPipePressure) | |||||
! call json%get(p,'CasingPressure',pval) | |||||
! call json%get(pval,data%Equipments%ChokeControlPanel%CasingPressure) | |||||
! call json%get(p,'ChokePosition',pval) | |||||
! call json%get(pval,data%Equipments%ChokeControlPanel%ChokePosition) | |||||
! call json%get(p,'ChokePanelSPMCounter',pval) | |||||
! call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelSPMCounter) | |||||
! call json%get(p,'ChokePanelTotalStrokeCounter',pval) | |||||
! call json%get(pval,data%Equipments%ChokeControlPanel%ChokePanelTotalStrokeCounter) | |||||
! call json%get(p,'Choke1LED',pval) | |||||
! call json%get(pval,data%Equipments%ChokeControlPanel%Choke1LED) | |||||
! call json%get(p,'Choke2LED',pval) | |||||
! call json%get(pval,data%Equipments%ChokeControlPanel%Choke2LED) | |||||
end subroutine | |||||
subroutine ChokeControlPanelFromJson(jsonfile) | |||||
type(json_file)::jsonfile | |||||
logical::found | |||||
call jsonfile%get('Equipments.ChokeControl.ChokePanelPumpSelectorSwitch',data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch,found) | |||||
if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokePanelPumpSelectorSwitch") | |||||
call jsonfile%get('Equipments.ChokeControl.ChokePanelStrokeResetSwitch',data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch,found) | |||||
if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokePanelStrokeResetSwitch") | |||||
call jsonfile%get('Equipments.ChokeControl.ChokeSelectorSwitch',data%Equipments%ChokeControlPanel%ChokeSelectorSwitch,found) | |||||
if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokeSelectorSwitch") | |||||
call jsonfile%get('Equipments.ChokeControl.ChokeRateControlKnob',data%Equipments%ChokeControlPanel%ChokeRateControlKnob,found) | |||||
if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokeRateControlKnob") | |||||
call jsonfile%get('Equipments.ChokeControl.ChokeControlLever',data%Equipments%ChokeControlPanel%ChokeControlLever,found) | |||||
if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokeControlLever") | |||||
call jsonfile%get('Equipments.ChokeControl.ChokePanelRigAirSwitch',data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch,found) | |||||
if ( .not. found ) call logg(4,"Not found: ChokeControlPanel%ChokePanelRigAirSwitch") | |||||
! print *,data%Equipments%ChokeControlPanel%ChokeSelectorSwitch | |||||
end subroutine | |||||
subroutine ChokeControlPanelToJson(parent) | subroutine ChokeControlPanelToJson(parent) | ||||
@@ -57,9 +34,9 @@ module CChokeControlPanel | |||||
! 1. create new node | ! 1. create new node | ||||
call json%create_object(p,'ChokeControl') | call json%create_object(p,'ChokeControl') | ||||
call json%add(p,"ChokePanelPumpSelectorSwitch",data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch) | call json%add(p,"ChokePanelPumpSelectorSwitch",data%Equipments%ChokeControlPanel%ChokePanelPumpSelectorSwitch) | ||||
! call json%add(p,"ChokePanelStrokeResetSwitch",data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch) | |||||
call json%add(p,"ChokePanelStrokeResetSwitch",data%Equipments%ChokeControlPanel%ChokePanelStrokeResetSwitch) | |||||
call json%add(p,"ChokeSelectorSwitch",data%Equipments%ChokeControlPanel%ChokeSelectorSwitch) | call json%add(p,"ChokeSelectorSwitch",data%Equipments%ChokeControlPanel%ChokeSelectorSwitch) | ||||
! call json%add(p,"ChokeRateControlKnob",data%Equipments%ChokeControlPanel%ChokeRateControlKnob) | |||||
call json%add(p,"ChokeRateControlKnob",data%Equipments%ChokeControlPanel%ChokeRateControlKnob) | |||||
call json%add(p,"ChokeControlLever",data%Equipments%ChokeControlPanel%ChokeControlLever) | call json%add(p,"ChokeControlLever",data%Equipments%ChokeControlPanel%ChokeControlLever) | ||||
call json%add(p,"ChokePanelRigAirSwitch",data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch) | call json%add(p,"ChokePanelRigAirSwitch",data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch) | ||||
! call json%add(p,"EnableAutoChoke",data%Equipments%ChokeControlPanel%EnableAutoChoke) | ! call json%add(p,"EnableAutoChoke",data%Equipments%ChokeControlPanel%EnableAutoChoke) | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CChokeManifold.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/Equipments/ControlPanels/CChokeManifold.f90" | |||||
module CChokeManifold | module CChokeManifold | ||||
! use CChokeManifoldVariables | ! use CChokeManifoldVariables | ||||
use SimulationVariables | use SimulationVariables | ||||
@@ -97,9 +97,9 @@ module CChokeManifold | |||||
call ChangeValve(33, .true.) | call ChangeValve(33, .true.) | ||||
else | else | ||||
if(v == 100) then | if(v == 100) then | ||||
if(Manifold%Valve(33)%Status) call ChangeValve(33, .false.) | |||||
if(data%state%manifold%Valve(33)%Status) call ChangeValve(33, .false.) | |||||
else | else | ||||
if(.not.Manifold%Valve(33)%Status) call ChangeValve(33, .true.) | |||||
if(.not.data%state%manifold%Valve(33)%Status) call ChangeValve(33, .true.) | |||||
endif | endif | ||||
endif | endif | ||||
!WRITE (*,*) ' valve 33 ', Valve(33)%Status, ' arg ', v | !WRITE (*,*) ' valve 33 ', Valve(33)%Status, ' arg ', v | ||||
@@ -113,9 +113,9 @@ subroutine SetHydraulicChock2(v) | |||||
call ChangeValve(34, .true.) | call ChangeValve(34, .true.) | ||||
else | else | ||||
if(v==100) then | if(v==100) then | ||||
if(Manifold%Valve(34)%Status) call ChangeValve(34, .false.) | |||||
if(data%state%manifold%Valve(34)%Status) call ChangeValve(34, .false.) | |||||
else | else | ||||
if(.not.Manifold%Valve(34)%Status) call ChangeValve(34, .true.) | |||||
if(.not.data%state%manifold%Valve(34)%Status) call ChangeValve(34, .true.) | |||||
endif | endif | ||||
endif | endif | ||||
!WRITE (*,*) ' valve 34 ', Valve(34)%Status, ' arg ', v | !WRITE (*,*) ' valve 34 ', Valve(34)%Status, ' arg ', v | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CChokeManifoldVariables.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/Equipments/ControlPanels/CChokeManifoldVariables.f90" | |||||
module CChokeManifoldVariables | module CChokeManifoldVariables | ||||
implicit none | implicit none | ||||
public | public | ||||
@@ -140,6 +140,8 @@ module CDataDisplayConsole | |||||
call json%add(p,"TotalWellDepth",data%Equipments%DataDisplayConsole%TotalWellDepth) | call json%add(p,"TotalWellDepth",data%Equipments%DataDisplayConsole%TotalWellDepth) | ||||
call json%add(p,"BitDepth",data%Equipments%DataDisplayConsole%BitDepth) | call json%add(p,"BitDepth",data%Equipments%DataDisplayConsole%BitDepth) | ||||
call json%add(p,"HookLoad",data%Equipments%DataDisplayConsole%HookLoad) | call json%add(p,"HookLoad",data%Equipments%DataDisplayConsole%HookLoad) | ||||
!!! | |||||
call json%add(p,"StaticHookLoad",data%State%TD_String%StaticHookLoad) | |||||
call json%add(p,"StandPipePressure",data%Equipments%DataDisplayConsole%StandPipePressure) | call json%add(p,"StandPipePressure",data%Equipments%DataDisplayConsole%StandPipePressure) | ||||
call json%add(p,"CasingPressure",data%Equipments%DataDisplayConsole%CasingPressure) | call json%add(p,"CasingPressure",data%Equipments%DataDisplayConsole%CasingPressure) | ||||
call json%add(p,"MP1SPM",data%Equipments%DataDisplayConsole%MP1SPM) | call json%add(p,"MP1SPM",data%Equipments%DataDisplayConsole%MP1SPM) | ||||
@@ -17,7 +17,6 @@ module CDataDisplayConsole | |||||
call json%get(p,'ResetWob',pval) | call json%get(p,'ResetWob',pval) | ||||
call json%get(pval,data%Equipments%DataDisplayConsole%ResetWob) | call json%get(pval,data%Equipments%DataDisplayConsole%ResetWob) | ||||
call json%get(p,'TotalStrokeCounterResetSwitch',pval) | call json%get(p,'TotalStrokeCounterResetSwitch',pval) | ||||
call json%get(pval,data%Equipments%DataDisplayConsole%TotalStrokeCounterResetSwitch) | call json%get(pval,data%Equipments%DataDisplayConsole%TotalStrokeCounterResetSwitch) | ||||
@@ -110,7 +109,6 @@ module CDataDisplayConsole | |||||
end subroutine | end subroutine | ||||
subroutine DataDisplayConsoleToJson(parent) | subroutine DataDisplayConsoleToJson(parent) | ||||
type(json_value),pointer :: parent | type(json_value),pointer :: parent | ||||
type(json_core) :: json | type(json_core) :: json | ||||
type(json_value),pointer :: p | type(json_value),pointer :: p | ||||
@@ -143,6 +141,8 @@ module CDataDisplayConsole | |||||
call json%add(p,"TotalWellDepth",data%Equipments%DataDisplayConsole%TotalWellDepth) | call json%add(p,"TotalWellDepth",data%Equipments%DataDisplayConsole%TotalWellDepth) | ||||
call json%add(p,"BitDepth",data%Equipments%DataDisplayConsole%BitDepth) | call json%add(p,"BitDepth",data%Equipments%DataDisplayConsole%BitDepth) | ||||
call json%add(p,"HookLoad",data%Equipments%DataDisplayConsole%HookLoad) | call json%add(p,"HookLoad",data%Equipments%DataDisplayConsole%HookLoad) | ||||
!!! | |||||
call json%add(p,"StaticHookLoad",data%State%TD_String%StaticHookLoad) | |||||
call json%add(p,"StandPipePressure",data%Equipments%DataDisplayConsole%StandPipePressure) | call json%add(p,"StandPipePressure",data%Equipments%DataDisplayConsole%StandPipePressure) | ||||
call json%add(p,"CasingPressure",data%Equipments%DataDisplayConsole%CasingPressure) | call json%add(p,"CasingPressure",data%Equipments%DataDisplayConsole%CasingPressure) | ||||
call json%add(p,"MP1SPM",data%Equipments%DataDisplayConsole%MP1SPM) | call json%add(p,"MP1SPM",data%Equipments%DataDisplayConsole%MP1SPM) | ||||
@@ -291,9 +291,8 @@ module CDataDisplayConsole | |||||
data%Equipments%DataDisplayConsole%MP1SPMGauge = v | data%Equipments%DataDisplayConsole%MP1SPMGauge = v | ||||
data%Equipments%DataDisplayConsole%MP1SPM = v | data%Equipments%DataDisplayConsole%MP1SPM = v | ||||
!@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%Equipments%DataDisplayConsole%MP1SPMGauge, data%Equipments%DataDisplayConsole%MP2SPMGauge) | !@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%Equipments%DataDisplayConsole%MP1SPMGauge, data%Equipments%DataDisplayConsole%MP2SPMGauge) | ||||
#ifdef deb | |||||
if(print_log) print*, 'MP1SPMGauge=', data%Equipments%DataDisplayConsole%MP1SPMGauge | |||||
#endif | |||||
# 295 | |||||
end subroutine | end subroutine | ||||
subroutine Set_MP2SPMGauge(v) | subroutine Set_MP2SPMGauge(v) | ||||
@@ -302,8 +301,7 @@ module CDataDisplayConsole | |||||
data%Equipments%DataDisplayConsole%MP2SPMGauge = v | data%Equipments%DataDisplayConsole%MP2SPMGauge = v | ||||
data%Equipments%DataDisplayConsole%MP2SPM = v | data%Equipments%DataDisplayConsole%MP2SPM = v | ||||
!@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%Equipments%DataDisplayConsole%MP1SPMGauge, data%Equipments%DataDisplayConsole%MP2SPMGauge) | !@data%State%unitySignals%(PumpsSpmChanges)) call PumpsSpmChanges(data%Equipments%DataDisplayConsole%MP1SPMGauge, data%Equipments%DataDisplayConsole%MP2SPMGauge) | ||||
#ifdef deb | |||||
if(print_log) print*, 'MP2SPMGauge=', data%Equipments%DataDisplayConsole%MP2SPMGauge | |||||
#endif | |||||
# 306 | |||||
end subroutine | end subroutine | ||||
end module CDataDisplayConsole | end module CDataDisplayConsole |
@@ -17,110 +17,104 @@ module CDrillingConsole | |||||
logical::found | logical::found | ||||
integer :: i | integer :: i | ||||
call jsonfile%get('Equipments.Drilling.AssignmentSwitch',data%Equipments%DrillingConsole%AssignmentSwitch,found) | |||||
if ( .not. found ) call logg(4,"Not found: AssignmentSwitch") | |||||
call jsonfile%get('Equipments.Drilling.EmergencySwitch',data%Equipments%DrillingConsole%EmergencySwitch,found) | |||||
if ( .not. found ) call logg(4,"Not found: EmergencySwitch") | |||||
call jsonfile%get('Equipments.Drilling.RTTorqueLimitKnob',data%Equipments%DrillingConsole%RTTorqueLimitKnob,found) | |||||
if ( .not. found ) call logg(4,"Not found: RTTorqueLimitKnob") | |||||
! call jsonfile%get('Equipments.Drilling.AssignmentSwitch',data%Equipments%DrillingConsole%AssignmentSwitch,found) | |||||
! if ( .not. found ) call logg(4,"Not found: AssignmentSwitch") | |||||
! call jsonfile%get('Equipments.Drilling.EmergencySwitch',data%Equipments%DrillingConsole%EmergencySwitch,found) | |||||
! if ( .not. found ) call logg(4,"Not found: EmergencySwitch") | |||||
! call jsonfile%get('Equipments.Drilling.RTTorqueLimitKnob',data%Equipments%DrillingConsole%RTTorqueLimitKnob,found) | |||||
! if ( .not. found ) call logg(4,"Not found: RTTorqueLimitKnob") | |||||
call jsonfile%get('Equipments.Drilling.MP1CPSwitch',data%Equipments%DrillingConsole%MP1CPSwitch,found) | call jsonfile%get('Equipments.Drilling.MP1CPSwitch',data%Equipments%DrillingConsole%MP1CPSwitch,found) | ||||
if ( .not. found ) call logg(4,"Not found: MP1CPSwitch") | if ( .not. found ) call logg(4,"Not found: MP1CPSwitch") | ||||
call jsonfile%get('Equipments.Drilling.MP1ThrottleUpdate',data%Equipments%DrillingConsole%MP1ThrottleUpdate,found) | |||||
if ( .not. found ) call logg(4,"Not found: MP1ThrottleUpdate") | |||||
! call jsonfile%get('Equipments.Drilling.MP1ThrottleUpdate',data%Equipments%DrillingConsole%MP1ThrottleUpdate,found) | |||||
! if ( .not. found ) call logg(4,"Not found: MP1ThrottleUpdate") | |||||
call jsonfile%get('Equipments.Drilling.MP1Throttle',data%Equipments%DrillingConsole%MP1Throttle,found) | call jsonfile%get('Equipments.Drilling.MP1Throttle',data%Equipments%DrillingConsole%MP1Throttle,found) | ||||
if ( .not. found ) then | |||||
call logg(4,"Not found: MP1Throttle") | |||||
endif | |||||
if ( .not. found ) call logg(4,"Not found: MP1Throttle") | |||||
call jsonfile%get('Equipments.Drilling.MP2Switch',data%Equipments%DrillingConsole%MP2Switch,found) | call jsonfile%get('Equipments.Drilling.MP2Switch',data%Equipments%DrillingConsole%MP2Switch,found) | ||||
if ( .not. found ) call logg(4,"Not found: MP2Switch") | if ( .not. found ) call logg(4,"Not found: MP2Switch") | ||||
call jsonfile%get('Equipments.Drilling.MP2ThrottleUpdate',data%Equipments%DrillingConsole%MP2ThrottleUpdate,found) | |||||
if ( .not. found ) call logg(4,"Not found: MP2ThrottleUpdate") | |||||
! call jsonfile%get('Equipments.Drilling.MP2ThrottleUpdate',data%Equipments%DrillingConsole%MP2ThrottleUpdate,found) | |||||
! if ( .not. found ) call logg(4,"Not found: MP2ThrottleUpdate") | |||||
call jsonfile%get('Equipments.Drilling.MP2Throttle',data%Equipments%DrillingConsole%MP2Throttle,found) | call jsonfile%get('Equipments.Drilling.MP2Throttle',data%Equipments%DrillingConsole%MP2Throttle,found) | ||||
if ( .not. found ) then | |||||
call logg(4,"Not found: MP2Throttle") | |||||
endif | |||||
if ( .not. found ) call logg(4,"Not found: MP2Throttle") | |||||
call jsonfile%get('Equipments.Drilling.DWSwitch',data%Equipments%DrillingConsole%DWSwitch,found) | call jsonfile%get('Equipments.Drilling.DWSwitch',data%Equipments%DrillingConsole%DWSwitch,found) | ||||
if ( .not. found ) call logg(4,"Not found: DWSwitch") | if ( .not. found ) call logg(4,"Not found: DWSwitch") | ||||
call jsonfile%get('Equipments.Drilling.DWThrottle',data%Equipments%DrillingConsole%DWThrottle,found) | call jsonfile%get('Equipments.Drilling.DWThrottle',data%Equipments%DrillingConsole%DWThrottle,found) | ||||
if ( .not. found ) call logg(4,"Not found: DWThrottle") | if ( .not. found ) call logg(4,"Not found: DWThrottle") | ||||
if (print_log .and. abs(data%Equipments%DrillingConsole%DWThrottle)>0) print *,"data%Equipments%DrillingConsole%DWThrottle = ",data%Equipments%DrillingConsole%DWThrottle | |||||
! if (print_log .and. abs(data%Equipments%DrillingConsole%DWThrottle)>0) print *,"data%Equipments%DrillingConsole%DWThrottle = ",data%Equipments%DrillingConsole%DWThrottle | |||||
call jsonfile%get('Equipments.Drilling.RTSwitch',data%Equipments%DrillingConsole%RTSwitch,found) | call jsonfile%get('Equipments.Drilling.RTSwitch',data%Equipments%DrillingConsole%RTSwitch,found) | ||||
if ( .not. found ) call logg(4,"Not found: RTSwitch") | if ( .not. found ) call logg(4,"Not found: RTSwitch") | ||||
call jsonfile%get('Equipments.Drilling.RTThrottle',i,found) | call jsonfile%get('Equipments.Drilling.RTThrottle',i,found) | ||||
data%Equipments%DrillingConsole%RTThrottle = real(i) | data%Equipments%DrillingConsole%RTThrottle = real(i) | ||||
if ( .not. found ) then | |||||
call logg(4,"Not found: RTThrottle") | |||||
endif | |||||
call jsonfile%get('Equipments.Drilling.DWBreak',data%Equipments%DrillingConsole%DWBreak,found) | |||||
if ( .not. found ) call logg(4,"Not found: DWBreak") | |||||
call jsonfile%get('Equipments.Drilling.PreviousDWBreak',data%Equipments%DrillingConsole%PreviousDWBreak,found) | |||||
if ( .not. found ) call logg(4,"Not found: PreviousDWBreak") | |||||
call jsonfile%get('Equipments.Drilling.ForceBreak',data%Equipments%DrillingConsole%ForceBreak,found) | |||||
if ( .not. found ) call logg(4,"Not found: ForceBreak") | |||||
call jsonfile%get('Equipments.Drilling.DWAcceleretor',data%Equipments%DrillingConsole%DWAcceleretor,found) | |||||
if ( .not. found ) call logg(4,"Not found: DWAcceleretor") | |||||
call jsonfile%get('Equipments.Drilling.DWTransmisionLever',data%Equipments%DrillingConsole%DWTransmisionLever,found) | |||||
if ( .not. found ) call logg(4,"Not found: DWTransmisionLever") | |||||
call jsonfile%get('Equipments.Drilling.DWPowerLever',data%Equipments%DrillingConsole%DWPowerLever,found) | |||||
if ( .not. found ) call logg(4,"Not found: DWPowerLever") | |||||
if ( .not. found ) call logg(4,"Not found: RTThrottle") | |||||
! call jsonfile%get('Equipments.Drilling.DWBreak',data%Equipments%DrillingConsole%DWBreak,found) | |||||
! if ( .not. found ) call logg(4,"Not found: DWBreak") | |||||
! call jsonfile%get('Equipments.Drilling.PreviousDWBreak',data%Equipments%DrillingConsole%PreviousDWBreak,found) | |||||
! if ( .not. found ) call logg(4,"Not found: PreviousDWBreak") | |||||
! call jsonfile%get('Equipments.Drilling.ForceBreak',data%Equipments%DrillingConsole%ForceBreak,found) | |||||
! if ( .not. found ) call logg(4,"Not found: ForceBreak") | |||||
! call jsonfile%get('Equipments.Drilling.DWAcceleretor',data%Equipments%DrillingConsole%DWAcceleretor,found) | |||||
! if ( .not. found ) call logg(4,"Not found: DWAcceleretor") | |||||
! call jsonfile%get('Equipments.Drilling.DWTransmisionLever',data%Equipments%DrillingConsole%DWTransmisionLever,found) | |||||
! if ( .not. found ) call logg(4,"Not found: DWTransmisionLever") | |||||
! call jsonfile%get('Equipments.Drilling.DWPowerLever',data%Equipments%DrillingConsole%DWPowerLever,found) | |||||
! if ( .not. found ) call logg(4,"Not found: DWPowerLever") | |||||
! call jsonfile%get('Equipments.Drilling.TongLever',data%Equipments%DrillingConsole%TongLever,found) | ! call jsonfile%get('Equipments.Drilling.TongLever',data%Equipments%DrillingConsole%TongLever,found) | ||||
! if ( .not. found ) call logg(4,"Not found: TongLever") | ! if ( .not. found ) call logg(4,"Not found: TongLever") | ||||
call jsonfile%get('Equipments.Drilling.RTTransmissionLever',data%Equipments%DrillingConsole%RTTransmissionLever,found) | |||||
if ( .not. found ) call logg(4,"Not found: RTTransmissionLever") | |||||
call jsonfile%get('Equipments.Drilling.DWClutchLever',data%Equipments%DrillingConsole%DWClutchLever,found) | |||||
if ( .not. found ) call logg(4,"Not found: DWClutchLever") | |||||
call jsonfile%get('Equipments.Drilling.EddyBreakLever',data%Equipments%DrillingConsole%EddyBreakLever,found) | |||||
if ( .not. found ) call logg(4,"Not found: EddyBreakLever") | |||||
call jsonfile%get('Equipments.Drilling.AutoDW',data%Equipments%DrillingConsole%AutoDW,found) | |||||
if ( .not. found ) call logg(4,"Not found: AutoDW") | |||||
call jsonfile%get('Equipments.Drilling.GEN1',data%Equipments%DrillingConsole%GEN1,found) | |||||
if ( .not. found ) call logg(4,"Not found: GEN1") | |||||
call jsonfile%get('Equipments.Drilling.GEN2',data%Equipments%DrillingConsole%GEN2,found) | |||||
if ( .not. found ) call logg(4,"Not found: GEN2") | |||||
call jsonfile%get('Equipments.Drilling.GEN3',data%Equipments%DrillingConsole%GEN3,found) | |||||
if ( .not. found ) call logg(4,"Not found: GEN3") | |||||
call jsonfile%get('Equipments.Drilling.GEN4',data%Equipments%DrillingConsole%GEN4,found) | |||||
if ( .not. found ) call logg(4,"Not found: GEN4") | |||||
call jsonfile%get('Equipments.Drilling.Permission_OpenKellyCock',data%Equipments%DrillingConsole%Permission_OpenKellyCock,found) | |||||
if ( .not. found ) call logg(4,"Not found: Permission_OpenKellyCock") | |||||
call jsonfile%get('Equipments.Drilling.OpenKellyCock',data%Equipments%DrillingConsole%OpenKellyCock,found) | |||||
if ( .not. found ) call logg(4,"Not found: OpenKellyCock") | |||||
call jsonfile%get('Equipments.Drilling.Permission_CloseKellyCock',data%Equipments%DrillingConsole%Permission_CloseKellyCock,found) | |||||
if ( .not. found ) call logg(4,"Not found: Permission_CloseKellyCock") | |||||
call jsonfile%get('Equipments.Drilling.CloseKellyCock',data%Equipments%DrillingConsole%CloseKellyCock,found) | |||||
if ( .not. found ) call logg(4,"Not found: CloseKellyCock") | |||||
call jsonfile%get('Equipments.Drilling.Permission_OpenSafetyValve',data%Equipments%DrillingConsole%Permission_OpenSafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: Permission_OpenSafetyValve") | |||||
call jsonfile%get('Equipments.Drilling.OpenSafetyValve',data%Equipments%DrillingConsole%OpenSafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: OpenSafetyValve") | |||||
call jsonfile%get('Equipments.Drilling.Permission_CloseSafetyValve',data%Equipments%DrillingConsole%Permission_CloseSafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: Permission_CloseSafetyValve") | |||||
call jsonfile%get('Equipments.Drilling.CloseSafetyValve',data%Equipments%DrillingConsole%CloseSafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: CloseSafetyValve") | |||||
call jsonfile%get('Equipments.Drilling.Permission_IRSafetyValve',data%Equipments%DrillingConsole%Permission_IRSafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: Permission_IRSafetyValve") | |||||
call jsonfile%get('Equipments.Drilling.IRSafetyValve',data%Equipments%DrillingConsole%IRSafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: IRSafetyValve") | |||||
call jsonfile%get('Equipments.Drilling.Permission_IRIBop',data%Equipments%DrillingConsole%Permission_IRIBop,found) | |||||
if ( .not. found ) call logg(4,"Not found: Permission_IRIBop") | |||||
call jsonfile%get('Equipments.Drilling.IRIBop',data%Equipments%DrillingConsole%IRIBop,found) | |||||
if ( .not. found ) call logg(4,"Not found: IRIBop") | |||||
call jsonfile%get('Equipments.Drilling.LatchPipe',data%Equipments%DrillingConsole%LatchPipe,found) | |||||
if ( .not. found ) call logg(4,"Not found: LatchPipe") | |||||
call jsonfile%get('Equipments.Drilling.UnlatchPipe',data%Equipments%DrillingConsole%UnlatchPipe,found) | |||||
if ( .not. found ) call logg(4,"Not found: UnlatchPipe") | |||||
call jsonfile%get('Equipments.Drilling.Swing',data%Equipments%DrillingConsole%Swing,found) | |||||
if ( .not. found ) call logg(4,"Not found: Swing") | |||||
call jsonfile%get('Equipments.Drilling.FillMouseHole',data%Equipments%DrillingConsole%FillMouseHole,found) | |||||
if ( .not. found ) call logg(4,"Not found: FillMouseHole") | |||||
call jsonfile%get('Equipments.Drilling.Slips',data%Equipments%DrillingConsole%Slips,found) | |||||
if ( .not. found ) call logg(4,"Not found: Slips") | |||||
call jsonfile%get('Equipments.Drilling.BrakeLeverCoefficient',data%Equipments%DrillingConsole%BrakeLeverCoefficient,found) | |||||
if ( .not. found ) call logg(4,"Not found: BrakeLeverCoefficient") | |||||
call jsonfile%get('Equipments.Drilling.HideDrillingBrake',data%Equipments%DrillingConsole%HideDrillingBrake,found) | |||||
if ( .not. found ) call logg(4,"Not found: HideDrillingBrake") | |||||
call jsonfile%get('Equipments.Drilling.ParkingBrakeBtn',data%Equipments%DrillingConsole%ParkingBrakeBtn,found) | |||||
if ( .not. found ) call logg(4,"Not found: ParkingBrakeBtn") | |||||
! call jsonfile%get('Equipments.Drilling.RTTransmissionLever',data%Equipments%DrillingConsole%RTTransmissionLever,found) | |||||
! if ( .not. found ) call logg(4,"Not found: RTTransmissionLever") | |||||
! call jsonfile%get('Equipments.Drilling.DWClutchLever',data%Equipments%DrillingConsole%DWClutchLever,found) | |||||
! if ( .not. found ) call logg(4,"Not found: DWClutchLever") | |||||
! call jsonfile%get('Equipments.Drilling.EddyBreakLever',data%Equipments%DrillingConsole%EddyBreakLever,found) | |||||
! if ( .not. found ) call logg(4,"Not found: EddyBreakLever") | |||||
! call jsonfile%get('Equipments.Drilling.AutoDW',data%Equipments%DrillingConsole%AutoDW,found) | |||||
! if ( .not. found ) call logg(4,"Not found: AutoDW") | |||||
! call jsonfile%get('Equipments.Drilling.GEN1',data%Equipments%DrillingConsole%GEN1,found) | |||||
! if ( .not. found ) call logg(4,"Not found: GEN1") | |||||
! call jsonfile%get('Equipments.Drilling.GEN2',data%Equipments%DrillingConsole%GEN2,found) | |||||
! if ( .not. found ) call logg(4,"Not found: GEN2") | |||||
! call jsonfile%get('Equipments.Drilling.GEN3',data%Equipments%DrillingConsole%GEN3,found) | |||||
! if ( .not. found ) call logg(4,"Not found: GEN3") | |||||
! call jsonfile%get('Equipments.Drilling.GEN4',data%Equipments%DrillingConsole%GEN4,found) | |||||
! if ( .not. found ) call logg(4,"Not found: GEN4") | |||||
! call jsonfile%get('Equipments.Drilling.Permission_OpenKellyCock',data%Equipments%DrillingConsole%Permission_OpenKellyCock,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Permission_OpenKellyCock") | |||||
! call jsonfile%get('Equipments.Drilling.OpenKellyCock',data%Equipments%DrillingConsole%OpenKellyCock,found) | |||||
! if ( .not. found ) call logg(4,"Not found: OpenKellyCock") | |||||
! call jsonfile%get('Equipments.Drilling.Permission_CloseKellyCock',data%Equipments%DrillingConsole%Permission_CloseKellyCock,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Permission_CloseKellyCock") | |||||
! call jsonfile%get('Equipments.Drilling.CloseKellyCock',data%Equipments%DrillingConsole%CloseKellyCock,found) | |||||
! if ( .not. found ) call logg(4,"Not found: CloseKellyCock") | |||||
! call jsonfile%get('Equipments.Drilling.Permission_OpenSafetyValve',data%Equipments%DrillingConsole%Permission_OpenSafetyValve,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Permission_OpenSafetyValve") | |||||
! call jsonfile%get('Equipments.Drilling.OpenSafetyValve',data%Equipments%DrillingConsole%OpenSafetyValve,found) | |||||
! if ( .not. found ) call logg(4,"Not found: OpenSafetyValve") | |||||
! call jsonfile%get('Equipments.Drilling.Permission_CloseSafetyValve',data%Equipments%DrillingConsole%Permission_CloseSafetyValve,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Permission_CloseSafetyValve") | |||||
! call jsonfile%get('Equipments.Drilling.CloseSafetyValve',data%Equipments%DrillingConsole%CloseSafetyValve,found) | |||||
! if ( .not. found ) call logg(4,"Not found: CloseSafetyValve") | |||||
! call jsonfile%get('Equipments.Drilling.Permission_IRSafetyValve',data%Equipments%DrillingConsole%Permission_IRSafetyValve,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Permission_IRSafetyValve") | |||||
! call jsonfile%get('Equipments.Drilling.IRSafetyValve',data%Equipments%DrillingConsole%IRSafetyValve,found) | |||||
! if ( .not. found ) call logg(4,"Not found: IRSafetyValve") | |||||
! call jsonfile%get('Equipments.Drilling.Permission_IRIBop',data%Equipments%DrillingConsole%Permission_IRIBop,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Permission_IRIBop") | |||||
! call jsonfile%get('Equipments.Drilling.IRIBop',data%Equipments%DrillingConsole%IRIBop,found) | |||||
! if ( .not. found ) call logg(4,"Not found: IRIBop") | |||||
! call jsonfile%get('Equipments.Drilling.LatchPipe',data%Equipments%DrillingConsole%LatchPipe,found) | |||||
! if ( .not. found ) call logg(4,"Not found: LatchPipe") | |||||
! call jsonfile%get('Equipments.Drilling.UnlatchPipe',data%Equipments%DrillingConsole%UnlatchPipe,found) | |||||
! if ( .not. found ) call logg(4,"Not found: UnlatchPipe") | |||||
! call jsonfile%get('Equipments.Drilling.Swing',data%Equipments%DrillingConsole%Swing,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Swing") | |||||
! call jsonfile%get('Equipments.Drilling.FillMouseHole',data%Equipments%DrillingConsole%FillMouseHole,found) | |||||
! if ( .not. found ) call logg(4,"Not found: FillMouseHole") | |||||
! call jsonfile%get('Equipments.Drilling.Slips',data%Equipments%DrillingConsole%Slips,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Slips") | |||||
! call jsonfile%get('Equipments.Drilling.BrakeLeverCoefficient',data%Equipments%DrillingConsole%BrakeLeverCoefficient,found) | |||||
! if ( .not. found ) call logg(4,"Not found: BrakeLeverCoefficient") | |||||
! call jsonfile%get('Equipments.Drilling.HideDrillingBrake',data%Equipments%DrillingConsole%HideDrillingBrake,found) | |||||
! if ( .not. found ) call logg(4,"Not found: HideDrillingBrake") | |||||
! call jsonfile%get('Equipments.Drilling.ParkingBrakeBtn',data%Equipments%DrillingConsole%ParkingBrakeBtn,found) | |||||
! if ( .not. found ) call logg(4,"Not found: ParkingBrakeBtn") | |||||
! call jsonfile%destroy() | ! call jsonfile%destroy() | ||||
@@ -2,7 +2,6 @@ | |||||
module CDrillingConsole | module CDrillingConsole | ||||
use CDrillingConsoleVariables | use CDrillingConsoleVariables | ||||
use SimulationVariables | use SimulationVariables | ||||
use SimulationVariables | |||||
! use CSimulationVariables | ! use CSimulationVariables | ||||
use CLog4 | use CLog4 | ||||
use CLog3 | use CLog3 | ||||
@@ -19,109 +18,104 @@ module CDrillingConsole | |||||
logical::found | logical::found | ||||
integer :: i | integer :: i | ||||
call jsonfile%get('Equipments.Drilling.AssignmentSwitch',data%Equipments%DrillingConsole%AssignmentSwitch,found) | |||||
if ( .not. found ) call logg(4,"Not found: AssignmentSwitch") | |||||
call jsonfile%get('Equipments.Drilling.EmergencySwitch',data%Equipments%DrillingConsole%EmergencySwitch,found) | |||||
if ( .not. found ) call logg(4,"Not found: EmergencySwitch") | |||||
call jsonfile%get('Equipments.Drilling.RTTorqueLimitKnob',data%Equipments%DrillingConsole%RTTorqueLimitKnob,found) | |||||
if ( .not. found ) call logg(4,"Not found: RTTorqueLimitKnob") | |||||
! call jsonfile%get('Equipments.Drilling.AssignmentSwitch',data%Equipments%DrillingConsole%AssignmentSwitch,found) | |||||
! if ( .not. found ) call logg(4,"Not found: AssignmentSwitch") | |||||
! call jsonfile%get('Equipments.Drilling.EmergencySwitch',data%Equipments%DrillingConsole%EmergencySwitch,found) | |||||
! if ( .not. found ) call logg(4,"Not found: EmergencySwitch") | |||||
! call jsonfile%get('Equipments.Drilling.RTTorqueLimitKnob',data%Equipments%DrillingConsole%RTTorqueLimitKnob,found) | |||||
! if ( .not. found ) call logg(4,"Not found: RTTorqueLimitKnob") | |||||
call jsonfile%get('Equipments.Drilling.MP1CPSwitch',data%Equipments%DrillingConsole%MP1CPSwitch,found) | call jsonfile%get('Equipments.Drilling.MP1CPSwitch',data%Equipments%DrillingConsole%MP1CPSwitch,found) | ||||
if ( .not. found ) call logg(4,"Not found: MP1CPSwitch") | if ( .not. found ) call logg(4,"Not found: MP1CPSwitch") | ||||
call jsonfile%get('Equipments.Drilling.MP1ThrottleUpdate',data%Equipments%DrillingConsole%MP1ThrottleUpdate,found) | |||||
if ( .not. found ) call logg(4,"Not found: MP1ThrottleUpdate") | |||||
! call jsonfile%get('Equipments.Drilling.MP1ThrottleUpdate',data%Equipments%DrillingConsole%MP1ThrottleUpdate,found) | |||||
! if ( .not. found ) call logg(4,"Not found: MP1ThrottleUpdate") | |||||
call jsonfile%get('Equipments.Drilling.MP1Throttle',data%Equipments%DrillingConsole%MP1Throttle,found) | call jsonfile%get('Equipments.Drilling.MP1Throttle',data%Equipments%DrillingConsole%MP1Throttle,found) | ||||
if ( .not. found ) then | |||||
call logg(4,"Not found: MP1Throttle") | |||||
endif | |||||
if ( .not. found ) call logg(4,"Not found: MP1Throttle") | |||||
call jsonfile%get('Equipments.Drilling.MP2Switch',data%Equipments%DrillingConsole%MP2Switch,found) | call jsonfile%get('Equipments.Drilling.MP2Switch',data%Equipments%DrillingConsole%MP2Switch,found) | ||||
if ( .not. found ) call logg(4,"Not found: MP2Switch") | if ( .not. found ) call logg(4,"Not found: MP2Switch") | ||||
call jsonfile%get('Equipments.Drilling.MP2ThrottleUpdate',data%Equipments%DrillingConsole%MP2ThrottleUpdate,found) | |||||
if ( .not. found ) call logg(4,"Not found: MP2ThrottleUpdate") | |||||
! call jsonfile%get('Equipments.Drilling.MP2ThrottleUpdate',data%Equipments%DrillingConsole%MP2ThrottleUpdate,found) | |||||
! if ( .not. found ) call logg(4,"Not found: MP2ThrottleUpdate") | |||||
call jsonfile%get('Equipments.Drilling.MP2Throttle',data%Equipments%DrillingConsole%MP2Throttle,found) | call jsonfile%get('Equipments.Drilling.MP2Throttle',data%Equipments%DrillingConsole%MP2Throttle,found) | ||||
if ( .not. found ) then | |||||
call logg(4,"Not found: MP2Throttle") | |||||
endif | |||||
if ( .not. found ) call logg(4,"Not found: MP2Throttle") | |||||
call jsonfile%get('Equipments.Drilling.DWSwitch',data%Equipments%DrillingConsole%DWSwitch,found) | call jsonfile%get('Equipments.Drilling.DWSwitch',data%Equipments%DrillingConsole%DWSwitch,found) | ||||
if ( .not. found ) call logg(4,"Not found: DWSwitch") | if ( .not. found ) call logg(4,"Not found: DWSwitch") | ||||
call jsonfile%get('Equipments.Drilling.DWThrottle',data%Equipments%DrillingConsole%DWThrottle,found) | call jsonfile%get('Equipments.Drilling.DWThrottle',data%Equipments%DrillingConsole%DWThrottle,found) | ||||
if ( .not. found ) call logg(4,"Not found: DWThrottle") | if ( .not. found ) call logg(4,"Not found: DWThrottle") | ||||
! if (print_log .and. abs(data%Equipments%DrillingConsole%DWThrottle)>0) print *,"data%Equipments%DrillingConsole%DWThrottle = ",data%Equipments%DrillingConsole%DWThrottle | |||||
call jsonfile%get('Equipments.Drilling.RTSwitch',data%Equipments%DrillingConsole%RTSwitch,found) | call jsonfile%get('Equipments.Drilling.RTSwitch',data%Equipments%DrillingConsole%RTSwitch,found) | ||||
if ( .not. found ) call logg(4,"Not found: RTSwitch") | if ( .not. found ) call logg(4,"Not found: RTSwitch") | ||||
call jsonfile%get('Equipments.Drilling.RTThrottle',i,found) | call jsonfile%get('Equipments.Drilling.RTThrottle',i,found) | ||||
data%Equipments%DrillingConsole%RTThrottle = real(i) | data%Equipments%DrillingConsole%RTThrottle = real(i) | ||||
if ( .not. found ) then | |||||
call logg(4,"Not found: RTThrottle") | |||||
endif | |||||
call jsonfile%get('Equipments.Drilling.DWBreak',data%Equipments%DrillingConsole%DWBreak,found) | |||||
if ( .not. found ) call logg(4,"Not found: DWBreak") | |||||
call jsonfile%get('Equipments.Drilling.PreviousDWBreak',data%Equipments%DrillingConsole%PreviousDWBreak,found) | |||||
if ( .not. found ) call logg(4,"Not found: PreviousDWBreak") | |||||
call jsonfile%get('Equipments.Drilling.ForceBreak',data%Equipments%DrillingConsole%ForceBreak,found) | |||||
if ( .not. found ) call logg(4,"Not found: ForceBreak") | |||||
call jsonfile%get('Equipments.Drilling.DWAcceleretor',data%Equipments%DrillingConsole%DWAcceleretor,found) | |||||
if ( .not. found ) call logg(4,"Not found: DWAcceleretor") | |||||
call jsonfile%get('Equipments.Drilling.DWTransmisionLever',data%Equipments%DrillingConsole%DWTransmisionLever,found) | |||||
if ( .not. found ) call logg(4,"Not found: DWTransmisionLever") | |||||
call jsonfile%get('Equipments.Drilling.DWPowerLever',data%Equipments%DrillingConsole%DWPowerLever,found) | |||||
if ( .not. found ) call logg(4,"Not found: DWPowerLever") | |||||
call jsonfile%get('Equipments.Drilling.TongLever',data%Equipments%DrillingConsole%TongLever,found) | |||||
if ( .not. found ) call logg(4,"Not found: TongLever") | |||||
call jsonfile%get('Equipments.Drilling.RTTransmissionLever',data%Equipments%DrillingConsole%RTTransmissionLever,found) | |||||
if ( .not. found ) call logg(4,"Not found: RTTransmissionLever") | |||||
call jsonfile%get('Equipments.Drilling.DWClutchLever',data%Equipments%DrillingConsole%DWClutchLever,found) | |||||
if ( .not. found ) call logg(4,"Not found: DWClutchLever") | |||||
call jsonfile%get('Equipments.Drilling.EddyBreakLever',data%Equipments%DrillingConsole%EddyBreakLever,found) | |||||
if ( .not. found ) call logg(4,"Not found: EddyBreakLever") | |||||
call jsonfile%get('Equipments.Drilling.AutoDW',data%Equipments%DrillingConsole%AutoDW,found) | |||||
if ( .not. found ) call logg(4,"Not found: AutoDW") | |||||
call jsonfile%get('Equipments.Drilling.GEN1',data%Equipments%DrillingConsole%GEN1,found) | |||||
if ( .not. found ) call logg(4,"Not found: GEN1") | |||||
call jsonfile%get('Equipments.Drilling.GEN2',data%Equipments%DrillingConsole%GEN2,found) | |||||
if ( .not. found ) call logg(4,"Not found: GEN2") | |||||
call jsonfile%get('Equipments.Drilling.GEN3',data%Equipments%DrillingConsole%GEN3,found) | |||||
if ( .not. found ) call logg(4,"Not found: GEN3") | |||||
call jsonfile%get('Equipments.Drilling.GEN4',data%Equipments%DrillingConsole%GEN4,found) | |||||
if ( .not. found ) call logg(4,"Not found: GEN4") | |||||
call jsonfile%get('Equipments.Drilling.Permission_OpenKellyCock',data%Equipments%DrillingConsole%Permission_OpenKellyCock,found) | |||||
if ( .not. found ) call logg(4,"Not found: Permission_OpenKellyCock") | |||||
call jsonfile%get('Equipments.Drilling.OpenKellyCock',data%Equipments%DrillingConsole%OpenKellyCock,found) | |||||
if ( .not. found ) call logg(4,"Not found: OpenKellyCock") | |||||
call jsonfile%get('Equipments.Drilling.Permission_CloseKellyCock',data%Equipments%DrillingConsole%Permission_CloseKellyCock,found) | |||||
if ( .not. found ) call logg(4,"Not found: Permission_CloseKellyCock") | |||||
call jsonfile%get('Equipments.Drilling.CloseKellyCock',data%Equipments%DrillingConsole%CloseKellyCock,found) | |||||
if ( .not. found ) call logg(4,"Not found: CloseKellyCock") | |||||
call jsonfile%get('Equipments.Drilling.Permission_OpenSafetyValve',data%Equipments%DrillingConsole%Permission_OpenSafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: Permission_OpenSafetyValve") | |||||
call jsonfile%get('Equipments.Drilling.OpenSafetyValve',data%Equipments%DrillingConsole%OpenSafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: OpenSafetyValve") | |||||
call jsonfile%get('Equipments.Drilling.Permission_CloseSafetyValve',data%Equipments%DrillingConsole%Permission_CloseSafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: Permission_CloseSafetyValve") | |||||
call jsonfile%get('Equipments.Drilling.CloseSafetyValve',data%Equipments%DrillingConsole%CloseSafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: CloseSafetyValve") | |||||
call jsonfile%get('Equipments.Drilling.Permission_IRSafetyValve',data%Equipments%DrillingConsole%Permission_IRSafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: Permission_IRSafetyValve") | |||||
call jsonfile%get('Equipments.Drilling.IRSafetyValve',data%Equipments%DrillingConsole%IRSafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: IRSafetyValve") | |||||
call jsonfile%get('Equipments.Drilling.Permission_IRIBop',data%Equipments%DrillingConsole%Permission_IRIBop,found) | |||||
if ( .not. found ) call logg(4,"Not found: Permission_IRIBop") | |||||
call jsonfile%get('Equipments.Drilling.IRIBop',data%Equipments%DrillingConsole%IRIBop,found) | |||||
if ( .not. found ) call logg(4,"Not found: IRIBop") | |||||
call jsonfile%get('Equipments.Drilling.LatchPipe',data%Equipments%DrillingConsole%LatchPipe,found) | |||||
if ( .not. found ) call logg(4,"Not found: LatchPipe") | |||||
call jsonfile%get('Equipments.Drilling.UnlatchPipe',data%Equipments%DrillingConsole%UnlatchPipe,found) | |||||
if ( .not. found ) call logg(4,"Not found: UnlatchPipe") | |||||
call jsonfile%get('Equipments.Drilling.Swing',data%Equipments%DrillingConsole%Swing,found) | |||||
if ( .not. found ) call logg(4,"Not found: Swing") | |||||
call jsonfile%get('Equipments.Drilling.FillMouseHole',data%Equipments%DrillingConsole%FillMouseHole,found) | |||||
if ( .not. found ) call logg(4,"Not found: FillMouseHole") | |||||
call jsonfile%get('Equipments.Drilling.Slips',data%Equipments%DrillingConsole%Slips,found) | |||||
if ( .not. found ) call logg(4,"Not found: Slips") | |||||
call jsonfile%get('Equipments.Drilling.BrakeLeverCoefficient',data%Equipments%DrillingConsole%BrakeLeverCoefficient,found) | |||||
if ( .not. found ) call logg(4,"Not found: BrakeLeverCoefficient") | |||||
call jsonfile%get('Equipments.Drilling.HideDrillingBrake',data%Equipments%DrillingConsole%HideDrillingBrake,found) | |||||
if ( .not. found ) call logg(4,"Not found: HideDrillingBrake") | |||||
call jsonfile%get('Equipments.Drilling.ParkingBrakeBtn',data%Equipments%DrillingConsole%ParkingBrakeBtn,found) | |||||
if ( .not. found ) call logg(4,"Not found: ParkingBrakeBtn") | |||||
if ( .not. found ) call logg(4,"Not found: RTThrottle") | |||||
! call jsonfile%get('Equipments.Drilling.DWBreak',data%Equipments%DrillingConsole%DWBreak,found) | |||||
! if ( .not. found ) call logg(4,"Not found: DWBreak") | |||||
! call jsonfile%get('Equipments.Drilling.PreviousDWBreak',data%Equipments%DrillingConsole%PreviousDWBreak,found) | |||||
! if ( .not. found ) call logg(4,"Not found: PreviousDWBreak") | |||||
! call jsonfile%get('Equipments.Drilling.ForceBreak',data%Equipments%DrillingConsole%ForceBreak,found) | |||||
! if ( .not. found ) call logg(4,"Not found: ForceBreak") | |||||
! call jsonfile%get('Equipments.Drilling.DWAcceleretor',data%Equipments%DrillingConsole%DWAcceleretor,found) | |||||
! if ( .not. found ) call logg(4,"Not found: DWAcceleretor") | |||||
! call jsonfile%get('Equipments.Drilling.DWTransmisionLever',data%Equipments%DrillingConsole%DWTransmisionLever,found) | |||||
! if ( .not. found ) call logg(4,"Not found: DWTransmisionLever") | |||||
! call jsonfile%get('Equipments.Drilling.DWPowerLever',data%Equipments%DrillingConsole%DWPowerLever,found) | |||||
! if ( .not. found ) call logg(4,"Not found: DWPowerLever") | |||||
! call jsonfile%get('Equipments.Drilling.TongLever',data%Equipments%DrillingConsole%TongLever,found) | |||||
! if ( .not. found ) call logg(4,"Not found: TongLever") | |||||
! call jsonfile%get('Equipments.Drilling.RTTransmissionLever',data%Equipments%DrillingConsole%RTTransmissionLever,found) | |||||
! if ( .not. found ) call logg(4,"Not found: RTTransmissionLever") | |||||
! call jsonfile%get('Equipments.Drilling.DWClutchLever',data%Equipments%DrillingConsole%DWClutchLever,found) | |||||
! if ( .not. found ) call logg(4,"Not found: DWClutchLever") | |||||
! call jsonfile%get('Equipments.Drilling.EddyBreakLever',data%Equipments%DrillingConsole%EddyBreakLever,found) | |||||
! if ( .not. found ) call logg(4,"Not found: EddyBreakLever") | |||||
! call jsonfile%get('Equipments.Drilling.AutoDW',data%Equipments%DrillingConsole%AutoDW,found) | |||||
! if ( .not. found ) call logg(4,"Not found: AutoDW") | |||||
! call jsonfile%get('Equipments.Drilling.GEN1',data%Equipments%DrillingConsole%GEN1,found) | |||||
! if ( .not. found ) call logg(4,"Not found: GEN1") | |||||
! call jsonfile%get('Equipments.Drilling.GEN2',data%Equipments%DrillingConsole%GEN2,found) | |||||
! if ( .not. found ) call logg(4,"Not found: GEN2") | |||||
! call jsonfile%get('Equipments.Drilling.GEN3',data%Equipments%DrillingConsole%GEN3,found) | |||||
! if ( .not. found ) call logg(4,"Not found: GEN3") | |||||
! call jsonfile%get('Equipments.Drilling.GEN4',data%Equipments%DrillingConsole%GEN4,found) | |||||
! if ( .not. found ) call logg(4,"Not found: GEN4") | |||||
! call jsonfile%get('Equipments.Drilling.Permission_OpenKellyCock',data%Equipments%DrillingConsole%Permission_OpenKellyCock,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Permission_OpenKellyCock") | |||||
! call jsonfile%get('Equipments.Drilling.OpenKellyCock',data%Equipments%DrillingConsole%OpenKellyCock,found) | |||||
! if ( .not. found ) call logg(4,"Not found: OpenKellyCock") | |||||
! call jsonfile%get('Equipments.Drilling.Permission_CloseKellyCock',data%Equipments%DrillingConsole%Permission_CloseKellyCock,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Permission_CloseKellyCock") | |||||
! call jsonfile%get('Equipments.Drilling.CloseKellyCock',data%Equipments%DrillingConsole%CloseKellyCock,found) | |||||
! if ( .not. found ) call logg(4,"Not found: CloseKellyCock") | |||||
! call jsonfile%get('Equipments.Drilling.Permission_OpenSafetyValve',data%Equipments%DrillingConsole%Permission_OpenSafetyValve,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Permission_OpenSafetyValve") | |||||
! call jsonfile%get('Equipments.Drilling.OpenSafetyValve',data%Equipments%DrillingConsole%OpenSafetyValve,found) | |||||
! if ( .not. found ) call logg(4,"Not found: OpenSafetyValve") | |||||
! call jsonfile%get('Equipments.Drilling.Permission_CloseSafetyValve',data%Equipments%DrillingConsole%Permission_CloseSafetyValve,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Permission_CloseSafetyValve") | |||||
! call jsonfile%get('Equipments.Drilling.CloseSafetyValve',data%Equipments%DrillingConsole%CloseSafetyValve,found) | |||||
! if ( .not. found ) call logg(4,"Not found: CloseSafetyValve") | |||||
! call jsonfile%get('Equipments.Drilling.Permission_IRSafetyValve',data%Equipments%DrillingConsole%Permission_IRSafetyValve,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Permission_IRSafetyValve") | |||||
! call jsonfile%get('Equipments.Drilling.IRSafetyValve',data%Equipments%DrillingConsole%IRSafetyValve,found) | |||||
! if ( .not. found ) call logg(4,"Not found: IRSafetyValve") | |||||
! call jsonfile%get('Equipments.Drilling.Permission_IRIBop',data%Equipments%DrillingConsole%Permission_IRIBop,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Permission_IRIBop") | |||||
! call jsonfile%get('Equipments.Drilling.IRIBop',data%Equipments%DrillingConsole%IRIBop,found) | |||||
! if ( .not. found ) call logg(4,"Not found: IRIBop") | |||||
! call jsonfile%get('Equipments.Drilling.LatchPipe',data%Equipments%DrillingConsole%LatchPipe,found) | |||||
! if ( .not. found ) call logg(4,"Not found: LatchPipe") | |||||
! call jsonfile%get('Equipments.Drilling.UnlatchPipe',data%Equipments%DrillingConsole%UnlatchPipe,found) | |||||
! if ( .not. found ) call logg(4,"Not found: UnlatchPipe") | |||||
! call jsonfile%get('Equipments.Drilling.Swing',data%Equipments%DrillingConsole%Swing,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Swing") | |||||
! call jsonfile%get('Equipments.Drilling.FillMouseHole',data%Equipments%DrillingConsole%FillMouseHole,found) | |||||
! if ( .not. found ) call logg(4,"Not found: FillMouseHole") | |||||
! call jsonfile%get('Equipments.Drilling.Slips',data%Equipments%DrillingConsole%Slips,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Slips") | |||||
! call jsonfile%get('Equipments.Drilling.BrakeLeverCoefficient',data%Equipments%DrillingConsole%BrakeLeverCoefficient,found) | |||||
! if ( .not. found ) call logg(4,"Not found: BrakeLeverCoefficient") | |||||
! call jsonfile%get('Equipments.Drilling.HideDrillingBrake',data%Equipments%DrillingConsole%HideDrillingBrake,found) | |||||
! if ( .not. found ) call logg(4,"Not found: HideDrillingBrake") | |||||
! call jsonfile%get('Equipments.Drilling.ParkingBrakeBtn',data%Equipments%DrillingConsole%ParkingBrakeBtn,found) | |||||
! if ( .not. found ) call logg(4,"Not found: ParkingBrakeBtn") | |||||
! call jsonfile%destroy() | ! call jsonfile%destroy() | ||||
@@ -184,8 +178,21 @@ module CDrillingConsole | |||||
call json%add(p,"MP2Throttle",data%Equipments%DrillingConsole%MP2Throttle) | call json%add(p,"MP2Throttle",data%Equipments%DrillingConsole%MP2Throttle) | ||||
call json%add(p,"RTThrottle",data%Equipments%DrillingConsole%RTThrottle) | call json%add(p,"RTThrottle",data%Equipments%DrillingConsole%RTThrottle) | ||||
call json%add(p,"DWThrottle",data%Equipments%DrillingConsole%DWThrottle) | call json%add(p,"DWThrottle",data%Equipments%DrillingConsole%DWThrottle) | ||||
call json%add(parent,p) | call json%add(parent,p) | ||||
end subroutine | end subroutine | ||||
subroutine SetTongLever(v) bind(C,name="setTongLever") | |||||
use CTongEnum | |||||
use ISO_C_BINDING, only:c_int | |||||
integer(c_int), intent(in) :: v | |||||
if(v == 1) then | |||||
call ButtonPress_Breakout_TongNotification() | |||||
if(print_log) print*, 'BreakoutLeverPress' | |||||
endif | |||||
if(v == -1) then | |||||
call ButtonPress_Makeup_TongNotification() | |||||
if(print_log) print*, 'MakeupLeverPress' | |||||
endif | |||||
if(print_log) print*, 'TongLever=', v | |||||
end subroutine | |||||
end module CDrillingConsole | end module CDrillingConsole |
@@ -6,7 +6,7 @@ module CDrillingConsoleVariables | |||||
TYPE, PUBLIC :: DrillingConsoleType | TYPE, PUBLIC :: DrillingConsoleType | ||||
! Input vars | ! Input vars | ||||
integer :: AssignmentSwitch | |||||
integer :: AssignmentSwitch = 1 | |||||
logical :: EmergencySwitch | logical :: EmergencySwitch | ||||
real(8) :: RTTorqueLimitKnob | real(8) :: RTTorqueLimitKnob | ||||
! integer :: MP1CPSwitchI = 0 !for not turning on pump1 on simulation start | ! integer :: MP1CPSwitchI = 0 !for not turning on pump1 on simulation start | ||||
@@ -7,7 +7,7 @@ module CDrillingConsoleVariables | |||||
TYPE, PUBLIC :: DrillingConsoleType | TYPE, PUBLIC :: DrillingConsoleType | ||||
! Input vars | ! Input vars | ||||
integer :: AssignmentSwitch | |||||
integer :: AssignmentSwitch = 1 | |||||
logical :: EmergencySwitch | logical :: EmergencySwitch | ||||
real(8) :: RTTorqueLimitKnob | real(8) :: RTTorqueLimitKnob | ||||
! integer :: MP1CPSwitchI = 0 !for not turning on pump1 on simulation start | ! integer :: MP1CPSwitchI = 0 !for not turning on pump1 on simulation start | ||||
@@ -30,7 +30,7 @@ module CDrillingConsoleVariables | |||||
real(8) :: DWAcceleretor | real(8) :: DWAcceleretor | ||||
real(8) :: DWTransmisionLever | real(8) :: DWTransmisionLever | ||||
real(8) :: DWPowerLever | real(8) :: DWPowerLever | ||||
real(8) :: TongLever | |||||
! real(8) :: TongLever | |||||
real(8) :: RTTransmissionLever | real(8) :: RTTransmissionLever | ||||
real(8) :: DWClutchLever | real(8) :: DWClutchLever | ||||
real(8) :: EddyBreakLever | real(8) :: EddyBreakLever | ||||
@@ -6,34 +6,24 @@ module CHook | |||||
public | public | ||||
contains | contains | ||||
subroutine HookFromJson(parent) | |||||
type(json_value),pointer :: parent | |||||
type(json_core) :: json | |||||
type(json_value),pointer :: p,pval | |||||
! subroutine HookFromJson(jsonfile) | |||||
! type(json_file)::jsonfile | |||||
! logical::found | |||||
! 1. get related root | |||||
! call json%get(parent,'Hook',p) | |||||
! ! 2. get member of data type from node | |||||
! call json%get(p,'HookHeight_S',pval) | |||||
! call json%get(pval,data%Equipments%Hook%HookHeight_S) | |||||
! call json%get(p,'HookHeight',pval) | |||||
! call json%get(pval,data%Equipments%Hook%HookHeight) | |||||
end subroutine | |||||
subroutine HookToJson(parent) | |||||
! call jsonfile%get('Equipments.HookHeight',data%State%Drawworks%Hook_Height_final,found) | |||||
! if ( .not. found ) call logg(4,"Not found: Equipments.Hook.HookHeight") | |||||
! end subroutine | |||||
type(json_value),pointer :: parent | |||||
type(json_core) :: json | |||||
type(json_value),pointer :: p | |||||
! subroutine HookToJson(parent) | |||||
! type(json_value),pointer :: parent | |||||
! type(json_core) :: json | |||||
! type(json_value),pointer :: p | |||||
! 1. create new node | |||||
call json%create_object(p,'Hook') | |||||
call json%add(p,"HookHeight_S",data%Equipments%Hook%HookHeight_S) | |||||
call json%add(p,"HookHeight",data%Equipments%Hook%HookHeight) | |||||
call json%add(parent,p) | |||||
end subroutine | |||||
! ! 1. create new node | |||||
! call json%create_object(p,'Hook') | |||||
! call json%add(p,"Velocity",data%State%Drawworks%HookLinearVelocity_final) | |||||
! call json%add(parent,p) | |||||
! end subroutine | |||||
subroutine Set_HookHeight(v) | subroutine Set_HookHeight(v) | ||||
use CDrillingConsoleVariables | use CDrillingConsoleVariables | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/Equipments/ControlPanels/CTopDrivePanelVariables.f90" | |||||
module CTopDrivePanelVariables | module CTopDrivePanelVariables | ||||
implicit none | implicit none | ||||
public | public | ||||
@@ -2,56 +2,6 @@ module DrillingWatchModule | |||||
use SimulationVariables | use SimulationVariables | ||||
contains | contains | ||||
! subroutine DrillingWatchFromJson(parent) | |||||
! type(json_value),pointer :: parent | |||||
! type(json_core) :: json | |||||
! type(json_value),pointer :: p,pval | |||||
! logical::is_found | |||||
! ! 1. get related root | |||||
! call json%get(parent,'DrillingWatch',p) | |||||
! ! 2. get member of data type from node | |||||
! call json%get(p,'Depth',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%Depth) | |||||
! call json%get(p,'BitPosition',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%BitPosition) | |||||
! call json%get(p,'HookLoad',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%HookLoad) | |||||
! call json%get(p,'WeightOnBit',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%WeightOnBit) | |||||
! call json%get(p,'RPM',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%RPM) | |||||
! call json%get(p,'ROP',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%ROP) | |||||
! call json%get(p,'Torque',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%Torque) | |||||
! call json%get(p,'PumpPressure',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%PumpPressure) | |||||
! call json%get(p,'SPM1',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%SPM1) | |||||
! call json%get(p,'SPM2',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%SPM2) | |||||
! call json%get(p,'CasingPressure',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%CasingPressure) | |||||
! call json%get(p,'PercentFlow',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%PercentFlow) | |||||
! call json%get(p,'PitGainLose',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%PitGainLose) | |||||
! call json%get(p,'PitVolume',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%PitVolume) | |||||
! call json%get(p,'KillMudVolume',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%KillMudVolume) | |||||
! call json%get(p,'TripTankVolume',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%TripTankVolume) | |||||
! call json%get(p,'MudWeightIn',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%MudWeightIn) | |||||
! call json%get(p,'FillVolume',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%FillVolume) | |||||
! call json%get(p,'MudWeightOut',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%MudWeightOut) | |||||
! end subroutine | |||||
subroutine DrillingWatchToJson(parent) | subroutine DrillingWatchToJson(parent) | ||||
type(json_value),pointer :: parent | type(json_value),pointer :: parent | ||||
type(json_core) :: json | type(json_core) :: json | ||||
@@ -3,56 +3,6 @@ module DrillingWatchModule | |||||
use SimulationVariables | use SimulationVariables | ||||
contains | contains | ||||
! subroutine DrillingWatchFromJson(parent) | |||||
! type(json_value),pointer :: parent | |||||
! type(json_core) :: json | |||||
! type(json_value),pointer :: p,pval | |||||
! logical::is_found | |||||
! ! 1. get related root | |||||
! call json%get(parent,'DrillingWatch',p) | |||||
! ! 2. get member of data type from node | |||||
! call json%get(p,'Depth',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%Depth) | |||||
! call json%get(p,'BitPosition',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%BitPosition) | |||||
! call json%get(p,'HookLoad',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%HookLoad) | |||||
! call json%get(p,'WeightOnBit',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%WeightOnBit) | |||||
! call json%get(p,'RPM',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%RPM) | |||||
! call json%get(p,'ROP',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%ROP) | |||||
! call json%get(p,'Torque',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%Torque) | |||||
! call json%get(p,'PumpPressure',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%PumpPressure) | |||||
! call json%get(p,'SPM1',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%SPM1) | |||||
! call json%get(p,'SPM2',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%SPM2) | |||||
! call json%get(p,'CasingPressure',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%CasingPressure) | |||||
! call json%get(p,'PercentFlow',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%PercentFlow) | |||||
! call json%get(p,'PitGainLose',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%PitGainLose) | |||||
! call json%get(p,'PitVolume',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%PitVolume) | |||||
! call json%get(p,'KillMudVolume',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%KillMudVolume) | |||||
! call json%get(p,'TripTankVolume',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%TripTankVolume) | |||||
! call json%get(p,'MudWeightIn',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%MudWeightIn) | |||||
! call json%get(p,'FillVolume',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%FillVolume) | |||||
! call json%get(p,'MudWeightOut',pval) | |||||
! call json%get(pval,data%Equipments%DrillingWatch%MudWeightOut) | |||||
! end subroutine | |||||
subroutine DrillingWatchToJson(parent) | subroutine DrillingWatchToJson(parent) | ||||
type(json_value),pointer :: parent | type(json_value),pointer :: parent | ||||
type(json_core) :: json | type(json_core) :: json | ||||
@@ -0,0 +1,138 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/Equipments/MudPathFinding/CArrangement.f90" | |||||
module CArrangement | |||||
implicit none | |||||
public | |||||
integer, parameter :: Normal = 0 | |||||
integer, parameter :: Relation = 1 | |||||
integer, parameter :: Input = 2 | |||||
integer, parameter :: Output = 3 | |||||
integer, parameter :: InputOutput = 4 | |||||
type, public :: Arrangement | |||||
integer, allocatable :: Adjacent(:) !adjacent valves that is connected to this valve | |||||
logical :: Status !valve status ... open/close ... true/false | |||||
integer :: ValveType ! Normal/Input/Output/InputOutput | |||||
integer :: Number | |||||
logical :: IsTraversed | |||||
contains | |||||
procedure :: Init => Init | |||||
procedure :: IsConnectedTo => IsConnectedTo | |||||
procedure :: IsSource => IsSource | |||||
procedure :: Length => Length | |||||
procedure :: AdjacentTo => AdjacentTo | |||||
procedure :: RemoveAdjacent => RemoveAdjacent | |||||
end type Arrangement | |||||
contains | |||||
subroutine Init(this, value) | |||||
implicit none | |||||
class(Arrangement), intent(inout) :: this | |||||
integer, intent(in) :: value | |||||
if(allocated(this%Adjacent)) deallocate(this%Adjacent) | |||||
this%Status = .false. | |||||
this%IsTraversed = .false. | |||||
this%ValveType = Normal | |||||
this%Number = value | |||||
end subroutine | |||||
integer function Length(this) | |||||
implicit none | |||||
class(Arrangement), intent(in) :: this | |||||
if(allocated(this%Adjacent)) then | |||||
Length = size(this%Adjacent) | |||||
return | |||||
end if | |||||
Length = 0 | |||||
end function | |||||
subroutine AdjacentTo(this, value) | |||||
implicit none | |||||
class(Arrangement), intent(inout) :: this | |||||
integer, intent(in) :: value | |||||
integer, allocatable :: tempArr(:) | |||||
integer :: i, isize | |||||
if(allocated(this%Adjacent)) then | |||||
isize = size(this%Adjacent) | |||||
! check to see if already AdjacentTo that valve# | |||||
do i=1,isize | |||||
if(this%Adjacent(i)==value) return | |||||
end do | |||||
! if value is a new entry then add it to the collection | |||||
allocate(tempArr(isize+1)) | |||||
do i=1,isize | |||||
tempArr(i) = this%Adjacent(i) | |||||
end do | |||||
tempArr(isize+1) = value | |||||
deallocate(this%Adjacent) | |||||
call move_alloc(tempArr, this%Adjacent) | |||||
else | |||||
allocate(this%Adjacent(1)) | |||||
this%Adjacent(1) = value | |||||
end if | |||||
end subroutine | |||||
logical function IsConnectedTo(this, value) | |||||
implicit none | |||||
class(Arrangement), intent(in) :: this | |||||
integer, intent(in) :: value | |||||
if(.not.allocated(this%Adjacent)) then | |||||
IsConnectedTo = .false. | |||||
return | |||||
endif | |||||
IsConnectedTo = any(this%Adjacent == value) | |||||
return | |||||
end function | |||||
logical function IsSource(this) | |||||
implicit none | |||||
class(Arrangement), intent(in) :: this | |||||
IsSource = this%ValveType > Relation | |||||
end function | |||||
subroutine RemoveAdjacent(this, value) | |||||
implicit none | |||||
class(Arrangement), intent(inout) :: this | |||||
integer, intent(in) :: value | |||||
integer, allocatable :: tempArr(:) | |||||
integer :: i, index, isize | |||||
logical :: found | |||||
if(.not.allocated(this%Adjacent))return | |||||
index = -1 | |||||
do i=1, size(this%Adjacent) | |||||
if(this%Adjacent(i)==value) then | |||||
index = i | |||||
exit | |||||
end if | |||||
end do | |||||
if(index <= 0 .or. index > size(this%Adjacent)) return | |||||
allocate(tempArr(size(this%Adjacent)-1)) | |||||
found = .false. | |||||
do i=1, size(this%Adjacent) | |||||
if(i==index) then | |||||
found = .true. | |||||
cycle | |||||
end if | |||||
if(found) then | |||||
tempArr(i-1) = this%Adjacent(i) | |||||
else | |||||
tempArr(i) = this%Adjacent(i) | |||||
endif | |||||
end do | |||||
deallocate(this%Adjacent) | |||||
call move_alloc(tempArr, this%Adjacent) | |||||
end subroutine | |||||
end module CArrangement |
@@ -26,7 +26,6 @@ module CManifolds | |||||
end subroutine | end subroutine | ||||
subroutine PathFinding_Setup() | subroutine PathFinding_Setup() | ||||
! use CSimulationVariables | |||||
implicit none | implicit none | ||||
data%state%manifold%IsTraverse = .false. | data%state%manifold%IsTraverse = .false. | ||||
call Setup() | call Setup() | ||||
@@ -48,7 +47,7 @@ module CManifolds | |||||
data%state%manifold%IsPathsDirty = .false. | data%state%manifold%IsPathsDirty = .false. | ||||
call Traverse() | call Traverse() | ||||
endif | endif | ||||
end subroutine PathFinding_Step | |||||
end subroutine PathFinding_Step | |||||
! subroutine PathFinding_Output | ! subroutine PathFinding_Output | ||||
! implicit none | ! implicit none | ||||
@@ -70,37 +69,21 @@ end subroutine PathFinding_Step | |||||
subroutine Traverse() bind(C,name="Traverse") | subroutine Traverse() bind(C,name="Traverse") | ||||
use CLog5 | use CLog5 | ||||
implicit none | implicit none | ||||
integer :: i, Duration | |||||
integer, dimension(8) :: StartTime,EndTime !TODO: clean up | |||||
call DATE_AND_TIME(values=StartTime) !TODO: clean up | |||||
integer :: i | |||||
!**call BeforeTraverse%RunAll() | !**call BeforeTraverse%RunAll() | ||||
if(allocated(data%state%manifold%OpenPaths)) deallocate(data%state%manifold%OpenPaths) | if(allocated(data%state%manifold%OpenPaths)) deallocate(data%state%manifold%OpenPaths) | ||||
do i=MinSource, MaxSource | |||||
do i=MinSource, MaxSource | |||||
if(IsValveOpen(i)) then | if(IsValveOpen(i)) then | ||||
call AddRootNode(i) | |||||
call data%state%manifold%Fringe%Push(i) | |||||
call AddChildren(data%state%manifold%Valve(i)) | call AddChildren(data%state%manifold%Valve(i)) | ||||
endif | endif | ||||
enddo | enddo | ||||
call PostProcess(data%state%manifold%OpenPaths) | call PostProcess(data%state%manifold%OpenPaths) | ||||
!**call AfterTraverse%RunAll() | |||||
!**call AfterTraverse%RunAll() | |||||
data%state%manifold%IsTraverse = .true. | data%state%manifold%IsTraverse = .true. | ||||
!TODO: clean up | |||||
#ifdef Log5 | |||||
CALL DATE_AND_TIME(values=EndTime) | |||||
Duration= EndTime(8) - StartTime(8) | |||||
!if(print_log) print*, 'Duration= ', Duration, 'ms' | |||||
call Log_5('Duration= ', Duration) | |||||
call DisplayOpenPaths() | |||||
call Log_5('==========================================') | |||||
#endif | |||||
call DisplayOpenPaths() | |||||
end subroutine | end subroutine | ||||
subroutine PostProcess(pathArr) | subroutine PostProcess(pathArr) | ||||
@@ -109,27 +92,19 @@ end subroutine PathFinding_Step | |||||
integer :: i | integer :: i | ||||
if(.not.allocated(pathArr)) return | if(.not.allocated(pathArr)) return | ||||
i = 1 | i = 1 | ||||
do | do | ||||
call pathArr(i)%Purge(MinRelation, MaxRelation) | call pathArr(i)%Purge(MinRelation, MaxRelation) | ||||
if(pathArr(i)%Length() <= 2) then | if(pathArr(i)%Length() <= 2) then | ||||
call RemovePath(pathArr, i) | call RemovePath(pathArr, i) | ||||
else | else | ||||
i = i + 1 | i = i + 1 | ||||
endif | endif | ||||
if(i > size(pathArr)) exit | if(i > size(pathArr)) exit | ||||
enddo | enddo | ||||
end subroutine | end subroutine | ||||
subroutine AddRootNode(valve) | |||||
implicit none | |||||
integer, intent(in) :: valve | |||||
call data%state%manifold%Fringe%Push(valve) | |||||
end subroutine | |||||
recursive subroutine AddChildren(node) | recursive subroutine AddChildren(node) | ||||
implicit none | implicit none | ||||
@@ -140,7 +115,7 @@ end subroutine PathFinding_Step | |||||
t = data%state%manifold%Valve(node%Number)%Adjacent(i) | t = data%state%manifold%Valve(node%Number)%Adjacent(i) | ||||
if(IsValveOpen(t)) then | if(IsValveOpen(t)) then | ||||
if(data%state%manifold%Fringe%DoesHave(t)) cycle | if(data%state%manifold%Fringe%DoesHave(t)) cycle | ||||
call data%state%manifold%Fringe%Push(t) | call data%state%manifold%Fringe%Push(t) | ||||
@@ -247,7 +222,6 @@ end subroutine PathFinding_Step | |||||
end do | end do | ||||
deallocate(pathArr) | deallocate(pathArr) | ||||
call move_alloc(tempArr, pathArr) | call move_alloc(tempArr, pathArr) | ||||
endsubroutine | endsubroutine | ||||
subroutine Setup() | subroutine Setup() | ||||
@@ -270,11 +244,9 @@ end subroutine PathFinding_Step | |||||
data%state%manifold%Valve(i)%ValveType = Relation | data%state%manifold%Valve(i)%ValveType = Relation | ||||
end do | end do | ||||
! make adjustments | ! make adjustments | ||||
call data%state%manifold%Valve(1)%AdjacentTo(91) | call data%state%manifold%Valve(1)%AdjacentTo(91) | ||||
call data%state%manifold%Valve(2)%AdjacentTo(92) | call data%state%manifold%Valve(2)%AdjacentTo(92) | ||||
call data%state%manifold%Valve(2)%AdjacentTo(117) | call data%state%manifold%Valve(2)%AdjacentTo(117) | ||||
@@ -0,0 +1,232 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/Equipments/MudPathFinding/CPath.f90" | |||||
module CPath | |||||
use CLog5 | |||||
implicit none | |||||
public | |||||
type, public :: Path | |||||
integer, allocatable :: Valves(:) | |||||
logical :: IsClosed | |||||
contains | |||||
procedure :: Display => Display | |||||
procedure :: DisplayWrite => DisplayWrite | |||||
procedure :: First => First | |||||
procedure :: Last => Last | |||||
procedure :: Length => Length | |||||
procedure :: Get => Get | |||||
procedure :: Add => Add | |||||
procedure :: Remove => Remove | |||||
procedure :: Purge => Purge | |||||
procedure :: Copy => Copy | |||||
procedure :: MakeNull => MakeNull | |||||
procedure :: IsNull => IsNull | |||||
procedure :: Equal => Equal | |||||
procedure :: Find => Find | |||||
end type Path | |||||
contains | |||||
subroutine DisplayWrite(this) | |||||
implicit none | |||||
class(Path), intent(in) :: this | |||||
character(len=512) :: temp | |||||
integer :: i | |||||
if(allocated(this%valves)) then | |||||
write(temp, '(a1,i0,a3,i0,a4,9999(g0))') '(', this%First(), '<=>', this%Last(), ') : ', (this%Valves(i), ", ",i=1,size(this%Valves)) | |||||
write(*,*) temp | |||||
end if | |||||
end subroutine | |||||
subroutine Display(this) | |||||
implicit none | |||||
class(Path), intent(in) :: this | |||||
character(len=512) :: temp | |||||
integer :: i | |||||
if(allocated(this%valves)) then | |||||
write(temp, '(a1,i0,a3,i0,a4,9999(g0))') '(', this%First(), '<=>', this%Last(), ') : ', (this%Valves(i), ", ",i=1,size(this%Valves)) | |||||
call Log_5(temp) | |||||
end if | |||||
end subroutine | |||||
integer function First(this) | |||||
implicit none | |||||
class(Path), intent(in) :: this | |||||
if(allocated(this%Valves) .and. size(this%Valves) > 0) then | |||||
First = this%Valves(1) | |||||
return | |||||
end if | |||||
First = 0 | |||||
end function | |||||
integer function Last(this) | |||||
implicit none | |||||
class(Path), intent(in) :: this | |||||
if(allocated(this%Valves) .and. size(this%Valves) > 0) then | |||||
Last = this%Valves(size(this%Valves)) | |||||
return | |||||
end if | |||||
Last = 0 | |||||
end function | |||||
integer function Length(this) | |||||
implicit none | |||||
class(Path), intent(in) :: this | |||||
if(allocated(this%Valves)) then | |||||
Length = size(this%Valves) | |||||
return | |||||
end if | |||||
Length = 0 | |||||
end function | |||||
integer function Get(this, index) | |||||
implicit none | |||||
class(Path), intent(in) :: this | |||||
integer, intent(in) :: index | |||||
if(allocated(this%Valves)) then | |||||
if(index < 1 .or. index > size(this%Valves)) then | |||||
Get = -1 | |||||
return | |||||
endif | |||||
Get = this%Valves(index) | |||||
return | |||||
end if | |||||
get = -1 | |||||
end function | |||||
subroutine Add(this, value) | |||||
implicit none | |||||
class(Path), intent(inout) :: this | |||||
integer, allocatable :: tempArr(:) | |||||
integer, intent(in) :: value | |||||
integer :: i, isize | |||||
if(allocated(this%Valves)) then | |||||
isize = size(this%Valves) | |||||
allocate(tempArr(isize+1)) | |||||
do i=1,isize | |||||
tempArr(i) = this%Valves(i) | |||||
end do | |||||
tempArr(isize+1) = value | |||||
deallocate(this%Valves) | |||||
call move_alloc(tempArr, this%Valves) | |||||
else | |||||
allocate(this%Valves(1)) | |||||
this%Valves(1) = value | |||||
end if | |||||
end subroutine | |||||
subroutine Remove(this, index) | |||||
implicit none | |||||
class(Path), intent(inout) :: this | |||||
integer, intent(in) :: index | |||||
integer, allocatable :: tempArr(:) | |||||
integer :: i | |||||
logical :: found | |||||
if(index <= 0 .or. index > size(this%Valves)) return | |||||
if(.not.allocated(this%Valves))return | |||||
allocate(tempArr(size(this%Valves)-1)) | |||||
found = .false. | |||||
do i=1, size(this%Valves) | |||||
if(i==index) then | |||||
found = .true. | |||||
cycle | |||||
end if | |||||
if(found) then | |||||
tempArr(i-1) = this%Valves(i) | |||||
else | |||||
tempArr(i) = this%Valves(i) | |||||
endif | |||||
end do | |||||
deallocate(this%valves) | |||||
call move_alloc(tempArr, this%valves) | |||||
end subroutine | |||||
subroutine Purge(this, min, max) | |||||
implicit none | |||||
class(Path), intent(inout) :: this | |||||
integer, intent(in) :: min | |||||
integer, intent(in) :: max | |||||
integer :: i | |||||
i = 1 | |||||
do | |||||
! | |||||
if(this%Valves(i) >= min .and. this%Valves(i) <= max) then | |||||
call this%Remove(i) | |||||
else | |||||
i = i + 1 | |||||
endif | |||||
if(i > this%Length()) exit | |||||
enddo | |||||
end subroutine | |||||
subroutine Copy(this, from) | |||||
implicit none | |||||
class(Path), intent(inout) :: this | |||||
class(Path), intent(in) :: from | |||||
if(allocated(from%Valves)) then | |||||
if(allocated(this%Valves)) deallocate(this%Valves) | |||||
allocate(this%Valves(size(from%Valves))) | |||||
this%Valves(:) = from%Valves(:) | |||||
end if | |||||
end subroutine | |||||
subroutine MakeNull(this) | |||||
implicit none | |||||
class(Path), intent(inout) :: this | |||||
if(allocated(this%Valves)) deallocate(this%Valves) | |||||
end subroutine | |||||
logical function IsNull(this) | |||||
implicit none | |||||
class(Path), intent(in) :: this | |||||
IsNull = .not.allocated(this%Valves) | |||||
return | |||||
end function | |||||
logical function Equal(this, otherPath) | |||||
implicit none | |||||
class(Path), intent(inout) :: this | |||||
class(Path), intent(in) :: otherPath | |||||
integer :: i, sizeThis, sizeOtherPath | |||||
sizeThis = size(this%Valves) | |||||
sizeOtherPath = size(otherPath%Valves) | |||||
if(sizeThis /= sizeOtherPath) then | |||||
Equal = .false. | |||||
return | |||||
end if | |||||
do i = 1, sizeThis | |||||
if(this%Valves(i) /= otherPath%Valves(i)) then | |||||
Equal = .false. | |||||
return | |||||
end if | |||||
end do | |||||
Equal = .true. | |||||
return | |||||
end function | |||||
logical function Find(this, value) | |||||
implicit none | |||||
class(Path), intent(in) :: this | |||||
integer, intent(in) :: value | |||||
if(allocated(this%Valves)) then | |||||
Find = any(this%Valves == value) | |||||
return | |||||
end if | |||||
Find = .false. | |||||
end function | |||||
end module CPath |
@@ -0,0 +1,43 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/Equipments/MudPathFinding/CStack.f90" | |||||
module CStack | |||||
use CPath,Only:Path | |||||
implicit none | |||||
public | |||||
type, public :: Stack | |||||
type(Path) :: List | |||||
contains | |||||
procedure :: Clear => Clear | |||||
procedure :: Push => Push | |||||
procedure :: Pop => Pop | |||||
procedure :: DoesHave => DoesHave | |||||
end type Stack | |||||
contains | |||||
subroutine Clear(this) | |||||
implicit none | |||||
class(Stack), intent(inout) :: this | |||||
call this%List%MakeNull() | |||||
end subroutine | |||||
subroutine Push(this, value) | |||||
implicit none | |||||
class(Stack), intent(inout) :: this | |||||
integer, intent(in) :: value | |||||
call this%List%Add(value) | |||||
end subroutine | |||||
subroutine Pop(this) | |||||
implicit none | |||||
class(Stack), intent(inout) :: this | |||||
call this%List%Remove(this%List%Length()) | |||||
end subroutine | |||||
logical function DoesHave(this, value) | |||||
implicit none | |||||
class(Stack), intent(in) :: this | |||||
integer, intent(in) :: value | |||||
DoesHave = this%List%Find(value) | |||||
end function | |||||
end module CStack |
@@ -0,0 +1,38 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/Equipments/MudPathFinding/ManifoldVariables.f90" | |||||
module ManifoldVariables | |||||
use CStack | |||||
use CArrangement | |||||
! use SimulationVariables | |||||
! use CStandPipeManifoldVariables | |||||
implicit none | |||||
public | |||||
integer, parameter :: ValveCount = 128 | |||||
integer, parameter :: MinSource = 71 | |||||
integer, parameter :: MaxSource = 90 | |||||
integer, parameter :: MinRelation = 91 | |||||
integer, parameter :: MaxRelation = 128 | |||||
Type::ManifoldType | |||||
type(Arrangement) :: Valve(ValveCount) | |||||
type(Path), allocatable :: OpenPaths(:) | |||||
type(Stack) :: Fringe | |||||
logical :: IsRepititveOutput | |||||
logical :: IsSafetyValveInstalled | |||||
logical :: IsSafetyValveInstalled_KellyMode | |||||
logical :: IsSafetyValveInstalled_TripMode | |||||
logical :: IsSafetyValveInstalled_TopDrive | |||||
logical :: SafetyValve | |||||
logical :: IsIBopInstalled | |||||
logical :: IBop | |||||
logical :: IsKellyCockInstalled | |||||
logical :: KellyCock | |||||
logical :: IsTopDriveIBopInstalled | |||||
logical :: TopDriveIBop | |||||
logical :: IsFloatValveInstalled | |||||
logical :: FloatValve | |||||
logical :: IsPathsDirty = .false. | |||||
logical :: IsTraverse = .false. | |||||
End type ManifoldType | |||||
End module ManifoldVariables |
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/Tanks/CTanks.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/Equipments/Tanks/CTanks.f90" | |||||
module CTanks | module CTanks | ||||
use SimulationVariables | use SimulationVariables | ||||
@@ -92,9 +92,8 @@ | |||||
logical, intent(in) :: v | logical, intent(in) :: v | ||||
data%Equipments%Tank%ManualPumpPower = v | data%Equipments%Tank%ManualPumpPower = v | ||||
call ChangeValve(43, v) | call ChangeValve(43, v) | ||||
#ifdef deb | |||||
if(print_log) print*, 'ManualPumpPower=', data%Equipments%Tank%ManualPumpPower | |||||
#endif | |||||
# 96 | |||||
end subroutine | end subroutine | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Equipments/Tanks/CTanksVariables.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/Equipments/Tanks/CTanksVariables.f90" | |||||
module CTanksVariables | module CTanksVariables | ||||
implicit none | implicit none | ||||
public | public | ||||
@@ -29,16 +29,8 @@ module COperationScenariosMain | |||||
use SoftwareInputsVariables | use SoftwareInputsVariables | ||||
use UnityModule | use UnityModule | ||||
! use CElevatorEnum | |||||
! use CIbopEnum | |||||
! use CKellyEnum | |||||
! use CMouseHoleEnum | |||||
use UnitySignalsModule | use UnitySignalsModule | ||||
! use CSafetyValveEnum | |||||
! use CSlipsEnum | |||||
! use CSwingEnum | |||||
use CTongEnum | use CTongEnum | ||||
! use CFlowPipeDisconnectEnum | |||||
use CFlowKellyDisconnectEnum | use CFlowKellyDisconnectEnum | ||||
use CFillupHeadPermission | use CFillupHeadPermission | ||||
use CSwingDrillPermission | use CSwingDrillPermission | ||||
@@ -116,16 +108,16 @@ module COperationScenariosMain | |||||
!topdrive | !topdrive | ||||
call Evaluate_TdsElevatorModes() | |||||
call Evaluate_TdsConnectionModes() | |||||
call Evaluate_SwingTiltPermission() | |||||
call Evaluate_SwingOffPermission() | |||||
call Evaluate_SwingDrillPermission() | |||||
call Evaluate_FillupHeadPermission() | |||||
call Evaluate_TdsTong() | |||||
call Evaluate_TdsBackupClamp() | |||||
call Evaluate_TdsSwing() | |||||
call Evaluate_TdsSpine() | |||||
! call Evaluate_TdsElevatorModes() | |||||
! call Evaluate_TdsConnectionModes() | |||||
! call Evaluate_SwingTiltPermission() | |||||
! call Evaluate_SwingOffPermission() | |||||
! call Evaluate_SwingDrillPermission() | |||||
! call Evaluate_FillupHeadPermission() | |||||
! call Evaluate_TdsTong() | |||||
! call Evaluate_TdsBackupClamp() | |||||
! call Evaluate_TdsSwing() | |||||
! call Evaluate_TdsSpine() | |||||
call Evaluate_PowerLed() | call Evaluate_PowerLed() | ||||
call Evaluate_IbopLed() | call Evaluate_IbopLed() | ||||
@@ -1,13 +1,12 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Common/COperationScenariosMain.f90" | # 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Common/COperationScenariosMain.f90" | ||||
module COperationScenariosMain | module COperationScenariosMain | ||||
use CIActionReference | use CIActionReference | ||||
use UnitySignalsModule | |||||
implicit none | implicit none | ||||
public | public | ||||
! procedure (ActionVoid), pointer :: UpdateUnityPtr | |||||
contains | contains | ||||
subroutine OperationScenarios_Step | subroutine OperationScenarios_Step | ||||
! use CSimulationVariables | |||||
use OperationScenariosModule | use OperationScenariosModule | ||||
use CElevatorConnectionEnum | use CElevatorConnectionEnum | ||||
use CCloseKellyCockLedNotification | use CCloseKellyCockLedNotification | ||||
@@ -29,42 +28,23 @@ module COperationScenariosMain | |||||
use CRemoveFillupHeadPermission | use CRemoveFillupHeadPermission | ||||
use CRemoveMudBucketPermission | use CRemoveMudBucketPermission | ||||
use SoftwareInputsVariables | use SoftwareInputsVariables | ||||
! use CHookHeight | |||||
! use CIbopHeight | |||||
! use CNearFloorConnection | |||||
! use CSafetyValveHeight | |||||
! use CSlackOff | |||||
! use CStandRack | |||||
! use CStringPressure | |||||
! use CZeroStringSpeed | |||||
! use CUnityInputs, only: & | |||||
! Get_ElevatorConnectionPossible, & | |||||
! Get_JointConnectionPossible, & | |||||
! Get_ElevatorPickup, & | |||||
! Get_NearFloorPosition, & | |||||
! Get_SingleSetInMouseHole | |||||
! use CBucketEnum | |||||
! use UnitySignalsModule | |||||
use UnityModule | use UnityModule | ||||
use CElevatorEnum | |||||
! use CHeadEnum | |||||
use CIbopEnum | |||||
use CKellyEnum | |||||
use CMouseHoleEnum | |||||
! use CElevatorEnum | |||||
! use CIbopEnum | |||||
! use CKellyEnum | |||||
! use CMouseHoleEnum | |||||
use UnitySignalsModule | use UnitySignalsModule | ||||
use CSafetyValveEnum | |||||
use CSlipsEnum | |||||
use CSwingEnum | |||||
! use CSafetyValveEnum | |||||
! use CSlipsEnum | |||||
! use CSwingEnum | |||||
use CTongEnum | use CTongEnum | ||||
! use CStringUpdate | |||||
use CFlowPipeDisconnectEnum | |||||
! use CFlowPipeDisconnectEnum | |||||
use CFlowKellyDisconnectEnum | use CFlowKellyDisconnectEnum | ||||
use CFillupHeadPermission | use CFillupHeadPermission | ||||
use CSwingDrillPermission | use CSwingDrillPermission | ||||
use CSwingOffPermission | use CSwingOffPermission | ||||
use CSwingTiltPermission | use CSwingTiltPermission | ||||
! use CTdsStemJointHeight | |||||
! use UnitySignalsModule !for CTdsConnectionModesEnum | |||||
use CTdsElevatorModesEnum | use CTdsElevatorModesEnum | ||||
use CTdsSpineEnum | use CTdsSpineEnum | ||||
use CTdsSwingEnum | use CTdsSwingEnum | ||||
@@ -73,7 +53,8 @@ module COperationScenariosMain | |||||
use CTdsIbopLedNotification | use CTdsIbopLedNotification | ||||
use CTdsPowerLedNotification | use CTdsPowerLedNotification | ||||
use CTdsTorqueWrenchLedNotification | use CTdsTorqueWrenchLedNotification | ||||
use CElevatorConnectionEnum | |||||
implicit none | implicit none | ||||
call Evaluate_KellyConnection() | call Evaluate_KellyConnection() | ||||
@@ -100,22 +81,21 @@ module COperationScenariosMain | |||||
call Evaluate_RemoveMudBucketPermission() | call Evaluate_RemoveMudBucketPermission() | ||||
call Evaluate_MudBucket() | call Evaluate_MudBucket() | ||||
call Evaluate_Elevator() | |||||
! call Evaluate_Elevator() | |||||
call Evaluate_FillupHead() | call Evaluate_FillupHead() | ||||
call Evaluate_Ibop() | |||||
call Evaluate_Kelly() | |||||
call Evaluate_MouseHole() | |||||
call Evaluate_MouseHole() | |||||
call Evaluate_OperationCondition() | |||||
call Evaluate_SafetyValve() | |||||
call Evaluate_Slips() | |||||
call Evaluate_Swing() | |||||
call Evaluate_Tong() | |||||
! call Evaluate_Ibop() is empty, so i commented (mahmood) | |||||
! call Evaluate_Kelly() is empty, so i commented (mahmood) | |||||
! call Evaluate_MouseHole() | |||||
! call Evaluate_OperationCondition() | |||||
! call Evaluate_SafetyValve() | |||||
! call Evaluate_Slips() | |||||
! call Evaluate_Swing() | |||||
! call Evaluate_Tong() | |||||
! call Evaluate_StringUpdate() | ! call Evaluate_StringUpdate() | ||||
call Evaluate_FlowKellyDisconnect() | |||||
call Evaluate_FlowPipeDisconnect() | |||||
! call Evaluate_FlowKellyDisconnect() is empty, so i commented (mahmood) | |||||
! call Evaluate_FlowPipeDisconnect() is empty, so i commented (mahmood) | |||||
!if(Get_FillMouseHoleLed()) then | !if(Get_FillMouseHoleLed()) then | ||||
! call Set_MouseHole(MOUSE_HOLE_FILL) | ! call Set_MouseHole(MOUSE_HOLE_FILL) | ||||
@@ -137,16 +117,16 @@ module COperationScenariosMain | |||||
!topdrive | !topdrive | ||||
call Evaluate_TdsElevatorModes() | |||||
call Evaluate_TdsConnectionModes() | |||||
call Evaluate_SwingTiltPermission() | |||||
call Evaluate_SwingOffPermission() | |||||
call Evaluate_SwingDrillPermission() | |||||
call Evaluate_FillupHeadPermission() | |||||
call Evaluate_TdsTong() | |||||
call Evaluate_TdsBackupClamp() | |||||
call Evaluate_TdsSwing() | |||||
call Evaluate_TdsSpine() | |||||
! call Evaluate_TdsElevatorModes() | |||||
! call Evaluate_TdsConnectionModes() | |||||
! call Evaluate_SwingTiltPermission() | |||||
! call Evaluate_SwingOffPermission() | |||||
! call Evaluate_SwingDrillPermission() | |||||
! call Evaluate_FillupHeadPermission() | |||||
! call Evaluate_TdsTong() | |||||
! call Evaluate_TdsBackupClamp() | |||||
! call Evaluate_TdsSwing() | |||||
! call Evaluate_TdsSpine() | |||||
call Evaluate_PowerLed() | call Evaluate_PowerLed() | ||||
call Evaluate_IbopLed() | call Evaluate_IbopLed() | ||||
@@ -160,13 +140,13 @@ module COperationScenariosMain | |||||
! if(associated(UpdateUnityPtr)) call UpdateUnityPtr() | ! if(associated(UpdateUnityPtr)) call UpdateUnityPtr() | ||||
! end subroutine | ! end subroutine | ||||
subroutine Kelly_ConnectionNothing | |||||
subroutine Kelly_ConnectionNothing() bind (C,name="Kelly_ConnectionNothine") | |||||
use UnitySignalVariables | use UnitySignalVariables | ||||
use UnitySignalsModule | |||||
use CHook | use CHook | ||||
use SimulationVariables | use SimulationVariables | ||||
implicit none | implicit none | ||||
! call logg(4,"Kelly_ConnectionNothing started") | |||||
print *,"Kelly_ConnectionNothing started" | |||||
call Set_HookHeight(75.0) | call Set_HookHeight(75.0) | ||||
call sleep(1) | call sleep(1) | ||||
@@ -207,12 +187,13 @@ module COperationScenariosMain | |||||
! move to final hook height | ! move to final hook height | ||||
call Update_HookHeight_From_Snapshot() | call Update_HookHeight_From_Snapshot() | ||||
call sleep(3) | call sleep(3) | ||||
! call logg(4,"Kelly_ConnectionNothing end") | |||||
print *,"Kelly_ConnectionNothing end" | |||||
end subroutine Kelly_ConnectionNothing | end subroutine Kelly_ConnectionNothing | ||||
subroutine Kelly_ConnectionString | |||||
subroutine Kelly_ConnectionString() BIND(C,name='Kelly_ConnectionString') | |||||
use UnitySignalVariables | use UnitySignalVariables | ||||
use UnitySignalsModule | |||||
use CHook | use CHook | ||||
use SimulationVariables | use SimulationVariables | ||||
implicit none | implicit none | ||||
@@ -269,12 +250,8 @@ module COperationScenariosMain | |||||
end subroutine Kelly_ConnectionString | end subroutine Kelly_ConnectionString | ||||
subroutine Kelly_ConnectionSingle | |||||
! use CSwingEnumVariables | |||||
! use CSlipsEnumVariables | |||||
! use CTongEnumVariables | |||||
subroutine Kelly_ConnectionSingle() BIND(C,name='Kelly_ConnectionSingle') | |||||
use UnitySignalVariables | use UnitySignalVariables | ||||
use UnitySignalsModule | |||||
use CHook | use CHook | ||||
use SimulationVariables | use SimulationVariables | ||||
implicit none | implicit none | ||||
@@ -344,9 +321,8 @@ module COperationScenariosMain | |||||
end subroutine Kelly_ConnectionSingle | end subroutine Kelly_ConnectionSingle | ||||
subroutine Elevator_ConnectionNothing | |||||
subroutine Elevator_ConnectionNothing() BIND(C,name='Elevator_ConnectionNothing') | |||||
use UnitySignalVariables | use UnitySignalVariables | ||||
use UnitySignalsModule | |||||
use CHook | use CHook | ||||
use SimulationVariables | use SimulationVariables | ||||
implicit none | implicit none | ||||
@@ -152,7 +152,8 @@ module COperationScenariosSettings | |||||
! | ! | ||||
!end subroutine | !end subroutine | ||||
subroutine SetDefaultValues() | |||||
! subroutine SetDefaultValues() | |||||
subroutine OperationScenarios_Init() | |||||
use OperationScenariosModule | use OperationScenariosModule | ||||
use CHoistingVariables | use CHoistingVariables | ||||
use SimulationVariables | use SimulationVariables | ||||
@@ -305,13 +306,8 @@ module COperationScenariosSettings | |||||
!SAFETY_VALVE_REMOVE | !SAFETY_VALVE_REMOVE | ||||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call Set_SafetyValve(SAFETY_VALVE_REMOVE) | if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call Set_SafetyValve(SAFETY_VALVE_REMOVE) | ||||
call Set_Slips(SLIPS_SET_BEGIN) | |||||
call Set_Slips(SLIPS_SET_END) | |||||
!Get_Slips() | !Get_Slips() | ||||
!SLIPS_NEUTRAL | |||||
!SLIPS_SET_BEGIN | |||||
!SLIPS_SET_END | |||||
!SLIPS_UNSET_BEGIN | |||||
!SLIPS_UNSET_END | |||||
call Set_Swing(SWING_WELL_BEGIN) | call Set_Swing(SWING_WELL_BEGIN) | ||||
!Get_Swing() | !Get_Swing() | ||||
@@ -467,23 +463,13 @@ module COperationScenariosSettings | |||||
!TDS_SPINE_DISCONNECT_BEGIN | !TDS_SPINE_DISCONNECT_BEGIN | ||||
!TDS_SPINE_DISCONNECT_END | !TDS_SPINE_DISCONNECT_END | ||||
end subroutine | end subroutine | ||||
subroutine SetDefaults_WN() | |||||
!DEC$ ATTRIBUTES DLLEXPORT :: SetDefaults_WN | |||||
!DEC$ ATTRIBUTES ALIAS: 'SetDefaults_WN' :: SetDefaults_WN | |||||
implicit none | |||||
call SetDefaultValues() | |||||
end subroutine | |||||
! subroutine SetDefaults_WN() | |||||
! !DEC$ ATTRIBUTES DLLEXPORT :: SetDefaults_WN | |||||
! !DEC$ ATTRIBUTES ALIAS: 'SetDefaults_WN' :: SetDefaults_WN | |||||
! implicit none | |||||
! call SetDefaultValues() | |||||
! end subroutine | |||||
end module COperationScenariosSettings | end module COperationScenariosSettings |
@@ -0,0 +1,476 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Common/COperationScenariosSettings.f90" | |||||
module COperationScenariosSettings | |||||
implicit none | |||||
public | |||||
contains | |||||
!subroutine Initialization() | |||||
! ! use CSimulationVariables | |||||
! use CUnityOutputs, only: SetupUnityOutputs => Setup | |||||
! | |||||
! use CBucketEnum | |||||
! use CTongEnum | |||||
! use CSwingEnum | |||||
! use CSlipsEnum | |||||
! use CSafetyValveEnum | |||||
! use UnitySignalsModule | |||||
! use CMouseHoleEnum | |||||
! use CKellyEnum | |||||
! use OperationScenariosModule | |||||
! use CIbopEnum | |||||
! use CHeadEnum | |||||
! use CElevatorEnum | |||||
! use CElevatorConnectionEnum | |||||
! | |||||
! use CInstallFillupHeadPermission | |||||
! use CInstallMudBucketPermission | |||||
! use CIrIbopPermission | |||||
! use CIrSafetyValvePermission | |||||
! use CRemoveFillupHeadPermission | |||||
! use CRemoveMudBucketPermission | |||||
! | |||||
! use CCloseKellyCockLedNotification | |||||
! use CCloseSafetyValveLedNotification | |||||
! use CFillMouseHoleLedNotification | |||||
! use CIrIBopLedNotification | |||||
! use CIrSafetyValveLedNotification | |||||
! use CLatchLedNotification | |||||
! use COpenKellyCockLedNotification | |||||
! use COpenSafetyValveLedNotification | |||||
! use CSlipsNotification | |||||
! use CSwingLedNotification | |||||
! use CTongNotification | |||||
! use CUnlatchLedNotification | |||||
! | |||||
! use CHookHeight | |||||
! use CIbopHeight | |||||
! use CNearFloorConnection | |||||
! use CSafetyValveHeight | |||||
! use CSlackOff | |||||
! use CStandRack | |||||
! use CStringPressure | |||||
! use CZeroStringSpeed | |||||
! | |||||
! use CStringUpdate | |||||
! | |||||
! use CFlowPipeDisconnectEnum | |||||
! use CFlowKellyDisconnectEnum | |||||
! | |||||
! use CFillupHeadPermission | |||||
! use CSwingDrillPermission | |||||
! use CSwingOffPermission | |||||
! use CSwingTiltPermission | |||||
! use CTdsStemJointHeight | |||||
! use UnitySignalsModule !for CTdsConnectionModesEnum | |||||
! use CTdsElevatorModesEnum | |||||
! use CTdsSpineEnum | |||||
! use CTdsSwingEnum | |||||
! use CTdsTongEnum | |||||
! use CTdsBackupClamp | |||||
! | |||||
! use CTdsIbopLedNotification | |||||
! use CTdsPowerLedNotification | |||||
! | |||||
! use CTdsTorqueWrenchLedNotification | |||||
! | |||||
! implicit none | |||||
! | |||||
! call SetupUnityOutputs() | |||||
! | |||||
! call Subscribe_Tong() | |||||
! call Subscribe_MudBucket() | |||||
! call Subscribe_ElevatorConnection() | |||||
! call Subscribe_Elevator() | |||||
! call Subscribe_FillupHead() | |||||
! call Subscribe_Ibop() | |||||
! call Subscribe_KellyConnection() | |||||
! call Subscribe_Kelly() | |||||
! call Subscribe_MouseHole() | |||||
! call Subscribe_OperationCondition() | |||||
! call Subscribe_SafetyValve() | |||||
! call Subscribe_Slips() | |||||
! call Subscribe_Swing() | |||||
! | |||||
! | |||||
! call Subscribe_InstallFillupHeadPermission() | |||||
! call Subscribe_InstallMudBucketPermission() | |||||
! call Subscribe_IrIbopPermission() | |||||
! call Subscribe_IrSafetyValvePermission() | |||||
! call Subscribe_RemoveFillupHeadPermission() | |||||
! call Subscribe_RemoveMudBucketPermission() | |||||
! | |||||
! call Subscribe_CloseKellyCockLed() | |||||
! call Subscribe_CloseSafetyValveLed() | |||||
! call Subscribe_FillMouseHoleLed() | |||||
! call Subscribe_IrIBopLed() | |||||
! call Subscribe_IrSafetyValveLed() | |||||
! call Subscribe_LatchLed() | |||||
! call Subscribe_OpenKellyCockLed() | |||||
! call Subscribe_OpenSafetyValveLed() | |||||
! call Subscribe_SlipsNotification() | |||||
! call Subscribe_SwingLed() | |||||
! call Subscribe_UnlatchLed() | |||||
! | |||||
! call Subscribe_HookHeight() | |||||
! call Subscribe_IbopHeight() | |||||
! call Subscribe_NearFloorConnection() | |||||
! call Subscribe_SafetyValveHeight() | |||||
! call Subscribe_SlackOff() | |||||
! call Subscribe_StringPressure() | |||||
! call Subscribe_ZeroStringSpeed() | |||||
! call Subscribe_StandRack() | |||||
! | |||||
! call Subscribe_StringUpdate() | |||||
! | |||||
! call Subscribe_TongNotification() | |||||
! | |||||
! call Subscribe_FlowKellyDisconnect() | |||||
! call Subscribe_FlowPipeDisconnect() | |||||
! | |||||
! | |||||
! | |||||
! | |||||
! | |||||
! !top drive | |||||
! call Subscribe_TdsConnectionModes() | |||||
! call Subscribe_TdsElevatorModes() | |||||
! call Subscribe_FillupHeadPermission() | |||||
! call Subscribe_SwingDrillPermission() | |||||
! call Subscribe_SwingOffPermission() | |||||
! call Subscribe_SwingTiltPermission() | |||||
! call Subscribe_TdsStemJointHeight() | |||||
! call Subscribe_TdsTong() | |||||
! call Subscribe_TdsBackupClamp() | |||||
! call Subscribe_TdsSwing() | |||||
! call Subscribe_TdsSpine() | |||||
! call Subscribe_PowerLed() | |||||
! call Subscribe_IbopLed() | |||||
! | |||||
! call Subscribe_TorqueWrenchLed() | |||||
! | |||||
! | |||||
! call OnSimulationStart%Add(SetDefaultValues) | |||||
! | |||||
!end subroutine | |||||
! subroutine SetDefaultValues() | |||||
subroutine OperationScenarios_Init() | |||||
use OperationScenariosModule | |||||
use CHoistingVariables | |||||
use SimulationVariables | |||||
use CManifolds, only: RemoveSafetyValve_TripMode, RemoveSafetyValve_KellyMode | |||||
implicit none | |||||
call Set_KellyConnection(KELLY_CONNECTION_NOTHING) | |||||
!Get_KellyConnection() | |||||
!KELLY_CONNECTION_NOTHING | |||||
!KELLY_CONNECTION_STRING | |||||
!KELLY_CONNECTION_SINGLE | |||||
call Set_ElevatorConnection(ELEVATOR_CONNECTION_NOTHING) | |||||
!Get_ElevatorConnection() | |||||
!ELEVATOR_CONNECTION_NOTHING | |||||
!ELEVATOR_CONNECTION_STRING | |||||
!ELEVATOR_CONNECTION_STAND | |||||
!ELEVATOR_CONNECTION_SINGLE | |||||
!ELEVATOR_LATCH_STRING | |||||
!ELEVATOR_LATCH_SINGLE | |||||
!ELEVATOR_LATCH_STAND | |||||
call Set_CloseKellyCockLed(.false.) !Get_CloseKellyCockLed() | |||||
call Set_CloseSafetyValveLed(.false.) !Get_CloseSafetyValveLed() | |||||
call Set_FillMouseHoleLed(.true.) !Get_FillMouseHoleLed() | |||||
call Set_IrIBopLed(.false.) !Get_IrIBopLed() | |||||
!call Set_IrSafetyValveLed(.true.) !Get_IrSafetyValveLed() | |||||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||||
call RemoveSafetyValve_TripMode() | |||||
call RemoveSafetyValve_KellyMode() | |||||
call Set_IrSafetyValveLed(.false.) | |||||
else | |||||
call Set_IrSafetyValveLed(.true.) | |||||
endif | |||||
call Set_LatchLed(.false.) !Get_LatchLed() | |||||
call Set_OpenKellyCockLed(.true.) !Get_OpenKellyCockLed() | |||||
call Set_OpenSafetyValveLed(.true.) !Get_OpenSafetyValveLed() | |||||
call Set_SlipsNotification(.false.) !Get_SlipsNotification() | |||||
call Set_SwingLed(.false.) !Get_SwingLed() | |||||
call Set_TongNotification(.false.) !Get_TongNotification() | |||||
call Set_UnlatchLed(.false.) !Get_UnlatchLed() | |||||
call Set_InstallFillupHeadPermission(.false.) !Get_InstallFillupHeadPermission() | |||||
call Set_InstallMudBucketPermission(.false.) !Get_InstallMudBucketPermission() | |||||
call Set_IrIbopPermission(.false.) !Get_IrIbopPermission() | |||||
call Set_IrSafetyValvePermission(.false.) !Get_IrSafetyValvePermission() | |||||
call Set_RemoveFillupHeadPermission(.false.) !Get_RemoveFillupHeadPermission() | |||||
call Set_RemoveMudBucketPermission(.false.) !Get_RemoveMudBucketPermission() | |||||
!call Set_HookHeight(REAL(70.0, 8)) !Get_HookHeight() | |||||
call Set_IbopHeight(3.0) !Get_IbopHeight() | |||||
!call Set_NearFloorConnection(3.0) !Get_NearFloorConnection() | |||||
call Set_SafetyValveHeight(3.0) !Get_SafetyValveHeight() | |||||
call Set_SlackOff(.true.) !Get_SlackOff() | |||||
!call Set_StandRack(0.0) !Get_StandRack() | |||||
!call Set_StringPressure(0.0) !Get_StringPressure() | |||||
!call Set_ZeroStringSpeed(.true.) !Get_ZeroStringSpeed() | |||||
!Get_ElevatorConnected() | |||||
!Get_JointConnection() | |||||
!Get_NearMonkeyBoardPosition() | |||||
!Get_NearFloorPosition() | |||||
!Get_SingleSetInMouseHole() | |||||
!Get_SwingCenter() | |||||
call Set_MudBucket(MUD_BUCKET_REMOVE) | |||||
!Get_MudBucket() | |||||
!MUD_BUCKET_INSTALL | |||||
!MUD_BUCKET_REMOVE | |||||
call Set_Elevator(ELEVATOR_NEUTRAL) | |||||
! Get_Elevator() | |||||
!ELEVATOR_NEUTRAL | |||||
!ELEVATOR_LATCH_STRING_BEGIN | |||||
!ELEVATOR_LATCH_STRING_END | |||||
!ELEVATOR_UNLATCH_STRING_BEGIN | |||||
!ELEVATOR_UNLATCH_STRING_END | |||||
!ELEVATOR_LATCH_STAND_BEGIN | |||||
!ELEVATOR_LATCH_STAND_END | |||||
!ELEVATOR_UNLATCH_STAND_BEGIN | |||||
!ELEVATOR_UNLATCH_STAND_END | |||||
!ELEVATOR_LATCH_SINGLE_BEGIN | |||||
!ELEVATOR_LATCH_SINGLE_END | |||||
!ELEVATOR_UNLATCH_SINGLE_BEGIN | |||||
!ELEVATOR_UNLATCH_SINGLE_END | |||||
call Set_FillupHead(FILLUP_HEAD_REMOVE) | |||||
!Get_FillupHead() | |||||
!FILLUP_HEAD_INSTALL | |||||
!FILLUP_HEAD_REMOVE | |||||
call Set_Ibop(IBOP_REMOVE) | |||||
!Get_Ibop() | |||||
!IBOP_INSTALL | |||||
!IBOP_REMOVE | |||||
call Set_Kelly(KELLY_INSTALL) | |||||
!Get_Kelly() | |||||
!KELLY_NEUTRAL | |||||
!KELLY_INSTALL | |||||
!KELLY_REMOVE | |||||
call Set_MouseHole(MOUSE_HOLE_FILL) | |||||
!Get_MouseHole() | |||||
!MOUSE_HOLE_NEUTRAL | |||||
!MOUSE_HOLE_FILL | |||||
!MOUSE_HOLE_EMPTY | |||||
call Set_OperationCondition(OPERATION_DRILL) | |||||
!Get_OperationCondition() | |||||
!OPERATION_DRILL | |||||
!OPERATION_TRIP | |||||
call Set_SafetyValve(SAFETY_VALVE_INSTALL) | |||||
!Get_SafetyValve() | |||||
!SAFETY_VALVE_INSTALL | |||||
!SAFETY_VALVE_REMOVE | |||||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call Set_SafetyValve(SAFETY_VALVE_REMOVE) | |||||
call Set_Slips(SLIPS_SET_END) | |||||
!Get_Slips() | |||||
call Set_Swing(SWING_WELL_BEGIN) | |||||
!Get_Swing() | |||||
!SWING_NEUTRAL | |||||
!SWING_MOUSE_HOLE_BEGIN | |||||
!SWING_MOUSE_HOLE_END | |||||
!SWING_RAT_HOLE_BEGIN | |||||
!SWING_RAT_HOLE_END | |||||
!SWING_WELL_BEGIN | |||||
!SWING_WELL_END | |||||
call Set_Tong(TONG_NEUTRAL) | |||||
!Get_Tong() | |||||
!TONG_NEUTRAL | |||||
!TONG_BREAKOUT_BEGIN | |||||
!TONG_BREAKOUT_END | |||||
!TONG_MAKEUP_BEGIN | |||||
!TONG_MAKEUP_END | |||||
call Set_StringUpdate(STRING_UPDATE_NEUTRAL) | |||||
!Get_StringUpdate() | |||||
!STRING_UPDATE_NEUTRAL | |||||
!STRING_UPDATE_ADD_SINGLE | |||||
!STRING_UPDATE_ADD_STAND | |||||
!STRING_UPDATE_REMOVE_SINGLE | |||||
!STRING_UPDATE_REMOVE_STAND | |||||
call Set_TdsElevatorModes(TDS_ELEVATOR_CONNECTION_NOTHING) | |||||
!Get_TdsElevatorModes() | |||||
!TDS_ELEVATOR_CONNECTION_NOTHING | |||||
!TDS_ELEVATOR_CONNECTION_STRING | |||||
!TDS_ELEVATOR_CONNECTION_SINGLE | |||||
!TDS_ELEVATOR_CONNECTION_STAND | |||||
!TDS_ELEVATOR_LATCH_STRING | |||||
!TDS_ELEVATOR_LATCH_SINGLE | |||||
!TDS_ELEVATOR_LATCH_STAND | |||||
call Set_TdsConnectionModes(TDS_CONNECTION_NOTHING) | |||||
!Get_TdsConnectionModes() | |||||
!TDS_CONNECTION_NOTHING | |||||
!TDS_CONNECTION_STRING | |||||
!TDS_CONNECTION_SPINE | |||||
call Set_SwingTiltPermission(.false.) !Get_SwingTiltPermission() | |||||
call Set_SwingOffPermission(.false.) !Get_SwingOffPermission() | |||||
call Set_SwingDrillPermission(.false.) !Get_SwingDrillPermission() | |||||
call Set_FillupHeadPermission(.false.) !Get_FillupHeadPermission() | |||||
call Set_PowerLed(.false.) | |||||
call Set_IbopLed(.false.) | |||||
call Set_TorqueWrenchLed(0) !Get_TorqueWrenchLed() | |||||
!TdsPower_REV = 1 | |||||
!TdsPower_OFF = 0 | |||||
!TdsPower_FWD = -1 | |||||
! | |||||
!TdsMu_TORQ = 1 | |||||
!TdsMu_SPINE = 0 | |||||
!TdsMu_DRILL = -1 | |||||
! | |||||
!TdsLinkTilt_TILT = 1 | |||||
!TdsLinkTilt_OFF = 0 | |||||
!TdsLinkTilt_DRILL = -1 | |||||
!TDS IBOP TopDriveIbop | |||||
!TDS LinkTilt TopDriveLinkTiltState | |||||
!TDS MU TopDriveDrillTorqueState | |||||
!TDS Power TopDriveTdsPowerState | |||||
!TopDriveTorqueWrench PRESSED=True or UNPRESSED=Falses | |||||
!Get_TdsConnectionPossible() | |||||
!Get_TdsStemIn() | |||||
!call Set_TdsStemJointHeight(v) !Get_TdsStemJointHeight() | |||||
!Get_SwingDrillPermission() | |||||
!Get_SwingOffPermission() | |||||
!Get_SwingTiltPermission() | |||||
!Get_FillupHeadPermission() | |||||
call Set_TdsTong(TDS_TONG_BREAKOUT_END) | |||||
!Get_TdsTong() | |||||
!TDS_TONG_BREAKOUT_BEGIN | |||||
!TDS_TONG_BREAKOUT_END | |||||
!TDS_TONG_MAKEUP_BEGIN | |||||
!TDS_TONG_MAKEUP_END | |||||
call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_END) | |||||
!Get_TdsBackupClamp() | |||||
!BACKUP_CLAMP_OFF_END | |||||
!BACKUP_CLAMP_OFF_BEGIN | |||||
!BACKUP_CLAMP_FW_BEGIN | |||||
!BACKUP_CLAMP_FW_END | |||||
call Set_TdsSwing(TDS_SWING_OFF_END) | |||||
!Get_TdsSwing() | |||||
!TDS_SWING_NEUTRAL | |||||
!TDS_SWING_OFF_BEGIN | |||||
!TDS_SWING_OFF_END | |||||
!TDS_SWING_DRILL_BEGIN | |||||
!TDS_SWING_DRILL_END | |||||
!TDS_SWING_TILT_BEGIN | |||||
!TDS_SWING_TILT_END | |||||
call Set_TdsSpine(TDS_SPINE_NEUTRAL) !TDS_SPINE_DISCONNECT_END | |||||
!Get_TdsSpine() | |||||
!TDS_SPINE_NEUTRAL | |||||
!TDS_SPINE_CONNECT_BEGIN | |||||
!TDS_SPINE_CONNECT_END | |||||
!TDS_SPINE_DISCONNECT_BEGIN | |||||
!TDS_SPINE_DISCONNECT_END | |||||
end subroutine | |||||
! subroutine SetDefaults_WN() | |||||
! !DEC$ ATTRIBUTES DLLEXPORT :: SetDefaults_WN | |||||
! !DEC$ ATTRIBUTES ALIAS: 'SetDefaults_WN' :: SetDefaults_WN | |||||
! implicit none | |||||
! call SetDefaultValues() | |||||
! end subroutine | |||||
end module COperationScenariosSettings |
@@ -0,0 +1,46 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Common/COperationScenariosVariables.f90" | |||||
module COperationScenariosVariables | |||||
implicit none | |||||
public | |||||
type::OperationScenarioType | |||||
! Apparently Constants | |||||
real :: HKL = 63.76 ! Hook And Kelly Length | |||||
real :: HL = 17.81 ! Hook Length | |||||
real :: PL = 30.0 ! Pipe Length | |||||
real :: SL = 90.0 ! Stand Length | |||||
real :: LG = 8.0 ! Limit Gap | |||||
real :: SG = 3.0 ! Slips Gap | |||||
real :: TG = 4.0 ! Tong Gap | |||||
real :: RE = 3.0 ! Release | |||||
real :: ECG = 2.3 ! Elevator Connection Gap | |||||
!Apparently Variables | |||||
integer :: ElevatorConnection = 0 | |||||
integer :: StringUpdate = 0 | |||||
integer :: KellyConnection = 0 | |||||
end type OperationScenarioType | |||||
enum, bind(c) | |||||
enumerator STRING_UPDATE_NEUTRAL | |||||
enumerator STRING_UPDATE_ADD_SINGLE | |||||
enumerator STRING_UPDATE_ADD_STAND | |||||
enumerator STRING_UPDATE_REMOVE_SINGLE | |||||
enumerator STRING_UPDATE_REMOVE_STAND | |||||
end enum | |||||
enum, bind(c) | |||||
enumerator KELLY_CONNECTION_NOTHING | |||||
enumerator KELLY_CONNECTION_STRING | |||||
enumerator KELLY_CONNECTION_SINGLE | |||||
end enum | |||||
enum, bind(c) | |||||
enumerator ELEVATOR_CONNECTION_NOTHING | |||||
enumerator ELEVATOR_CONNECTION_STRING | |||||
enumerator ELEVATOR_CONNECTION_STAND | |||||
enumerator ELEVATOR_CONNECTION_SINGLE | |||||
enumerator ELEVATOR_LATCH_STRING | |||||
enumerator ELEVATOR_LATCH_SINGLE | |||||
enumerator ELEVATOR_LATCH_STAND | |||||
end enum | |||||
contains | |||||
end module COperationScenariosVariables |
@@ -3,18 +3,12 @@ module OperationScenariosModule | |||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||||
!! Paseted From ....Variables.f90 | !! Paseted From ....Variables.f90 | ||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||||
! use OperationScenariosModule ! | |||||
! use OperationScenariosModule !!CElevator... | |||||
! use COperationScenariosVariables | |||||
use SimulationVariables | use SimulationVariables | ||||
use PermissionsModule | use PermissionsModule | ||||
! use SoftwareInputsVariables | |||||
! use CUnityInputs | |||||
use UnityModule | use UnityModule | ||||
use UnitySignalVariables | use UnitySignalVariables | ||||
use UnitySignalsModule | use UnitySignalsModule | ||||
use PermissionsModule | use PermissionsModule | ||||
! use CTdsElevatorModesEnumVariables ! | |||||
use CHoistingVariables | use CHoistingVariables | ||||
use CTopDrivePanelVariables | use CTopDrivePanelVariables | ||||
use NotificationModule | use NotificationModule | ||||
@@ -45,9 +39,8 @@ module OperationScenariosModule | |||||
use CManifolds, Only: KellyConnected, KellyDisconnected | use CManifolds, Only: KellyConnected, KellyDisconnected | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%OperationScenario%KellyConnection == v) return | |||||
#endif | |||||
# 43 | |||||
data%State%OperationScenario%KellyConnection = v | data%State%OperationScenario%KellyConnection = v | ||||
@@ -57,9 +50,8 @@ module OperationScenariosModule | |||||
call KellyConnected() | call KellyConnected() | ||||
endif | endif | ||||
#ifdef deb | |||||
if(print_log) print*, 'data%State%OperationScenario%KellyConnection=', data%State%OperationScenario%KellyConnection | |||||
#endif | |||||
# 55 | |||||
!**call data%State%OperationScenario%OnKellyConnectionChange%RunAll() | !**call data%State%OperationScenario%OnKellyConnectionChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -71,14 +63,12 @@ module OperationScenariosModule | |||||
subroutine Evaluate_KellyConnection() | subroutine Evaluate_KellyConnection() | ||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_KellyConnection=TopDrive' | |||||
#endif | |||||
# 69 | |||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_KellyConnection=Kelly' | |||||
#endif | |||||
# 74 | |||||
!OPERATION-CODE=1 | !OPERATION-CODE=1 | ||||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | if (Get_OperationCondition() == OPERATION_DRILL .and.& | ||||
@@ -183,13 +173,13 @@ module OperationScenariosModule | |||||
subroutine ButtonPress_Breakout() | subroutine ButtonPress_Breakout() | ||||
implicit none | implicit none | ||||
# 187 | |||||
# 181 | |||||
end subroutine | end subroutine | ||||
subroutine ButtonPress_Makeup() | subroutine ButtonPress_Makeup() | ||||
implicit none | implicit none | ||||
# 194 | |||||
# 188 | |||||
end subroutine | end subroutine | ||||
@@ -197,9 +187,8 @@ module OperationScenariosModule | |||||
subroutine Set_StringUpdate(v) | subroutine Set_StringUpdate(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%OperationScenario%StringUpdate == v) return | |||||
#endif | |||||
# 197 | |||||
data%State%OperationScenario%StringUpdate = v | data%State%OperationScenario%StringUpdate = v | ||||
!**call data%State%OperationScenario%OnStringUpdateChange%RunAll(v) | !**call data%State%OperationScenario%OnStringUpdateChange%RunAll(v) | ||||
end subroutine | end subroutine | ||||
@@ -229,14 +218,12 @@ module OperationScenariosModule | |||||
subroutine Set_ElevatorConnection(v) | subroutine Set_ElevatorConnection(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%OperationScenario%ElevatorConnection == v) return | |||||
#endif | |||||
# 229 | |||||
data%State%OperationScenario%ElevatorConnection = v | data%State%OperationScenario%ElevatorConnection = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'data%State%OperationScenario%ElevatorConnection=', data%State%OperationScenario%ElevatorConnection | |||||
#endif | |||||
# 234 | |||||
!**call data%State%OperationScenario%OnElevatorConnectionChange%RunAll() | !**call data%State%OperationScenario%OnElevatorConnectionChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -245,4 +232,73 @@ module OperationScenariosModule | |||||
Get_ElevatorConnection = data%State%OperationScenario%ElevatorConnection | Get_ElevatorConnection = data%State%OperationScenario%ElevatorConnection | ||||
end function | end function | ||||
!//SLIPS: everythings start here | |||||
subroutine ButtonPress_Slips() bind(C,name="ButtonPress_Slips") | |||||
! use NotificationModule | |||||
use CUnityOutputs | |||||
! use UnitySignalsModule | |||||
implicit none | |||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||||
if(print_log) print*, 'ButtonPress_Slips=TopDrive' | |||||
!TOPDRIVE-CODE=30 | |||||
if (Get_Slips() == SLIPS_UNSET_END .and.& | |||||
Get_SlipsNotification()) then | |||||
call Set_Slips(SLIPS_SET_BEGIN) | |||||
return | |||||
end if | |||||
!TOPDRIVE-CODE=31 | |||||
if (Get_TdsConnectionModes() == TDS_CONNECTION_STRING .and.& | |||||
Get_Slips() == SLIPS_SET_END .and.& | |||||
Get_SlipsNotification()) then | |||||
call Set_Slips(SLIPS_UNSET_BEGIN) | |||||
return | |||||
end if | |||||
!TOPDRIVE-CODE=32 | |||||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STRING .and.& | |||||
Get_Slips() == SLIPS_SET_END .and.& | |||||
Get_SlipsNotification()) then | |||||
call Set_Slips(SLIPS_UNSET_BEGIN) | |||||
return | |||||
end if | |||||
endif | |||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
if(print_log) print*, 'ButtonPress_Slips=Kelly' | |||||
!OPERATION-CODE=19 | |||||
if (Get_Slips() == SLIPS_UNSET_END .and.& | |||||
Get_SlipsNotification()) then | |||||
call Set_Slips(SLIPS_SET_BEGIN) | |||||
return | |||||
end if | |||||
!OPERATION-CODE=20 | |||||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||||
Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& | |||||
GetRotaryRpm() == 0.0d0 .and.& | |||||
Get_SlipsNotification() .and.& | |||||
Get_Slips() == SLIPS_SET_END) then | |||||
call Set_Slips(SLIPS_UNSET_BEGIN) | |||||
return | |||||
end if | |||||
!OPERATION-CODE=21 | |||||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||||
Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .and.& | |||||
GetRotaryRpm() == 0.0d0 .and.& | |||||
Get_SlipsNotification() .and.& | |||||
Get_Slips() == SLIPS_SET_END) then | |||||
call Set_Slips(SLIPS_UNSET_BEGIN) | |||||
return | |||||
end if | |||||
endif | |||||
end subroutine | |||||
end module OperationScenariosModule | end module OperationScenariosModule |
@@ -9,10 +9,7 @@ module CTdsElevatorModesEnum | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsElevatorModes=TopDrive' | if(print_log) print*, 'Evaluate_TdsElevatorModes=TopDrive' | ||||
#endif | |||||
!TOPDRIVE-CODE=7 | !TOPDRIVE-CODE=7 | ||||
if (Get_Elevator() == ELEVATOR_LATCH_STRING_END .and.& | if (Get_Elevator() == ELEVATOR_LATCH_STRING_END .and.& | ||||
@@ -24,8 +21,6 @@ module CTdsElevatorModesEnum | |||||
return | return | ||||
end if | end if | ||||
!TOPDRIVE-CODE=8 | !TOPDRIVE-CODE=8 | ||||
if (Get_HookHeight() <= (TL() + TJH() - data%State%OperationScenario%ECG) .and.& | if (Get_HookHeight() <= (TL() + TJH() - data%State%OperationScenario%ECG) .and.& | ||||
Get_ElevatorPickup() == .false. .and.& | Get_ElevatorPickup() == .false. .and.& | ||||
@@ -304,19 +299,9 @@ module CTdsElevatorModesEnum | |||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsElevatorModes=Kelly' | |||||
#endif | |||||
endif | |||||
! if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_TdsElevatorModes=Kelly' | |||||
! endif | |||||
@@ -325,8 +310,8 @@ module CTdsElevatorModesEnum | |||||
subroutine Subscribe_TdsElevatorModes() | subroutine Subscribe_TdsElevatorModes() | ||||
use CDrillingConsoleVariables | use CDrillingConsoleVariables | ||||
use SimulationVariables | |||||
use SimulationVariables | |||||
use SimulationVariables | |||||
use SimulationVariables | |||||
implicit none | implicit none | ||||
end subroutine | end subroutine | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Enums/CTdsElevatorModesEnum.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Enums/CTdsElevatorModesEnum.f90" | |||||
module CTdsElevatorModesEnum | module CTdsElevatorModesEnum | ||||
use OperationScenariosModule | use OperationScenariosModule | ||||
use UnityModule | use UnityModule | ||||
@@ -10,9 +10,7 @@ module CTdsElevatorModesEnum | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
# 14 | |||||
if(print_log) print*, 'Evaluate_TdsElevatorModes=TopDrive' | |||||
!TOPDRIVE-CODE=7 | !TOPDRIVE-CODE=7 | ||||
if (Get_Elevator() == ELEVATOR_LATCH_STRING_END .and.& | if (Get_Elevator() == ELEVATOR_LATCH_STRING_END .and.& | ||||
@@ -24,8 +22,6 @@ module CTdsElevatorModesEnum | |||||
return | return | ||||
end if | end if | ||||
!TOPDRIVE-CODE=8 | !TOPDRIVE-CODE=8 | ||||
if (Get_HookHeight() <= (TL() + TJH() - data%State%OperationScenario%ECG) .and.& | if (Get_HookHeight() <= (TL() + TJH() - data%State%OperationScenario%ECG) .and.& | ||||
Get_ElevatorPickup() == .false. .and.& | Get_ElevatorPickup() == .false. .and.& | ||||
@@ -304,18 +300,9 @@ module CTdsElevatorModesEnum | |||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
# 318 | |||||
endif | |||||
! if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_TdsElevatorModes=Kelly' | |||||
! endif | |||||
@@ -324,8 +311,8 @@ module CTdsElevatorModesEnum | |||||
subroutine Subscribe_TdsElevatorModes() | subroutine Subscribe_TdsElevatorModes() | ||||
use CDrillingConsoleVariables | use CDrillingConsoleVariables | ||||
use SimulationVariables | |||||
use SimulationVariables | |||||
use SimulationVariables | |||||
use SimulationVariables | |||||
implicit none | implicit none | ||||
end subroutine | end subroutine | ||||
@@ -0,0 +1,105 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Notifications/COpenSafetyValveLedNotification.f90" | |||||
module COpenSafetyValveLedNotification | |||||
use OperationScenariosModule | |||||
implicit none | |||||
contains | |||||
subroutine Evaluate_OpenSafetyValveLed() | |||||
implicit none | |||||
! if (DriveType == TopDrive_DriveType) then | |||||
!#ifdef OST | |||||
! if(print_log) print*, 'Evaluate_OpenSafetyValveLed=TopDrive' | |||||
!#endif | |||||
! endif | |||||
! | |||||
! | |||||
! | |||||
! | |||||
! | |||||
! | |||||
! | |||||
! | |||||
! if (DriveType == Kelly_DriveType) then | |||||
!#ifdef OST | |||||
! if(print_log) print*, 'Evaluate_OpenSafetyValveLed=Kelly' | |||||
!#endif | |||||
! endif | |||||
end subroutine | |||||
! subroutine Subscribe_OpenSafetyValveLed() | |||||
! use CDrillingConsoleVariables | |||||
! use ConfigurationVariables | |||||
! use ConfigurationVariables | |||||
! implicit none | |||||
! call OnOpenSafetyValvePress%Add(ButtonPress_OpenSafetyValve) | |||||
! call OnOperationConditionChangeInt%Add(Set_Operation_OpenSafetyValveLed) | |||||
! end subroutine | |||||
subroutine Set_Operation_OpenSafetyValveLed(v) | |||||
implicit none | |||||
integer , intent(in) :: v | |||||
# 49 | |||||
data%State%notifications%operation_OpenSafetyValveLed = v | |||||
# 53 | |||||
end subroutine | |||||
subroutine ButtonPress_OpenSafetyValve() | |||||
implicit none | |||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||||
# 64 | |||||
!TOPDRIVE-CODE=56 | |||||
if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.& | |||||
Get_OpenSafetyValveLed() == .false. .and.& | |||||
Get_CloseSafetyValveLed()) then | |||||
call Set_CloseSafetyValveLed(.false.) | |||||
call Set_OpenSafetyValveLed(.true.) | |||||
return | |||||
end if | |||||
endif | |||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
# 88 | |||||
!OPERATION-CODE=58 | |||||
if (Get_SafetyValveHeight() >= 3.0 .and. Get_SafetyValveHeight() <= 12.0 .and.& | |||||
Get_OpenSafetyValveLed() == .false. .and.& | |||||
Get_CloseSafetyValveLed()) then | |||||
call Set_OpenSafetyValveLed(.true.) | |||||
call Set_CloseSafetyValveLed(.false.) | |||||
return | |||||
end if | |||||
endif | |||||
end subroutine | |||||
end module COpenSafetyValveLedNotification |
@@ -3,17 +3,12 @@ module CSlipsNotification | |||||
implicit none | implicit none | ||||
contains | contains | ||||
!//TODO: must change code such that get new states of tong and slips from uie | |||||
subroutine Evaluate_SlipsNotification() | subroutine Evaluate_SlipsNotification() | ||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_SlipsNotification=TopDrive' | |||||
#endif | |||||
! if(print_log) print*, 'Evaluate_SlipsNotification=TopDrive' | |||||
!TOPDRIVE-CODE=28 | !TOPDRIVE-CODE=28 | ||||
if (Get_ZeroStringSpeed() .and.& | if (Get_ZeroStringSpeed() .and.& | ||||
GetRotaryRpm() == 0.0d0 .and.& | GetRotaryRpm() == 0.0d0 .and.& | ||||
@@ -22,10 +17,8 @@ module CSlipsNotification | |||||
call Set_SlipsNotification(.true.) | call Set_SlipsNotification(.true.) | ||||
return | return | ||||
end if | |||||
end if | |||||
!TOPDRIVE-CODE=29 | !TOPDRIVE-CODE=29 | ||||
if (Get_ZeroStringSpeed() .and.& | if (Get_ZeroStringSpeed() .and.& | ||||
GetRotaryRpm() == 0.0d0 .and.& | GetRotaryRpm() == 0.0d0 .and.& | ||||
@@ -37,25 +30,16 @@ module CSlipsNotification | |||||
call Set_SlipsNotification(.true.) | call Set_SlipsNotification(.true.) | ||||
return | return | ||||
end if | end if | ||||
endif | endif | ||||
! enumerator SLIPS_NEUTRAL | |||||
! enumerator SLIPS_SET_BEGIN | |||||
! enumerator SLIPS_SET_END | |||||
! enumerator SLIPS_UNSET_BEGIN | |||||
! enumerator SLIPS_UNSET_END | |||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_SlipsNotification=Kelly' | |||||
#endif | |||||
! if(print_log) print*, 'Evaluate_SlipsNotification=Kelly' | |||||
!OPERATION-CODE=53 | !OPERATION-CODE=53 | ||||
if (Get_ZeroStringSpeed() .and.& | if (Get_ZeroStringSpeed() .and.& | ||||
@@ -67,10 +51,6 @@ module CSlipsNotification | |||||
return | return | ||||
end if | end if | ||||
!OPERATION-CODE=77 | !OPERATION-CODE=77 | ||||
if (Get_ZeroStringSpeed() .and.& | if (Get_ZeroStringSpeed() .and.& | ||||
GetRotaryRpm() == 0.0d0 .and.& | GetRotaryRpm() == 0.0d0 .and.& | ||||
@@ -79,43 +59,13 @@ module CSlipsNotification | |||||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | ||||
(Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_KellyConnection() == KELLY_CONNECTION_STRING)) then | (Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_KellyConnection() == KELLY_CONNECTION_STRING)) then | ||||
call Set_SlipsNotification(.true.) | call Set_SlipsNotification(.true.) | ||||
return | return | ||||
end if | end if | ||||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||||
! Get_ZeroStringSpeed() .and.& | |||||
! Get_SlackOff() .and.& | |||||
! Get_KellyConnection() == KELLY_CONNECTION_STRING) then | |||||
! call Set_SlipsNotification(.true.) | |||||
! return | |||||
!end if | |||||
! | |||||
! | |||||
!if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||||
! Get_ZeroStringSpeed() .and.& | |||||
! Get_NearFloorConnection() >= 21 .and. Get_NearFloorConnection() <= 25 .and.& | |||||
! Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING) then | |||||
! call Set_SlipsNotification(.true.) | |||||
! return | |||||
!end if | |||||
call Set_SlipsNotification(.false.) | call Set_SlipsNotification(.false.) | ||||
endif | endif | ||||
end subroutine | end subroutine | ||||
! subroutine Subscribe_SlipsNotification() | ! subroutine Subscribe_SlipsNotification() | ||||
@@ -1,19 +1,15 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Notifications/CSlipsNotification.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Notifications/CSlipsNotification.f90" | |||||
module CSlipsNotification | module CSlipsNotification | ||||
use OperationScenariosModule | use OperationScenariosModule | ||||
implicit none | implicit none | ||||
contains | contains | ||||
!//TODO: must change code such that get new states of tong and slips from uie | |||||
subroutine Evaluate_SlipsNotification() | subroutine Evaluate_SlipsNotification() | ||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
# 15 | |||||
! if(print_log) print*, 'Evaluate_SlipsNotification=TopDrive' | |||||
!TOPDRIVE-CODE=28 | !TOPDRIVE-CODE=28 | ||||
if (Get_ZeroStringSpeed() .and.& | if (Get_ZeroStringSpeed() .and.& | ||||
GetRotaryRpm() == 0.0d0 .and.& | GetRotaryRpm() == 0.0d0 .and.& | ||||
@@ -22,10 +18,8 @@ module CSlipsNotification | |||||
call Set_SlipsNotification(.true.) | call Set_SlipsNotification(.true.) | ||||
return | return | ||||
end if | |||||
end if | |||||
!TOPDRIVE-CODE=29 | !TOPDRIVE-CODE=29 | ||||
if (Get_ZeroStringSpeed() .and.& | if (Get_ZeroStringSpeed() .and.& | ||||
GetRotaryRpm() == 0.0d0 .and.& | GetRotaryRpm() == 0.0d0 .and.& | ||||
@@ -37,24 +31,16 @@ module CSlipsNotification | |||||
call Set_SlipsNotification(.true.) | call Set_SlipsNotification(.true.) | ||||
return | return | ||||
end if | end if | ||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
# 58 | |||||
! enumerator SLIPS_NEUTRAL | |||||
! enumerator SLIPS_SET_BEGIN | |||||
! enumerator SLIPS_SET_END | |||||
! enumerator SLIPS_UNSET_BEGIN | |||||
! enumerator SLIPS_UNSET_END | |||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_SlipsNotification=Kelly' | |||||
!OPERATION-CODE=53 | !OPERATION-CODE=53 | ||||
if (Get_ZeroStringSpeed() .and.& | if (Get_ZeroStringSpeed() .and.& | ||||
@@ -66,10 +52,6 @@ module CSlipsNotification | |||||
return | return | ||||
end if | end if | ||||
!OPERATION-CODE=77 | !OPERATION-CODE=77 | ||||
if (Get_ZeroStringSpeed() .and.& | if (Get_ZeroStringSpeed() .and.& | ||||
GetRotaryRpm() == 0.0d0 .and.& | GetRotaryRpm() == 0.0d0 .and.& | ||||
@@ -78,43 +60,13 @@ module CSlipsNotification | |||||
Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 6.0 .and.& | ||||
(Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_KellyConnection() == KELLY_CONNECTION_STRING)) then | (Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING .or. Get_KellyConnection() == KELLY_CONNECTION_STRING)) then | ||||
call Set_SlipsNotification(.true.) | call Set_SlipsNotification(.true.) | ||||
return | return | ||||
end if | end if | ||||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | |||||
! Get_ZeroStringSpeed() .and.& | |||||
! Get_SlackOff() .and.& | |||||
! Get_KellyConnection() == KELLY_CONNECTION_STRING) then | |||||
! call Set_SlipsNotification(.true.) | |||||
! return | |||||
!end if | |||||
! | |||||
! | |||||
!if (Get_OperationCondition() == OPERATION_TRIP .and.& | |||||
! Get_ZeroStringSpeed() .and.& | |||||
! Get_NearFloorConnection() >= 21 .and. Get_NearFloorConnection() <= 25 .and.& | |||||
! Get_ElevatorConnection() == ELEVATOR_CONNECTION_STRING) then | |||||
! call Set_SlipsNotification(.true.) | |||||
! return | |||||
!end if | |||||
call Set_SlipsNotification(.false.) | call Set_SlipsNotification(.false.) | ||||
endif | endif | ||||
end subroutine | end subroutine | ||||
! subroutine Subscribe_SlipsNotification() | ! subroutine Subscribe_SlipsNotification() | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Notifications/CSwingLedNotification.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Notifications/CSwingLedNotification.f90" | |||||
module CSwingLedNotification | module CSwingLedNotification | ||||
use OperationScenariosModule | use OperationScenariosModule | ||||
use UnityModule | use UnityModule | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotification.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Notifications/CTdsPowerLedNotification.f90" | |||||
module CTdsPowerLedNotification | module CTdsPowerLedNotification | ||||
use OperationScenariosModule | use OperationScenariosModule | ||||
use SimulationVariables | use SimulationVariables | ||||
@@ -7,17 +7,9 @@ module CTongNotification | |||||
subroutine Evaluate_TongNotification() | subroutine Evaluate_TongNotification() | ||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
# 16 | |||||
! if(print_log) print*, 'Evaluate_TongNotification=TopDrive' | |||||
!TOPDRIVE-CODE=50 | !TOPDRIVE-CODE=50 | ||||
if (((Get_HookHeight() >= (TL() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + NFC() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + data%State%OperationScenario%TG)) .or.& | if (((Get_HookHeight() >= (TL() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + NFC() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + data%State%OperationScenario%TG)) .or.& | ||||
(Get_HookHeight() >= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + data%State%OperationScenario%TG))).and.& | (Get_HookHeight() >= (TL() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + NFC() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (TL() + NFC() + data%State%OperationScenario%SL - data%State%OperationScenario%ECG + data%State%OperationScenario%TG))).and.& | ||||
@@ -34,62 +26,34 @@ module CTongNotification | |||||
return | return | ||||
end if | end if | ||||
!TOPDRIVE-CODE=51 | !TOPDRIVE-CODE=51 | ||||
if (GetRotaryRpm() == 0.0d0 .and.& | if (GetRotaryRpm() == 0.0d0 .and.& | ||||
Get_JointConnectionPossible() .and.& | |||||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) .and.& | |||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
Get_Slips() == SLIPS_SET_END) then | |||||
Get_JointConnectionPossible() .and.& | |||||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_SINGLE .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_SINGLE) .and.& | |||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
Get_Slips() == SLIPS_SET_END) then | |||||
call Set_TongNotification(.true.) | call Set_TongNotification(.true.) | ||||
return | return | ||||
end if | end if | ||||
!TOPDRIVE-CODE=52 | !TOPDRIVE-CODE=52 | ||||
if (GetRotaryRpm() == 0.0d0 .and.& | if (GetRotaryRpm() == 0.0d0 .and.& | ||||
Get_JointConnectionPossible() .and.& | |||||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) .and.& | |||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
Get_Slips() == SLIPS_SET_END) then | |||||
Get_JointConnectionPossible() .and.& | |||||
(Get_Tong() /= TONG_BREAKOUT_BEGIN .and.& | |||||
Get_Tong() /= TONG_MAKEUP_BEGIN) .and.& | |||||
(Get_TdsElevatorModes() == TDS_ELEVATOR_LATCH_STAND .or. Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_STAND) .and.& | |||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
Get_Slips() == SLIPS_SET_END) then | |||||
call Set_TongNotification(.true.) | call Set_TongNotification(.true.) | ||||
return | return | ||||
end if | end if | ||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | ||||
# 92 | |||||
! if(print_log) print*, 'Evaluate_TongNotification=Kelly' | |||||
!OPERATION-CODE=44 | !OPERATION-CODE=44 | ||||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | if (Get_OperationCondition() == OPERATION_DRILL .and.& | ||||
!((Get_HookHeight() >= 65.0 .and. Get_HookHeight() <= 70.0) .or.& | !((Get_HookHeight() >= 65.0 .and. Get_HookHeight() <= 70.0) .or.& | ||||
@@ -108,9 +72,6 @@ module CTongNotification | |||||
return | return | ||||
end if | end if | ||||
!OPERATION-CODE=45 | !OPERATION-CODE=45 | ||||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | if (Get_OperationCondition() == OPERATION_DRILL .and.& | ||||
Get_HookHeight() >= 66 .and. Get_HookHeight() <= 69 .and.& | Get_HookHeight() >= 66 .and. Get_HookHeight() <= 69 .and.& | ||||
@@ -123,8 +84,6 @@ module CTongNotification | |||||
return | return | ||||
end if | end if | ||||
!OPERATION-CODE=46 | !OPERATION-CODE=46 | ||||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | if (Get_OperationCondition() == OPERATION_DRILL .and.& | ||||
Get_JointConnectionPossible() .and.& | Get_JointConnectionPossible() .and.& | ||||
@@ -137,9 +96,6 @@ module CTongNotification | |||||
return | return | ||||
end if | end if | ||||
!OPERATION-CODE=47 | !OPERATION-CODE=47 | ||||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | if (Get_OperationCondition() == OPERATION_DRILL .and.& | ||||
GetRotaryRpm() == 0.0d0 .and.& | GetRotaryRpm() == 0.0d0 .and.& | ||||
@@ -152,11 +108,7 @@ module CTongNotification | |||||
call Set_TongNotification(.true.) | call Set_TongNotification(.true.) | ||||
return | return | ||||
end if | |||||
end if | |||||
!OPERATION-CODE=48 | !OPERATION-CODE=48 | ||||
if (Get_OperationCondition() == OPERATION_DRILL .and.& | if (Get_OperationCondition() == OPERATION_DRILL .and.& | ||||
@@ -171,21 +123,7 @@ module CTongNotification | |||||
call Set_TongNotification(.true.) | call Set_TongNotification(.true.) | ||||
return | return | ||||
end if | end if | ||||
!OPERATION-CODE=50 | !OPERATION-CODE=50 | ||||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | if (Get_OperationCondition() == OPERATION_TRIP .and.& | ||||
((Get_HookHeight() >= (data%State%OperationScenario%HL + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + Get_NearFloorConnection() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + data%State%OperationScenario%TG)) .or.& | ((Get_HookHeight() >= (data%State%OperationScenario%HL + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + Get_NearFloorConnection() - data%State%OperationScenario%RE) .and. Get_HookHeight() <= (data%State%OperationScenario%HL + Get_NearFloorConnection() + data%State%OperationScenario%PL - data%State%OperationScenario%ECG + data%State%OperationScenario%TG)) .or.& | ||||
@@ -219,11 +157,7 @@ module CTongNotification | |||||
call Set_TongNotification(.true.) | call Set_TongNotification(.true.) | ||||
return | return | ||||
end if | end if | ||||
!OPERATION-CODE=52 | !OPERATION-CODE=52 | ||||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | if (Get_OperationCondition() == OPERATION_TRIP .and.& | ||||
GetRotaryRpm() == 0.0d0 .and.& | GetRotaryRpm() == 0.0d0 .and.& | ||||
@@ -237,9 +171,6 @@ module CTongNotification | |||||
call Set_TongNotification(.true.) | call Set_TongNotification(.true.) | ||||
return | return | ||||
end if | end if | ||||
!if (Get_OperationCondition() == OPERATION_DRILL .and.& | !if (Get_OperationCondition() == OPERATION_DRILL .and.& | ||||
! Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& | ! Get_KellyConnection() == KELLY_CONNECTION_STRING .and.& | ||||
@@ -250,21 +181,11 @@ module CTongNotification | |||||
! return | ! return | ||||
!end if | !end if | ||||
! | ! | ||||
call Set_TongNotification(.false.) | call Set_TongNotification(.false.) | ||||
endif | endif | ||||
call Set_TongNotification(.true.) | |||||
end subroutine | end subroutine | ||||
! subroutine Subscribe_TongNotification() | ! subroutine Subscribe_TongNotification() | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Notifications/Notifications.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Notifications/Notifications.f90" | |||||
module NotificationModule | module NotificationModule | ||||
use SimulationVariables | use SimulationVariables | ||||
implicit none | implicit none | ||||
@@ -9,9 +9,8 @@ contains | |||||
!use CLatchLedNotification | !use CLatchLedNotification | ||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%UnlatchLed == v) return | |||||
#endif | |||||
# 13 | |||||
data%State%notifications%UnlatchLed = v | data%State%notifications%UnlatchLed = v | ||||
if(data%State%notifications%UnlatchLed) then | if(data%State%notifications%UnlatchLed) then | ||||
@@ -32,14 +31,12 @@ contains | |||||
subroutine Set_TongNotification(v) | subroutine Set_TongNotification(v) | ||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%TongNotification == v) return | |||||
#endif | |||||
# 36 | |||||
data%State%notifications%TongNotification = v | data%State%notifications%TongNotification = v | ||||
! if(associated(data%State%notifications%TongNotificationPtr)) !**call data%State%notifications%TongNotificationPtr(data%State%notifications%TongNotification) | ! if(associated(data%State%notifications%TongNotificationPtr)) !**call data%State%notifications%TongNotificationPtr(data%State%notifications%TongNotification) | ||||
#ifdef deb | |||||
if(print_log) print*, 'data%State%notifications%TongNotification=', data%State%notifications%TongNotification | |||||
#endif | |||||
# 41 | |||||
!**call data%State%notifications%OnTongNotificationChange%RunAll() | !**call data%State%notifications%OnTongNotificationChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -54,9 +51,8 @@ contains | |||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%TorqueWrenchLed == v) return | |||||
#endif | |||||
# 58 | |||||
data%State%notifications%TorqueWrenchLed = v | data%State%notifications%TorqueWrenchLed = v | ||||
data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed = v | data%Equipments%TopDrivePanel%TopDriveTorqueWrenchLed = v | ||||
!**call data%State%notifications%OnTorqueWrenchLedChange%RunAll() | !**call data%State%notifications%OnTorqueWrenchLedChange%RunAll() | ||||
@@ -73,9 +69,8 @@ contains | |||||
!use CLatchLedNotification | !use CLatchLedNotification | ||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%PowerLed == v) return | |||||
#endif | |||||
# 77 | |||||
data%State%notifications%PowerLed = v | data%State%notifications%PowerLed = v | ||||
if(data%State%notifications%PowerLed) then | if(data%State%notifications%PowerLed) then | ||||
@@ -100,9 +95,8 @@ contains | |||||
!use CLatchLedNotification | !use CLatchLedNotification | ||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%IbopLed == v) return | |||||
#endif | |||||
# 104 | |||||
data%State%notifications%IbopLed = v | data%State%notifications%IbopLed = v | ||||
if(data%State%notifications%IbopLed) then | if(data%State%notifications%IbopLed) then | ||||
@@ -128,9 +122,8 @@ contains | |||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%SwingLed == v) return | |||||
#endif | |||||
# 132 | |||||
data%State%notifications%SwingLed = v | data%State%notifications%SwingLed = v | ||||
if(data%State%notifications%SwingLed) then | if(data%State%notifications%SwingLed) then | ||||
data%Equipments%DrillingConsole%SwingLed = 1 | data%Equipments%DrillingConsole%SwingLed = 1 | ||||
@@ -148,14 +141,12 @@ contains | |||||
subroutine Set_SlipsNotification(v) | subroutine Set_SlipsNotification(v) | ||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%SlipsNotification == v) return | |||||
#endif | |||||
# 152 | |||||
data%State%notifications%SlipsNotification = v | data%State%notifications%SlipsNotification = v | ||||
! if(associated(data%State%notifications%SlipsNotificationPtr)) !**call data%State%notifications%SlipsNotificationPtr(data%State%notifications%SlipsNotification) | ! if(associated(data%State%notifications%SlipsNotificationPtr)) !**call data%State%notifications%SlipsNotificationPtr(data%State%notifications%SlipsNotification) | ||||
#ifdef deb | |||||
if(print_log) print*, 'data%State%notifications%SlipsNotification=', data%State%notifications%SlipsNotification | |||||
#endif | |||||
# 157 | |||||
!**call data%State%notifications%OnSlipsNotificationChange%RunAll() | !**call data%State%notifications%OnSlipsNotificationChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -173,9 +164,8 @@ contains | |||||
use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | ||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%OpenSafetyValveLed == v) return | |||||
#endif | |||||
# 177 | |||||
data%State%notifications%OpenSafetyValveLed = v | data%State%notifications%OpenSafetyValveLed = v | ||||
if(data%State%notifications%OpenSafetyValveLed) then | if(data%State%notifications%OpenSafetyValveLed) then | ||||
@@ -200,9 +190,8 @@ contains | |||||
use CManifolds, only: OpenKellyCock | use CManifolds, only: OpenKellyCock | ||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%OpenKellyCockLed == v) return | |||||
#endif | |||||
# 204 | |||||
data%State%notifications%OpenKellyCockLed = v | data%State%notifications%OpenKellyCockLed = v | ||||
if(data%State%notifications%OpenKellyCockLed) then | if(data%State%notifications%OpenKellyCockLed) then | ||||
@@ -232,9 +221,8 @@ contains | |||||
!use CUnlatchLedNotification | !use CUnlatchLedNotification | ||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%LatchLed == v) return | |||||
#endif | |||||
# 236 | |||||
data%State%notifications%LatchLed = v | data%State%notifications%LatchLed = v | ||||
if(data%State%notifications%LatchLed) then | if(data%State%notifications%LatchLed) then | ||||
data%Equipments%DrillingConsole%LatchPipeLED = 1 | data%Equipments%DrillingConsole%LatchPipeLED = 1 | ||||
@@ -252,8 +240,8 @@ contains | |||||
subroutine Set_IrSafetyValveLed(v) | subroutine Set_IrSafetyValveLed(v) | ||||
use CDrillingConsoleVariables | use CDrillingConsoleVariables | ||||
use SimulationVariables | |||||
use SimulationVariables!, only: data%Equipments%DrillingConsole%CloseKellyCockLed => IRSafetyValveLed | |||||
use SimulationVariables | |||||
use UnitySignalsModule | |||||
use CManifolds, only: & | use CManifolds, only: & | ||||
InstallSafetyValve_TopDrive, & | InstallSafetyValve_TopDrive, & | ||||
InstallSafetyValve_KellyMode, & | InstallSafetyValve_KellyMode, & | ||||
@@ -262,31 +250,23 @@ contains | |||||
RemoveSafetyValve_KellyMode, & | RemoveSafetyValve_KellyMode, & | ||||
RemoveSafetyValve_TripMode | RemoveSafetyValve_TripMode | ||||
use UnitySignalVariables | use UnitySignalVariables | ||||
use UnitySignalsModule, only: Set_SafetyValve_Install, Set_SafetyValve_Remove | |||||
use CHoistingVariables | use CHoistingVariables | ||||
use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | |||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%IrSafetyValveLed == v) return | |||||
#endif | |||||
# 269 | |||||
data%State%notifications%IrSafetyValveLed = v | data%State%notifications%IrSafetyValveLed = v | ||||
if(data%State%notifications%IrSafetyValveLed) then | if(data%State%notifications%IrSafetyValveLed) then | ||||
data%Equipments%DrillingConsole%IRSafetyValveLed = 1 | data%Equipments%DrillingConsole%IRSafetyValveLed = 1 | ||||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call InstallSafetyValve_TopDrive() | if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call InstallSafetyValve_TopDrive() | ||||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call InstallSafetyValve_KellyMode() | if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call InstallSafetyValve_KellyMode() | ||||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 1) call InstallSafetyValve_TripMode() | if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 1) call InstallSafetyValve_TripMode() | ||||
call Set_SafetyValve_Install() | call Set_SafetyValve_Install() | ||||
else | else | ||||
data%Equipments%DrillingConsole%IRSafetyValveLed = 0 | data%Equipments%DrillingConsole%IRSafetyValveLed = 0 | ||||
if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call RemoveSafetyValve_TopDrive() | if(data%Configuration%Hoisting%DriveType == TopDrive_DriveType) call RemoveSafetyValve_TopDrive() | ||||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call RemoveSafetyValve_KellyMode() | if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 0) call RemoveSafetyValve_KellyMode() | ||||
if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 1) call RemoveSafetyValve_TripMode() | if(data%Configuration%Hoisting%DriveType == Kelly_DriveType .and. data%State%notifications%operation_IrSafetyValveLed == 1) call RemoveSafetyValve_TripMode() | ||||
call Set_SafetyValve_Remove() | call Set_SafetyValve_Remove() | ||||
endif | endif | ||||
@@ -300,16 +280,15 @@ contains | |||||
subroutine Set_IrIBopLed(v) | subroutine Set_IrIBopLed(v) | ||||
use CDrillingConsoleVariables | use CDrillingConsoleVariables | ||||
use SimulationVariables | |||||
use SimulationVariables!, only: IRIBopLedHw => IRIBopLed | |||||
use SimulationVariables | |||||
use SimulationVariables!, only: IRIBopLedHw => IRIBopLed | |||||
use CManifolds, only: InstallIBop, RemoveIBop | use CManifolds, only: InstallIBop, RemoveIBop | ||||
use UnitySignalVariables | use UnitySignalVariables | ||||
use UnitySignalsModule, only: Set_Ibop_Install, Set_Ibop_Remove | |||||
use UnitySignalsModule, only: Set_Ibop_Install, Set_Ibop_Remove | |||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%IrIBopLed == v) return | |||||
#endif | |||||
# 304 | |||||
data%State%notifications%IrIBopLed = v | data%State%notifications%IrIBopLed = v | ||||
if(data%State%notifications%IrIBopLed) then | if(data%State%notifications%IrIBopLed) then | ||||
data%Equipments%DrillingConsole%IRIBopLed = 1 | data%Equipments%DrillingConsole%IRIBopLed = 1 | ||||
@@ -330,16 +309,14 @@ contains | |||||
subroutine Set_FillMouseHoleLed(v) | subroutine Set_FillMouseHoleLed(v) | ||||
use CDrillingConsoleVariables | use CDrillingConsoleVariables | ||||
use SimulationVariables | |||||
use SimulationVariables!, only: FillMouseHoleLedHw => FillMouseHoleLed | |||||
use SimulationVariables | |||||
! use CMouseHoleEnumVariables | ! use CMouseHoleEnumVariables | ||||
use UnitySignalVariables | use UnitySignalVariables | ||||
use UnitySignalsModule | |||||
use UnitySignalsModule | |||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%FillMouseHoleLed == v) return | |||||
#endif | |||||
# 333 | |||||
data%State%notifications%FillMouseHoleLed = v | data%State%notifications%FillMouseHoleLed = v | ||||
if(data%State%notifications%FillMouseHoleLed) then | if(data%State%notifications%FillMouseHoleLed) then | ||||
data%Equipments%DrillingConsole%FillMouseHoleLed = 1 | data%Equipments%DrillingConsole%FillMouseHoleLed = 1 | ||||
@@ -363,9 +340,8 @@ contains | |||||
use CManifolds, only: CloseKellyCock | use CManifolds, only: CloseKellyCock | ||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%CloseKellyCockLed == v) return | |||||
#endif | |||||
# 359 | |||||
data%State%notifications%CloseKellyCockLed = v | data%State%notifications%CloseKellyCockLed = v | ||||
if(data%State%notifications%CloseKellyCockLed) then | if(data%State%notifications%CloseKellyCockLed) then | ||||
call CloseKellyCock() | call CloseKellyCock() | ||||
@@ -387,9 +363,8 @@ contains | |||||
use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | use SimulationVariables!, only: data%Configuration%Hoisting%DriveType, TopDrive_DriveType, Kelly_DriveType | ||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%notifications%CloseSafetyValveLed == v) return | |||||
#endif | |||||
# 383 | |||||
data%State%notifications%CloseSafetyValveLed = v | data%State%notifications%CloseSafetyValveLed = v | ||||
if(data%State%notifications%CloseSafetyValveLed) then | if(data%State%notifications%CloseSafetyValveLed) then | ||||
!!call CloseSafetyValve() | !!call CloseSafetyValve() | ||||
@@ -9,10 +9,6 @@ module CFillupHeadPermission | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_FillupHeadPermission=TopDrive' | |||||
#endif | |||||
!TOPDRIVE-CODE=66 | !TOPDRIVE-CODE=66 | ||||
if (Get_NearFloorConnection() >= 3 .and. Get_NearFloorConnection() <= 10 .and.& | if (Get_NearFloorConnection() >= 3 .and. Get_NearFloorConnection() <= 10 .and.& | ||||
@@ -28,15 +24,7 @@ module CFillupHeadPermission | |||||
endif | endif | ||||
! if (DriveType == Kelly_DriveType) then | ! if (DriveType == Kelly_DriveType) then | ||||
!#ifdef OST | !#ifdef OST | ||||
! if(print_log) print*, 'Evaluate_FillupHeadPermission=Kelly' | ! if(print_log) print*, 'Evaluate_FillupHeadPermission=Kelly' | ||||
@@ -0,0 +1,43 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Permissions/CFillupHeadPermission.f90" | |||||
module CFillupHeadPermission | |||||
use OperationScenariosModule | |||||
implicit none | |||||
contains | |||||
subroutine Evaluate_FillupHeadPermission() | |||||
! use UnitySignalsModule !for CTdsConnectionModesEnum | |||||
implicit none | |||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||||
!TOPDRIVE-CODE=66 | |||||
if (Get_NearFloorConnection() >= 3 .and. Get_NearFloorConnection() <= 10 .and.& | |||||
Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | |||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | |||||
call Set_FillupHeadPermission(.true.) | |||||
return | |||||
end if | |||||
call Set_FillupHeadPermission(.false.) | |||||
endif | |||||
! if (DriveType == Kelly_DriveType) then | |||||
!#ifdef OST | |||||
! if(print_log) print*, 'Evaluate_FillupHeadPermission=Kelly' | |||||
!#endif | |||||
! endif | |||||
end subroutine | |||||
subroutine Subscribe_FillupHeadPermission() | |||||
implicit none | |||||
end subroutine | |||||
end module CFillupHeadPermission |
@@ -12,12 +12,6 @@ module CIrSafetyValvePermission | |||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_IrSafetyValvePermission=TopDrive' | |||||
#endif | |||||
!TOPDRIVE-CODE=55 | !TOPDRIVE-CODE=55 | ||||
if (GetRotaryRpm() == 0.0d0 .and.& | if (GetRotaryRpm() == 0.0d0 .and.& | ||||
(Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 10.0) .and.& | (Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 10.0) .and.& | ||||
@@ -28,21 +22,9 @@ module CIrSafetyValvePermission | |||||
call Set_IrSafetyValvePermission(.true.) | call Set_IrSafetyValvePermission(.true.) | ||||
return | return | ||||
end if | end if | ||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | ||||
if(print_log) print*, 'Evaluate_IrSafetyValvePermission=Kelly' | |||||
!OPERATION-CODE=57 | !OPERATION-CODE=57 | ||||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | if (Get_OperationCondition() == OPERATION_TRIP .and.& | ||||
GetRotaryRpm() == 0.0d0 .and.& | GetRotaryRpm() == 0.0d0 .and.& | ||||
@@ -57,10 +39,6 @@ module CIrSafetyValvePermission | |||||
return | return | ||||
end if | end if | ||||
call Set_IrSafetyValvePermission(.false.) | call Set_IrSafetyValvePermission(.false.) | ||||
endif | endif | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Permissions/CIrSafetyValvePermission.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Permissions/CIrSafetyValvePermission.f90" | |||||
module CIrSafetyValvePermission | module CIrSafetyValvePermission | ||||
use OperationScenariosModule | use OperationScenariosModule | ||||
implicit none | implicit none | ||||
@@ -13,11 +13,6 @@ module CIrSafetyValvePermission | |||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
# 17 | |||||
!TOPDRIVE-CODE=55 | !TOPDRIVE-CODE=55 | ||||
if (GetRotaryRpm() == 0.0d0 .and.& | if (GetRotaryRpm() == 0.0d0 .and.& | ||||
(Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 10.0) .and.& | (Get_NearFloorConnection() >= 3.0 .and. Get_NearFloorConnection() <= 10.0) .and.& | ||||
@@ -28,23 +23,9 @@ module CIrSafetyValvePermission | |||||
call Set_IrSafetyValvePermission(.true.) | call Set_IrSafetyValvePermission(.true.) | ||||
return | return | ||||
end if | end if | ||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | ||||
# 46 | |||||
!OPERATION-CODE=57 | !OPERATION-CODE=57 | ||||
if (Get_OperationCondition() == OPERATION_TRIP .and.& | if (Get_OperationCondition() == OPERATION_TRIP .and.& | ||||
GetRotaryRpm() == 0.0d0 .and.& | GetRotaryRpm() == 0.0d0 .and.& | ||||
@@ -59,10 +40,6 @@ module CIrSafetyValvePermission | |||||
return | return | ||||
end if | end if | ||||
call Set_IrSafetyValvePermission(.false.) | call Set_IrSafetyValvePermission(.false.) | ||||
endif | endif | ||||
@@ -9,42 +9,19 @@ module CSwingDrillPermission | |||||
subroutine Evaluate_SwingDrillPermission() | subroutine Evaluate_SwingDrillPermission() | ||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_SwingDrillPermission=TopDrive' | if(print_log) print*, 'Evaluate_SwingDrillPermission=TopDrive' | ||||
#endif | |||||
!TOPDRIVE-CODE=33 | !TOPDRIVE-CODE=33 | ||||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | ||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
call Set_SwingDrillPermission(.true.) | call Set_SwingDrillPermission(.true.) | ||||
return | return | ||||
end if | end if | ||||
call Set_SwingDrillPermission(.false.) | call Set_SwingDrillPermission(.false.) | ||||
endif | endif | ||||
! if (DriveType == Kelly_DriveType) then | ! if (DriveType == Kelly_DriveType) then | ||||
!#ifdef OST | !#ifdef OST | ||||
! if(print_log) print*, 'Evaluate_SwingDrillPermission=Kelly' | ! if(print_log) print*, 'Evaluate_SwingDrillPermission=Kelly' | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Permissions/CSwingDrillPermission.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Permissions/CSwingDrillPermission.f90" | |||||
module CSwingDrillPermission | module CSwingDrillPermission | ||||
use OperationScenariosModule | use OperationScenariosModule | ||||
use CTopDrivePanelVariables | use CTopDrivePanelVariables | ||||
@@ -10,41 +10,19 @@ module CSwingDrillPermission | |||||
subroutine Evaluate_SwingDrillPermission() | subroutine Evaluate_SwingDrillPermission() | ||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
# 16 | |||||
if(print_log) print*, 'Evaluate_SwingDrillPermission=TopDrive' | |||||
!TOPDRIVE-CODE=33 | !TOPDRIVE-CODE=33 | ||||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | ||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
call Set_SwingDrillPermission(.true.) | call Set_SwingDrillPermission(.true.) | ||||
return | return | ||||
end if | end if | ||||
call Set_SwingDrillPermission(.false.) | call Set_SwingDrillPermission(.false.) | ||||
endif | endif | ||||
! if (DriveType == Kelly_DriveType) then | ! if (DriveType == Kelly_DriveType) then | ||||
!#ifdef OST | !#ifdef OST | ||||
! if(print_log) print*, 'Evaluate_SwingDrillPermission=Kelly' | ! if(print_log) print*, 'Evaluate_SwingDrillPermission=Kelly' | ||||
@@ -7,55 +7,34 @@ module CSwingOffPermission | |||||
subroutine Evaluate_SwingOffPermission() | subroutine Evaluate_SwingOffPermission() | ||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_SwingOffPermission=TopDrive' | if(print_log) print*, 'Evaluate_SwingOffPermission=TopDrive' | ||||
#endif | |||||
!TOPDRIVE-CODE=35 | !TOPDRIVE-CODE=35 | ||||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | ||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||||
Get_Slips() == SLIPS_SET_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||||
Get_Slips() == SLIPS_SET_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
call Set_SwingOffPermission(.true.) | call Set_SwingOffPermission(.true.) | ||||
return | return | ||||
end if | end if | ||||
!TOPDRIVE-CODE=36 | !TOPDRIVE-CODE=36 | ||||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | ||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||||
Get_TdsSwing() == TDS_SWING_DRILL_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||||
Get_TdsSwing() == TDS_SWING_DRILL_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
call Set_SwingOffPermission(.true.) | call Set_SwingOffPermission(.true.) | ||||
return | return | ||||
end if | end if | ||||
call Set_SwingOffPermission(.false.) | call Set_SwingOffPermission(.false.) | ||||
endif | endif | ||||
! if (DriveType == Kelly_DriveType) then | ! if (DriveType == Kelly_DriveType) then | ||||
!#ifdef OST | |||||
! if(print_log) print*, 'Evaluate_SwingOffPermission=Kelly' | ! if(print_log) print*, 'Evaluate_SwingOffPermission=Kelly' | ||||
!#endif | |||||
! endif | ! endif | ||||
end subroutine | end subroutine | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Permissions/CSwingOffPermission.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Permissions/CSwingOffPermission.f90" | |||||
module CSwingOffPermission | module CSwingOffPermission | ||||
use OperationScenariosModule | use OperationScenariosModule | ||||
implicit none | implicit none | ||||
@@ -8,54 +8,34 @@ module CSwingOffPermission | |||||
subroutine Evaluate_SwingOffPermission() | subroutine Evaluate_SwingOffPermission() | ||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
# 14 | |||||
if(print_log) print*, 'Evaluate_SwingOffPermission=TopDrive' | |||||
!TOPDRIVE-CODE=35 | !TOPDRIVE-CODE=35 | ||||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | ||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||||
Get_Slips() == SLIPS_SET_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||||
Get_TdsSwing() == TDS_SWING_TILT_END .and.& | |||||
Get_Slips() == SLIPS_SET_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
call Set_SwingOffPermission(.true.) | call Set_SwingOffPermission(.true.) | ||||
return | return | ||||
end if | end if | ||||
!TOPDRIVE-CODE=36 | !TOPDRIVE-CODE=36 | ||||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | ||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||||
Get_TdsSwing() == TDS_SWING_DRILL_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||||
Get_TdsSwing() == TDS_SWING_DRILL_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
call Set_SwingOffPermission(.true.) | call Set_SwingOffPermission(.true.) | ||||
return | return | ||||
end if | end if | ||||
call Set_SwingOffPermission(.false.) | call Set_SwingOffPermission(.false.) | ||||
endif | endif | ||||
! if (DriveType == Kelly_DriveType) then | ! if (DriveType == Kelly_DriveType) then | ||||
!#ifdef OST | |||||
! if(print_log) print*, 'Evaluate_SwingOffPermission=Kelly' | ! if(print_log) print*, 'Evaluate_SwingOffPermission=Kelly' | ||||
!#endif | |||||
! endif | ! endif | ||||
end subroutine | end subroutine | ||||
@@ -10,35 +10,21 @@ module CSwingTiltPermission | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_SwingTiltPermission=TopDrive' | if(print_log) print*, 'Evaluate_SwingTiltPermission=TopDrive' | ||||
#endif | |||||
!TOPDRIVE-CODE=34 | !TOPDRIVE-CODE=34 | ||||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | ||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
Get_Slips() == SLIPS_SET_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
Get_Slips() == SLIPS_SET_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
call Set_SwingTiltPermission(.true.) | call Set_SwingTiltPermission(.true.) | ||||
return | return | ||||
end if | end if | ||||
call Set_SwingTiltPermission(.false.) | call Set_SwingTiltPermission(.false.) | ||||
endif | endif | ||||
! if (DriveType == Kelly_DriveType) then | ! if (DriveType == Kelly_DriveType) then | ||||
!#ifdef OST | !#ifdef OST | ||||
! if(print_log) print*, 'Evaluate_SwingTiltPermission=Kelly' | ! if(print_log) print*, 'Evaluate_SwingTiltPermission=Kelly' | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/Permissions/CSwingTiltPermission.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Permissions/CSwingTiltPermission.f90" | |||||
module CSwingTiltPermission | module CSwingTiltPermission | ||||
use UnitySignalsModule | use UnitySignalsModule | ||||
use OperationScenariosModule | use OperationScenariosModule | ||||
@@ -11,34 +11,21 @@ module CSwingTiltPermission | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
# 15 | |||||
if(print_log) print*, 'Evaluate_SwingTiltPermission=TopDrive' | |||||
!TOPDRIVE-CODE=34 | !TOPDRIVE-CODE=34 | ||||
if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | if (Get_TdsElevatorModes() == TDS_ELEVATOR_CONNECTION_NOTHING .and.& | ||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
Get_Slips() == SLIPS_SET_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING .and.& | |||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
Get_Slips() == SLIPS_SET_END .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF) then | |||||
call Set_SwingTiltPermission(.true.) | call Set_SwingTiltPermission(.true.) | ||||
return | return | ||||
end if | end if | ||||
call Set_SwingTiltPermission(.false.) | call Set_SwingTiltPermission(.false.) | ||||
endif | endif | ||||
! if (DriveType == Kelly_DriveType) then | ! if (DriveType == Kelly_DriveType) then | ||||
!#ifdef OST | !#ifdef OST | ||||
! if(print_log) print*, 'Evaluate_SwingTiltPermission=Kelly' | ! if(print_log) print*, 'Evaluate_SwingTiltPermission=Kelly' | ||||
@@ -0,0 +1,169 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Permissions/Permissions.f90" | |||||
module PermissionsModule | |||||
use SimulationVariables | |||||
implicit none | |||||
contains | |||||
subroutine Set_SwingTiltPermission(v) | |||||
implicit none | |||||
logical , intent(in) :: v | |||||
# 11 | |||||
data%State%permissions%SwingTiltPermission = v | |||||
# 15 | |||||
!**call data%State%permissions%OnSwingTiltPermissionChange%RunAll() | |||||
end subroutine | |||||
logical function Get_SwingTiltPermission() | |||||
implicit none | |||||
Get_SwingTiltPermission = data%State%permissions%SwingTiltPermission | |||||
end function | |||||
subroutine Set_SwingOffPermission(v) | |||||
implicit none | |||||
logical , intent(in) :: v | |||||
# 29 | |||||
data%State%permissions%SwingOffPermission = v | |||||
# 33 | |||||
!**call data%State%permissions%OnSwingOffPermissionChange%RunAll() | |||||
end subroutine | |||||
logical function Get_SwingOffPermission() | |||||
implicit none | |||||
Get_SwingOffPermission = data%State%permissions%SwingOffPermission | |||||
end function | |||||
subroutine Set_SwingDrillPermission(v) | |||||
implicit none | |||||
logical , intent(in) :: v | |||||
# 47 | |||||
data%State%permissions%SwingDrillPermission = v | |||||
# 51 | |||||
!**call data%State%permissions%OnSwingDrillPermissionChange%RunAll() | |||||
end subroutine | |||||
logical function Get_SwingDrillPermission() | |||||
implicit none | |||||
Get_SwingDrillPermission = data%State%permissions%SwingDrillPermission | |||||
end function | |||||
subroutine Set_RemoveMudBucketPermission(v) | |||||
implicit none | |||||
logical , intent(in) :: v | |||||
# 65 | |||||
data%State%permissions%RemoveMudBucketPermission = v | |||||
# 69 | |||||
!**call data%State%permissions%OnRemoveMudBucketPermissionChange%RunAll() | |||||
end subroutine | |||||
logical function Get_RemoveMudBucketPermission() | |||||
implicit none | |||||
Get_RemoveMudBucketPermission = data%State%permissions%RemoveMudBucketPermission | |||||
end function | |||||
subroutine Set_RemoveFillupHeadPermission(v) | |||||
implicit none | |||||
logical , intent(in) :: v | |||||
# 84 | |||||
data%State%permissions%RemoveFillupHeadPermission = v | |||||
# 88 | |||||
!**call data%State%permissions%OnRemoveFillupHeadPermissionChange%RunAll() | |||||
end subroutine | |||||
logical function Get_RemoveFillupHeadPermission() | |||||
implicit none | |||||
Get_RemoveFillupHeadPermission = data%State%permissions%RemoveFillupHeadPermission | |||||
end function | |||||
subroutine Set_IrSafetyValvePermission(v) | |||||
implicit none | |||||
logical , intent(in) :: v | |||||
# 102 | |||||
data%State%permissions%IrSafetyValvePermission = v | |||||
# 106 | |||||
!**call data%State%permissions%OnIrSafetyValvePermissionChange%RunAll() | |||||
end subroutine | |||||
logical function Get_IrSafetyValvePermission() | |||||
implicit none | |||||
Get_IrSafetyValvePermission = data%State%permissions%IrSafetyValvePermission | |||||
end function | |||||
subroutine Set_IrIbopPermission(v) | |||||
implicit none | |||||
logical , intent(in) :: v | |||||
# 120 | |||||
data%State%permissions%IrIbopPermission = v | |||||
# 124 | |||||
!**call data%State%permissions%OnIrIbopPermissionChange%RunAll() | |||||
end subroutine | |||||
logical function Get_IrIbopPermission() | |||||
implicit none | |||||
Get_IrIbopPermission = data%State%permissions%IrIbopPermission | |||||
end function | |||||
subroutine Set_InstallMudBucketPermission(v) | |||||
implicit none | |||||
logical , intent(in) :: v | |||||
# 139 | |||||
data%State%permissions%InstallMudBucketPermission = v | |||||
# 143 | |||||
!**call data%State%permissions%OnInstallMudBucketPermissionChange%RunAll() | |||||
end subroutine | |||||
logical function Get_InstallMudBucketPermission() | |||||
implicit none | |||||
Get_InstallMudBucketPermission = data%State%permissions%InstallMudBucketPermission | |||||
end function | |||||
subroutine Set_InstallFillupHeadPermission(v) | |||||
implicit none | |||||
logical , intent(in) :: v | |||||
# 157 | |||||
data%State%permissions%InstallFillupHeadPermission = v | |||||
# 161 | |||||
!**call data%State%permissions%OnInstallFillupHeadPermissionChange%RunAll() | |||||
end subroutine | |||||
logical function Get_InstallFillupHeadPermission() | |||||
implicit none | |||||
Get_InstallFillupHeadPermission = data%State%permissions%InstallFillupHeadPermission | |||||
end function | |||||
subroutine Set_FillupHeadPermission(v) | |||||
implicit none | |||||
logical , intent(in) :: v | |||||
# 175 | |||||
data%State%permissions%FillupHeadPermission = v | |||||
# 179 | |||||
!**call data%State%permissions%OnFillupHeadPermissionChange%RunAll() | |||||
end subroutine | |||||
logical function Get_FillupHeadPermission() | |||||
implicit none | |||||
Get_FillupHeadPermission = data%State%permissions%FillupHeadPermission | |||||
end function | |||||
end module PermissionsModule |
@@ -0,0 +1,17 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Permissions/PermissionsVariables.f90" | |||||
module PermissionsVariables | |||||
! use CVoidEventHandlerCollection | |||||
type::PermissionsType | |||||
logical :: FillupHeadPermission = .false. | |||||
logical :: InstallFillupHeadPermission = .false. | |||||
logical :: InstallMudBucketPermission = .false. | |||||
logical :: IrIbopPermission = .false. | |||||
logical :: IrSafetyValvePermission = .false. | |||||
logical :: RemoveFillupHeadPermission = .false. | |||||
logical :: RemoveMudBucketPermission = .false. | |||||
logical :: SwingDrillPermission = .false. | |||||
logical :: SwingOffPermission = .false. | |||||
logical :: SwingTiltPermission = .false. | |||||
end type PermissionsType | |||||
contains | |||||
end module |
@@ -18,7 +18,12 @@ module SoftwareInputsModule | |||||
logical function Get_ZeroStringSpeed() | logical function Get_ZeroStringSpeed() | ||||
implicit none | implicit none | ||||
Get_ZeroStringSpeed = data%State%softwareInputs%ZeroStringSpeed | |||||
if(abs(data%State%Drawworks%HookLinearVelocity_final)<0.2) then | |||||
Get_ZeroStringSpeed = .TRUE. | |||||
else | |||||
Get_ZeroStringSpeed = .FALSE. | |||||
endif | |||||
!data%State%softwareInputs%ZeroStringSpeed | |||||
!Get_ZeroStringSpeed = .true. | !Get_ZeroStringSpeed = .true. | ||||
end function | end function | ||||
@@ -153,6 +158,7 @@ module SoftwareInputsModule | |||||
!Get_IbopHeight = 23.0 | !Get_IbopHeight = 23.0 | ||||
end function | end function | ||||
!//TODO: Investigate this hookheight! why two hook height?! | |||||
subroutine Set_HookHeight(v) | subroutine Set_HookHeight(v) | ||||
implicit none | implicit none | ||||
real , intent(in) :: v | real , intent(in) :: v | ||||
@@ -168,6 +174,7 @@ module SoftwareInputsModule | |||||
real function Get_HookHeight() | real function Get_HookHeight() | ||||
implicit none | implicit none | ||||
Get_HookHeight = data%State%softwareInputs%HookHeight | |||||
! Get_HookHeight = data%State%softwareInputs%HookHeight | |||||
Get_HookHeight = data%State%Drawworks%Hook_Height_final | |||||
end function | end function | ||||
end module SoftwareInputsModule | end module SoftwareInputsModule |
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/SoftwareInputs.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/SoftwareInputs.f90" | |||||
module SoftwareInputsModule | module SoftwareInputsModule | ||||
use SimulationVariables | use SimulationVariables | ||||
@@ -7,32 +7,33 @@ module SoftwareInputsModule | |||||
subroutine Set_ZeroStringSpeed(v) | subroutine Set_ZeroStringSpeed(v) | ||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%softwareInputs%ZeroStringSpeed == v) return | |||||
#endif | |||||
# 11 | |||||
data%State%softwareInputs%ZeroStringSpeed = v | data%State%softwareInputs%ZeroStringSpeed = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'ZeroStringSpeed=', data%State%softwareInputs%ZeroStringSpeed | |||||
#endif | |||||
# 15 | |||||
! call data%State%softwareInputs%OnZeroStringSpeedChange%RunAll() | ! call data%State%softwareInputs%OnZeroStringSpeedChange%RunAll() | ||||
end subroutine | end subroutine | ||||
logical function Get_ZeroStringSpeed() | logical function Get_ZeroStringSpeed() | ||||
implicit none | implicit none | ||||
Get_ZeroStringSpeed = data%State%softwareInputs%ZeroStringSpeed | |||||
if(abs(data%State%Drawworks%HookLinearVelocity_final)<0.2) then | |||||
Get_ZeroStringSpeed = .TRUE. | |||||
else | |||||
Get_ZeroStringSpeed = .FALSE. | |||||
endif | |||||
!data%State%softwareInputs%ZeroStringSpeed | |||||
!Get_ZeroStringSpeed = .true. | !Get_ZeroStringSpeed = .true. | ||||
end function | end function | ||||
subroutine Set_TdsStemJointHeight(v) | subroutine Set_TdsStemJointHeight(v) | ||||
implicit none | implicit none | ||||
real , intent(in) :: v | real , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%softwareInputs%TdsStemJointHeight == v) return | |||||
#endif | |||||
# 35 | |||||
data%State%softwareInputs%TdsStemJointHeight = v | data%State%softwareInputs%TdsStemJointHeight = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'TdsStemJointHeight=', data%State%softwareInputs%TdsStemJointHeight | |||||
#endif | |||||
# 39 | |||||
! call data%State%softwareInputs%OnTdsStemJointHeightChange%RunAll() | ! call data%State%softwareInputs%OnTdsStemJointHeightChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -45,13 +46,11 @@ module SoftwareInputsModule | |||||
subroutine Set_StringPressure(v) | subroutine Set_StringPressure(v) | ||||
implicit none | implicit none | ||||
real , intent(in) :: v | real , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%softwareInputs%StringPressure == v) return | |||||
#endif | |||||
# 54 | |||||
data%State%softwareInputs%StringPressure = v | data%State%softwareInputs%StringPressure = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'StringPressure=', data%State%softwareInputs%StringPressure | |||||
#endif | |||||
# 58 | |||||
! call data%State%softwareInputs%OnStringPressureChange%RunAll() | ! call data%State%softwareInputs%OnStringPressureChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -63,13 +62,11 @@ module SoftwareInputsModule | |||||
subroutine Set_StandRack(v) | subroutine Set_StandRack(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%softwareInputs%StandRack == v) return | |||||
#endif | |||||
# 72 | |||||
data%State%softwareInputs%StandRack = v | data%State%softwareInputs%StandRack = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'StandRack=', data%State%softwareInputs%StandRack | |||||
#endif | |||||
# 76 | |||||
! call data%State%softwareInputs%OnStandRackChanged%RunAll() | ! call data%State%softwareInputs%OnStandRackChanged%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -81,13 +78,11 @@ module SoftwareInputsModule | |||||
subroutine Set_SlackOff(v) | subroutine Set_SlackOff(v) | ||||
implicit none | implicit none | ||||
logical , intent(in) :: v | logical , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%softwareInputs%SlackOff == v) return | |||||
#endif | |||||
# 90 | |||||
data%State%softwareInputs%SlackOff = v | data%State%softwareInputs%SlackOff = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'SlackOff=', data%State%softwareInputs%SlackOff | |||||
#endif | |||||
# 94 | |||||
! call data%State%softwareInputs%OnSlackOffChange%RunAll() | ! call data%State%softwareInputs%OnSlackOffChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -99,13 +94,11 @@ module SoftwareInputsModule | |||||
subroutine Set_SafetyValveHeight(v) | subroutine Set_SafetyValveHeight(v) | ||||
implicit none | implicit none | ||||
real , intent(in) :: v | real , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%softwareInputs%SafetyValveHeight == v) return | |||||
#endif | |||||
# 108 | |||||
data%State%softwareInputs%SafetyValveHeight = v | data%State%softwareInputs%SafetyValveHeight = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'SafetyValveHeight=', data%State%softwareInputs%SafetyValveHeight | |||||
#endif | |||||
# 112 | |||||
! call data%State%softwareInputs%OnSafetyValveHeightChange%RunAll() | ! call data%State%softwareInputs%OnSafetyValveHeightChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -119,13 +112,11 @@ module SoftwareInputsModule | |||||
subroutine Set_NearFloorConnection(v) | subroutine Set_NearFloorConnection(v) | ||||
implicit none | implicit none | ||||
real , intent(in) :: v | real , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%softwareInputs%NearFloorConnection == v) return | |||||
#endif | |||||
# 128 | |||||
data%State%softwareInputs%NearFloorConnection = v | data%State%softwareInputs%NearFloorConnection = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'NearFloorConnection=', data%State%softwareInputs%NearFloorConnection | |||||
#endif | |||||
# 132 | |||||
! call data%State%softwareInputs%OnNearFloorConnectionChange%RunAll() | ! call data%State%softwareInputs%OnNearFloorConnectionChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -138,13 +129,11 @@ module SoftwareInputsModule | |||||
subroutine Set_IbopHeight(v) | subroutine Set_IbopHeight(v) | ||||
implicit none | implicit none | ||||
real , intent(in) :: v | real , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%softwareInputs%IbopHeight == v) return | |||||
#endif | |||||
# 147 | |||||
data%State%softwareInputs%IbopHeight = v | data%State%softwareInputs%IbopHeight = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'IbopHeight=', data%State%softwareInputs%IbopHeight | |||||
#endif | |||||
# 151 | |||||
! call data%State%softwareInputs%OnIbopHeightChange%RunAll() | ! call data%State%softwareInputs%OnIbopHeightChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -154,21 +143,21 @@ module SoftwareInputsModule | |||||
!Get_IbopHeight = 23.0 | !Get_IbopHeight = 23.0 | ||||
end function | end function | ||||
!//TODO: Investigate this hookheight! why two hook height?! | |||||
subroutine Set_HookHeight(v) | subroutine Set_HookHeight(v) | ||||
implicit none | implicit none | ||||
real , intent(in) :: v | real , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%softwareInputs%HookHeight == v) return | |||||
#endif | |||||
# 167 | |||||
data%State%softwareInputs%HookHeight = v | data%State%softwareInputs%HookHeight = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'HookHeight=', data%State%softwareInputs%HookHeight | |||||
#endif | |||||
# 171 | |||||
! call data%State%softwareInputs%OnHookHeightChange%RunAll() | ! call data%State%softwareInputs%OnHookHeightChange%RunAll() | ||||
end subroutine | end subroutine | ||||
real function Get_HookHeight() | real function Get_HookHeight() | ||||
implicit none | implicit none | ||||
Get_HookHeight = data%State%softwareInputs%HookHeight | |||||
! Get_HookHeight = data%State%softwareInputs%HookHeight | |||||
Get_HookHeight = data%State%Drawworks%Hook_Height_final | |||||
end function | end function | ||||
end module SoftwareInputsModule | end module SoftwareInputsModule |
@@ -12,7 +12,6 @@ module SoftwareInputsVariables | |||||
real :: TdsStemJointHeight = 0 | real :: TdsStemJointHeight = 0 | ||||
logical :: ZeroStringSpeed = .false. | logical :: ZeroStringSpeed = .false. | ||||
end type SoftwareInputsType | end type SoftwareInputsType | ||||
! type(SoftwareInputsType):: softwareInputs | |||||
contains | contains | ||||
@@ -1,12 +1,14 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Unity/CUnityInputs.f90" | # 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/Unity/CUnityInputs.f90" | ||||
module CUnityInputs | module CUnityInputs | ||||
! use CVoidEventHandlerCollection | ! use CVoidEventHandlerCollection | ||||
implicit none | |||||
implicit none | |||||
type :: UnityInputsType | type :: UnityInputsType | ||||
!Input from unity to fortran | |||||
logical :: ElevatorConnectionPossible | logical :: ElevatorConnectionPossible | ||||
logical :: JointConnectionPossible | logical :: JointConnectionPossible | ||||
logical :: IsKellyBushingSetInTable | logical :: IsKellyBushingSetInTable | ||||
logical :: ElevatorPickup | |||||
logical :: ElevatorPickup | |||||
!only used in set and get | |||||
logical :: NearFloorPosition | logical :: NearFloorPosition | ||||
logical :: SingleSetInMouseHole | logical :: SingleSetInMouseHole | ||||
logical :: TdsConnectionPossible | logical :: TdsConnectionPossible | ||||
@@ -3,31 +3,27 @@ module UnityModule | |||||
use SimulationVariables | use SimulationVariables | ||||
implicit none | implicit none | ||||
contains | contains | ||||
subroutine UnityInputsFromJson(parent) | |||||
use json_module,IK =>json_ik | |||||
type(json_value),pointer :: parent | |||||
type(json_core) :: json | |||||
type(json_value),pointer :: p,pval | |||||
call json%get(parent,'Unity',p) | |||||
call json%get(p,'ElevatorConnectionPossible',pval) | |||||
call json%get(pval,data%Equipments%UnityInputs%ElevatorConnectionPossible) | |||||
call json%get(p,'JointConnectionPossible',pval) | |||||
call json%get(pval,data%Equipments%UnityInputs%JointConnectionPossible) | |||||
call json%get(p,'IsKellyBushingSetInTable',pval) | |||||
call json%get(pval,data%Equipments%UnityInputs%IsKellyBushingSetInTable) | |||||
call json%get(p,'ElevatorPickup',pval) | |||||
call json%get(pval,data%Equipments%UnityInputs%ElevatorPickup) | |||||
call json%get(p,'NearFloorPosition',pval) | |||||
call json%get(pval,data%Equipments%UnityInputs%NearFloorPosition) | |||||
call json%get(p,'SingleSetInMouseHole',pval) | |||||
call json%get(pval,data%Equipments%UnityInputs%SingleSetInMouseHole) | |||||
call json%get(p,'TdsConnectionPossible',pval) | |||||
call json%get(pval,data%Equipments%UnityInputs%TdsConnectionPossible) | |||||
call json%get(p,'TdsStemIn',pval) | |||||
call json%get(pval,data%Equipments%UnityInputs%TdsStemIn) | |||||
end subroutine | |||||
subroutine UnityInputsFromJson(jsonfile) | |||||
type(json_file)::jsonfile | |||||
logical::found | |||||
call jsonfile%get('UnityInputs.ElevatorConnectionPossible',data%Equipments%UnityInputs%ElevatorConnectionPossible,found) | |||||
if ( .not. found ) call logg(4,"Not found: UnityInputs%ElevatorConnectionPossible") | |||||
call jsonfile%get('UnityInputs.JointConnectionPossible',data%Equipments%UnityInputs%JointConnectionPossible,found) | |||||
if ( .not. found ) call logg(4,"Not found: UnityInputs%JointConnectionPossible") | |||||
call jsonfile%get('UnityInputs.IsKellyBushingSetInTable',data%Equipments%UnityInputs%IsKellyBushingSetInTable,found) | |||||
if ( .not. found ) call logg(4,"Not found: UnityInputs%IsKellyBushingSetInTable") | |||||
call jsonfile%get('UnityInputs.ElevatorPickup',data%Equipments%UnityInputs%ElevatorPickup,found) | |||||
if ( .not. found ) call logg(4,"Not found: UnityInputs%ElevatorPickup") | |||||
call jsonfile%get('UnityInputs.NearFloorPosition',data%Equipments%UnityInputs%NearFloorPosition,found) | |||||
if ( .not. found ) call logg(4,"Not found: UnityInputs%NearFloorPosition") | |||||
call jsonfile%get('UnityInputs.SingleSetInMouseHole',data%Equipments%UnityInputs%SingleSetInMouseHole,found) | |||||
if ( .not. found ) call logg(4,"Not found: UnityInputs%SingleSetInMouseHole") | |||||
call jsonfile%get('UnityInputs.TdsConnectionPossible',data%Equipments%UnityInputs%TdsConnectionPossible,found) | |||||
if ( .not. found ) call logg(4,"Not found: UnityInputs%TdsConnectionPossible") | |||||
call jsonfile%get('UnityInputs.TdsStemIn',data%Equipments%UnityInputs%TdsStemIn,found) | |||||
if ( .not. found ) call logg(4,"Not found: UnityInputs%TdsStemIn") | |||||
end subroutine | |||||
subroutine UnityOutputsToJson(parent) | subroutine UnityOutputsToJson(parent) | ||||
type(json_value),pointer :: parent | type(json_value),pointer :: parent | ||||
@@ -101,7 +97,7 @@ subroutine Set_BlowoutFromString(v) | |||||
implicit none | implicit none | ||||
logical, intent (in) :: v | logical, intent (in) :: v | ||||
data%Equipments%UnityOutputs%BlowoutFromString = v | data%Equipments%UnityOutputs%BlowoutFromString = v | ||||
# 105 | |||||
# 101 | |||||
end subroutine | end subroutine | ||||
@@ -114,7 +110,7 @@ subroutine Set_BlowoutFromAnnular(v) | |||||
implicit none | implicit none | ||||
logical, intent (in) :: v | logical, intent (in) :: v | ||||
data%Equipments%UnityOutputs%BlowoutFromAnnular = v | data%Equipments%UnityOutputs%BlowoutFromAnnular = v | ||||
# 119 | |||||
# 115 | |||||
end subroutine | end subroutine | ||||
@@ -131,7 +127,7 @@ subroutine Set_FlowFromReturnLine(v) | |||||
implicit none | implicit none | ||||
logical, intent (in) :: v | logical, intent (in) :: v | ||||
data%Equipments%UnityOutputs%FlowFromReturnLine = v | data%Equipments%UnityOutputs%FlowFromReturnLine = v | ||||
# 137 | |||||
# 133 | |||||
end subroutine | end subroutine | ||||
@@ -146,7 +142,7 @@ subroutine Set_FlowFromKelly(v) | |||||
implicit none | implicit none | ||||
real, intent (in) :: v | real, intent (in) :: v | ||||
data%Equipments%UnityOutputs%FlowFromKelly = v | data%Equipments%UnityOutputs%FlowFromKelly = v | ||||
# 153 | |||||
# 149 | |||||
end subroutine | end subroutine | ||||
@@ -163,7 +159,7 @@ subroutine Set_FlowFromFillupHead(v) | |||||
implicit none | implicit none | ||||
real, intent (in) :: v | real, intent (in) :: v | ||||
data%Equipments%UnityOutputs%FlowFromFillupHead = v | data%Equipments%UnityOutputs%FlowFromFillupHead = v | ||||
# 171 | |||||
# 167 | |||||
end subroutine | end subroutine | ||||
@@ -181,7 +177,7 @@ subroutine Set_FlowKellyDisconnect(v) | |||||
implicit none | implicit none | ||||
logical, intent (in) :: v | logical, intent (in) :: v | ||||
data%Equipments%UnityOutputs%FlowKellyDisconnect = v | data%Equipments%UnityOutputs%FlowKellyDisconnect = v | ||||
# 190 | |||||
# 186 | |||||
end subroutine | end subroutine | ||||
@@ -197,7 +193,7 @@ subroutine Set_FlowPipeDisconnect(v) | |||||
implicit none | implicit none | ||||
logical, intent (in) :: v | logical, intent (in) :: v | ||||
data%Equipments%UnityOutputs%FlowPipeDisconnect = v | data%Equipments%UnityOutputs%FlowPipeDisconnect = v | ||||
# 207 | |||||
# 203 | |||||
end subroutine | end subroutine | ||||
@@ -210,7 +206,7 @@ subroutine Set_BlowoutFromStringPercent(v) | |||||
implicit none | implicit none | ||||
real(8), intent (in) :: v | real(8), intent (in) :: v | ||||
data%Equipments%UnityOutputs%BlowoutFromStringPercent = v | data%Equipments%UnityOutputs%BlowoutFromStringPercent = v | ||||
# 221 | |||||
# 217 | |||||
end subroutine | end subroutine | ||||
@@ -226,7 +222,7 @@ subroutine Calc_KellyHoseVibrationRate(spm1, spm2) | |||||
real :: total | real :: total | ||||
total = (spm1 + spm2)/2 | total = (spm1 + spm2)/2 | ||||
data%Equipments%UnityOutputs%KellyHoseVibrationRate = ScaleRange(total, 0.0, 10.0, 0.0, 120.0) | data%Equipments%UnityOutputs%KellyHoseVibrationRate = ScaleRange(total, 0.0, 10.0, 0.0, 120.0) | ||||
# 238 | |||||
# 234 | |||||
end subroutine | end subroutine | ||||
@@ -239,7 +235,7 @@ subroutine Set_Pedal(v) | |||||
implicit none | implicit none | ||||
real(8), intent (in) :: v | real(8), intent (in) :: v | ||||
data%Equipments%UnityOutputs%Pedal = v | data%Equipments%UnityOutputs%Pedal = v | ||||
# 252 | |||||
# 248 | |||||
end subroutine | end subroutine | ||||
@@ -252,7 +248,7 @@ subroutine Set_FlowRate(v) | |||||
implicit none | implicit none | ||||
real(8), intent (in) :: v | real(8), intent (in) :: v | ||||
data%Equipments%UnityOutputs%FlowRate = v | data%Equipments%UnityOutputs%FlowRate = v | ||||
# 266 | |||||
# 262 | |||||
end subroutine | end subroutine | ||||
@@ -265,7 +261,7 @@ subroutine Set_RotaryRpm(v) | |||||
implicit none | implicit none | ||||
real(8), intent (in) :: v | real(8), intent (in) :: v | ||||
data%Equipments%UnityOutputs%RotaryRpm = v | data%Equipments%UnityOutputs%RotaryRpm = v | ||||
# 280 | |||||
# 276 | |||||
end subroutine | end subroutine | ||||
@@ -7,45 +7,26 @@ module CTdsBackupClamp | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsBackupClamp=TopDrive' | |||||
#endif | |||||
!TOPDRIVE-CODE=79 | !TOPDRIVE-CODE=79 | ||||
if(Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_END .and.& | if(Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_END .and.& | ||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTorqueWrench) then | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTorqueWrench) then | |||||
call Set_TdsBackupClamp(BACKUP_CLAMP_FW_BEGIN) | call Set_TdsBackupClamp(BACKUP_CLAMP_FW_BEGIN) | ||||
endif | endif | ||||
!TOPDRIVE-CODE=80 | !TOPDRIVE-CODE=80 | ||||
if(Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_END .and.& | if(Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_END .and.& | ||||
Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_BEGIN .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTorqueWrench == .false.) then | |||||
Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_BEGIN .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTorqueWrench == .false.) then | |||||
call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_BEGIN) | call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_BEGIN) | ||||
endif | endif | ||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsBackupClamp=Kelly' | |||||
#endif | |||||
endif | |||||
! if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_TdsBackupClamp=Kelly' | |||||
! endif | |||||
end subroutine | end subroutine | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/UnitySignals/CTdsBackupClamp.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/UnitySignals/CTdsBackupClamp.f90" | |||||
module CTdsBackupClamp | module CTdsBackupClamp | ||||
use OperationScenariosModule | use OperationScenariosModule | ||||
implicit none | implicit none | ||||
@@ -8,43 +8,26 @@ module CTdsBackupClamp | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
# 12 | |||||
!TOPDRIVE-CODE=79 | !TOPDRIVE-CODE=79 | ||||
if(Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_END .and.& | if(Get_TdsBackupClamp() == BACKUP_CLAMP_OFF_END .and.& | ||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTorqueWrench) then | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTorqueWrench) then | |||||
call Set_TdsBackupClamp(BACKUP_CLAMP_FW_BEGIN) | call Set_TdsBackupClamp(BACKUP_CLAMP_FW_BEGIN) | ||||
endif | endif | ||||
!TOPDRIVE-CODE=80 | !TOPDRIVE-CODE=80 | ||||
if(Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_END .and.& | if(Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_END .and.& | ||||
Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_BEGIN .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTorqueWrench == .false.) then | |||||
Get_TdsBackupClamp() /= BACKUP_CLAMP_OFF_BEGIN .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState /= TdsPower_OFF .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveTorqueWrench == .false.) then | |||||
call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_BEGIN) | call Set_TdsBackupClamp(BACKUP_CLAMP_OFF_BEGIN) | ||||
endif | endif | ||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
# 47 | |||||
endif | |||||
! if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_TdsBackupClamp=Kelly' | |||||
! endif | |||||
end subroutine | end subroutine | ||||
@@ -9,9 +9,7 @@ module CTdsSpineEnum | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsSpine=TopDrive' | if(print_log) print*, 'Evaluate_TdsSpine=TopDrive' | ||||
#endif | |||||
!TOPDRIVE-CODE=83 | !TOPDRIVE-CODE=83 | ||||
if (Get_TdsStemIn() .and.& | if (Get_TdsStemIn() .and.& | ||||
@@ -35,23 +33,11 @@ module CTdsSpineEnum | |||||
return | return | ||||
end if | end if | ||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsSpine=Kelly' | |||||
#endif | |||||
endif | |||||
! if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_TdsSpine=Kelly' | |||||
! endif | |||||
end subroutine | end subroutine | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/UnitySignals/CTdsSpineEnum.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/UnitySignals/CTdsSpineEnum.f90" | |||||
module CTdsSpineEnum | module CTdsSpineEnum | ||||
use OperationScenariosModule | use OperationScenariosModule | ||||
use UnityModule | use UnityModule | ||||
@@ -10,8 +10,7 @@ module CTdsSpineEnum | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
# 14 | |||||
if(print_log) print*, 'Evaluate_TdsSpine=TopDrive' | |||||
!TOPDRIVE-CODE=83 | !TOPDRIVE-CODE=83 | ||||
if (Get_TdsStemIn() .and.& | if (Get_TdsStemIn() .and.& | ||||
@@ -35,22 +34,11 @@ module CTdsSpineEnum | |||||
return | return | ||||
end if | end if | ||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
# 53 | |||||
endif | |||||
! if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_TdsSpine=Kelly' | |||||
! endif | |||||
end subroutine | end subroutine | ||||
@@ -9,17 +9,12 @@ module CTdsSwingEnum | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsSwing=TopDrive' | if(print_log) print*, 'Evaluate_TdsSwing=TopDrive' | ||||
#endif | |||||
!TOPDRIVE-CODE=37 | !TOPDRIVE-CODE=37 | ||||
if (Get_SwingDrillPermission() .and.& | if (Get_SwingDrillPermission() .and.& | ||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
Get_FillMouseHoleLed() == .false. .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_DRILL) then | |||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
Get_FillMouseHoleLed() == .false. .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_DRILL) then | |||||
call Set_TdsSwing(TDS_SWING_DRILL_BEGIN) | call Set_TdsSwing(TDS_SWING_DRILL_BEGIN) | ||||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | ||||
return | return | ||||
@@ -115,17 +110,6 @@ module CTdsSwingEnum | |||||
endif | endif | ||||
! if (DriveType == Kelly_DriveType) then | ! if (DriveType == Kelly_DriveType) then | ||||
!#ifdef OST | !#ifdef OST | ||||
! if(print_log) print*, 'Evaluate_TdsSwing=Kelly' | ! if(print_log) print*, 'Evaluate_TdsSwing=Kelly' | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/UnitySignals/CTdsSwingEnum.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/UnitySignals/CTdsSwingEnum.f90" | |||||
module CTdsSwingEnum | module CTdsSwingEnum | ||||
use OperationScenariosModule | use OperationScenariosModule | ||||
use SimulationVariables | use SimulationVariables | ||||
@@ -10,16 +10,12 @@ module CTdsSwingEnum | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
# 14 | |||||
if(print_log) print*, 'Evaluate_TdsSwing=TopDrive' | |||||
!TOPDRIVE-CODE=37 | !TOPDRIVE-CODE=37 | ||||
if (Get_SwingDrillPermission() .and.& | if (Get_SwingDrillPermission() .and.& | ||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
Get_FillMouseHoleLed() == .false. .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_DRILL) then | |||||
Get_TdsSwing() == TDS_SWING_OFF_END .and.& | |||||
Get_FillMouseHoleLed() == .false. .and.& | |||||
data%Equipments%TopDrivePanel%TopDriveLinkTiltState == TdsLinkTilt_DRILL) then | |||||
call Set_TdsSwing(TDS_SWING_DRILL_BEGIN) | call Set_TdsSwing(TDS_SWING_DRILL_BEGIN) | ||||
data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | data%Equipments%TopDrivePanel%TopDriveLinkTiltLed = LED_ON | ||||
return | return | ||||
@@ -115,17 +111,6 @@ module CTdsSwingEnum | |||||
endif | endif | ||||
! if (DriveType == Kelly_DriveType) then | ! if (DriveType == Kelly_DriveType) then | ||||
!#ifdef OST | !#ifdef OST | ||||
! if(print_log) print*, 'Evaluate_TdsSwing=Kelly' | ! if(print_log) print*, 'Evaluate_TdsSwing=Kelly' | ||||
@@ -7,21 +7,15 @@ module CTdsTongEnum | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsTong=TopDrive' | |||||
#endif | |||||
!TOPDRIVE-CODE=1 | !TOPDRIVE-CODE=1 | ||||
if (Get_TdsConnectionModes() == TDS_CONNECTION_SPINE .and.& | if (Get_TdsConnectionModes() == TDS_CONNECTION_SPINE .and.& | ||||
Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& | Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& | ||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_FWD .and.& | data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_FWD .and.& | ||||
data%Equipments%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_TORQ) then | data%Equipments%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_TORQ) then | ||||
call Set_TdsTong(TDS_TONG_MAKEUP_BEGIN) | |||||
!TopDriveTorqueWrenchLed = LED_ON | |||||
return | |||||
call Set_TdsTong(TDS_TONG_MAKEUP_BEGIN) | |||||
!TopDriveTorqueWrenchLed = LED_ON | |||||
return | |||||
end if | end if | ||||
@@ -30,29 +24,17 @@ module CTdsTongEnum | |||||
if (Get_TdsConnectionModes() == TDS_CONNECTION_STRING .and.& | if (Get_TdsConnectionModes() == TDS_CONNECTION_STRING .and.& | ||||
Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& | Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& | ||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_REV .and.& | data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_REV .and.& | ||||
data%Equipments%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_TORQ) then | |||||
call Set_TdsTong(TDS_TONG_BREAKOUT_BEGIN) | |||||
!TopDriveTorqueWrenchLed = LED_ON | |||||
return | |||||
data%Equipments%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_TORQ) then | |||||
call Set_TdsTong(TDS_TONG_BREAKOUT_BEGIN) | |||||
!TopDriveTorqueWrenchLed = LED_ON | |||||
return | |||||
end if | end if | ||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsTong=Kelly' | |||||
#endif | |||||
endif | |||||
! if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_TdsTong=Kelly' | |||||
! endif | |||||
end subroutine | end subroutine | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/OperationScenarios/UnitySignals/CTdsTongEnum.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/UnitySignals/CTdsTongEnum.f90" | |||||
module CTdsTongEnum | module CTdsTongEnum | ||||
use OperationScenariosModule | use OperationScenariosModule | ||||
implicit none | implicit none | ||||
@@ -8,20 +8,15 @@ module CTdsTongEnum | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
# 12 | |||||
!TOPDRIVE-CODE=1 | !TOPDRIVE-CODE=1 | ||||
if (Get_TdsConnectionModes() == TDS_CONNECTION_SPINE .and.& | if (Get_TdsConnectionModes() == TDS_CONNECTION_SPINE .and.& | ||||
Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& | Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& | ||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_FWD .and.& | data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_FWD .and.& | ||||
data%Equipments%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_TORQ) then | data%Equipments%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_TORQ) then | ||||
call Set_TdsTong(TDS_TONG_MAKEUP_BEGIN) | |||||
call Set_TdsTong(TDS_TONG_MAKEUP_BEGIN) | |||||
!TopDriveTorqueWrenchLed = LED_ON | !TopDriveTorqueWrenchLed = LED_ON | ||||
return | |||||
return | |||||
end if | end if | ||||
@@ -30,28 +25,17 @@ module CTdsTongEnum | |||||
if (Get_TdsConnectionModes() == TDS_CONNECTION_STRING .and.& | if (Get_TdsConnectionModes() == TDS_CONNECTION_STRING .and.& | ||||
Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& | Get_TdsBackupClamp() == BACKUP_CLAMP_FW_END .and.& | ||||
data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_REV .and.& | data%Equipments%TopDrivePanel%TopDriveTdsPowerState == TdsPower_REV .and.& | ||||
data%Equipments%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_TORQ) then | |||||
call Set_TdsTong(TDS_TONG_BREAKOUT_BEGIN) | |||||
data%Equipments%TopDrivePanel%TopDriveDrillTorqueState == TdsMu_TORQ) then | |||||
call Set_TdsTong(TDS_TONG_BREAKOUT_BEGIN) | |||||
!TopDriveTorqueWrenchLed = LED_ON | !TopDriveTorqueWrenchLed = LED_ON | ||||
return | |||||
return | |||||
end if | end if | ||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
# 54 | |||||
endif | |||||
! if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_TdsTong=Kelly' | |||||
! endif | |||||
end subroutine | end subroutine | ||||
@@ -0,0 +1,92 @@ | |||||
# 1 "/home/admin/SimulationCore2/CSharp/OperationScenarios/UnitySignals/CTongEnum.f90" | |||||
module CTongEnum | |||||
use OperationScenariosModule | |||||
implicit none | |||||
contains | |||||
subroutine Evaluate_Tong() | |||||
implicit none | |||||
! if (DriveType == TopDrive_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_Tong=TopDrive' | |||||
! endif | |||||
! if (DriveType == Kelly_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_Tong=Kelly' | |||||
! endif | |||||
end subroutine | |||||
! subroutine Subscribe_Tong() | |||||
! use CDrillingConsoleVariables | |||||
!@ use ConfigurationVariables | |||||
! implicit none | |||||
! call OnBreakoutLeverPress%Add(ButtonPress_Breakout_TongNotification) | |||||
! call OnMakeupLeverPress%Add(ButtonPress_Makeup_TongNotification) | |||||
! call OnTongNeutralPress%Add(ButtonPress_Neutral_TongNotification) | |||||
! end subroutine | |||||
subroutine ButtonPress_Breakout_TongNotification() | |||||
implicit none | |||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||||
if(print_log) print*, 'ButtonPress_Breakout_TongNotification=TopDrive' | |||||
!TOPDRIVE-CODE=70 | |||||
if (Get_TongNotification()) then | |||||
call Set_Tong(TONG_BREAKOUT_BEGIN) | |||||
return | |||||
end if | |||||
endif | |||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
if(print_log) print*, 'ButtonPress_Breakout_TongNotification=Kelly' | |||||
!OPERATION-CODE=74 | |||||
if (Get_TongNotification()) then | |||||
call Set_Tong(TONG_BREAKOUT_BEGIN) | |||||
endif | |||||
endif | |||||
end subroutine | |||||
subroutine ButtonPress_Makeup_TongNotification() | |||||
use NotificationModule | |||||
implicit none | |||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||||
if(print_log) print*, 'ButtonPress_Makeup_TongNotification=TopDrive' | |||||
!TOPDRIVE-CODE=69 | |||||
if (Get_TongNotification()) then | |||||
call Set_Tong(TONG_MAKEUP_BEGIN) | |||||
return | |||||
end if | |||||
endif | |||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
if(print_log) print*, 'ButtonPress_Makeup_TongNotification=Kelly' | |||||
!OPERATION-CODE=73 | |||||
if (Get_TongNotification()) then | |||||
call Set_Tong(TONG_MAKEUP_BEGIN) | |||||
endif | |||||
endif | |||||
end subroutine | |||||
subroutine ButtonPress_Neutral_TongNotification() | |||||
implicit none | |||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | |||||
if(print_log) print*, 'ButtonPress_Neutral_TongNotification=TopDrive' | |||||
endif | |||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
if(print_log) print*, 'ButtonPress_Neutral_TongNotification=Kelly' | |||||
call Set_Tong(TONG_NEUTRAL) | |||||
endif | |||||
end subroutine | |||||
end module CTongEnum |
@@ -4,13 +4,41 @@ module UnitySignalsModule | |||||
use RedisInterface | use RedisInterface | ||||
contains | contains | ||||
subroutine UnitySignalsFromJson(jsonfile) | |||||
subroutine UnitySignalsToJson(parent) | |||||
type(json_value),pointer :: parent | type(json_value),pointer :: parent | ||||
type(json_core) :: json | |||||
type(json_value),pointer :: p,pval | |||||
type(json_value),pointer :: p | |||||
type(json_core) :: jsoncore | |||||
call jsoncore%create_object(p,'UnitySignals') | |||||
call jsoncore%add(p,"MudBucket",data%State%unitySignals%MudBucket) | |||||
call jsoncore%add(p,"Elevator",data%State%unitySignals%Elevator) | |||||
call jsoncore%add(p,"FillupHead",data%State%unitySignals%FillupHead) | |||||
call jsoncore%add(p,"Ibop",data%State%unitySignals%Ibop) | |||||
call jsoncore%add(p,"Kelly",data%State%unitySignals%Kelly) | |||||
call jsoncore%add(p,"MouseHole",data%State%unitySignals%MouseHole) | |||||
call jsoncore%add(p,"OperationCondition",data%State%unitySignals%OperationCondition) | |||||
call jsoncore%add(p,"SafetyValve",data%State%unitySignals%SafetyValve) | |||||
call jsoncore%add(p,"operation",data%State%unitySignals%operation) | |||||
call jsoncore%add(p,"Slips",data%State%unitySignals%Slips) | |||||
call jsoncore%add(p,"Slips_S",data%State%unitySignals%Slips_S) | |||||
call jsoncore%add(p,"Swing",data%State%unitySignals%Swing) | |||||
call jsoncore%add(p,"Swing_S",data%State%unitySignals%Swing_S) | |||||
call jsoncore%add(p,"TdsBackupClamp",data%State%unitySignals%TdsBackupClamp) | |||||
call jsoncore%add(p,"TdsSpine",data%State%unitySignals%TdsSpine) | |||||
call jsoncore%add(p,"TdsSwing",data%State%unitySignals%TdsSwing) | |||||
call jsoncore%add(p,"TdsTong",data%State%unitySignals%TdsTong) | |||||
call jsoncore%add(p,"Tong",data%State%unitySignals%Tong) | |||||
call jsoncore%add(p,"Tong_S",data%State%unitySignals%Tong_S) | |||||
call jsoncore%add(p,"TdsConnectionModes",data%State%unitySignals%TdsConnectionModes) | |||||
call jsoncore%add(p,"TdsElevatorModes",data%State%unitySignals%TdsElevatorModes) | |||||
call jsoncore%add(parent,p) | |||||
end subroutine | |||||
subroutine UnitySignalsFromJson(jsonfile) | |||||
type(json_file)::jsonfile | type(json_file)::jsonfile | ||||
logical::found | logical::found | ||||
integer :: i | |||||
call jsonfile%get('UnitySignals.MudBucket',data%State%unitySignals%MudBucket,found) | call jsonfile%get('UnitySignals.MudBucket',data%State%unitySignals%MudBucket,found) | ||||
if ( .not. found ) call logg(4,"Not found: unitySignals%MudBucket") | if ( .not. found ) call logg(4,"Not found: unitySignals%MudBucket") | ||||
@@ -487,15 +515,12 @@ subroutine Evaluate_TdsConnectionModes() | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsConnectionModes=TopDrive' | |||||
#endif | |||||
!TOPDRIVE-CODE=3 | !TOPDRIVE-CODE=3 | ||||
if (Get_TdsStemIn() .and.& | if (Get_TdsStemIn() .and.& | ||||
Get_TdsSpine() == TDS_SPINE_CONNECT_END .and.& | Get_TdsSpine() == TDS_SPINE_CONNECT_END .and.& | ||||
!TopDriveDrillTorqueState == TdsMu_SPINE | !TopDriveDrillTorqueState == TdsMu_SPINE | ||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | ||||
call Set_TdsConnectionModes(TDS_CONNECTION_SPINE) | call Set_TdsConnectionModes(TDS_CONNECTION_SPINE) | ||||
return | return | ||||
end if | end if | ||||
@@ -529,11 +554,9 @@ subroutine Evaluate_TdsConnectionModes() | |||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsConnectionModes=Kelly' | |||||
#endif | |||||
endif | |||||
! if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_TdsConnectionModes=Kelly' | |||||
! endif | |||||
end subroutine | end subroutine | ||||
@@ -2,14 +2,95 @@ | |||||
module UnitySignalsModule | module UnitySignalsModule | ||||
use UnitySignalVariables | use UnitySignalVariables | ||||
use SimulationVariables | use SimulationVariables | ||||
use RedisInterface | |||||
contains | contains | ||||
subroutine UnitySignalsToJson(parent) | |||||
type(json_value),pointer :: parent | |||||
type(json_value),pointer :: p | |||||
type(json_core) :: jsoncore | |||||
call jsoncore%create_object(p,'UnitySignals') | |||||
call jsoncore%add(p,"MudBucket",data%State%unitySignals%MudBucket) | |||||
call jsoncore%add(p,"Elevator",data%State%unitySignals%Elevator) | |||||
call jsoncore%add(p,"FillupHead",data%State%unitySignals%FillupHead) | |||||
call jsoncore%add(p,"Ibop",data%State%unitySignals%Ibop) | |||||
call jsoncore%add(p,"Kelly",data%State%unitySignals%Kelly) | |||||
call jsoncore%add(p,"MouseHole",data%State%unitySignals%MouseHole) | |||||
call jsoncore%add(p,"OperationCondition",data%State%unitySignals%OperationCondition) | |||||
call jsoncore%add(p,"SafetyValve",data%State%unitySignals%SafetyValve) | |||||
call jsoncore%add(p,"operation",data%State%unitySignals%operation) | |||||
call jsoncore%add(p,"Slips",data%State%unitySignals%Slips) | |||||
call jsoncore%add(p,"Slips_S",data%State%unitySignals%Slips_S) | |||||
call jsoncore%add(p,"Swing",data%State%unitySignals%Swing) | |||||
call jsoncore%add(p,"Swing_S",data%State%unitySignals%Swing_S) | |||||
call jsoncore%add(p,"TdsBackupClamp",data%State%unitySignals%TdsBackupClamp) | |||||
call jsoncore%add(p,"TdsSpine",data%State%unitySignals%TdsSpine) | |||||
call jsoncore%add(p,"TdsSwing",data%State%unitySignals%TdsSwing) | |||||
call jsoncore%add(p,"TdsTong",data%State%unitySignals%TdsTong) | |||||
call jsoncore%add(p,"Tong",data%State%unitySignals%Tong) | |||||
call jsoncore%add(p,"Tong_S",data%State%unitySignals%Tong_S) | |||||
call jsoncore%add(p,"TdsConnectionModes",data%State%unitySignals%TdsConnectionModes) | |||||
call jsoncore%add(p,"TdsElevatorModes",data%State%unitySignals%TdsElevatorModes) | |||||
call jsoncore%add(parent,p) | |||||
end subroutine | |||||
subroutine UnitySignalsFromJson(jsonfile) | |||||
type(json_file)::jsonfile | |||||
logical::found | |||||
call jsonfile%get('UnitySignals.MudBucket',data%State%unitySignals%MudBucket,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%MudBucket") | |||||
call jsonfile%get('UnitySignals.Elevator',data%State%unitySignals%Elevator,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%Elevator") | |||||
call jsonfile%get('UnitySignals.FillupHead',data%State%unitySignals%FillupHead,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%FillupHead") | |||||
call jsonfile%get('UnitySignals.Ibop',data%State%unitySignals%Ibop,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%Ibop") | |||||
call jsonfile%get('UnitySignals.Kelly',data%State%unitySignals%Kelly,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%Kelly") | |||||
call jsonfile%get('UnitySignals.MouseHole',data%State%unitySignals%MouseHole,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%MouseHole") | |||||
call jsonfile%get('UnitySignals.OperationCondition',data%State%unitySignals%OperationCondition,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%OperationCondition") | |||||
call jsonfile%get('UnitySignals.SafetyValve',data%State%unitySignals%SafetyValve,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%SafetyValve") | |||||
call jsonfile%get('UnitySignals.operation',data%State%unitySignals%operation,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%operation") | |||||
call jsonfile%get('UnitySignals.Slips',data%State%unitySignals%Slips,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%Slips") | |||||
call jsonfile%get('UnitySignals.Slips_S',data%State%unitySignals%Slips_S,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%Slips_S") | |||||
call jsonfile%get('UnitySignals.Swing',data%State%unitySignals%Swing,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%Swing") | |||||
call jsonfile%get('UnitySignals.Swing_S',data%State%unitySignals%Swing_S,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%Swing_S") | |||||
call jsonfile%get('UnitySignals.TdsBackupClamp',data%State%unitySignals%TdsBackupClamp,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%TdsBackupClamp") | |||||
call jsonfile%get('UnitySignals.TdsSpine',data%State%unitySignals%TdsSpine,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%TdsSpine") | |||||
call jsonfile%get('UnitySignals.TdsSwing',data%State%unitySignals%TdsSwing,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%TdsSwing") | |||||
call jsonfile%get('UnitySignals.TdsTong',data%State%unitySignals%TdsTong,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%TdsTong") | |||||
call jsonfile%get('UnitySignals.Tong',data%State%unitySignals%Tong,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%Tong") | |||||
call jsonfile%get('UnitySignals.Tong_S',data%State%unitySignals%Tong_S,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%Tong_S") | |||||
call jsonfile%get('UnitySignals.TdsConnectionModes',data%State%unitySignals%TdsConnectionModes,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%TdsConnectionModes") | |||||
call jsonfile%get('UnitySignals.TdsElevatorModes',data%State%unitySignals%TdsElevatorModes,found) | |||||
if ( .not. found ) call logg(4,"Not found: unitySignals%TdsElevatorModes") | |||||
end subroutine | |||||
subroutine Set_TdsElevatorModes(v) | subroutine Set_TdsElevatorModes(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%TdsElevatorModes == v) return | |||||
#endif | |||||
# 93 | |||||
data%State%unitySignals%TdsElevatorModes = v | data%State%unitySignals%TdsElevatorModes = v | ||||
!**call TdsElevatorModesEnum%OnTdsElevatorModesChange%RunAll() | !**call TdsElevatorModesEnum%OnTdsElevatorModesChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -32,13 +113,11 @@ end subroutine | |||||
subroutine Set_Tong(v) | subroutine Set_Tong(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%Tong == v) return | |||||
#endif | |||||
if(data%State%unitySignals%Tong == v) return | |||||
data%State%unitySignals%Tong = v | data%State%unitySignals%Tong = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'Tong=', data%State%unitySignals%Tong | |||||
#endif | |||||
if(print_log) print*, 'Tong=', data%State%unitySignals%Tong | |||||
if(data%State%unitySignals%Tong==TONG_MAKEUP_BEGIN) call publishMessageToChannel("TONG_MAKEUP_BEGIN") | |||||
if(data%State%unitySignals%Tong==TONG_BREAKOUT_BEGIN) call publishMessageToChannel("TONG_BREAKOUT_BEGIN") | |||||
!**call data%State%unitySignals%OnTongChange%RunAll() | !**call data%State%unitySignals%OnTongChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -51,13 +130,11 @@ end function | |||||
subroutine Set_TdsTong(v) | subroutine Set_TdsTong(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%TdsTong == v) return | |||||
#endif | |||||
# 135 | |||||
data%State%unitySignals%TdsTong = v | data%State%unitySignals%TdsTong = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'TdsTong=', data%State%unitySignals%TdsTong | |||||
#endif | |||||
# 139 | |||||
!**call data%State%unitySignals%OnTdsTongChange%RunAll() | !**call data%State%unitySignals%OnTdsTongChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -70,13 +147,11 @@ end function | |||||
subroutine Set_TdsSwing(v) | subroutine Set_TdsSwing(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%TdsSwing == v) return | |||||
#endif | |||||
# 154 | |||||
data%State%unitySignals%TdsSwing = v | data%State%unitySignals%TdsSwing = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'TdsSwing=', data%State%unitySignals%TdsSwing | |||||
#endif | |||||
# 158 | |||||
!**call data%State%unitySignals%OnTdsSwingChange%RunAll() | !**call data%State%unitySignals%OnTdsSwingChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -89,13 +164,11 @@ end function | |||||
subroutine Set_TdsSpine(v) | subroutine Set_TdsSpine(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%TdsSpine == v) return | |||||
#endif | |||||
# 173 | |||||
data%State%unitySignals%TdsSpine = v | data%State%unitySignals%TdsSpine = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'TdsSpine=', data%State%unitySignals%TdsSpine | |||||
#endif | |||||
# 177 | |||||
!**call data%State%unitySignals%OnTdsSpineChange%RunAll() | !**call data%State%unitySignals%OnTdsSpineChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -108,13 +181,11 @@ end function | |||||
subroutine Set_TdsBackupClamp(v) | subroutine Set_TdsBackupClamp(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%TdsBackupClamp == v) return | |||||
#endif | |||||
# 192 | |||||
data%State%unitySignals%TdsBackupClamp = v | data%State%unitySignals%TdsBackupClamp = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'TdsBackupClamp=', data%State%unitySignals%TdsBackupClamp | |||||
#endif | |||||
# 196 | |||||
!**call data%State%unitySignals%OnTdsBackupClampChange%RunAll() | !**call data%State%unitySignals%OnTdsBackupClampChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -127,13 +198,11 @@ end function | |||||
subroutine Set_Swing(v) | subroutine Set_Swing(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%Swing == v) return | |||||
#endif | |||||
# 211 | |||||
data%State%unitySignals%Swing = v | data%State%unitySignals%Swing = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'Swing=', data%State%unitySignals%Swing | |||||
#endif | |||||
# 215 | |||||
!**call data%State%unitySignals%OnSwingChange%RunAll() | !**call data%State%unitySignals%OnSwingChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -142,17 +211,15 @@ integer function Get_Swing() | |||||
Get_Swing = data%State%unitySignals%Swing | Get_Swing = data%State%unitySignals%Swing | ||||
end function | end function | ||||
!//TODO: apparently every thing is started here for slips | |||||
subroutine Set_Slips(v) | subroutine Set_Slips(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%Slips == v) return | |||||
#endif | |||||
if(data%State%unitySignals%Slips == v) return | |||||
data%State%unitySignals%Slips = v | data%State%unitySignals%Slips = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'Slips=', data%State%unitySignals%Slips | |||||
#endif | |||||
if(print_log) print*, 'Slips=', data%State%unitySignals%Slips | |||||
if(v==SLIPS_SET_BEGIN) call publishMessageToChannel("SLIPS_SET_BEGIN") | |||||
if(v==SLIPS_UNSET_BEGIN) call publishMessageToChannel("SLIPS_UNSET_BEGIN") | |||||
!**call data%State%unitySignals%OnSlipsChange%RunAll() | !**call data%State%unitySignals%OnSlipsChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -170,10 +237,10 @@ end subroutine | |||||
subroutine Set_SafetyValve(v) | subroutine Set_SafetyValve(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
# 174 | |||||
# 252 | |||||
data%State%unitySignals%SafetyValve = v | data%State%unitySignals%SafetyValve = v | ||||
# 184 | |||||
# 262 | |||||
!**call data%State%unitySignals%OnSafetyValveChange%RunAll() | !**call data%State%unitySignals%OnSafetyValveChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -198,13 +265,11 @@ subroutine Set_OperationCondition(v) | |||||
! use CKellyEnumVariables | ! use CKellyEnumVariables | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%OperationCondition == v) return | |||||
#endif | |||||
# 288 | |||||
data%State%unitySignals%OperationCondition = v | data%State%unitySignals%OperationCondition = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'OperationCondition=', data%State%unitySignals%OperationCondition | |||||
#endif | |||||
# 292 | |||||
!**call data%State%unitySignals%OnOperationConditionChange%RunAll() | !**call data%State%unitySignals%OnOperationConditionChange%RunAll() | ||||
!**call data%State%unitySignals%OnOperationConditionChangeInt%RunAll(data%State%unitySignals%OperationCondition) | !**call data%State%unitySignals%OnOperationConditionChangeInt%RunAll(data%State%unitySignals%OperationCondition) | ||||
end subroutine | end subroutine | ||||
@@ -222,14 +287,12 @@ end subroutine | |||||
subroutine Set_MouseHole(v) | subroutine Set_MouseHole(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%MouseHole == v) return | |||||
#endif | |||||
# 312 | |||||
!call sleep(2) | !call sleep(2) | ||||
data%State%unitySignals%MouseHole = v | data%State%unitySignals%MouseHole = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'MouseHole=', data%State%unitySignals%MouseHole | |||||
#endif | |||||
# 317 | |||||
!**call data%State%unitySignals%OnMouseHoleChange%RunAll() | !**call data%State%unitySignals%OnMouseHoleChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -243,13 +306,11 @@ end function | |||||
subroutine Set_Kelly(v) | subroutine Set_Kelly(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%Kelly == v) return | |||||
#endif | |||||
# 333 | |||||
data%State%unitySignals%Kelly = v | data%State%unitySignals%Kelly = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'Kelly=', data%State%unitySignals%Kelly | |||||
#endif | |||||
# 337 | |||||
!**call data%State%unitySignals%OnKellyChange%RunAll() | !**call data%State%unitySignals%OnKellyChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -262,13 +323,11 @@ end function | |||||
subroutine Set_Ibop(v) | subroutine Set_Ibop(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%Ibop == v) return | |||||
#endif | |||||
# 352 | |||||
data%State%unitySignals%Ibop = v | data%State%unitySignals%Ibop = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'Ibop=', data%State%unitySignals%Ibop | |||||
#endif | |||||
# 356 | |||||
!**call data%State%unitySignals%OnIbopChange%RunAll() | !**call data%State%unitySignals%OnIbopChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -282,9 +341,8 @@ subroutine Set_FillupHead(v) | |||||
use CManifolds, only: ToggleFillupHead | use CManifolds, only: ToggleFillupHead | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%FillupHead == v) return | |||||
#endif | |||||
# 372 | |||||
data%State%unitySignals%FillupHead = v | data%State%unitySignals%FillupHead = v | ||||
if (data%State%unitySignals%FillupHead == FILLUP_HEAD_INSTALL) then | if (data%State%unitySignals%FillupHead == FILLUP_HEAD_INSTALL) then | ||||
@@ -293,9 +351,8 @@ subroutine Set_FillupHead(v) | |||||
call ToggleFillupHead(.false.) | call ToggleFillupHead(.false.) | ||||
endif | endif | ||||
#ifdef deb | |||||
if(print_log) print*, 'FillupHead=', data%State%unitySignals%FillupHead | |||||
#endif | |||||
# 383 | |||||
!**call data%State%unitySignals%OnFillupHeadChange%RunAll() | !**call data%State%unitySignals%OnFillupHeadChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -311,7 +368,7 @@ subroutine Evaluate_FillupHead() | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
# 323 | |||||
# 401 | |||||
endif | endif | ||||
@@ -321,7 +378,7 @@ subroutine Evaluate_FillupHead() | |||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | ||||
# 334 | |||||
# 412 | |||||
endif | endif | ||||
@@ -338,13 +395,11 @@ end subroutine | |||||
subroutine Set_Elevator(v) | subroutine Set_Elevator(v) | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%Elevator == v) return | |||||
#endif | |||||
# 430 | |||||
data%State%unitySignals%Elevator = v | data%State%unitySignals%Elevator = v | ||||
#ifdef deb | |||||
if(print_log) print*, 'Elevator=', data%State%unitySignals%Elevator | |||||
#endif | |||||
# 434 | |||||
!**call data%State%unitySignals%OnElevatorChange%RunAll() | !**call data%State%unitySignals%OnElevatorChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -359,18 +414,16 @@ subroutine Set_MudBucket(v) | |||||
use CManifolds, only: ToggleMudBox | use CManifolds, only: ToggleMudBox | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%MudBucket == v) return | |||||
#endif | |||||
# 451 | |||||
data%State%unitySignals%MudBucket = v | data%State%unitySignals%MudBucket = v | ||||
if (data%State%unitySignals%MudBucket == MUD_BUCKET_INSTALL) then | if (data%State%unitySignals%MudBucket == MUD_BUCKET_INSTALL) then | ||||
call ToggleMudBox(.true.) | call ToggleMudBox(.true.) | ||||
else if (data%State%unitySignals%MudBucket == MUD_BUCKET_REMOVE) then | else if (data%State%unitySignals%MudBucket == MUD_BUCKET_REMOVE) then | ||||
call ToggleMudBox(.false.) | call ToggleMudBox(.false.) | ||||
endif | endif | ||||
#ifdef deb | |||||
if(print_log) print*, 'MudBucket=', data%State%unitySignals%MudBucket | |||||
#endif | |||||
# 460 | |||||
!**call data%State%unitySignals%OnMudBucketChange%RunAll() | !**call data%State%unitySignals%OnMudBucketChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -398,9 +451,8 @@ subroutine Set_TdsConnectionModes(v) | |||||
use CManifolds, Only: KellyConnected, KellyDisconnected | use CManifolds, Only: KellyConnected, KellyDisconnected | ||||
implicit none | implicit none | ||||
integer , intent(in) :: v | integer , intent(in) :: v | ||||
#ifdef ExcludeExtraChanges | |||||
if(data%State%unitySignals%TdsConnectionModes == v) return | |||||
#endif | |||||
# 490 | |||||
data%State%unitySignals%TdsConnectionModes = v | data%State%unitySignals%TdsConnectionModes = v | ||||
if(data%State%unitySignals%TdsConnectionModes == TDS_CONNECTION_NOTHING) then | if(data%State%unitySignals%TdsConnectionModes == TDS_CONNECTION_NOTHING) then | ||||
@@ -409,9 +461,8 @@ subroutine Set_TdsConnectionModes(v) | |||||
call KellyConnected() | call KellyConnected() | ||||
endif | endif | ||||
#ifdef deb | |||||
if(print_log) print*, 'data%State%unitySignals%TdsConnectionModes=', data%State%unitySignals%TdsConnectionModes | |||||
#endif | |||||
# 501 | |||||
!**call data%State%unitySignals%OnTdsConnectionModesChange%RunAll() | !**call data%State%unitySignals%OnTdsConnectionModesChange%RunAll() | ||||
end subroutine | end subroutine | ||||
@@ -428,15 +479,12 @@ subroutine Evaluate_TdsConnectionModes() | |||||
implicit none | implicit none | ||||
if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | if (data%Configuration%Hoisting%DriveType == TopDrive_DriveType) then | ||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsConnectionModes=TopDrive' | |||||
#endif | |||||
!TOPDRIVE-CODE=3 | !TOPDRIVE-CODE=3 | ||||
if (Get_TdsStemIn() .and.& | if (Get_TdsStemIn() .and.& | ||||
Get_TdsSpine() == TDS_SPINE_CONNECT_END .and.& | Get_TdsSpine() == TDS_SPINE_CONNECT_END .and.& | ||||
!TopDriveDrillTorqueState == TdsMu_SPINE | !TopDriveDrillTorqueState == TdsMu_SPINE | ||||
Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | Get_TdsConnectionModes() == TDS_CONNECTION_NOTHING) then | ||||
call Set_TdsConnectionModes(TDS_CONNECTION_SPINE) | call Set_TdsConnectionModes(TDS_CONNECTION_SPINE) | ||||
return | return | ||||
end if | end if | ||||
@@ -470,11 +518,9 @@ subroutine Evaluate_TdsConnectionModes() | |||||
endif | endif | ||||
if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
#ifdef OST | |||||
if(print_log) print*, 'Evaluate_TdsConnectionModes=Kelly' | |||||
#endif | |||||
endif | |||||
! if (data%Configuration%Hoisting%DriveType == Kelly_DriveType) then | |||||
! if(print_log) print*, 'Evaluate_TdsConnectionModes=Kelly' | |||||
! endif | |||||
end subroutine | end subroutine | ||||
@@ -23,7 +23,7 @@ module UnitySignalVariables | |||||
integer :: OperationCondition = 0 | integer :: OperationCondition = 0 | ||||
integer :: SafetyValve = 0 | integer :: SafetyValve = 0 | ||||
integer :: operation = 0 | integer :: operation = 0 | ||||
!previous value is 0 (neutral),set to unset_end by mahmood | |||||
!previous value is 0 (neutral),set to set_end by mahmood | |||||
integer :: Slips = SLIPS_SET_END | integer :: Slips = SLIPS_SET_END | ||||
integer :: Slips_S = 0 | integer :: Slips_S = 0 | ||||
integer :: Swing = 0 | integer :: Swing = 0 | ||||
@@ -95,17 +95,19 @@ module UnitySignalVariables | |||||
enumerator MOUSE_HOLE_NEUTRAL | enumerator MOUSE_HOLE_NEUTRAL | ||||
enumerator MOUSE_HOLE_FILL | enumerator MOUSE_HOLE_FILL | ||||
enumerator MOUSE_HOLE_EMPTY | enumerator MOUSE_HOLE_EMPTY | ||||
end enum | |||||
enum, bind(c) | |||||
enumerator KELLY_NEUTRAL | enumerator KELLY_NEUTRAL | ||||
enumerator KELLY_INSTALL | enumerator KELLY_INSTALL | ||||
enumerator KELLY_REMOVE | enumerator KELLY_REMOVE | ||||
end enum | |||||
enum, bind(c) | |||||
!enumerator FILLUP_HEAD_NEUTRAL | !enumerator FILLUP_HEAD_NEUTRAL | ||||
enumerator FILLUP_HEAD_REMOVE | enumerator FILLUP_HEAD_REMOVE | ||||
enumerator FILLUP_HEAD_INSTALL | enumerator FILLUP_HEAD_INSTALL | ||||
end enum | |||||
enum, bind(c) | |||||
enumerator ELEVATOR_NEUTRAL | enumerator ELEVATOR_NEUTRAL | ||||
enumerator ELEVATOR_LATCH_STRING_BEGIN | enumerator ELEVATOR_LATCH_STRING_BEGIN | ||||
enumerator ELEVATOR_LATCH_STRING_END | enumerator ELEVATOR_LATCH_STRING_END | ||||
@@ -123,19 +125,23 @@ module UnitySignalVariables | |||||
enumerator ELEVATOR_UNLATCH_SINGLE_BEGIN | enumerator ELEVATOR_UNLATCH_SINGLE_BEGIN | ||||
enumerator ELEVATOR_UNLATCH_SINGLE_END | enumerator ELEVATOR_UNLATCH_SINGLE_END | ||||
end enum | |||||
enum, bind(c) | |||||
!enumerator MUD_BUCKET_NEUTRAL | !enumerator MUD_BUCKET_NEUTRAL | ||||
enumerator MUD_BUCKET_REMOVE | enumerator MUD_BUCKET_REMOVE | ||||
enumerator MUD_BUCKET_INSTALL | enumerator MUD_BUCKET_INSTALL | ||||
end enum | |||||
enum, bind(c) | |||||
!enumerator IBOP_NEUTRAL | !enumerator IBOP_NEUTRAL | ||||
enumerator IBOP_REMOVE | enumerator IBOP_REMOVE | ||||
enumerator IBOP_INSTALL | enumerator IBOP_INSTALL | ||||
end enum | |||||
enum, bind(c) | |||||
enumerator TDS_CONNECTION_NOTHING | enumerator TDS_CONNECTION_NOTHING | ||||
enumerator TDS_CONNECTION_STRING | enumerator TDS_CONNECTION_STRING | ||||
enumerator TDS_CONNECTION_SPINE | enumerator TDS_CONNECTION_SPINE | ||||
end enum | |||||
enum, bind(c) | |||||
enumerator TDS_ELEVATOR_CONNECTION_NOTHING | enumerator TDS_ELEVATOR_CONNECTION_NOTHING | ||||
enumerator TDS_ELEVATOR_CONNECTION_STRING | enumerator TDS_ELEVATOR_CONNECTION_STRING | ||||
enumerator TDS_ELEVATOR_CONNECTION_SINGLE | enumerator TDS_ELEVATOR_CONNECTION_SINGLE | ||||
@@ -146,6 +152,5 @@ module UnitySignalVariables | |||||
end enum | end enum | ||||
contains | contains | ||||
end module UnitySignalVariables | end module UnitySignalVariables |
@@ -3,9 +3,20 @@ module UnitySignalVariables | |||||
! use CVoidEventHandlerCollection | ! use CVoidEventHandlerCollection | ||||
! use CIntegerEventHandlerCollection | ! use CIntegerEventHandlerCollection | ||||
enum, bind(c) | |||||
enumerator SLIPS_NEUTRAL | |||||
enumerator SLIPS_SET_BEGIN | |||||
enumerator SLIPS_SET_END | |||||
enumerator SLIPS_UNSET_BEGIN | |||||
enumerator SLIPS_UNSET_END | |||||
end enum | |||||
type:: UnitySignalsType | type:: UnitySignalsType | ||||
! used only in set and get (unitysignals.f90) | |||||
integer :: MudBucket = 0 | integer :: MudBucket = 0 | ||||
! used only in set and get (unitysignals.f90) and indirectly in Evaluate... | |||||
integer :: Elevator = 0 | integer :: Elevator = 0 | ||||
! used only in set and get (unitysignals.f90) and indirectly in Evaluate... | |||||
integer :: FillupHead = 0 | integer :: FillupHead = 0 | ||||
integer :: Ibop = 0 | integer :: Ibop = 0 | ||||
integer :: Kelly = 0 | integer :: Kelly = 0 | ||||
@@ -13,7 +24,8 @@ module UnitySignalVariables | |||||
integer :: OperationCondition = 0 | integer :: OperationCondition = 0 | ||||
integer :: SafetyValve = 0 | integer :: SafetyValve = 0 | ||||
integer :: operation = 0 | integer :: operation = 0 | ||||
integer :: Slips = 0 | |||||
!previous value is 0 (neutral),set to set_end by mahmood | |||||
integer :: Slips = SLIPS_SET_END | |||||
integer :: Slips_S = 0 | integer :: Slips_S = 0 | ||||
integer :: Swing = 0 | integer :: Swing = 0 | ||||
integer :: Swing_S = 0 | integer :: Swing_S = 0 | ||||
@@ -25,7 +37,6 @@ module UnitySignalVariables | |||||
integer :: Tong_S = 0 | integer :: Tong_S = 0 | ||||
integer :: TdsConnectionModes = 0 | integer :: TdsConnectionModes = 0 | ||||
integer :: TdsElevatorModes = 0 | integer :: TdsElevatorModes = 0 | ||||
end type UnitySignalsType | end type UnitySignalsType | ||||
enum, bind(c) | enum, bind(c) | ||||
@@ -81,27 +92,23 @@ module UnitySignalVariables | |||||
enumerator OPERATION_DRILL | enumerator OPERATION_DRILL | ||||
enumerator OPERATION_TRIP | enumerator OPERATION_TRIP | ||||
end enum | end enum | ||||
enum, bind(c) | |||||
enumerator SLIPS_NEUTRAL | |||||
enumerator SLIPS_SET_BEGIN | |||||
enumerator SLIPS_SET_END | |||||
enumerator SLIPS_UNSET_BEGIN | |||||
enumerator SLIPS_UNSET_END | |||||
enum, bind(c) | |||||
enumerator MOUSE_HOLE_NEUTRAL | enumerator MOUSE_HOLE_NEUTRAL | ||||
enumerator MOUSE_HOLE_FILL | enumerator MOUSE_HOLE_FILL | ||||
enumerator MOUSE_HOLE_EMPTY | enumerator MOUSE_HOLE_EMPTY | ||||
end enum | |||||
enum, bind(c) | |||||
enumerator KELLY_NEUTRAL | enumerator KELLY_NEUTRAL | ||||
enumerator KELLY_INSTALL | enumerator KELLY_INSTALL | ||||
enumerator KELLY_REMOVE | enumerator KELLY_REMOVE | ||||
end enum | |||||
enum, bind(c) | |||||
!enumerator FILLUP_HEAD_NEUTRAL | !enumerator FILLUP_HEAD_NEUTRAL | ||||
enumerator FILLUP_HEAD_REMOVE | enumerator FILLUP_HEAD_REMOVE | ||||
enumerator FILLUP_HEAD_INSTALL | enumerator FILLUP_HEAD_INSTALL | ||||
end enum | |||||
enum, bind(c) | |||||
enumerator ELEVATOR_NEUTRAL | enumerator ELEVATOR_NEUTRAL | ||||
enumerator ELEVATOR_LATCH_STRING_BEGIN | enumerator ELEVATOR_LATCH_STRING_BEGIN | ||||
enumerator ELEVATOR_LATCH_STRING_END | enumerator ELEVATOR_LATCH_STRING_END | ||||
@@ -119,19 +126,23 @@ module UnitySignalVariables | |||||
enumerator ELEVATOR_UNLATCH_SINGLE_BEGIN | enumerator ELEVATOR_UNLATCH_SINGLE_BEGIN | ||||
enumerator ELEVATOR_UNLATCH_SINGLE_END | enumerator ELEVATOR_UNLATCH_SINGLE_END | ||||
end enum | |||||
enum, bind(c) | |||||
!enumerator MUD_BUCKET_NEUTRAL | !enumerator MUD_BUCKET_NEUTRAL | ||||
enumerator MUD_BUCKET_REMOVE | enumerator MUD_BUCKET_REMOVE | ||||
enumerator MUD_BUCKET_INSTALL | enumerator MUD_BUCKET_INSTALL | ||||
end enum | |||||
enum, bind(c) | |||||
!enumerator IBOP_NEUTRAL | !enumerator IBOP_NEUTRAL | ||||
enumerator IBOP_REMOVE | enumerator IBOP_REMOVE | ||||
enumerator IBOP_INSTALL | enumerator IBOP_INSTALL | ||||
end enum | |||||
enum, bind(c) | |||||
enumerator TDS_CONNECTION_NOTHING | enumerator TDS_CONNECTION_NOTHING | ||||
enumerator TDS_CONNECTION_STRING | enumerator TDS_CONNECTION_STRING | ||||
enumerator TDS_CONNECTION_SPINE | enumerator TDS_CONNECTION_SPINE | ||||
end enum | |||||
enum, bind(c) | |||||
enumerator TDS_ELEVATOR_CONNECTION_NOTHING | enumerator TDS_ELEVATOR_CONNECTION_NOTHING | ||||
enumerator TDS_ELEVATOR_CONNECTION_STRING | enumerator TDS_ELEVATOR_CONNECTION_STRING | ||||
enumerator TDS_ELEVATOR_CONNECTION_SINGLE | enumerator TDS_ELEVATOR_CONNECTION_SINGLE | ||||
@@ -142,6 +153,5 @@ module UnitySignalVariables | |||||
end enum | end enum | ||||
contains | contains | ||||
end module UnitySignalVariables | end module UnitySignalVariables |
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/CSharp/Problems/CRotaryProblems.f90" | |||||
# 1 "/home/admin/SimulationCore2/CSharp/Problems/CRotaryProblems.f90" | |||||
module CRotaryProblems | module CRotaryProblems | ||||
use SimulationVariables | use SimulationVariables | ||||
implicit none | implicit none | ||||
@@ -14,173 +14,173 @@ SUBROUTINE ANNULAR_SUB1 | |||||
! START CONDITIONS FOR ANNULAR PREVENTER | ! START CONDITIONS FOR ANNULAR PREVENTER | ||||
!===================================================================== | !===================================================================== | ||||
data%State%RAM(1)%SuccessionCounter = data%State%RAM(1)%SuccessionCounter + 1 | |||||
data%State%RAM(1)%SuccessionCounter = data%State%RAM(1)%SuccessionCounter + 1 | |||||
if (data%Equipments%BopControlPanel%AnnularValve == 1.0 .and. data%State%Annular%AnnularFailureMalf==0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1) then | |||||
if (data%State%BopStackInput%AnnularCloseLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
if ( data%State%RAM(1)%SuccessionCounter /= data%State%RAM(1)%SuccessionCounterOld+1 ) then | |||||
data%State%RAM(1)%SuccessionCounter = 0 ! also in starup | |||||
data%State%RAM(1)%SuccessionCounterOld = 0 ! also in starup | |||||
!return | |||||
else | |||||
data%State%RAM(1)%SuccessionCounterOld= data%State%RAM(1)%SuccessionCounter | |||||
endif | |||||
if (data%Equipments%BopControlPanel%AnnularValve == 1.0 .and. data%State%Annular%AnnularFailureMalf==0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1) then | |||||
if (data%State%BopStackInput%AnnularCloseLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
if ( data%State%RAM(1)%SuccessionCounter /= data%State%RAM(1)%SuccessionCounterOld+1 ) then | |||||
data%State%RAM(1)%SuccessionCounter = 0 ! also in starup | |||||
data%State%RAM(1)%SuccessionCounterOld = 0 ! also in starup | |||||
!return | |||||
else | |||||
data%State%RAM(1)%SuccessionCounterOld= data%State%RAM(1)%SuccessionCounter | |||||
endif | |||||
if ( data%State%RAM(1)%SuccessionCounter >= int(2.5/data%State%RamLine%DeltaT_BOP) ) then | |||||
!return | |||||
data%State%RAM(1)%First_CloseTimecheck= 1 | |||||
data%Equipments%BopControlPanel%AnnularOpenLED = LedOff | |||||
data%State%BopStackInput%AnnularOpenLedMine = LedOff | |||||
data%Equipments%BopControlPanel%AnnularCloseLED = LedOn !LedBlinking | |||||
data%State%RAM(1)%FourwayValve = 1 | |||||
endif | |||||
if ( data%State%RAM(1)%SuccessionCounter >= int(2.5/data%State%RamLine%DeltaT_BOP) ) then | |||||
!return | |||||
data%State%RAM(1)%First_CloseTimecheck= 1 | |||||
data%Equipments%BopControlPanel%AnnularOpenLED = LedOff | |||||
data%State%BopStackInput%AnnularOpenLedMine = LedOff | |||||
data%Equipments%BopControlPanel%AnnularCloseLED = LedOn !LedBlinking | |||||
data%State%RAM(1)%FourwayValve = 1 | |||||
endif | endif | ||||
endif | |||||
if (data%State%RAM(1)%FourwayValve == 1 .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure .and. data%State%Annular%Pannular_reg>data%State%AnnularComputational%AnnularMovingPressure) then ! 1: Open , 0: Close | |||||
if (data%State%RAM(1)%FourwayValve == 1 .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure .and. data%State%Annular%Pannular_reg>data%State%AnnularComputational%AnnularMovingPressure) then ! 1: Open , 0: Close | |||||
data%State%RAM(1)%FourwayValve = 0 | |||||
data%State%Annular%Annular_closed=0 | |||||
!Annular_closed_withPossibility= Annular_closed * TD_BOPConnectionPossibility(1) | |||||
data%State%RAM(1)%vdis_tot=0 | |||||
data%State%RAM(1)%vdis_bottles=0. | |||||
data%State%RAM(1)%fvr_air=0. | |||||
data%State%RAM(1)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(1)%Qzero=70 | |||||
data%State%RAM(1)%Q=data%State%RAM(1)%Qzero | |||||
data%State%RAM(1)%flow=70 | |||||
data%State%Annular%tolAnnular=0.0018 | |||||
if (data%State%Annular%finished_Annular==1) then | |||||
data%State%Annular%AnnularLeverOld=-1.0 | |||||
else | |||||
data%State%Annular%AnnularLeverOld=data%Equipments%BopControlPanel%AnnularValve | |||||
endif | |||||
data%State%Annular%finished_Annular=0 | |||||
data%State%Annular%AnnularIsClosing = .true. | |||||
data%State%Annular%AnnularIsOpening = .false. | |||||
data%State%RAM(1)%FourwayValve = 0 | |||||
data%State%Annular%Annular_closed=0 | |||||
!Annular_closed_withPossibility= Annular_closed * TD_BOPConnectionPossibility(1) | |||||
data%State%RAM(1)%vdis_tot=0 | |||||
data%State%RAM(1)%vdis_bottles=0. | |||||
data%State%RAM(1)%fvr_air=0. | |||||
data%State%RAM(1)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(1)%Qzero=70 | |||||
data%State%RAM(1)%Q=data%State%RAM(1)%Qzero | |||||
data%State%RAM(1)%flow=70 | |||||
data%State%Annular%tolAnnular=0.0018 | |||||
if (data%State%Annular%finished_Annular==1) then | |||||
data%State%Annular%AnnularLeverOld=-1.0 | |||||
else | |||||
data%State%Annular%AnnularLeverOld=data%Equipments%BopControlPanel%AnnularValve | |||||
endif | |||||
data%State%Annular%finished_Annular=0 | |||||
data%State%Annular%AnnularIsClosing = .true. | |||||
data%State%Annular%AnnularIsOpening = .false. | |||||
data%State%RAM(2)%bop_type = 3 | |||||
!AbopAnnular=963.1 !(in^2) | |||||
data%State%Annular%AbopAnnular=(data%Configuration%BopStack%AnnularPreventerClose*231.)/((data%State%Annular%IDAnnularBase-data%State%Annular%ODDrillpipe_inAnnularBase)/2.) ! 231 in^3 = 1 gal | |||||
data%State%Annular%NeededVolumeAnnular=data%State%Annular%AbopAnnular*(data%State%Annular%IDAnnularBase-max(data%State%Annular%ODDrillpipe_inAnnular,data%State%Annular%ODDrillpipe_inAnnularBase))/(2.*231) !=17.98 galon for IDAnnularBase=13 5/8 , ODDrillpipe_inAnnularBase=5 | |||||
!WRITE(*,*) 'a)NeededVolumeAnnular=' , NeededVolumeAnnular | |||||
!write(*,*) 'close 1' | |||||
endif | |||||
data%State%RAM(2)%bop_type = 3 | |||||
!AbopAnnular=963.1 !(in^2) | |||||
data%State%Annular%AbopAnnular=(data%Configuration%BopStack%AnnularPreventerClose*231.)/((data%State%Annular%IDAnnularBase-data%State%Annular%ODDrillpipe_inAnnularBase)/2.) ! 231 in^3 = 1 gal | |||||
data%State%Annular%NeededVolumeAnnular=data%State%Annular%AbopAnnular*(data%State%Annular%IDAnnularBase-max(data%State%Annular%ODDrillpipe_inAnnular,data%State%Annular%ODDrillpipe_inAnnularBase))/(2.*231) !=17.98 galon for IDAnnularBase=13 5/8 , ODDrillpipe_inAnnularBase=5 | |||||
!WRITE(*,*) 'a)NeededVolumeAnnular=' , NeededVolumeAnnular | |||||
!write(*,*) 'close 1' | |||||
endif | |||||
if (data%Equipments%BopControlPanel%AnnularValve == -1.0 .and. data%State%Annular%AnnularFailureMalf==0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1 ) then | |||||
if (data%Equipments%BopControlPanel%AnnularValve == -1.0 .and. data%State%Annular%AnnularFailureMalf==0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1 ) then | |||||
if (data%State%BopStackInput%AnnularOpenLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
!CasingPressure : PressureGauges(2) *****temp conditionssssss | |||||
!note: (AnnularSealingPressure) is only for opening while well is pressurised | |||||
if ( data%State%RAM(1)%SuccessionCounter /= data%State%RAM(1)%SuccessionCounterOld+1 ) then | |||||
data%State%RAM(1)%SuccessionCounter = 0 ! also in starup | |||||
data%State%RAM(1)%SuccessionCounterOld = 0 ! also in starup | |||||
!return | |||||
else | |||||
data%State%RAM(1)%SuccessionCounterOld= data%State%RAM(1)%SuccessionCounter | |||||
endif | |||||
if ( data%State%RAM(1)%SuccessionCounter >= int(2.5/data%State%RamLine%DeltaT_BOP) ) then | |||||
!return | |||||
if (data%State%BopStackInput%AnnularOpenLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
data%State%RAM(1)%First_OpenTimecheck= 1 | |||||
!CasingPressure : PressureGauges(2) *****temp conditionssssss | |||||
data%Equipments%BopControlPanel%AnnularCloseLED = LedOff !new | |||||
data%State%BopStackInput%AnnularCloseLedMine = LedOff !new | |||||
data%Equipments%BopControlPanel%AnnularOpenLED = LedOn !LedBlinking | |||||
!note: (AnnularSealingPressure) is only for opening while well is pressurised | |||||
if ( data%State%RAM(1)%SuccessionCounter /= data%State%RAM(1)%SuccessionCounterOld+1 ) then | |||||
data%State%RAM(1)%SuccessionCounter = 0 ! also in starup | |||||
data%State%RAM(1)%SuccessionCounterOld = 0 ! also in starup | |||||
!return | |||||
else | |||||
data%State%RAM(1)%SuccessionCounterOld= data%State%RAM(1)%SuccessionCounter | |||||
endif | |||||
if ( data%State%RAM(1)%SuccessionCounter >= int(2.5/data%State%RamLine%DeltaT_BOP) ) then | |||||
!return | |||||
data%State%RAM(1)%First_OpenTimecheck= 1 | |||||
data%Equipments%BopControlPanel%AnnularCloseLED = LedOff !new | |||||
data%State%BopStackInput%AnnularCloseLedMine = LedOff !new | |||||
data%Equipments%BopControlPanel%AnnularOpenLED = LedOn !LedBlinking | |||||
data%State%RAM(1)%FourwayValve = 1 | |||||
endif | |||||
data%State%RAM(1)%FourwayValve = 1 | |||||
endif | endif | ||||
endif | |||||
if (data%State%RAM(1)%FourwayValve == 1 .and. data%State%Annular%Pannular_reg>data%State%AnnularComputational%AnnularMovingPressure .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure & | |||||
if (data%State%RAM(1)%FourwayValve == 1 .and. data%State%Annular%Pannular_reg>data%State%AnnularComputational%AnnularMovingPressure .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure & | |||||
.and. (data%State%Annular%Annular_closed==0 .or. (data%State%Annular%Annular_closed==1 .and. data%State%PressureDisplay%PressureGauges(2) <=100.0) .or. (data%State%Annular%Annular_closed==1 .and. data%State%PressureDisplay%PressureGauges(2)>100.0 .and. data%State%Annular%Pannular_reg>=data%State%AnnularComputational%AnnularSealingPressure))) then ! 1: Open , 0: Close | .and. (data%State%Annular%Annular_closed==0 .or. (data%State%Annular%Annular_closed==1 .and. data%State%PressureDisplay%PressureGauges(2) <=100.0) .or. (data%State%Annular%Annular_closed==1 .and. data%State%PressureDisplay%PressureGauges(2)>100.0 .and. data%State%Annular%Pannular_reg>=data%State%AnnularComputational%AnnularSealingPressure))) then ! 1: Open , 0: Close | ||||
!write(*,*) 'open 2' | |||||
!write(*,*) 'open 2' | |||||
data%State%RAM(1)%FourwayValve = 0 | |||||
data%State%RAM(1)%FourwayValve = 0 | |||||
data%State%Annular%Annular_closed=0 | |||||
!Annular_closed_withPossibility= Annular_closed * TD_BOPConnectionPossibility(1) | |||||
data%State%RAM(1)%vdis_tot=0 | |||||
data%State%RAM(1)%vdis_bottles=0. | |||||
data%State%RAM(1)%fvr_air=0. | |||||
data%State%RAM(1)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(1)%Qzero=70 | |||||
data%State%RAM(1)%Q=data%State%RAM(1)%Qzero | |||||
data%State%RAM(1)%flow=70 | |||||
data%State%Annular%tolAnnular=0.0018 | |||||
data%State%Annular%Annular_closed=0 | |||||
!Annular_closed_withPossibility= Annular_closed * TD_BOPConnectionPossibility(1) | |||||
data%State%RAM(1)%vdis_tot=0 | |||||
data%State%RAM(1)%vdis_bottles=0. | |||||
data%State%RAM(1)%fvr_air=0. | |||||
data%State%RAM(1)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(1)%Qzero=70 | |||||
data%State%RAM(1)%Q=data%State%RAM(1)%Qzero | |||||
data%State%RAM(1)%flow=70 | |||||
data%State%Annular%tolAnnular=0.0018 | |||||
if (data%State%Annular%finished_Annular==1) then | |||||
data%State%Annular%AnnularLeverOld=1.0 | |||||
else | |||||
data%State%Annular%AnnularLeverOld=data%Equipments%BopControlPanel%AnnularValve | |||||
endif | |||||
data%State%Annular%finished_Annular=0 | |||||
data%State%Annular%AnnularIsOpening = .true. | |||||
data%State%Annular%AnnularIsClosing = .false. | |||||
if (data%State%Annular%finished_Annular==1) then | |||||
data%State%Annular%AnnularLeverOld=1.0 | |||||
else | |||||
data%State%Annular%AnnularLeverOld=data%Equipments%BopControlPanel%AnnularValve | |||||
endif | |||||
data%State%Annular%finished_Annular=0 | |||||
data%State%Annular%AnnularIsOpening = .true. | |||||
data%State%Annular%AnnularIsClosing = .false. | |||||
!if (AnnularOpenLed == LedOn) then | |||||
! RETURN | |||||
!end if | |||||
!if (AnnularOpenLed == LedOn) then | |||||
! RETURN | |||||
!end if | |||||
data%State%RAM(1)%bop_type = 3 | |||||
!AbopAnnular=758.48 !(in^2) | |||||
data%State%Annular%AbopAnnular=(data%Configuration%BopStack%AnnularPreventerOpen*231)/((data%State%Annular%IDAnnularBase-max(data%State%Annular%ODDrillpipe_inAnnular,data%State%Annular%ODDrillpipe_inAnnularBase))/2.) | |||||
data%State%Annular%NeededVolumeAnnular=data%State%Annular%AbopAnnular*(data%State%Annular%IDAnnularBase-data%State%Annular%ODDrillpipe_inAnnular)/(2.*231) !=14.16 galon for IDAnnularBase=13 5/8 , ODDrillpipe_inAnnular=5 | |||||
!write(*,*) 'open 1' | |||||
data%State%RAM(1)%bop_type = 3 | |||||
!AbopAnnular=758.48 !(in^2) | |||||
data%State%Annular%AbopAnnular=(data%Configuration%BopStack%AnnularPreventerOpen*231)/((data%State%Annular%IDAnnularBase-max(data%State%Annular%ODDrillpipe_inAnnular,data%State%Annular%ODDrillpipe_inAnnularBase))/2.) | |||||
data%State%Annular%NeededVolumeAnnular=data%State%Annular%AbopAnnular*(data%State%Annular%IDAnnularBase-data%State%Annular%ODDrillpipe_inAnnular)/(2.*231) !=14.16 galon for IDAnnularBase=13 5/8 , ODDrillpipe_inAnnular=5 | |||||
!write(*,*) 'open 1' | |||||
endif | |||||
endif | |||||
!===================================================================== | !===================================================================== | ||||
if (data%State%Annular%AnnularIsOpening .or. data%State%Annular%AnnularIsClosing .or. data%State%RAM(1)%Bottles_Charged_MalfActive) then | |||||
CALL ANNULAR_SUB2 | |||||
end if | |||||
if (data%State%Annular%AnnularIsOpening .or. data%State%Annular%AnnularIsClosing .or. data%State%RAM(1)%Bottles_Charged_MalfActive) then | |||||
CALL ANNULAR_SUB2 | |||||
end if | |||||
END SUBROUTINE ANNULAR_SUB1 | |||||
END SUBROUTINE ANNULAR_SUB1 | |||||
@@ -15,147 +15,147 @@ SUBROUTINE ANNULAR_SUB1 | |||||
! START CONDITIONS FOR ANNULAR PREVENTER | ! START CONDITIONS FOR ANNULAR PREVENTER | ||||
!===================================================================== | !===================================================================== | ||||
data%State%RAM(1)%SuccessionCounter = data%State%RAM(1)%SuccessionCounter + 1 | |||||
data%State%RAM(1)%SuccessionCounter = data%State%RAM(1)%SuccessionCounter + 1 | |||||
if (data%Equipments%BopControlPanel%AnnularValve == 1.0 .and. data%State%Annular%AnnularFailureMalf==0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1) then | |||||
if (data%State%BopStackInput%AnnularCloseLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
if ( data%State%RAM(1)%SuccessionCounter /= data%State%RAM(1)%SuccessionCounterOld+1 ) then | |||||
data%State%RAM(1)%SuccessionCounter = 0 ! also in starup | |||||
data%State%RAM(1)%SuccessionCounterOld = 0 ! also in starup | |||||
if (data%Equipments%BopControlPanel%AnnularValve == 1.0 .and. data%State%Annular%AnnularFailureMalf==0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1) then | |||||
if (data%State%BopStackInput%AnnularCloseLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
if ( data%State%RAM(1)%SuccessionCounter /= data%State%RAM(1)%SuccessionCounterOld+1 ) then | |||||
data%State%RAM(1)%SuccessionCounter = 0 ! also in starup | |||||
data%State%RAM(1)%SuccessionCounterOld = 0 ! also in starup | |||||
!return | !return | ||||
else | |||||
data%State%RAM(1)%SuccessionCounterOld= data%State%RAM(1)%SuccessionCounter | |||||
endif | |||||
else | |||||
data%State%RAM(1)%SuccessionCounterOld= data%State%RAM(1)%SuccessionCounter | |||||
endif | |||||
if ( data%State%RAM(1)%SuccessionCounter >= int(2.5/data%State%RamLine%DeltaT_BOP) ) then | |||||
if ( data%State%RAM(1)%SuccessionCounter >= int(2.5/data%State%RamLine%DeltaT_BOP) ) then | |||||
!return | !return | ||||
data%State%RAM(1)%First_CloseTimecheck= 1 | |||||
data%Equipments%BopControlPanel%AnnularOpenLED = LedOff | |||||
data%State%BopStackInput%AnnularOpenLedMine = LedOff | |||||
data%Equipments%BopControlPanel%AnnularCloseLED = LedOn !LedBlinking | |||||
data%State%RAM(1)%FourwayValve = 1 | |||||
endif | |||||
data%State%RAM(1)%First_CloseTimecheck= 1 | |||||
data%Equipments%BopControlPanel%AnnularOpenLED = LedOff | |||||
data%State%BopStackInput%AnnularOpenLedMine = LedOff | |||||
data%Equipments%BopControlPanel%AnnularCloseLED = LedOn !LedBlinking | |||||
data%State%RAM(1)%FourwayValve = 1 | |||||
endif | endif | ||||
endif | |||||
if (data%State%RAM(1)%FourwayValve == 1 .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure .and. data%State%Annular%Pannular_reg>data%State%AnnularComputational%AnnularMovingPressure) then ! 1: Open , 0: Close | |||||
if (data%State%RAM(1)%FourwayValve == 1 .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure .and. data%State%Annular%Pannular_reg>data%State%AnnularComputational%AnnularMovingPressure) then ! 1: Open , 0: Close | |||||
data%State%RAM(1)%FourwayValve = 0 | |||||
data%State%Annular%Annular_closed=0 | |||||
data%State%RAM(1)%FourwayValve = 0 | |||||
data%State%Annular%Annular_closed=0 | |||||
!Annular_closed_withPossibility= Annular_closed * TD_BOPConnectionPossibility(1) | !Annular_closed_withPossibility= Annular_closed * TD_BOPConnectionPossibility(1) | ||||
data%State%RAM(1)%vdis_tot=0 | |||||
data%State%RAM(1)%vdis_bottles=0. | |||||
data%State%RAM(1)%fvr_air=0. | |||||
data%State%RAM(1)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(1)%Qzero=70 | |||||
data%State%RAM(1)%Q=data%State%RAM(1)%Qzero | |||||
data%State%RAM(1)%flow=70 | |||||
data%State%Annular%tolAnnular=0.0018 | |||||
if (data%State%Annular%finished_Annular==1) then | |||||
data%State%Annular%AnnularLeverOld=-1.0 | |||||
else | |||||
data%State%Annular%AnnularLeverOld=data%Equipments%BopControlPanel%AnnularValve | |||||
endif | |||||
data%State%Annular%finished_Annular=0 | |||||
data%State%Annular%AnnularIsClosing = .true. | |||||
data%State%Annular%AnnularIsOpening = .false. | |||||
data%State%RAM(1)%vdis_tot=0 | |||||
data%State%RAM(1)%vdis_bottles=0. | |||||
data%State%RAM(1)%fvr_air=0. | |||||
data%State%RAM(1)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(1)%Qzero=70 | |||||
data%State%RAM(1)%Q=data%State%RAM(1)%Qzero | |||||
data%State%RAM(1)%flow=70 | |||||
data%State%Annular%tolAnnular=0.0018 | |||||
if (data%State%Annular%finished_Annular==1) then | |||||
data%State%Annular%AnnularLeverOld=-1.0 | |||||
else | |||||
data%State%Annular%AnnularLeverOld=data%Equipments%BopControlPanel%AnnularValve | |||||
endif | |||||
data%State%Annular%finished_Annular=0 | |||||
data%State%Annular%AnnularIsClosing = .true. | |||||
data%State%Annular%AnnularIsOpening = .false. | |||||
data%State%RAM(2)%bop_type = 3 | |||||
data%State%RAM(2)%bop_type = 3 | |||||
!AbopAnnular=963.1 !(in^2) | !AbopAnnular=963.1 !(in^2) | ||||
data%State%Annular%AbopAnnular=(data%Configuration%BopStack%AnnularPreventerClose*231.)/((data%State%Annular%IDAnnularBase-data%State%Annular%ODDrillpipe_inAnnularBase)/2.) ! 231 in^3 = 1 gal | |||||
data%State%Annular%NeededVolumeAnnular=data%State%Annular%AbopAnnular*(data%State%Annular%IDAnnularBase-max(data%State%Annular%ODDrillpipe_inAnnular,data%State%Annular%ODDrillpipe_inAnnularBase))/(2.*231) !=17.98 galon for IDAnnularBase=13 5/8 , ODDrillpipe_inAnnularBase=5 | |||||
data%State%Annular%AbopAnnular=(data%Configuration%BopStack%AnnularPreventerClose*231.)/((data%State%Annular%IDAnnularBase-data%State%Annular%ODDrillpipe_inAnnularBase)/2.) ! 231 in^3 = 1 gal | |||||
data%State%Annular%NeededVolumeAnnular=data%State%Annular%AbopAnnular*(data%State%Annular%IDAnnularBase-max(data%State%Annular%ODDrillpipe_inAnnular,data%State%Annular%ODDrillpipe_inAnnularBase))/(2.*231) !=17.98 galon for IDAnnularBase=13 5/8 , ODDrillpipe_inAnnularBase=5 | |||||
!WRITE(*,*) 'a)NeededVolumeAnnular=' , NeededVolumeAnnular | !WRITE(*,*) 'a)NeededVolumeAnnular=' , NeededVolumeAnnular | ||||
!write(*,*) 'close 1' | !write(*,*) 'close 1' | ||||
endif | |||||
endif | |||||
if (data%Equipments%BopControlPanel%AnnularValve == -1.0 .and. data%State%Annular%AnnularFailureMalf==0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1 ) then | |||||
if (data%State%BopStackInput%AnnularOpenLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
if (data%Equipments%BopControlPanel%AnnularValve == -1.0 .and. data%State%Annular%AnnularFailureMalf==0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1 ) then | |||||
if (data%State%BopStackInput%AnnularOpenLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
!CasingPressure : PressureGauges(2) *****temp conditionssssss | !CasingPressure : PressureGauges(2) *****temp conditionssssss | ||||
!note: (AnnularSealingPressure) is only for opening while well is pressurised | !note: (AnnularSealingPressure) is only for opening while well is pressurised | ||||
if ( data%State%RAM(1)%SuccessionCounter /= data%State%RAM(1)%SuccessionCounterOld+1 ) then | |||||
data%State%RAM(1)%SuccessionCounter = 0 ! also in starup | |||||
data%State%RAM(1)%SuccessionCounterOld = 0 ! also in starup | |||||
if ( data%State%RAM(1)%SuccessionCounter /= data%State%RAM(1)%SuccessionCounterOld+1 ) then | |||||
data%State%RAM(1)%SuccessionCounter = 0 ! also in starup | |||||
data%State%RAM(1)%SuccessionCounterOld = 0 ! also in starup | |||||
!return | !return | ||||
else | |||||
data%State%RAM(1)%SuccessionCounterOld= data%State%RAM(1)%SuccessionCounter | |||||
endif | |||||
else | |||||
data%State%RAM(1)%SuccessionCounterOld= data%State%RAM(1)%SuccessionCounter | |||||
endif | |||||
if ( data%State%RAM(1)%SuccessionCounter >= int(2.5/data%State%RamLine%DeltaT_BOP) ) then | |||||
if ( data%State%RAM(1)%SuccessionCounter >= int(2.5/data%State%RamLine%DeltaT_BOP) ) then | |||||
!return | !return | ||||
data%State%RAM(1)%First_OpenTimecheck= 1 | |||||
data%Equipments%BopControlPanel%AnnularCloseLED = LedOff !new | |||||
data%State%BopStackInput%AnnularCloseLedMine = LedOff !new | |||||
data%Equipments%BopControlPanel%AnnularOpenLED = LedOn !LedBlinking | |||||
data%State%RAM(1)%FourwayValve = 1 | |||||
endif | |||||
data%State%RAM(1)%First_OpenTimecheck= 1 | |||||
data%Equipments%BopControlPanel%AnnularCloseLED = LedOff !new | |||||
data%State%BopStackInput%AnnularCloseLedMine = LedOff !new | |||||
data%Equipments%BopControlPanel%AnnularOpenLED = LedOn !LedBlinking | |||||
data%State%RAM(1)%FourwayValve = 1 | |||||
endif | endif | ||||
endif | |||||
if (data%State%RAM(1)%FourwayValve == 1 .and. data%State%Annular%Pannular_reg>data%State%AnnularComputational%AnnularMovingPressure .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure & | |||||
if (data%State%RAM(1)%FourwayValve == 1 .and. data%State%Annular%Pannular_reg>data%State%AnnularComputational%AnnularMovingPressure .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure & | |||||
.and. (data%State%Annular%Annular_closed==0 .or. (data%State%Annular%Annular_closed==1 .and. data%State%PressureDisplay%PressureGauges(2) <=100.0) .or. (data%State%Annular%Annular_closed==1 .and. data%State%PressureDisplay%PressureGauges(2)>100.0 .and. data%State%Annular%Pannular_reg>=data%State%AnnularComputational%AnnularSealingPressure))) then ! 1: Open , 0: Close | .and. (data%State%Annular%Annular_closed==0 .or. (data%State%Annular%Annular_closed==1 .and. data%State%PressureDisplay%PressureGauges(2) <=100.0) .or. (data%State%Annular%Annular_closed==1 .and. data%State%PressureDisplay%PressureGauges(2)>100.0 .and. data%State%Annular%Pannular_reg>=data%State%AnnularComputational%AnnularSealingPressure))) then ! 1: Open , 0: Close | ||||
!write(*,*) 'open 2' | !write(*,*) 'open 2' | ||||
data%State%RAM(1)%FourwayValve = 0 | |||||
data%State%RAM(1)%FourwayValve = 0 | |||||
data%State%Annular%Annular_closed=0 | |||||
data%State%Annular%Annular_closed=0 | |||||
!Annular_closed_withPossibility= Annular_closed * TD_BOPConnectionPossibility(1) | !Annular_closed_withPossibility= Annular_closed * TD_BOPConnectionPossibility(1) | ||||
data%State%RAM(1)%vdis_tot=0 | |||||
data%State%RAM(1)%vdis_bottles=0. | |||||
data%State%RAM(1)%fvr_air=0. | |||||
data%State%RAM(1)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(1)%Qzero=70 | |||||
data%State%RAM(1)%Q=data%State%RAM(1)%Qzero | |||||
data%State%RAM(1)%flow=70 | |||||
data%State%Annular%tolAnnular=0.0018 | |||||
data%State%RAM(1)%vdis_tot=0 | |||||
data%State%RAM(1)%vdis_bottles=0. | |||||
data%State%RAM(1)%fvr_air=0. | |||||
data%State%RAM(1)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(1)%Qzero=70 | |||||
data%State%RAM(1)%Q=data%State%RAM(1)%Qzero | |||||
data%State%RAM(1)%flow=70 | |||||
data%State%Annular%tolAnnular=0.0018 | |||||
if (data%State%Annular%finished_Annular==1) then | |||||
data%State%Annular%AnnularLeverOld=1.0 | |||||
else | |||||
data%State%Annular%AnnularLeverOld=data%Equipments%BopControlPanel%AnnularValve | |||||
endif | |||||
data%State%Annular%finished_Annular=0 | |||||
data%State%Annular%AnnularIsOpening = .true. | |||||
data%State%Annular%AnnularIsClosing = .false. | |||||
if (data%State%Annular%finished_Annular==1) then | |||||
data%State%Annular%AnnularLeverOld=1.0 | |||||
else | |||||
data%State%Annular%AnnularLeverOld=data%Equipments%BopControlPanel%AnnularValve | |||||
endif | |||||
data%State%Annular%finished_Annular=0 | |||||
data%State%Annular%AnnularIsOpening = .true. | |||||
data%State%Annular%AnnularIsClosing = .false. | |||||
!if (AnnularOpenLed == LedOn) then | !if (AnnularOpenLed == LedOn) then | ||||
@@ -164,24 +164,24 @@ SUBROUTINE ANNULAR_SUB1 | |||||
data%State%RAM(1)%bop_type = 3 | |||||
data%State%RAM(1)%bop_type = 3 | |||||
!AbopAnnular=758.48 !(in^2) | !AbopAnnular=758.48 !(in^2) | ||||
data%State%Annular%AbopAnnular=(data%Configuration%BopStack%AnnularPreventerOpen*231)/((data%State%Annular%IDAnnularBase-max(data%State%Annular%ODDrillpipe_inAnnular,data%State%Annular%ODDrillpipe_inAnnularBase))/2.) | |||||
data%State%Annular%NeededVolumeAnnular=data%State%Annular%AbopAnnular*(data%State%Annular%IDAnnularBase-data%State%Annular%ODDrillpipe_inAnnular)/(2.*231) !=14.16 galon for IDAnnularBase=13 5/8 , ODDrillpipe_inAnnular=5 | |||||
data%State%Annular%AbopAnnular=(data%Configuration%BopStack%AnnularPreventerOpen*231)/((data%State%Annular%IDAnnularBase-max(data%State%Annular%ODDrillpipe_inAnnular,data%State%Annular%ODDrillpipe_inAnnularBase))/2.) | |||||
data%State%Annular%NeededVolumeAnnular=data%State%Annular%AbopAnnular*(data%State%Annular%IDAnnularBase-data%State%Annular%ODDrillpipe_inAnnular)/(2.*231) !=14.16 galon for IDAnnularBase=13 5/8 , ODDrillpipe_inAnnular=5 | |||||
!write(*,*) 'open 1' | !write(*,*) 'open 1' | ||||
endif | |||||
endif | |||||
!===================================================================== | !===================================================================== | ||||
if (data%State%Annular%AnnularIsOpening .or. data%State%Annular%AnnularIsClosing .or. data%State%RAM(1)%Bottles_Charged_MalfActive) then | |||||
CALL ANNULAR_SUB2 | |||||
end if | |||||
if (data%State%Annular%AnnularIsOpening .or. data%State%Annular%AnnularIsClosing .or. data%State%RAM(1)%Bottles_Charged_MalfActive) then | |||||
CALL ANNULAR_SUB2 | |||||
end if | |||||
END SUBROUTINE ANNULAR_SUB1 | |||||
END SUBROUTINE ANNULAR_SUB1 | |||||
@@ -289,7 +289,8 @@ module BOP | |||||
data%Equipments%BopControlPanel%LowerRamsStatus = data%State%PipeRam2%ID | data%Equipments%BopControlPanel%LowerRamsStatus = data%State%PipeRam2%ID | ||||
data%Equipments%BopControlPanel%AnnularStatus = data%State%Annular%IDAnnular | data%Equipments%BopControlPanel%AnnularStatus = data%State%Annular%IDAnnular | ||||
data%Equipments%BopControlPanel%AccumulatorPressureGauge = (1 - data%State%BopStackAcc%AccumulatorPressureGaugeMalf) * data%State%RamLine%P_ACC | data%Equipments%BopControlPanel%AccumulatorPressureGauge = (1 - data%State%BopStackAcc%AccumulatorPressureGaugeMalf) * data%State%RamLine%P_ACC | ||||
data%Equipments%BopControlPanel%ManifoldPressureGauge= (1 - data%State%BopStackAcc%ManifoldPressureGaugeMalf) * data%State%BopStackAcc%pram_reg | |||||
data%Equipments%BopControlPanel%ManifoldPressureGauge = (1 - data%State%BopStackAcc%ManifoldPressureGaugeMalf) * data%State%BopStackAcc%pram_reg | |||||
! if(print_log) print *, "ManifoldPressureGauge = ", data%Equipments%BopControlPanel%ManifoldPressureGauge | |||||
!AnnularPressureGauge=Pannular_reg | !AnnularPressureGauge=Pannular_reg | ||||
! | ! | ||||
! WRITE(60,60) data%State%RAM(2)%time,data%State%RAM(2)%Q,data%State%RAM(2)%vdis_tot,p_acc, & | ! WRITE(60,60) data%State%RAM(2)%time,data%State%RAM(2)%Q,data%State%RAM(2)%vdis_tot,p_acc, & | ||||
@@ -18,7 +18,7 @@ module BOP | |||||
data%State%BopStackInput%BOP_timeCounter= data%State%BopStackInput%BOP_timeCounter + 1 | data%State%BopStackInput%BOP_timeCounter= data%State%BopStackInput%BOP_timeCounter + 1 | ||||
write(*,*) 'BOP_timeCounter=' , data%State%BopStackInput%BOP_timeCounter | |||||
! write(*,*) 'BOP_timeCounter=' , data%State%BopStackInput%BOP_timeCounter | |||||
data%Equipments%BopControlPanel%AirSupplyPressureGauge= (1 - data%State%BopStackAcc%AirSupplyPressureGaugeMalf)* (1 - data%State%BopStackAcc%RigAirMalf) *120. !psi | data%Equipments%BopControlPanel%AirSupplyPressureGauge= (1 - data%State%BopStackAcc%AirSupplyPressureGaugeMalf)* (1 - data%State%BopStackAcc%RigAirMalf) *120. !psi | ||||
@@ -290,7 +290,8 @@ module BOP | |||||
data%Equipments%BopControlPanel%LowerRamsStatus = data%State%PipeRam2%ID | data%Equipments%BopControlPanel%LowerRamsStatus = data%State%PipeRam2%ID | ||||
data%Equipments%BopControlPanel%AnnularStatus = data%State%Annular%IDAnnular | data%Equipments%BopControlPanel%AnnularStatus = data%State%Annular%IDAnnular | ||||
data%Equipments%BopControlPanel%AccumulatorPressureGauge = (1 - data%State%BopStackAcc%AccumulatorPressureGaugeMalf) * data%State%RamLine%P_ACC | data%Equipments%BopControlPanel%AccumulatorPressureGauge = (1 - data%State%BopStackAcc%AccumulatorPressureGaugeMalf) * data%State%RamLine%P_ACC | ||||
data%Equipments%BopControlPanel%ManifoldPressureGauge= (1 - data%State%BopStackAcc%ManifoldPressureGaugeMalf) * data%State%BopStackAcc%pram_reg | |||||
data%Equipments%BopControlPanel%ManifoldPressureGauge = (1 - data%State%BopStackAcc%ManifoldPressureGaugeMalf) * data%State%BopStackAcc%pram_reg | |||||
! if(print_log) print *, "ManifoldPressureGauge = ", data%Equipments%BopControlPanel%ManifoldPressureGauge | |||||
!AnnularPressureGauge=Pannular_reg | !AnnularPressureGauge=Pannular_reg | ||||
! | ! | ||||
! WRITE(60,60) data%State%RAM(2)%time,data%State%RAM(2)%Q,data%State%RAM(2)%vdis_tot,p_acc, & | ! WRITE(60,60) data%State%RAM(2)%time,data%State%RAM(2)%Q,data%State%RAM(2)%vdis_tot,p_acc, & | ||||
@@ -17,11 +17,11 @@ SUBROUTINE KILL_LINE | |||||
! START CONDITIONS FOR KILL LINE 1 | ! START CONDITIONS FOR KILL LINE 1 | ||||
!===================================================================== | !===================================================================== | ||||
data%State%RAM(6)%SuccessionCounter = data%State%RAM(6)%SuccessionCounter + 1 | |||||
data%State%RAM(6)%SuccessionCounter = data%State%RAM(6)%SuccessionCounter + 1 | |||||
if (data%Equipments%BopControlPanel%KillLineValve == -1.0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1 .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure) then | |||||
if (data%Equipments%BopControlPanel%KillLineValve == -1.0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1 .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure) then | |||||
if ( data%State%RAM(6)%SuccessionCounter /= data%State%RAM(6)%SuccessionCounterOld+1 ) then | if ( data%State%RAM(6)%SuccessionCounter /= data%State%RAM(6)%SuccessionCounterOld+1 ) then | ||||
data%State%RAM(6)%SuccessionCounter = 0 ! also in starup | data%State%RAM(6)%SuccessionCounter = 0 ! also in starup | ||||
data%State%RAM(6)%SuccessionCounterOld = 0 ! also in starup | data%State%RAM(6)%SuccessionCounterOld = 0 ! also in starup | ||||
@@ -35,97 +35,97 @@ SUBROUTINE KILL_LINE | |||||
return | return | ||||
endif | endif | ||||
data%State%RAM(6)%First_CloseTimecheck= 1 | |||||
data%State%RAM(6)%First_CloseTimecheck= 1 | |||||
if (data%State%BopStackInput%KillLineOpenLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
data%State%KillLine%closed=0 | |||||
data%State%RAM(6)%vdis_tot=0 | |||||
data%State%RAM(6)%vdis_bottles=0. | |||||
data%State%RAM(6)%fvr_air=0. | |||||
data%State%RAM(6)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(6)%Qzero=70 | |||||
data%State%RAM(6)%Q=data%State%RAM(6)%Qzero | |||||
data%State%RAM(6)%flow=70 | |||||
data%State%RAM(6)%tol=0.0037 | |||||
if (data%State%KillLine%finished==1) then | |||||
data%State%KillLine%LeverOld= 1.0 | |||||
else | |||||
data%State%KillLine%LeverOld=data%Equipments%BopControlPanel%KillLineValve | |||||
endif | |||||
data%State%KillLine%finished=0 | |||||
data%State%KillLine%IsOpening = .true. | |||||
data%Equipments%BopControlPanel%KillLineCloseLED = LedOff | |||||
data%State%BopStackInput%KillLineCloseLedMine = LedOff | |||||
data%Equipments%BopControlPanel%KillLineOpenLED = LedOn !LedBlinking | |||||
data%State%RAM(6)%bop_type = 3 | |||||
!AbopKillLine=196.67 | |||||
data%State%KillLine%Abop=(data%Configuration%BopStack%KillClose*231)/((data%State%KillLine%IDBase-data%State%KillLine%ODDrillpipe_inBase)/2.) | |||||
data%State%KillLine%NeededVolume=data%State%KillLine%Abop*(data%State%KillLine%IDBase-max(data%State%KillLine%ODDrillpipe_in,data%State%KillLine%ODDrillpipe_inBase))/(2.*231) !1.5 galon for each BOP | |||||
if (data%State%BopStackInput%KillLineOpenLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
data%State%KillLine%closed=0 | |||||
data%State%RAM(6)%vdis_tot=0 | |||||
data%State%RAM(6)%vdis_bottles=0. | |||||
data%State%RAM(6)%fvr_air=0. | |||||
data%State%RAM(6)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(6)%Qzero=70 | |||||
data%State%RAM(6)%Q=data%State%RAM(6)%Qzero | |||||
data%State%RAM(6)%flow=70 | |||||
data%State%RAM(6)%tol=0.0037 | |||||
if (data%State%KillLine%finished==1) then | |||||
data%State%KillLine%LeverOld= 1.0 | |||||
else | |||||
data%State%KillLine%LeverOld=data%Equipments%BopControlPanel%KillLineValve | |||||
endif | endif | ||||
data%State%KillLine%finished=0 | |||||
data%State%KillLine%IsOpening = .true. | |||||
data%Equipments%BopControlPanel%KillLineCloseLED = LedOff | |||||
data%State%BopStackInput%KillLineCloseLedMine = LedOff | |||||
data%Equipments%BopControlPanel%KillLineOpenLED = LedOn !LedBlinking | |||||
data%State%RAM(6)%bop_type = 3 | |||||
!AbopKillLine=196.67 | |||||
data%State%KillLine%Abop=(data%Configuration%BopStack%KillClose*231)/((data%State%KillLine%IDBase-data%State%KillLine%ODDrillpipe_inBase)/2.) | |||||
data%State%KillLine%NeededVolume=data%State%KillLine%Abop*(data%State%KillLine%IDBase-max(data%State%KillLine%ODDrillpipe_in,data%State%KillLine%ODDrillpipe_inBase))/(2.*231) !1.5 galon for each BOP | |||||
endif | |||||
if (data%Equipments%BopControlPanel%KillLineValve == 1.0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1 .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure) then | |||||
if ( data%State%RAM(6)%SuccessionCounter /= data%State%RAM(6)%SuccessionCounterOld+1 ) then | |||||
data%State%RAM(6)%SuccessionCounter = 0 ! also in starup | |||||
data%State%RAM(6)%SuccessionCounterOld = 0 ! also in starup | |||||
return | |||||
else | |||||
data%State%RAM(6)%SuccessionCounterOld= data%State%RAM(6)%SuccessionCounter | |||||
endif | |||||
if (data%Equipments%BopControlPanel%KillLineValve == 1.0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1 .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure) then | |||||
if ( data%State%RAM(6)%SuccessionCounter < int(2.5/data%State%RamLine%DeltaT_BOP) ) then | |||||
return | |||||
endif | |||||
data%State%RAM(6)%First_OpenTimecheck= 1 | |||||
if (data%State%BopStackInput%KillLineCloseLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
data%State%KillLine%closed=0 | |||||
data%State%RAM(6)%vdis_tot=0 | |||||
data%State%RAM(6)%vdis_bottles=0. | |||||
data%State%RAM(6)%fvr_air=0. | |||||
data%State%RAM(6)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(6)%Qzero=70 | |||||
data%State%RAM(6)%Q=data%State%RAM(6)%Qzero | |||||
data%State%RAM(6)%flow=70 | |||||
data%State%RAM(6)%tol=0.0037 | |||||
if ( data%State%RAM(6)%SuccessionCounter /= data%State%RAM(6)%SuccessionCounterOld+1 ) then | |||||
data%State%RAM(6)%SuccessionCounter = 0 ! also in starup | |||||
data%State%RAM(6)%SuccessionCounterOld = 0 ! also in starup | |||||
return | |||||
else | |||||
data%State%RAM(6)%SuccessionCounterOld= data%State%RAM(6)%SuccessionCounter | |||||
endif | |||||
if ( data%State%RAM(6)%SuccessionCounter < int(2.5/data%State%RamLine%DeltaT_BOP) ) then | |||||
return | |||||
endif | |||||
data%State%RAM(6)%First_OpenTimecheck= 1 | |||||
if (data%State%BopStackInput%KillLineCloseLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
data%State%KillLine%closed=0 | |||||
data%State%RAM(6)%vdis_tot=0 | |||||
data%State%RAM(6)%vdis_bottles=0. | |||||
data%State%RAM(6)%fvr_air=0. | |||||
data%State%RAM(6)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(6)%Qzero=70 | |||||
data%State%RAM(6)%Q=data%State%RAM(6)%Qzero | |||||
data%State%RAM(6)%flow=70 | |||||
data%State%RAM(6)%tol=0.0037 | |||||
if (data%State%KillLine%finished==1) then | |||||
data%State%KillLine%LeverOld= -1.0 | |||||
else | |||||
data%State%KillLine%LeverOld=data%Equipments%BopControlPanel%KillLineValve | |||||
endif | |||||
data%State%KillLine%finished=0 | |||||
data%State%KillLine%IsClosing = .true. | |||||
if (data%State%KillLine%finished==1) then | |||||
data%State%KillLine%LeverOld= -1.0 | |||||
else | |||||
data%State%KillLine%LeverOld=data%Equipments%BopControlPanel%KillLineValve | |||||
endif | |||||
data%State%KillLine%finished=0 | |||||
data%State%KillLine%IsClosing = .true. | |||||
!if (KillLineCloseLed == LedOn) then | |||||
! RETURN | |||||
!end if | |||||
!if (KillLineCloseLed == LedOn) then | |||||
! RETURN | |||||
!end if | |||||
data%Equipments%BopControlPanel%KillLineCloseLED = LedOff !new | |||||
data%State%BopStackInput%KillLineCloseLedMine = LedOff !new | |||||
data%Equipments%BopControlPanel%KillLineCloseLED = LedOn !LedBlinking | |||||
data%State%RAM(6)%bop_type = 3 | |||||
!AbopKillLine=196.67 | |||||
data%State%KillLine%Abop=(data%Configuration%BopStack%KillOpen*231)/((data%State%KillLine%IDBase-data%State%KillLine%ODDrillpipe_inBase)/2.) | |||||
data%State%KillLine%NeededVolume=data%State%KillLine%Abop*(data%State%KillLine%IDBase-max(data%State%KillLine%ODDrillpipe_in,data%State%KillLine%ODDrillpipe_inBase))/(2.*231) !1.5 galon for each BOP | |||||
endif | |||||
data%Equipments%BopControlPanel%KillLineCloseLED = LedOff !new | |||||
data%State%BopStackInput%KillLineCloseLedMine = LedOff !new | |||||
data%Equipments%BopControlPanel%KillLineCloseLED = LedOn !LedBlinking | |||||
data%State%RAM(6)%bop_type = 3 | |||||
!AbopKillLine=196.67 | |||||
data%State%KillLine%Abop=(data%Configuration%BopStack%KillOpen*231)/((data%State%KillLine%IDBase-data%State%KillLine%ODDrillpipe_inBase)/2.) | |||||
data%State%KillLine%NeededVolume=data%State%KillLine%Abop*(data%State%KillLine%IDBase-max(data%State%KillLine%ODDrillpipe_in,data%State%KillLine%ODDrillpipe_inBase))/(2.*231) !1.5 galon for each BOP | |||||
endif | |||||
!========================================================================== | !========================================================================== | ||||
@@ -1,4 +1,4 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/Equipments/BopStack/KILL_LINE.f90" | |||||
# 1 "/home/admin/SimulationCore2/Equipments/BopStack/KILL_LINE.f90" | |||||
SUBROUTINE KILL_LINE | SUBROUTINE KILL_LINE | ||||
@@ -18,11 +18,11 @@ SUBROUTINE KILL_LINE | |||||
! START CONDITIONS FOR KILL LINE 1 | ! START CONDITIONS FOR KILL LINE 1 | ||||
!===================================================================== | !===================================================================== | ||||
data%State%RAM(6)%SuccessionCounter = data%State%RAM(6)%SuccessionCounter + 1 | |||||
data%State%RAM(6)%SuccessionCounter = data%State%RAM(6)%SuccessionCounter + 1 | |||||
if (data%Equipments%BopControlPanel%KillLineValve == -1.0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1 .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure) then | |||||
if (data%Equipments%BopControlPanel%KillLineValve == -1.0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1 .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure) then | |||||
if ( data%State%RAM(6)%SuccessionCounter /= data%State%RAM(6)%SuccessionCounterOld+1 ) then | if ( data%State%RAM(6)%SuccessionCounter /= data%State%RAM(6)%SuccessionCounterOld+1 ) then | ||||
data%State%RAM(6)%SuccessionCounter = 0 ! also in starup | data%State%RAM(6)%SuccessionCounter = 0 ! also in starup | ||||
data%State%RAM(6)%SuccessionCounterOld = 0 ! also in starup | data%State%RAM(6)%SuccessionCounterOld = 0 ! also in starup | ||||
@@ -36,97 +36,97 @@ SUBROUTINE KILL_LINE | |||||
return | return | ||||
endif | endif | ||||
data%State%RAM(6)%First_CloseTimecheck= 1 | |||||
data%State%RAM(6)%First_CloseTimecheck= 1 | |||||
if (data%State%BopStackInput%KillLineOpenLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
data%State%KillLine%closed=0 | |||||
data%State%RAM(6)%vdis_tot=0 | |||||
data%State%RAM(6)%vdis_bottles=0. | |||||
data%State%RAM(6)%fvr_air=0. | |||||
data%State%RAM(6)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(6)%Qzero=70 | |||||
data%State%RAM(6)%Q=data%State%RAM(6)%Qzero | |||||
data%State%RAM(6)%flow=70 | |||||
data%State%RAM(6)%tol=0.0037 | |||||
if (data%State%KillLine%finished==1) then | |||||
data%State%KillLine%LeverOld= 1.0 | |||||
else | |||||
data%State%KillLine%LeverOld=data%Equipments%BopControlPanel%KillLineValve | |||||
endif | |||||
data%State%KillLine%finished=0 | |||||
data%State%KillLine%IsOpening = .true. | |||||
data%Equipments%BopControlPanel%KillLineCloseLED = LedOff | |||||
data%State%BopStackInput%KillLineCloseLedMine = LedOff | |||||
data%Equipments%BopControlPanel%KillLineOpenLED = LedOn !LedBlinking | |||||
data%State%RAM(6)%bop_type = 3 | |||||
!AbopKillLine=196.67 | |||||
data%State%KillLine%Abop=(data%Configuration%BopStack%KillClose*231)/((data%State%KillLine%IDBase-data%State%KillLine%ODDrillpipe_inBase)/2.) | |||||
data%State%KillLine%NeededVolume=data%State%KillLine%Abop*(data%State%KillLine%IDBase-max(data%State%KillLine%ODDrillpipe_in,data%State%KillLine%ODDrillpipe_inBase))/(2.*231) !1.5 galon for each BOP | |||||
if (data%State%BopStackInput%KillLineOpenLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
data%State%KillLine%closed=0 | |||||
data%State%RAM(6)%vdis_tot=0 | |||||
data%State%RAM(6)%vdis_bottles=0. | |||||
data%State%RAM(6)%fvr_air=0. | |||||
data%State%RAM(6)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(6)%Qzero=70 | |||||
data%State%RAM(6)%Q=data%State%RAM(6)%Qzero | |||||
data%State%RAM(6)%flow=70 | |||||
data%State%RAM(6)%tol=0.0037 | |||||
if (data%State%KillLine%finished==1) then | |||||
data%State%KillLine%LeverOld= 1.0 | |||||
else | |||||
data%State%KillLine%LeverOld=data%Equipments%BopControlPanel%KillLineValve | |||||
endif | endif | ||||
data%State%KillLine%finished=0 | |||||
data%State%KillLine%IsOpening = .true. | |||||
data%Equipments%BopControlPanel%KillLineCloseLED = LedOff | |||||
data%State%BopStackInput%KillLineCloseLedMine = LedOff | |||||
data%Equipments%BopControlPanel%KillLineOpenLED = LedOn !LedBlinking | |||||
data%State%RAM(6)%bop_type = 3 | |||||
!AbopKillLine=196.67 | |||||
data%State%KillLine%Abop=(data%Configuration%BopStack%KillClose*231)/((data%State%KillLine%IDBase-data%State%KillLine%ODDrillpipe_inBase)/2.) | |||||
data%State%KillLine%NeededVolume=data%State%KillLine%Abop*(data%State%KillLine%IDBase-max(data%State%KillLine%ODDrillpipe_in,data%State%KillLine%ODDrillpipe_inBase))/(2.*231) !1.5 galon for each BOP | |||||
endif | |||||
if (data%Equipments%BopControlPanel%KillLineValve == 1.0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1 .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure) then | |||||
if ( data%State%RAM(6)%SuccessionCounter /= data%State%RAM(6)%SuccessionCounterOld+1 ) then | |||||
data%State%RAM(6)%SuccessionCounter = 0 ! also in starup | |||||
data%State%RAM(6)%SuccessionCounterOld = 0 ! also in starup | |||||
return | |||||
else | |||||
data%State%RAM(6)%SuccessionCounterOld= data%State%RAM(6)%SuccessionCounter | |||||
endif | |||||
if (data%Equipments%BopControlPanel%KillLineValve == 1.0 .and. data%State%BopStackAcc%RigAirMalf==0 .and. data%Equipments%BopControlPanel%AirMasterValve==1 .and. data%State%RamLine%P_ACC>data%State%BopStackAcc%acc_MinPressure) then | |||||
if ( data%State%RAM(6)%SuccessionCounter < int(2.5/data%State%RamLine%DeltaT_BOP) ) then | |||||
return | |||||
endif | |||||
data%State%RAM(6)%First_OpenTimecheck= 1 | |||||
if (data%State%BopStackInput%KillLineCloseLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
data%State%KillLine%closed=0 | |||||
data%State%RAM(6)%vdis_tot=0 | |||||
data%State%RAM(6)%vdis_bottles=0. | |||||
data%State%RAM(6)%fvr_air=0. | |||||
data%State%RAM(6)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(6)%Qzero=70 | |||||
data%State%RAM(6)%Q=data%State%RAM(6)%Qzero | |||||
data%State%RAM(6)%flow=70 | |||||
data%State%RAM(6)%tol=0.0037 | |||||
if ( data%State%RAM(6)%SuccessionCounter /= data%State%RAM(6)%SuccessionCounterOld+1 ) then | |||||
data%State%RAM(6)%SuccessionCounter = 0 ! also in starup | |||||
data%State%RAM(6)%SuccessionCounterOld = 0 ! also in starup | |||||
return | |||||
else | |||||
data%State%RAM(6)%SuccessionCounterOld= data%State%RAM(6)%SuccessionCounter | |||||
endif | |||||
if ( data%State%RAM(6)%SuccessionCounter < int(2.5/data%State%RamLine%DeltaT_BOP) ) then | |||||
return | |||||
endif | |||||
data%State%RAM(6)%First_OpenTimecheck= 1 | |||||
if (data%State%BopStackInput%KillLineCloseLedMine == LedOn) then | |||||
RETURN | |||||
end if | |||||
data%State%KillLine%closed=0 | |||||
data%State%RAM(6)%vdis_tot=0 | |||||
data%State%RAM(6)%vdis_bottles=0. | |||||
data%State%RAM(6)%fvr_air=0. | |||||
data%State%RAM(6)%vdis_elecp=0. | |||||
data%State%Pumps%Qiter=7 | |||||
data%State%RAM(6)%Qzero=70 | |||||
data%State%RAM(6)%Q=data%State%RAM(6)%Qzero | |||||
data%State%RAM(6)%flow=70 | |||||
data%State%RAM(6)%tol=0.0037 | |||||
if (data%State%KillLine%finished==1) then | |||||
data%State%KillLine%LeverOld= -1.0 | |||||
else | |||||
data%State%KillLine%LeverOld=data%Equipments%BopControlPanel%KillLineValve | |||||
endif | |||||
data%State%KillLine%finished=0 | |||||
data%State%KillLine%IsClosing = .true. | |||||
if (data%State%KillLine%finished==1) then | |||||
data%State%KillLine%LeverOld= -1.0 | |||||
else | |||||
data%State%KillLine%LeverOld=data%Equipments%BopControlPanel%KillLineValve | |||||
endif | |||||
data%State%KillLine%finished=0 | |||||
data%State%KillLine%IsClosing = .true. | |||||
!if (KillLineCloseLed == LedOn) then | !if (KillLineCloseLed == LedOn) then | ||||
! RETURN | ! RETURN | ||||
!end if | !end if | ||||
data%Equipments%BopControlPanel%KillLineCloseLED = LedOff !new | |||||
data%State%BopStackInput%KillLineCloseLedMine = LedOff !new | |||||
data%Equipments%BopControlPanel%KillLineCloseLED = LedOn !LedBlinking | |||||
data%State%RAM(6)%bop_type = 3 | |||||
data%Equipments%BopControlPanel%KillLineCloseLED = LedOff !new | |||||
data%State%BopStackInput%KillLineCloseLedMine = LedOff !new | |||||
data%Equipments%BopControlPanel%KillLineCloseLED = LedOn !LedBlinking | |||||
data%State%RAM(6)%bop_type = 3 | |||||
!AbopKillLine=196.67 | !AbopKillLine=196.67 | ||||
data%State%KillLine%Abop=(data%Configuration%BopStack%KillOpen*231)/((data%State%KillLine%IDBase-data%State%KillLine%ODDrillpipe_inBase)/2.) | |||||
data%State%KillLine%NeededVolume=data%State%KillLine%Abop*(data%State%KillLine%IDBase-max(data%State%KillLine%ODDrillpipe_in,data%State%KillLine%ODDrillpipe_inBase))/(2.*231) !1.5 galon for each BOP | |||||
endif | |||||
data%State%KillLine%Abop=(data%Configuration%BopStack%KillOpen*231)/((data%State%KillLine%IDBase-data%State%KillLine%ODDrillpipe_inBase)/2.) | |||||
data%State%KillLine%NeededVolume=data%State%KillLine%Abop*(data%State%KillLine%IDBase-max(data%State%KillLine%ODDrillpipe_in,data%State%KillLine%ODDrillpipe_inBase))/(2.*231) !1.5 galon for each BOP | |||||
endif | |||||
!========================================================================== | !========================================================================== | ||||
@@ -0,0 +1,37 @@ | |||||
# 1 "/home/admin/SimulationCore2/Equipments/BopStack/KillLineMain.f90" | |||||
module KillLineMain | |||||
implicit none | |||||
public | |||||
contains | |||||
! subroutine KillLine_Setup() | |||||
! ! use CSimulationVariables | |||||
! implicit none | |||||
! call OnSimulationInitialization%Add(KillLine_Init) | |||||
! call OnSimulationStop%Add(KillLine_Init) | |||||
! call OnKillLineStep%Add(KillLine_Step) | |||||
! call OnKillLineOutput%Add(KillLine_Output) | |||||
! call OnKillLineMain%Add(KillLineMainBody) | |||||
! end subroutine | |||||
! subroutine KillLine_Init | |||||
! implicit none | |||||
! end subroutine KillLine_Init | |||||
subroutine KillLine_Step | |||||
use SimulationVariables | |||||
implicit none | |||||
if (data%State%KillLine%finished/=0) then | |||||
call KILL_LINE | |||||
if (data%State%KillLine%IsOpening .or. data%State%KillLine%IsClosing) then | |||||
if(data%State%KillLine%finished==0) then | |||||
call KILL_LINE_SUB !only body of loop2 | |||||
endif | |||||
endif | |||||
else | |||||
call KILL_LINE_SUB | |||||
endif | |||||
end subroutine KillLine_Step | |||||
end module KillLineMain |
@@ -64,7 +64,6 @@ INTEGER I | |||||
! RAMLINE MINOR LOSSES INPUT | ! RAMLINE MINOR LOSSES INPUT | ||||
!=========================================================================== | !=========================================================================== | ||||
data%State%RamLine%NO_MINORSRAMLINE=34 | data%State%RamLine%NO_MINORSRAMLINE=34 | ||||
ALLOCATE (data%State%BopStackInput%MINORS1(data%State%RamLine%NO_MINORSRAMLINE,4)) | ALLOCATE (data%State%BopStackInput%MINORS1(data%State%RamLine%NO_MINORSRAMLINE,4)) | ||||
! ID(INCH) LF CV NOTE(BAR) DESCRIPTION | ! ID(INCH) LF CV NOTE(BAR) DESCRIPTION | ||||
@@ -1,337 +0,0 @@ | |||||
SUBROUTINE DEALLOCATE_ARRAYS_CHOKE() | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables !@ | |||||
implicit none | |||||
write(*,*) 'deallocateeeeeeeeeeeee' | |||||
!=========================================================================== | |||||
! AIR PUMP LOSSES INPUT | |||||
!=========================================================================== | |||||
!if(allocated(PIPINGS_AIRPUMP)) deallocate(PIPINGS_AIRPUMP) | |||||
DEALLOCATE (data%State%AirPumpLine%PIPINGS_AIRPUMP,data%State%AirPumpLine%DIAM_AIR_INCH, & | |||||
data%State%AirPumpLine%Re_air,data%State%AirPumpLine%AREA_AIR,data%State%AirPumpLine%LENGT_AIR,data%State%AirPumpLine%ROUGHNESS_AIRPLINE,data%State%AirPumpLine%REL_ROUGHAIR, & | |||||
data%State%AirPumpLine%fric_air,data%State%AirPumpLine%fricloss_air) | |||||
!================================================================ | |||||
DEALLOCATE (data%State%AirPumpLine%MINORS_AIRPUMP,data%State%AirPumpLine%MINORDIAM_AIR_INCH, & | |||||
data%State%AirPumpLine%MINORAREA_AIR,data%State%AirPumpLine%LF_AIR,data%State%AirPumpLine%CV_AIR,data%State%AirPumpLine%NOTE_AIR & | |||||
,data%State%AirPumpLine%minlosspa_air,data%State%AirPumpLine%minloss_air) | |||||
END | |||||
SUBROUTINE LOSS_INPUTS_CHOKE() | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables !@ | |||||
implicit none | |||||
Integer I | |||||
!=========================================================================== | |||||
! AIR PUMP LOSSES INPUT | |||||
!=========================================================================== | |||||
data%State%AirPumpLine%NO_PIPINGS_AIRPLINE=1 | |||||
ALLOCATE (data%State%AirPumpLine%PIPINGS_AIRPUMP(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE,3)) | |||||
! ID(INCH) L(MM) ROUGHNESS(MM)=e DESCRIPTION | |||||
data%State%AirPumpLine%PIPINGS_AIRPUMP(1,1:3)= (/0.5, 60960., 0.03/) !Avg.acc.distance | |||||
!60960= 200 ft | |||||
ALLOCATE(data%State%AirPumpLine%DIAM_AIR_INCH(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%Re_air(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%AREA_AIR(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%LENGT_AIR(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%ROUGHNESS_AIRPLINE(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%REL_ROUGHAIR(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%fric_air(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%fricloss_air(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
DO I=1,data%State%AirPumpLine%NO_PIPINGS_AIRPLINE | |||||
data%State%AirPumpLine%DIAM_AIR_INCH(I)=data%State%AirPumpLine%PIPINGS_AIRPUMP(I,1) | |||||
data%State%AirPumpLine%LENGT_AIR(I)=data%State%AirPumpLine%PIPINGS_AIRPUMP(I,2) | |||||
data%State%AirPumpLine%ROUGHNESS_AIRPLINE(I)=data%State%AirPumpLine%PIPINGS_AIRPUMP(I,3) | |||||
data%State%AirPumpLine%AREA_AIR(I)=PI*(data%State%AirPumpLine%DIAM_AIR_INCH(I)*0.0254)**2/4 !D(in), AREA(m) | |||||
data%State%AirPumpLine%REL_ROUGHAIR(I)=data%State%AirPumpLine%ROUGHNESS_AIRPLINE(I)/(data%State%AirPumpLine%DIAM_AIR_INCH(I)*25.4) | |||||
!DIAM_RAMLINE_MM(I)=DIAM_RAMLINE_MM(I)*.001 ! (m) | |||||
data%State%AirPumpLine%LENGT_AIR(I)=data%State%AirPumpLine%LENGT_AIR(I)*.001 ! (m) | |||||
ENDDO | |||||
!================================================================ | |||||
data%State%AirPumpLine%NO_MINORS_AIRPLINE=6 | |||||
ALLOCATE (data%State%AirPumpLine%MINORS_AIRPUMP(data%State%AirPumpLine%NO_MINORS_AIRPLINE,4)) | |||||
! ID(INCH) LF CV NOTE(BAR) DESCRIPTION | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(1,1:4)= (/2., 10., 0., 0./) !Acc.tee | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(2,1:4)= (/2., 11., 0., 0./) !elbow | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(3,1:4)= (/1., 0., 0., 3.4/) !filter | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(4,1:4)= (/2., 0., 105., 0./) !valve | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(5,1:4)= (/1., 0., 9.2, 0./) !valve | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(6,1:4)= (/2., 6.4, 0., 0./) !unionA | |||||
ALLOCATE (data%State%AirPumpLine%MINORDIAM_AIR_INCH(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%MINORAREA_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE), & | |||||
data%State%AirPumpLine%LF_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%CV_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%NOTE_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE) & | |||||
,data%State%AirPumpLine%minlosspa_air(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%minloss_air(data%State%AirPumpLine%NO_MINORS_AIRPLINE)) | |||||
DO I=1,data%State%AirPumpLine%NO_MINORS_AIRPLINE | |||||
data%State%AirPumpLine%MINORDIAM_AIR_INCH(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,1) | |||||
data%State%AirPumpLine%LF_AIR(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,2) | |||||
data%State%AirPumpLine%CV_AIR(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,3) | |||||
data%State%AirPumpLine%NOTE_AIR(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,4) | |||||
data%State%AirPumpLine%MINORAREA_AIR(I)=PI*(data%State%AirPumpLine%MINORDIAM_AIR_INCH(I)*0.0254)**2/4. !D(in), AREA(m) | |||||
ENDDO | |||||
END | |||||
! SUBROUTINE PIPE_RAMS_CHOKE(CHNUMBER) | |||||
! USE CHOKEVARIABLES | |||||
! use ConfigurationVariables !@ | |||||
! Use CSimulationVariables | |||||
! implicit none | |||||
! INTEGER CHNUMBER | |||||
! Integer I | |||||
! loop3: do while (ABS(data%Equipments%ChokeControlPanel%ChokeControlLever)==1.0 .AND. data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch == 1 .AND. data%State%CHOOKE(CHNUMBER)%FailMalf==0 .AND. data%State%AirDrivenPump%ChokeAirFail==0) | |||||
! if (data%Equipments%ChokeControlPanel%ChokeControlLever == 1.0) then | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .true. | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .false. | |||||
! endif | |||||
! if (data%Equipments%ChokeControlPanel%ChokeControlLever == -1.0) then | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .true. | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .false. | |||||
! endif | |||||
! data%State%AirPumpLine%TIME=data%State%AirPumpLine%TIME+data%State%AirPumpLine%DeltaT_Choke !overal time (s) | |||||
! call airpump_code_CHOKE(CHNUMBER) | |||||
! call sleepqq(100) | |||||
! if (IsStopped == .true.) return | |||||
! end do loop3 !while finished_Choke==0 | |||||
! end | |||||
SUBROUTINE airpump_code_CHOKE(CHNUMBER) | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables !@ | |||||
use CChokeManifold | |||||
use SimulationVariables | |||||
use CSounds | |||||
USE CChokeProblemsVariables | |||||
implicit none | |||||
Integer I | |||||
INTEGER CHNUMBER | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirPumpLine%QITER+.1 !(gpm) maximum flow for the start | |||||
data%State%AirPumpLine%diffp_air=-10 | |||||
data%State%AirPumpLine%losses_air=10 | |||||
!=================================================================== | |||||
! AIR OPERATED PUMP | |||||
! MODEL 10-6000W030 RATIO 55:1 | |||||
!=================for air consumption at 100 psig=================== | |||||
do while (data%State%AirPumpLine%diffp_air<0) | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP-.1 | |||||
! Qup=data%State%AirDrivenPump%QAIR_PUMP; | |||||
!cc1 = 1354; cc2 = -2066; cc3 = -2109; cc4 = -513.6; cc5 = 5935 FOR OUTPUT IN GPM | |||||
data%State%AirPumpLine%P_AIRP=data%State%AirDrivenPump%cc1*(data%State%AirDrivenPump%QAIR_PUMP**4) + data%State%AirDrivenPump%cc2*(data%State%AirDrivenPump%QAIR_PUMP**3) + data%State%AirDrivenPump%cc3*(data%State%AirDrivenPump%QAIR_PUMP**2) + data%State%AirDrivenPump%cc4*data%State%AirDrivenPump%QAIR_PUMP + data%State%AirDrivenPump%cc5 !(psig) | |||||
! kinetic_air=sg*wdens*(QAIR_PUMP*6.30902e-5/((1/4.)*pi*(2*0.254e-1)**2))**2/(2*6895) !(psi) | |||||
data%State%AirPumpLine%diffp_air= data%State%AirPumpLine%P_AIRP - data%State%AirPumpLine%Pdownstrem | |||||
end do !returns Qup | |||||
do while (abs((data%State%AirPumpLine%diffp_air-data%State%AirPumpLine%losses_air)/data%State%AirPumpLine%diffp_air)>data%State%AirPumpLine%TOL_AIR) !finding correct QAIR_pump for 1 timecounter_ram | |||||
if (data%State%AirPumpLine%diffp_air-data%State%AirPumpLine%losses_air>0) then | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP+.005 | |||||
else | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP-.005 | |||||
endif | |||||
!=================================================================== | |||||
! AIR OPERATED PUMP | |||||
! MODEL 10-6000W030 RATIO 55:1 | |||||
!=================for air consumption at 100 psig=================== | |||||
data%State%AirPumpLine%P_AIRP=data%State%AirDrivenPump%cc1*(data%State%AirDrivenPump%QAIR_PUMP**4) + data%State%AirDrivenPump%cc2*(data%State%AirDrivenPump%QAIR_PUMP**3) + data%State%AirDrivenPump%cc3*(data%State%AirDrivenPump%QAIR_PUMP**2) + data%State%AirDrivenPump%cc4*data%State%AirDrivenPump%QAIR_PUMP + data%State%AirDrivenPump%cc5 !(psig) | |||||
!kinetic_air=sg*wdens*(QAIR_PUMP*6.30902e-005/((1/4.)*pi*(2*0.254e-1)**2))**2/(2*6895) !(psi) | |||||
data%State%AirPumpLine%diffp_air= data%State%AirPumpLine%P_AIRP - data%State%AirPumpLine%Pdownstrem | |||||
!===========================LOSSES==================================== | |||||
do i=1,data%State%AirPumpLine%NO_PIPINGS_AIRPLINE | |||||
data%State%AirPumpLine%Re_air(i)=data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005*data%State%AirPumpLine%DIAM_AIR_INCH(I)*0.0254/(data%State%AirPumpLine%AREA_AIR(i)*nu) | |||||
enddo | |||||
do i=1,data%State%AirPumpLine%NO_PIPINGS_AIRPLINE | |||||
if (data%State%AirPumpLine%Re_air(i)<Re_cr) then | |||||
data%State%AirPumpLine%fric_air(i)=64/data%State%AirPumpLine%Re_air(i) | |||||
else | |||||
data%State%AirPumpLine%fric_air(i)=1/(-1.8*log10((data%State%AirPumpLine%REL_ROUGHAIR(i)/3.7)**1.11+6.9/data%State%AirPumpLine%Re_air(i)))**2 | |||||
endif | |||||
data%State%AirPumpLine%fricloss_air(i)=((data%State%AirPumpLine%fric_air(i)*(wdens*sg*data%State%AirPumpLine%LENGT_AIR(i)*(data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005/data%State%AirPumpLine%AREA_AIR(i))**2))/(2*data%State%AirPumpLine%DIAM_AIR_INCH(I)*0.0254))/6895 | |||||
enddo | |||||
data%State%AirPumpLine%pipe_loss1air=sum(data%State%AirPumpLine%fricloss_air) !loss before regulator(psi) | |||||
do i=1,data%State%AirPumpLine%NO_MINORS_AIRPLINE | |||||
if (data%State%AirPumpLine%LF_AIR(i)/=0) then | |||||
data%State%AirPumpLine%minlosspa_air(i)=data%State%AirPumpLine%LF_AIR(i)*wdens*sg*(data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005/data%State%AirPumpLine%MINORAREA_AIR(i))**2/2 !(Pa) | |||||
data%State%AirPumpLine%minloss_air(i)=data%State%AirPumpLine%minlosspa_air(i)/6895 !(psi) | |||||
elseif (data%State%AirPumpLine%CV_AIR(i)/=0) then | |||||
data%State%AirPumpLine%minlosspa_air(i)=1000*sg*((11.7*data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005*3600)/(data%State%AirPumpLine%CV_AIR(i)))**2 !(pa) | |||||
data%State%AirPumpLine%minloss_air(i)=data%State%AirPumpLine%minlosspa_air(i)/6895 !(psi) | |||||
else | |||||
data%State%AirPumpLine%minlosspa_air(i)=data%State%AirPumpLine%NOTE_AIR(i)*1e5 !(pa) | |||||
data%State%AirPumpLine%minloss_air(i)=data%State%AirPumpLine%minlosspa_air(i)/6895 !(psi) | |||||
endif | |||||
enddo | |||||
data%State%AirPumpLine%minor_loss1air=sum(data%State%AirPumpLine%minloss_air) !loss before regulator(psi) | |||||
data%State%AirPumpLine%static_loss1air=0 | |||||
data%State%AirPumpLine%losses_air=data%State%AirPumpLine%pipe_loss1air+data%State%AirPumpLine%minor_loss1air+data%State%AirPumpLine%static_loss1air !(psi) | |||||
!========================================================================= | |||||
end do !returns correct QAIR_PUMP for 1 counter | |||||
data%State%AirPumpLine%QITER=data%State%AirDrivenPump%QAIR_PUMP | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP*(data%Equipments%ChokeControlPanel%ChokeRateControlKnob/10.) ! final Q (gpm) | |||||
data%State%Choke%Cumulative_AirVolume_Choke= data%State%Choke%Cumulative_AirVolume_Choke + ((data%State%AirDrivenPump%QAIR_PUMP * data%State%AirPumpLine%DeltaT_Choke / 60.0 ) / (1.5*0.004329004) ) ! =strokes | |||||
if ( data%State%Choke%Cumulative_AirVolume_Choke > 1.0 ) then | |||||
data%State%Choke%SoundChokePump= 60 | |||||
data%State%Choke%Cumulative_AirVolume_Choke= data%State%Choke%Cumulative_AirVolume_Choke - 1.0 | |||||
else | |||||
data%State%Choke%SoundChokePump= 0.0 | |||||
endif | |||||
data%State%AirPumpLine%DELTAV_AIR=data%State%AirDrivenPump%QAIR_PUMP*data%State%AirPumpLine%DeltaT_Choke/60 !(galon) delta_t=1sec , Q(gpm) | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsClosing) data%State%CHOOKE(CHNUMBER)%PassedCourse=data%State%CHOOKE(CHNUMBER)%PassedCourse + (data%State%AirPumpLine%DELTAV_AIR*3785.412/data%State%AirPumpLine%Acylinder)!*(ChokeRateControlKnob/10.) ! 3785.412 : GALON TO CM^3 | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsOpening) data%State%CHOOKE(CHNUMBER)%PassedCourse=data%State%CHOOKE(CHNUMBER)%PassedCourse - (data%State%AirPumpLine%DELTAV_AIR*3785.412/data%State%AirPumpLine%Acylinder)!*(ChokeRateControlKnob/10.) | |||||
!DeltaT_Choke= 1sec or 2sec | |||||
!((((((((IN OUTER LOOP)))))) | |||||
!===============AIR PUMP OUTPUTS========================= | |||||
data%State%AirPumpLine%alpha_timeair=data%State%AirPumpLine%TIME ! overal time (s) | |||||
data%State%AirPumpLine%alpha_Pdownstrem=data%State%AirPumpLine%Pdownstrem | |||||
data%State%AirPumpLine%alpha_pairp=data%State%AirPumpLine%P_AIRP | |||||
data%State%AirPumpLine%alpha_Qair=data%State%AirDrivenPump%QAIR_PUMP | |||||
!write(*,*) 'diffp_air=',diffp_air | |||||
!pause | |||||
data%State%AirPumpLine%alpha_diffpair=data%State%AirPumpLine%diffp_air | |||||
data%State%AirPumpLine%alpha_lossesair=data%State%AirPumpLine%losses_air | |||||
!======================================================== | |||||
!OPEN(150,FILE='CHOKE_AIRPUMP_OUTPUTS.DAT') | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsClosing .AND. data%State%CHOOKE(CHNUMBER)%PassedCourse>data%State%AirPumpLine%CourseBase) then | |||||
data%State%CHOOKE(CHNUMBER)%PassedCourse=data%State%AirPumpLine%CourseBase | |||||
data%State%Choke%SoundChokePump= 0.0 | |||||
endif | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsOpening .AND. data%State%CHOOKE(CHNUMBER)%PassedCourse<0.) then | |||||
data%State%CHOOKE(CHNUMBER)%PassedCourse=0. | |||||
data%State%Choke%SoundChokePump= 0.0 | |||||
endif | |||||
call SetSoundChokePump(data%State%Choke%SoundChokePump) | |||||
data%State%CHOOKE(CHNUMBER)%PercentClose= data%State%CHOOKE(CHNUMBER)%PassedCourse/data%State%AirPumpLine%CourseBase | |||||
IF (data%Equipments%ChokeControlPanel%Choke1LED==1) THEN | |||||
data%Equipments%ChokeControlPanel%ChokePosition= (1 - data%State%Choke%GaugeChokePositionMailf) * data%State%CHOOKE(1)%PercentClose*10 | |||||
ELSE ! Choke2LED==1 | |||||
data%Equipments%ChokeControlPanel%ChokePosition= (1 - data%State%Choke%GaugeChokePositionMailf) * data%State%CHOOKE(2)%PercentClose*10 | |||||
ENDIF | |||||
!CALL SetHydraulicChock1(nint(MIN(data%State%CHOOKE(1)%PercentClose / 0.91 , 1.0)*100)) | |||||
! CALL SetHydraulicChock2(nint(MIN(data%State%CHOOKE(2)%PercentClose / 0.91 , 1.0)*100)) | |||||
! .91 >> 9 percent clearance | |||||
! =================== calculating Area | |||||
! AreaChoke=0.5 | |||||
! .91 >> 9 percent clearance | |||||
data%State%CHOOKE(1)%AreaChoke=0.01334635-(0.01334635* MIN(data%State%CHOOKE(1)%PercentClose / 0.91 , 1.0)) !ft^2 0.01334635 is ChokeAreaFullyOpen (ft^2) | |||||
data%State%CHOOKE(2)%AreaChoke=0.01334635-(0.01334635* MIN(data%State%CHOOKE(2)%PercentClose/ 0.91 , 1.0)) !ft^2 | |||||
data%State%Choke%HydraulicChoke1WashoutCoef= data%State%Choke%HydraulicChoke1WashoutCoef * data%State%CHOOKE(1)%WashoutMalf | |||||
data%State%Choke%HydraulicChoke1WashoutCoef= MIN( 0.5 , data%State%Choke%HydraulicChoke1WashoutCoef+ data%State%CHOOKE(1)%WashoutMalf*(0.5/(60.0/data%State%AirPumpLine%DeltaT_Choke)) ) ! 0.5=maximum washout coef , 60.0 sec= 1min duration time | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= data%State%Choke%HydraulicChoke2WashoutCoef * data%State%CHOOKE(2)%WashoutMalf | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= MIN( 0.5 , data%State%Choke%HydraulicChoke2WashoutCoef+ data%State%CHOOKE(2)%WashoutMalf*(0.5/(60.0/data%State%AirPumpLine%DeltaT_Choke)) ) ! 0.5=maximum washout coef , 60.0 sec= 1min duration time | |||||
!write(*,*) 'HydraulicChoke1WashoutCoef=' , HydraulicChoke1WashoutCoef | |||||
IF (data%State%CHOOKE(1)%PlugMalf == 1) THEN | |||||
data%State%Choke%Present_HydraulicChoke1Plug= data%State%Choke%Present_HydraulicChoke1Plug * data%State%CHOOKE(1)%PlugMalf | |||||
! integer: HydraulicChoke1PluggedPercent,HydraulicChoke1PluggedPercent_Old,PlugTimeCounter,ChokePlugTimeDelay | |||||
! real: Present_HydraulicChoke1Plug,DeltaPlug1Percent | |||||
!write(*,*) 'HydraulicChoke1PluggedPercent=' , HydraulicChoke1PluggedPercent | |||||
if ( (data%problems%ChokeProblems%HydraulicChoke1PluggedPercent - data%State%Choke%HydraulicChoke1PluggedPercent_Old) /= 0) then | |||||
data%State%Choke%DeltaPlug1Percent = (REAL(data%problems%ChokeProblems%HydraulicChoke1PluggedPercent)/100.) - data%State%Choke%Present_HydraulicChoke1Plug | |||||
data%State%Choke%Plug1TimeCounter = 0 | |||||
!write(*,*) 'DeltaPlug1Percent, Present_HydraulicChoke1Plug = ' ,DeltaPlug1Percent , Present_HydraulicChoke1Plug | |||||
endif | |||||
data%State%Choke%Plug1TimeCounter= data%State%Choke%Plug1TimeCounter + 1 | |||||
data%State%Choke%HydraulicChoke1PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke1PluggedPercent | |||||
if (data%State%Choke%Plug1TimeCounter <= data%State%Choke%ChokePlugTimeDelay) then !ChokePlugTimeDelay=600 | |||||
data%State%Choke%Present_HydraulicChoke1Plug = data%State%Choke%Present_HydraulicChoke1Plug + data%State%CHOOKE(1)%PlugMalf* ((data%State%Choke%DeltaPlug1Percent / real(data%State%Choke%ChokePlugTimeDelay))) ! real(ChokePlugTimeDelay)= 600.0 | |||||
endif | |||||
!write(*,*) 'Present_HydraulicChoke1Plug=' , Present_HydraulicChoke1Plug | |||||
ENDIF | |||||
IF (data%State%CHOOKE(2)%PlugMalf == 1) THEN | |||||
data%State%Choke%Present_HydraulicChoke2Plug= data%State%Choke%Present_HydraulicChoke2Plug * data%State%CHOOKE(2)%PlugMalf | |||||
! integer: HydraulicChoke2PluggedPercent,HydraulicChoke2PluggedPercent_Old,PlugTimeCounter,ChokePlugTimeDelay | |||||
! real: Present_HydraulicChoke2Plug,DeltaPlug2Percent | |||||
if ( (data%problems%ChokeProblems%HydraulicChoke2PluggedPercent - data%State%Choke%HydraulicChoke2PluggedPercent_Old) /= 0 ) then | |||||
data%State%Choke%DeltaPlug2Percent = (REAL(data%problems%ChokeProblems%HydraulicChoke2PluggedPercent)/100.) - data%State%Choke%Present_HydraulicChoke2Plug | |||||
data%State%Choke%Plug2TimeCounter = 0 | |||||
endif | |||||
data%State%Choke%Plug2TimeCounter= data%State%Choke%Plug2TimeCounter + 1 | |||||
data%State%Choke%HydraulicChoke2PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke2PluggedPercent | |||||
if (data%State%Choke%Plug2TimeCounter <= data%State%Choke%ChokePlugTimeDelay) then !ChokePlugTimeDelay=600 | |||||
data%State%Choke%Present_HydraulicChoke2Plug = data%State%Choke%Present_HydraulicChoke2Plug + data%State%CHOOKE(2)%PlugMalf *((data%State%Choke%DeltaPlug2Percent / real(data%State%Choke%ChokePlugTimeDelay))) ! real(ChokePlugTimeDelay)= 600.0 | |||||
endif | |||||
ENDIF | |||||
! fully open area is 123/64 in^2 = 0.01334635 ft^2 | |||||
data%State%CHOOKE(1)%AreaChoke=data%State%CHOOKE(1)%AreaChoke+(data%State%CHOOKE(1)%WashoutMalf*data%State%Choke%HydraulicChoke1WashoutCoef*data%State%Choke%ChokeAreaFullyOpen/144.0) ! Initialised in Choke Startup | |||||
!write(*,*) 'data%State%CHOOKE(1)%WashoutMalf , data%State%CHOOKE(1)%AreaChoke=' ,data%State%CHOOKE(1)%WashoutMalf , data%State%CHOOKE(1)%AreaChoke | |||||
data%State%CHOOKE(1)%AreaChoke=data%State%CHOOKE(1)%AreaChoke-(data%State%CHOOKE(1)%PlugMalf* data%State%Choke%Present_HydraulicChoke1Plug *data%State%CHOOKE(1)%AreaChoke) ! Initialised in Choke Startup | |||||
data%State%CHOOKE(2)%AreaChoke=data%State%CHOOKE(2)%AreaChoke+(data%State%CHOOKE(2)%WashoutMalf*data%State%Choke%HydraulicChoke2WashoutCoef*data%State%Choke%ChokeAreaFullyOpen/144.0) ! Initialised in Choke Startup | |||||
data%State%CHOOKE(2)%AreaChoke=data%State%CHOOKE(2)%AreaChoke-(data%State%CHOOKE(2)%PlugMalf* data%State%Choke%Present_HydraulicChoke2Plug *data%State%CHOOKE(2)%AreaChoke) ! Initialised in Choke Startup | |||||
!write(*,*) 'data%State%CHOOKE(2)%WashoutMalf , data%State%CHOOKE(2)%AreaChoke=' ,data%State%CHOOKE(2)%WashoutMalf , data%State%CHOOKE(2)%AreaChoke | |||||
data%State%CHOOKE(1)%AreaChokeFinal= data%State%CHOOKE(1)%AreaChoke | |||||
data%State%CHOOKE(2)%AreaChokeFinal= data%State%CHOOKE(2)%AreaChoke | |||||
! 144: ft^2 to in^2 | |||||
CALL SetHydraulicChock1(100 - nint((data%State%CHOOKE(1)%AreaChokeFinal/(data%State%Choke%ChokeAreaFullyOpen/144.))*100)) ! for manifold valve | |||||
CALL SetHydraulicChock2(100 - nint((data%State%CHOOKE(2)%AreaChokeFinal/(data%State%Choke%ChokeAreaFullyOpen/144.))*100)) ! for manifold valve | |||||
!write(*,*) 'data%State%CHOOKE(1)%PercentClose=' , data%State%CHOOKE(1)%PercentClose ! close percent 0 to 100 | |||||
!write(*,*) 'ChokePosition=' , ChokePosition ! close position 0 to 10 for display | |||||
!write(*,*) 'data%State%CHOOKE(1)%AreaChokeFinal=' , data%State%CHOOKE(1)%AreaChokeFinal ! Open Area (in^2) with clearance | |||||
!write(*,*) '(ChokeAreaFullyOpen/144.)=' , (ChokeAreaFullyOpen/144.) | |||||
!write(*,*) 'valve value=' , 100 - nint((data%State%CHOOKE(1)%AreaChokeFinal/(ChokeAreaFullyOpen/144.))*100) ! percent close 0 to 100 with clearance | |||||
!write(*,*) 'Valve(33)%Status=' , Valve(33)%Status ! T : open , F: close | |||||
! =================== calculating Area | |||||
!write(*,*) 'data%State%CHOOKE(1)%AreaChoke= ' , data%State%CHOOKE(1)%AreaChoke | |||||
!WRITE(150,50) alpha_timeair,alpha_Qair,alpha_pairp, & | |||||
!alpha_Pdownstrem,alpha_diffpair,alpha_lossesair,data%State%CHOOKE(CHNUMBER)%PassedCourse | |||||
!50 FORMAT(7(f15.5)) | |||||
!======================================================================================== | |||||
!======================================================================================== | |||||
! write(*,*) PassedCourse | |||||
end |
@@ -1,338 +1 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/Equipments/ChokeControl/AirPump_Choke_Subs.f90" | |||||
SUBROUTINE DEALLOCATE_ARRAYS_CHOKE() | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables !@ | |||||
implicit none | |||||
write(*,*) 'deallocateeeeeeeeeeeee' | |||||
!=========================================================================== | |||||
! AIR PUMP LOSSES INPUT | |||||
!=========================================================================== | |||||
!if(allocated(PIPINGS_AIRPUMP)) deallocate(PIPINGS_AIRPUMP) | |||||
DEALLOCATE (data%State%AirPumpLine%PIPINGS_AIRPUMP,data%State%AirPumpLine%DIAM_AIR_INCH, & | |||||
data%State%AirPumpLine%Re_air,data%State%AirPumpLine%AREA_AIR,data%State%AirPumpLine%LENGT_AIR,data%State%AirPumpLine%ROUGHNESS_AIRPLINE,data%State%AirPumpLine%REL_ROUGHAIR, & | |||||
data%State%AirPumpLine%fric_air,data%State%AirPumpLine%fricloss_air) | |||||
!================================================================ | |||||
DEALLOCATE (data%State%AirPumpLine%MINORS_AIRPUMP,data%State%AirPumpLine%MINORDIAM_AIR_INCH, & | |||||
data%State%AirPumpLine%MINORAREA_AIR,data%State%AirPumpLine%LF_AIR,data%State%AirPumpLine%CV_AIR,data%State%AirPumpLine%NOTE_AIR & | |||||
,data%State%AirPumpLine%minlosspa_air,data%State%AirPumpLine%minloss_air) | |||||
END | |||||
SUBROUTINE LOSS_INPUTS_CHOKE() | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables !@ | |||||
implicit none | |||||
Integer I | |||||
!=========================================================================== | |||||
! AIR PUMP LOSSES INPUT | |||||
!=========================================================================== | |||||
data%State%AirPumpLine%NO_PIPINGS_AIRPLINE=1 | |||||
ALLOCATE (data%State%AirPumpLine%PIPINGS_AIRPUMP(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE,3)) | |||||
! ID(INCH) L(MM) ROUGHNESS(MM)=e DESCRIPTION | |||||
data%State%AirPumpLine%PIPINGS_AIRPUMP(1,1:3)= (/0.5, 60960., 0.03/) !Avg.acc.distance | |||||
!60960= 200 ft | |||||
ALLOCATE (data%State%AirPumpLine%DIAM_AIR_INCH(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE),data%State%AirPumpLine%Re_air(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE),data%State%AirPumpLine%AREA_AIR(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE), & | |||||
data%State%AirPumpLine%LENGT_AIR(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE),data%State%AirPumpLine%ROUGHNESS_AIRPLINE(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE),data%State%AirPumpLine%REL_ROUGHAIR(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE), & | |||||
data%State%AirPumpLine%fric_air(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE),data%State%AirPumpLine%fricloss_air(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
DO I=1,data%State%AirPumpLine%NO_PIPINGS_AIRPLINE | |||||
data%State%AirPumpLine%DIAM_AIR_INCH(I)=data%State%AirPumpLine%PIPINGS_AIRPUMP(I,1) | |||||
data%State%AirPumpLine%LENGT_AIR(I)=data%State%AirPumpLine%PIPINGS_AIRPUMP(I,2) | |||||
data%State%AirPumpLine%ROUGHNESS_AIRPLINE(I)=data%State%AirPumpLine%PIPINGS_AIRPUMP(I,3) | |||||
data%State%AirPumpLine%AREA_AIR(I)=PI*(data%State%AirPumpLine%DIAM_AIR_INCH(I)*0.0254)**2/4 !D(in), AREA(m) | |||||
data%State%AirPumpLine%REL_ROUGHAIR(I)=data%State%AirPumpLine%ROUGHNESS_AIRPLINE(I)/(data%State%AirPumpLine%DIAM_AIR_INCH(I)*25.4) | |||||
!DIAM_RAMLINE_MM(I)=DIAM_RAMLINE_MM(I)*.001 ! (m) | |||||
data%State%AirPumpLine%LENGT_AIR(I)=data%State%AirPumpLine%LENGT_AIR(I)*.001 ! (m) | |||||
ENDDO | |||||
!================================================================ | |||||
data%State%AirPumpLine%NO_MINORS_AIRPLINE=6 | |||||
ALLOCATE (data%State%AirPumpLine%MINORS_AIRPUMP(data%State%AirPumpLine%NO_MINORS_AIRPLINE,4)) | |||||
! ID(INCH) LF CV NOTE(BAR) DESCRIPTION | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(1,1:4)= (/2., 10., 0., 0./) !Acc.tee | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(2,1:4)= (/2., 11., 0., 0./) !elbow | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(3,1:4)= (/1., 0., 0., 3.4/) !filter | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(4,1:4)= (/2., 0., 105., 0./) !valve | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(5,1:4)= (/1., 0., 9.2, 0./) !valve | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(6,1:4)= (/2., 6.4, 0., 0./) !unionA | |||||
ALLOCATE (data%State%AirPumpLine%MINORDIAM_AIR_INCH(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%MINORAREA_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE), & | |||||
data%State%AirPumpLine%LF_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%CV_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%NOTE_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE) & | |||||
,data%State%AirPumpLine%minlosspa_air(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%minloss_air(data%State%AirPumpLine%NO_MINORS_AIRPLINE)) | |||||
DO I=1,data%State%AirPumpLine%NO_MINORS_AIRPLINE | |||||
data%State%AirPumpLine%MINORDIAM_AIR_INCH(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,1) | |||||
data%State%AirPumpLine%LF_AIR(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,2) | |||||
data%State%AirPumpLine%CV_AIR(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,3) | |||||
data%State%AirPumpLine%NOTE_AIR(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,4) | |||||
data%State%AirPumpLine%MINORAREA_AIR(I)=PI*(data%State%AirPumpLine%MINORDIAM_AIR_INCH(I)*0.0254)**2/4. !D(in), AREA(m) | |||||
ENDDO | |||||
END | |||||
! SUBROUTINE PIPE_RAMS_CHOKE(CHNUMBER) | |||||
! USE CHOKEVARIABLES | |||||
! use ConfigurationVariables !@ | |||||
! Use CSimulationVariables | |||||
! implicit none | |||||
! INTEGER CHNUMBER | |||||
! Integer I | |||||
! loop3: do while (ABS(data%Equipments%ChokeControlPanel%ChokeControlLever)==1.0 .AND. data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch == 1 .AND. data%State%CHOOKE(CHNUMBER)%FailMalf==0 .AND. data%State%AirDrivenPump%ChokeAirFail==0) | |||||
! if (data%Equipments%ChokeControlPanel%ChokeControlLever == 1.0) then | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .true. | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .false. | |||||
! endif | |||||
! if (data%Equipments%ChokeControlPanel%ChokeControlLever == -1.0) then | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .true. | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .false. | |||||
! endif | |||||
! data%State%AirPumpLine%TIME=data%State%AirPumpLine%TIME+data%State%AirPumpLine%DeltaT_Choke !overal time (s) | |||||
! call airpump_code_CHOKE(CHNUMBER) | |||||
! call sleepqq(100) | |||||
! if (IsStopped == .true.) return | |||||
! end do loop3 !while finished_Choke==0 | |||||
! end | |||||
SUBROUTINE airpump_code_CHOKE(CHNUMBER) | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables !@ | |||||
use CChokeManifold | |||||
use SimulationVariables | |||||
use CSounds | |||||
USE CChokeProblemsVariables | |||||
implicit none | |||||
Integer I | |||||
INTEGER CHNUMBER | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirPumpLine%QITER+.1 !(gpm) maximum flow for the start | |||||
data%State%AirPumpLine%diffp_air=-10 | |||||
data%State%AirPumpLine%losses_air=10 | |||||
!=================================================================== | |||||
! AIR OPERATED PUMP | |||||
! MODEL 10-6000W030 RATIO 55:1 | |||||
!=================for air consumption at 100 psig=================== | |||||
do while (data%State%AirPumpLine%diffp_air<0) | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP-.1 | |||||
! Qup=data%State%AirDrivenPump%QAIR_PUMP; | |||||
!cc1 = 1354; cc2 = -2066; cc3 = -2109; cc4 = -513.6; cc5 = 5935 FOR OUTPUT IN GPM | |||||
data%State%AirPumpLine%P_AIRP=data%State%AirDrivenPump%cc1*(data%State%AirDrivenPump%QAIR_PUMP**4) + data%State%AirDrivenPump%cc2*(data%State%AirDrivenPump%QAIR_PUMP**3) + data%State%AirDrivenPump%cc3*(data%State%AirDrivenPump%QAIR_PUMP**2) + data%State%AirDrivenPump%cc4*data%State%AirDrivenPump%QAIR_PUMP + data%State%AirDrivenPump%cc5 !(psig) | |||||
! kinetic_air=sg*wdens*(QAIR_PUMP*6.30902e-5/((1/4.)*pi*(2*0.254e-1)**2))**2/(2*6895) !(psi) | |||||
data%State%AirPumpLine%diffp_air= data%State%AirPumpLine%P_AIRP - data%State%AirPumpLine%Pdownstrem | |||||
end do !returns Qup | |||||
do while (abs((data%State%AirPumpLine%diffp_air-data%State%AirPumpLine%losses_air)/data%State%AirPumpLine%diffp_air)>data%State%AirPumpLine%TOL_AIR) !finding correct QAIR_pump for 1 timecounter_ram | |||||
if (data%State%AirPumpLine%diffp_air-data%State%AirPumpLine%losses_air>0) then | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP+.005 | |||||
else | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP-.005 | |||||
endif | |||||
!=================================================================== | |||||
! AIR OPERATED PUMP | |||||
! MODEL 10-6000W030 RATIO 55:1 | |||||
!=================for air consumption at 100 psig=================== | |||||
data%State%AirPumpLine%P_AIRP=data%State%AirDrivenPump%cc1*(data%State%AirDrivenPump%QAIR_PUMP**4) + data%State%AirDrivenPump%cc2*(data%State%AirDrivenPump%QAIR_PUMP**3) + data%State%AirDrivenPump%cc3*(data%State%AirDrivenPump%QAIR_PUMP**2) + data%State%AirDrivenPump%cc4*data%State%AirDrivenPump%QAIR_PUMP + data%State%AirDrivenPump%cc5 !(psig) | |||||
!kinetic_air=sg*wdens*(QAIR_PUMP*6.30902e-005/((1/4.)*pi*(2*0.254e-1)**2))**2/(2*6895) !(psi) | |||||
data%State%AirPumpLine%diffp_air= data%State%AirPumpLine%P_AIRP - data%State%AirPumpLine%Pdownstrem | |||||
!===========================LOSSES==================================== | |||||
do i=1,data%State%AirPumpLine%NO_PIPINGS_AIRPLINE | |||||
data%State%AirPumpLine%Re_air(i)=data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005*data%State%AirPumpLine%DIAM_AIR_INCH(I)*0.0254/(data%State%AirPumpLine%AREA_AIR(i)*nu) | |||||
enddo | |||||
do i=1,data%State%AirPumpLine%NO_PIPINGS_AIRPLINE | |||||
if (data%State%AirPumpLine%Re_air(i)<Re_cr) then | |||||
data%State%AirPumpLine%fric_air(i)=64/data%State%AirPumpLine%Re_air(i) | |||||
else | |||||
data%State%AirPumpLine%fric_air(i)=1/(-1.8*log10((data%State%AirPumpLine%REL_ROUGHAIR(i)/3.7)**1.11+6.9/data%State%AirPumpLine%Re_air(i)))**2 | |||||
endif | |||||
data%State%AirPumpLine%fricloss_air(i)=((data%State%AirPumpLine%fric_air(i)*(wdens*sg*data%State%AirPumpLine%LENGT_AIR(i)*(data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005/data%State%AirPumpLine%AREA_AIR(i))**2))/(2*data%State%AirPumpLine%DIAM_AIR_INCH(I)*0.0254))/6895 | |||||
enddo | |||||
data%State%AirPumpLine%pipe_loss1air=sum(data%State%AirPumpLine%fricloss_air) !loss before regulator(psi) | |||||
do i=1,data%State%AirPumpLine%NO_MINORS_AIRPLINE | |||||
if (data%State%AirPumpLine%LF_AIR(i)/=0) then | |||||
data%State%AirPumpLine%minlosspa_air(i)=data%State%AirPumpLine%LF_AIR(i)*wdens*sg*(data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005/data%State%AirPumpLine%MINORAREA_AIR(i))**2/2 !(Pa) | |||||
data%State%AirPumpLine%minloss_air(i)=data%State%AirPumpLine%minlosspa_air(i)/6895 !(psi) | |||||
elseif (data%State%AirPumpLine%CV_AIR(i)/=0) then | |||||
data%State%AirPumpLine%minlosspa_air(i)=1000*sg*((11.7*data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005*3600)/(data%State%AirPumpLine%CV_AIR(i)))**2 !(pa) | |||||
data%State%AirPumpLine%minloss_air(i)=data%State%AirPumpLine%minlosspa_air(i)/6895 !(psi) | |||||
else | |||||
data%State%AirPumpLine%minlosspa_air(i)=data%State%AirPumpLine%NOTE_AIR(i)*1e5 !(pa) | |||||
data%State%AirPumpLine%minloss_air(i)=data%State%AirPumpLine%minlosspa_air(i)/6895 !(psi) | |||||
endif | |||||
enddo | |||||
data%State%AirPumpLine%minor_loss1air=sum(data%State%AirPumpLine%minloss_air) !loss before regulator(psi) | |||||
data%State%AirPumpLine%static_loss1air=0 | |||||
data%State%AirPumpLine%losses_air=data%State%AirPumpLine%pipe_loss1air+data%State%AirPumpLine%minor_loss1air+data%State%AirPumpLine%static_loss1air !(psi) | |||||
!========================================================================= | |||||
end do !returns correct QAIR_PUMP for 1 counter | |||||
data%State%AirPumpLine%QITER=data%State%AirDrivenPump%QAIR_PUMP | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP*(data%Equipments%ChokeControlPanel%ChokeRateControlKnob/10.) ! final Q (gpm) | |||||
data%State%Choke%Cumulative_AirVolume_Choke= data%State%Choke%Cumulative_AirVolume_Choke + ((data%State%AirDrivenPump%QAIR_PUMP * data%State%AirPumpLine%DeltaT_Choke / 60.0 ) / (1.5*0.004329004) ) ! =strokes | |||||
if ( data%State%Choke%Cumulative_AirVolume_Choke > 1.0 ) then | |||||
data%State%Choke%SoundChokePump= 60 | |||||
data%State%Choke%Cumulative_AirVolume_Choke= data%State%Choke%Cumulative_AirVolume_Choke - 1.0 | |||||
else | |||||
data%State%Choke%SoundChokePump= 0.0 | |||||
endif | |||||
data%State%AirPumpLine%DELTAV_AIR=data%State%AirDrivenPump%QAIR_PUMP*data%State%AirPumpLine%DeltaT_Choke/60 !(galon) delta_t=1sec , Q(gpm) | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsClosing) data%State%CHOOKE(CHNUMBER)%PassedCourse=data%State%CHOOKE(CHNUMBER)%PassedCourse + (data%State%AirPumpLine%DELTAV_AIR*3785.412/data%State%AirPumpLine%Acylinder)!*(ChokeRateControlKnob/10.) ! 3785.412 : GALON TO CM^3 | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsOpening) data%State%CHOOKE(CHNUMBER)%PassedCourse=data%State%CHOOKE(CHNUMBER)%PassedCourse - (data%State%AirPumpLine%DELTAV_AIR*3785.412/data%State%AirPumpLine%Acylinder)!*(ChokeRateControlKnob/10.) | |||||
!DeltaT_Choke= 1sec or 2sec | |||||
!((((((((IN OUTER LOOP)))))) | |||||
!===============AIR PUMP OUTPUTS========================= | |||||
data%State%AirPumpLine%alpha_timeair=data%State%AirPumpLine%TIME ! overal time (s) | |||||
data%State%AirPumpLine%alpha_Pdownstrem=data%State%AirPumpLine%Pdownstrem | |||||
data%State%AirPumpLine%alpha_pairp=data%State%AirPumpLine%P_AIRP | |||||
data%State%AirPumpLine%alpha_Qair=data%State%AirDrivenPump%QAIR_PUMP | |||||
!write(*,*) 'diffp_air=',diffp_air | |||||
!pause | |||||
data%State%AirPumpLine%alpha_diffpair=data%State%AirPumpLine%diffp_air | |||||
data%State%AirPumpLine%alpha_lossesair=data%State%AirPumpLine%losses_air | |||||
!======================================================== | |||||
!OPEN(150,FILE='CHOKE_AIRPUMP_OUTPUTS.DAT') | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsClosing .AND. data%State%CHOOKE(CHNUMBER)%PassedCourse>data%State%AirPumpLine%CourseBase) then | |||||
data%State%CHOOKE(CHNUMBER)%PassedCourse=data%State%AirPumpLine%CourseBase | |||||
data%State%Choke%SoundChokePump= 0.0 | |||||
endif | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsOpening .AND. data%State%CHOOKE(CHNUMBER)%PassedCourse<0.) then | |||||
data%State%CHOOKE(CHNUMBER)%PassedCourse=0. | |||||
data%State%Choke%SoundChokePump= 0.0 | |||||
endif | |||||
call SetSoundChokePump(data%State%Choke%SoundChokePump) | |||||
data%State%CHOOKE(CHNUMBER)%PercentClose= data%State%CHOOKE(CHNUMBER)%PassedCourse/data%State%AirPumpLine%CourseBase | |||||
IF (data%Equipments%ChokeControlPanel%Choke1LED==1) THEN | |||||
data%Equipments%ChokeControlPanel%ChokePosition= (1 - data%State%Choke%GaugeChokePositionMailf) * data%State%CHOOKE(1)%PercentClose*10 | |||||
ELSE ! Choke2LED==1 | |||||
data%Equipments%ChokeControlPanel%ChokePosition= (1 - data%State%Choke%GaugeChokePositionMailf) * data%State%CHOOKE(2)%PercentClose*10 | |||||
ENDIF | |||||
!CALL SetHydraulicChock1(nint(MIN(data%State%CHOOKE(1)%PercentClose / 0.91 , 1.0)*100)) | |||||
! CALL SetHydraulicChock2(nint(MIN(data%State%CHOOKE(2)%PercentClose / 0.91 , 1.0)*100)) | |||||
! .91 >> 9 percent clearance | |||||
! =================== calculating Area | |||||
! AreaChoke=0.5 | |||||
! .91 >> 9 percent clearance | |||||
data%State%CHOOKE(1)%AreaChoke=0.01334635-(0.01334635* MIN(data%State%CHOOKE(1)%PercentClose / 0.91 , 1.0)) !ft^2 0.01334635 is ChokeAreaFullyOpen (ft^2) | |||||
data%State%CHOOKE(2)%AreaChoke=0.01334635-(0.01334635* MIN(data%State%CHOOKE(2)%PercentClose/ 0.91 , 1.0)) !ft^2 | |||||
data%State%Choke%HydraulicChoke1WashoutCoef= data%State%Choke%HydraulicChoke1WashoutCoef * data%State%CHOOKE(1)%WashoutMalf | |||||
data%State%Choke%HydraulicChoke1WashoutCoef= MIN( 0.5 , data%State%Choke%HydraulicChoke1WashoutCoef+ data%State%CHOOKE(1)%WashoutMalf*(0.5/(60.0/data%State%AirPumpLine%DeltaT_Choke)) ) ! 0.5=maximum washout coef , 60.0 sec= 1min duration time | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= data%State%Choke%HydraulicChoke2WashoutCoef * data%State%CHOOKE(2)%WashoutMalf | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= MIN( 0.5 , data%State%Choke%HydraulicChoke2WashoutCoef+ data%State%CHOOKE(2)%WashoutMalf*(0.5/(60.0/data%State%AirPumpLine%DeltaT_Choke)) ) ! 0.5=maximum washout coef , 60.0 sec= 1min duration time | |||||
!write(*,*) 'HydraulicChoke1WashoutCoef=' , HydraulicChoke1WashoutCoef | |||||
IF (data%State%CHOOKE(1)%PlugMalf == 1) THEN | |||||
data%State%Choke%Present_HydraulicChoke1Plug= data%State%Choke%Present_HydraulicChoke1Plug * data%State%CHOOKE(1)%PlugMalf | |||||
! integer: HydraulicChoke1PluggedPercent,HydraulicChoke1PluggedPercent_Old,PlugTimeCounter,ChokePlugTimeDelay | |||||
! real: Present_HydraulicChoke1Plug,DeltaPlug1Percent | |||||
!write(*,*) 'HydraulicChoke1PluggedPercent=' , HydraulicChoke1PluggedPercent | |||||
if ( (data%problems%ChokeProblems%HydraulicChoke1PluggedPercent - data%State%Choke%HydraulicChoke1PluggedPercent_Old) /= 0) then | |||||
data%State%Choke%DeltaPlug1Percent = (REAL(data%problems%ChokeProblems%HydraulicChoke1PluggedPercent)/100.) - data%State%Choke%Present_HydraulicChoke1Plug | |||||
data%State%Choke%Plug1TimeCounter = 0 | |||||
!write(*,*) 'DeltaPlug1Percent, Present_HydraulicChoke1Plug = ' ,DeltaPlug1Percent , Present_HydraulicChoke1Plug | |||||
endif | |||||
data%State%Choke%Plug1TimeCounter= data%State%Choke%Plug1TimeCounter + 1 | |||||
data%State%Choke%HydraulicChoke1PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke1PluggedPercent | |||||
if (data%State%Choke%Plug1TimeCounter <= data%State%Choke%ChokePlugTimeDelay) then !ChokePlugTimeDelay=600 | |||||
data%State%Choke%Present_HydraulicChoke1Plug = data%State%Choke%Present_HydraulicChoke1Plug + data%State%CHOOKE(1)%PlugMalf* ((data%State%Choke%DeltaPlug1Percent / real(data%State%Choke%ChokePlugTimeDelay))) ! real(ChokePlugTimeDelay)= 600.0 | |||||
endif | |||||
!write(*,*) 'Present_HydraulicChoke1Plug=' , Present_HydraulicChoke1Plug | |||||
ENDIF | |||||
IF (data%State%CHOOKE(2)%PlugMalf == 1) THEN | |||||
data%State%Choke%Present_HydraulicChoke2Plug= data%State%Choke%Present_HydraulicChoke2Plug * data%State%CHOOKE(2)%PlugMalf | |||||
! integer: HydraulicChoke2PluggedPercent,HydraulicChoke2PluggedPercent_Old,PlugTimeCounter,ChokePlugTimeDelay | |||||
! real: Present_HydraulicChoke2Plug,DeltaPlug2Percent | |||||
if ( (data%problems%ChokeProblems%HydraulicChoke2PluggedPercent - data%State%Choke%HydraulicChoke2PluggedPercent_Old) /= 0 ) then | |||||
data%State%Choke%DeltaPlug2Percent = (REAL(data%problems%ChokeProblems%HydraulicChoke2PluggedPercent)/100.) - data%State%Choke%Present_HydraulicChoke2Plug | |||||
data%State%Choke%Plug2TimeCounter = 0 | |||||
endif | |||||
data%State%Choke%Plug2TimeCounter= data%State%Choke%Plug2TimeCounter + 1 | |||||
data%State%Choke%HydraulicChoke2PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke2PluggedPercent | |||||
if (data%State%Choke%Plug2TimeCounter <= data%State%Choke%ChokePlugTimeDelay) then !ChokePlugTimeDelay=600 | |||||
data%State%Choke%Present_HydraulicChoke2Plug = data%State%Choke%Present_HydraulicChoke2Plug + data%State%CHOOKE(2)%PlugMalf *((data%State%Choke%DeltaPlug2Percent / real(data%State%Choke%ChokePlugTimeDelay))) ! real(ChokePlugTimeDelay)= 600.0 | |||||
endif | |||||
ENDIF | |||||
! fully open area is 123/64 in^2 = 0.01334635 ft^2 | |||||
data%State%CHOOKE(1)%AreaChoke=data%State%CHOOKE(1)%AreaChoke+(data%State%CHOOKE(1)%WashoutMalf*data%State%Choke%HydraulicChoke1WashoutCoef*data%State%Choke%ChokeAreaFullyOpen/144.0) ! Initialised in Choke Startup | |||||
!write(*,*) 'data%State%CHOOKE(1)%WashoutMalf , data%State%CHOOKE(1)%AreaChoke=' ,data%State%CHOOKE(1)%WashoutMalf , data%State%CHOOKE(1)%AreaChoke | |||||
data%State%CHOOKE(1)%AreaChoke=data%State%CHOOKE(1)%AreaChoke-(data%State%CHOOKE(1)%PlugMalf* data%State%Choke%Present_HydraulicChoke1Plug *data%State%CHOOKE(1)%AreaChoke) ! Initialised in Choke Startup | |||||
data%State%CHOOKE(2)%AreaChoke=data%State%CHOOKE(2)%AreaChoke+(data%State%CHOOKE(2)%WashoutMalf*data%State%Choke%HydraulicChoke2WashoutCoef*data%State%Choke%ChokeAreaFullyOpen/144.0) ! Initialised in Choke Startup | |||||
data%State%CHOOKE(2)%AreaChoke=data%State%CHOOKE(2)%AreaChoke-(data%State%CHOOKE(2)%PlugMalf* data%State%Choke%Present_HydraulicChoke2Plug *data%State%CHOOKE(2)%AreaChoke) ! Initialised in Choke Startup | |||||
!write(*,*) 'data%State%CHOOKE(2)%WashoutMalf , data%State%CHOOKE(2)%AreaChoke=' ,data%State%CHOOKE(2)%WashoutMalf , data%State%CHOOKE(2)%AreaChoke | |||||
data%State%CHOOKE(1)%AreaChokeFinal= data%State%CHOOKE(1)%AreaChoke | |||||
data%State%CHOOKE(2)%AreaChokeFinal= data%State%CHOOKE(2)%AreaChoke | |||||
! 144: ft^2 to in^2 | |||||
CALL SetHydraulicChock1(100 - nint((data%State%CHOOKE(1)%AreaChokeFinal/(data%State%Choke%ChokeAreaFullyOpen/144.))*100)) ! for manifold valve | |||||
CALL SetHydraulicChock2(100 - nint((data%State%CHOOKE(2)%AreaChokeFinal/(data%State%Choke%ChokeAreaFullyOpen/144.))*100)) ! for manifold valve | |||||
!write(*,*) 'data%State%CHOOKE(1)%PercentClose=' , data%State%CHOOKE(1)%PercentClose ! close percent 0 to 100 | |||||
!write(*,*) 'ChokePosition=' , ChokePosition ! close position 0 to 10 for display | |||||
!write(*,*) 'data%State%CHOOKE(1)%AreaChokeFinal=' , data%State%CHOOKE(1)%AreaChokeFinal ! Open Area (in^2) with clearance | |||||
!write(*,*) '(ChokeAreaFullyOpen/144.)=' , (ChokeAreaFullyOpen/144.) | |||||
!write(*,*) 'valve value=' , 100 - nint((data%State%CHOOKE(1)%AreaChokeFinal/(ChokeAreaFullyOpen/144.))*100) ! percent close 0 to 100 with clearance | |||||
!write(*,*) 'Valve(33)%Status=' , Valve(33)%Status ! T : open , F: close | |||||
! =================== calculating Area | |||||
!write(*,*) 'data%State%CHOOKE(1)%AreaChoke= ' , data%State%CHOOKE(1)%AreaChoke | |||||
!WRITE(150,50) alpha_timeair,alpha_Qair,alpha_pairp, & | |||||
!alpha_Pdownstrem,alpha_diffpair,alpha_lossesair,data%State%CHOOKE(CHNUMBER)%PassedCourse | |||||
!50 FORMAT(7(f15.5)) | |||||
!======================================================================================== | |||||
!======================================================================================== | |||||
! write(*,*) PassedCourse | |||||
end | |||||
# 1 "/home/admin/SimulationCore2/Equipments/ChokeControl/AirPump_Choke_Subs.f90" |
@@ -2,17 +2,11 @@ | |||||
module ChokeModule | module ChokeModule | ||||
USE CHOKEVARIABLES | USE CHOKEVARIABLES | ||||
use SimulationVariables !@ | |||||
!use CDataDisplayConsole | |||||
! !@use ConfigurationVariables, CasingPressureDataDisplay=>CasingPressure!, StandPipePressureDataDisplay=>StandPipePressure | |||||
use SimulationVariables | |||||
USE CChokeProblemsVariables | USE CChokeProblemsVariables | ||||
!use CChokeControlPanelVariables | |||||
! !@use ConfigurationVariables, StandPipePressureChoke=>StandPipePressure | |||||
USE MudSystemVARIABLES | USE MudSystemVARIABLES | ||||
use SimulationVariables !@@@ | |||||
use CChokeManifold | use CChokeManifold | ||||
use SimulationVariables | |||||
contains | contains | ||||
! function CHOKE_MainBody1 result(CHNUMBER) | ! function CHOKE_MainBody1 result(CHNUMBER) | ||||
@@ -1,19 +1,13 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/Equipments/ChokeControl/CHOKE.f90" | |||||
# 1 "/home/admin/SimulationCore2/Equipments/ChokeControl/CHOKE.f90" | |||||
module ChokeModule | module ChokeModule | ||||
USE CHOKEVARIABLES | USE CHOKEVARIABLES | ||||
use SimulationVariables !@ | |||||
!use CDataDisplayConsole | |||||
! !@use ConfigurationVariables, CasingPressureDataDisplay=>CasingPressure!, StandPipePressureDataDisplay=>StandPipePressure | |||||
use SimulationVariables | |||||
USE CChokeProblemsVariables | USE CChokeProblemsVariables | ||||
!use CChokeControlPanelVariables | |||||
! !@use ConfigurationVariables, StandPipePressureChoke=>StandPipePressure | |||||
USE MudSystemVARIABLES | USE MudSystemVARIABLES | ||||
use SimulationVariables !@@@ | |||||
use CChokeManifold | use CChokeManifold | ||||
use SimulationVariables | |||||
contains | contains | ||||
! function CHOKE_MainBody1 result(CHNUMBER) | ! function CHOKE_MainBody1 result(CHNUMBER) | ||||
@@ -0,0 +1,79 @@ | |||||
# 1 "/home/admin/SimulationCore2/Equipments/ChokeControl/CHOKE_VARIABLES.f90" | |||||
MODULE CHOKEVARIABLES | |||||
!IMPLICIT DOUBLEPRECISION(A-H,O-Z) | |||||
! use CBopControlPanel | |||||
! use ConfigurationVariables | |||||
! use CEquipmentsConstants | |||||
! use CSimulationVariables | |||||
! use CAccumulatorVariables | |||||
! use CBopStackVariables | |||||
! use CChokeControlPanelVariables | |||||
! use ConfigurationVariables | |||||
IMPLICIT NONE | |||||
!=========================================================================== | |||||
! CHOKE VARIABLES | |||||
!=========================================================================== | |||||
type::ChokeType | |||||
REAL Ycritical,Cp,Cv,CL,kRatio,nPolytripic,x1,SGliquid,WaterDensity,LiquidDensity,VL,VG1 | |||||
REAL epsilon_step,epsilon_abs,step_size,Ycritical_a,Ycritical_b,Ycritical_c | |||||
REAL G2,Cdrag,Pwh,MixDens2,Yratio_a,Yratio_b,Yratio_c,Yratio,Yratio_low,Yratio_high | |||||
REAL FlowRate,Patm,MassFlux,LiquidPPG,time2,AreaChoke | |||||
REAL eps_step,eps_abs,Yratiomat(100),Yrario_actual,Yrario | |||||
REAL :: DegreeOpen,GRAVITY1=9.81!,PercentClose | |||||
REAL ChokedMassFlux,ChokedFlowRate,PwhChoked | |||||
REAL TotalStrokes1,TotalStrokes2 | |||||
!INTEGER WashoutMalf,PlugMalf,failMalf | |||||
INTEGER GaugeChokePositionMailf,SoundChokePump | |||||
Real Cumulative_AirVolume_Choke | |||||
Real HydraulicChoke1WashoutCoef,HydraulicChoke2WashoutCoef | |||||
Real Present_HydraulicChoke1Plug, Present_HydraulicChoke2Plug,DeltaPlug1Percent,DeltaPlug2Percent | |||||
Integer HydraulicChoke1PluggedPercent_Old,HydraulicChoke2PluggedPercent_Old,Plug1TimeCounter,Plug2TimeCounter,ChokePlugTimeDelay | |||||
Real ChokeAreaFullyOpen | |||||
end type ChokeType | |||||
!=========================================================================== | |||||
! AIR DRIVEN PUMP VARIABLES | |||||
!=========================================================================== | |||||
type::AirDrivenPumpType | |||||
REAL QAIR_PUMP,cc1,cc2,cc3,cc4,cc5 | |||||
INTEGER ChokeAirFail | |||||
end type AirDrivenPumpType | |||||
! PARAMETER PI=3.141593 | |||||
!============================================================================ | |||||
! OIL & ENVIRONMENT VARIABLES | |||||
!============================================================================ | |||||
! REAL:: SG=1.12,WDENS=1000,GRAVITY=9.81,RE_CR=2000 | |||||
!specific gravity of liquid | |||||
!water density(kg/m^3) | |||||
!=========================================================================== | |||||
! AIR PUMP LINE COMPUTATIONAL VARIABLES | |||||
!=========================================================================== | |||||
!logical ChokeIsClosing,ChokeIsOpening | |||||
type::AirPumpLineType | |||||
REAL ChokeControlLeverOld | |||||
REAL P_AIRP,QITER,DELTAV_AIR,TIME,DeltaT_Choke,TOL_AIR | |||||
REAL diffp_air,losses_air,pipe_loss1air,minor_loss1air,static_loss1air | |||||
integer NO_PIPINGS_AIRPLINE,NO_MINORS_AIRPLINE | |||||
REAL,ALLOCATABLE:: Re_air(:),DIAM_AIR_MM(:),DIAM_AIR_INCH(:),AREA_AIR(:),REL_ROUGHAIR(:),LENGT_AIR(:),LF_AIR(:),CV_AIR(:),NOTE_AIR(:) | |||||
REAL,ALLOCATABLE:: fric_air(:),fricloss_air(:),minlosspa_air(:),minloss_air(:),MINORS_AIRPUMP(:,:) | |||||
REAL,ALLOCATABLE:: MINORDIAM_AIR_INCH(:),MINORAREA_AIR(:) | |||||
REAL,ALLOCATABLE:: ROUGHNESS_AIRPLINE(:),PIPINGS_AIRPUMP(:,:) | |||||
REAL Acylinder,CourseBase!,PassedCourse | |||||
REAL alpha_Qair,alpha_timeair,alpha_pairp,alpha_diffpair,alpha_lossesair,alpha_Pdownstrem,Pdownstrem | |||||
end type AirPumpLineType | |||||
!================================================================================= | |||||
TYPE, PUBLIC :: CHOKE_TypeVars | |||||
INTEGER WashoutMalf,PlugMalf,failMalf | |||||
REAL PercentClose,PassedCourse,AreaChoke,AreaChokeFinal | |||||
logical ChokeIsClosing,ChokeIsOpening | |||||
END TYPE CHOKE_TypeVars | |||||
END MODULE |
@@ -1,6 +1,6 @@ | |||||
module ChokeControlMain | module ChokeControlMain | ||||
USE CHOKEVARIABLES | USE CHOKEVARIABLES | ||||
use SimulationVariables !@ | |||||
use SimulationVariables !@ | |||||
implicit none | implicit none | ||||
public | public | ||||
contains | contains | ||||
@@ -16,7 +16,7 @@ use SimulationVariables !@ | |||||
! end subroutine | ! end subroutine | ||||
subroutine ChokeControl_Init | subroutine ChokeControl_Init | ||||
call Choke_StartUp | |||||
call Choke_StartUp() | |||||
end subroutine ChokeControl_Init | end subroutine ChokeControl_Init | ||||
subroutine ChokeControl_Step | subroutine ChokeControl_Step | ||||
@@ -33,7 +33,7 @@ use SimulationVariables !@ | |||||
data%Equipments%ChokeControlPanel%Choke1LED=0 | data%Equipments%ChokeControlPanel%Choke1LED=0 | ||||
CHNUMBER=2 | CHNUMBER=2 | ||||
ENDIF | ENDIF | ||||
if(ABS(data%Equipments%ChokeControlPanel%ChokeControlLever)==1.0 .AND. data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch == 1 .AND. data%State%CHOOKE(CHNUMBER)%FailMalf==0 .AND. data%State%AirDrivenPump%ChokeAirFail==0) then | |||||
if(ABS(data%Equipments%ChokeControlPanel%ChokeControlLever)==1.0 .AND. data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch .AND. data%State%CHOOKE(CHNUMBER)%FailMalf==0 .AND. data%State%AirDrivenPump%ChokeAirFail==0) then | |||||
if (data%Equipments%ChokeControlPanel%ChokeControlLever == 1.0) then | if (data%Equipments%ChokeControlPanel%ChokeControlLever == 1.0) then | ||||
data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .true. | data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .true. | ||||
data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .false. | data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .false. | ||||
@@ -85,4 +85,455 @@ use SimulationVariables !@ | |||||
! end subroutine ChokeControlMainBody | ! end subroutine ChokeControlMainBody | ||||
SUBROUTINE Choke_StartUp() | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables | |||||
USE CChokeProblemsVariables | |||||
implicit none | |||||
CALL LOSS_INPUTS_CHOKE() | |||||
!OPEN(150,FILE='CHOKE_AIRPUMP_OUTPUTS.DAT') | |||||
!data%State%CHOOKE(1)%WashoutMalf=1 | |||||
!data%State%CHOOKE(1)%PlugMalf=0 | |||||
!data%State%CHOOKE(1)%FailMalf=0 | |||||
! | |||||
!data%State%CHOOKE(2)%WashoutMalf=1 | |||||
!data%State%CHOOKE(2)%PlugMalf=0 | |||||
!data%State%CHOOKE(2)%FailMalf=0 | |||||
! | |||||
! | |||||
!ChokeAirFail=0 | |||||
! | |||||
!GaugeChokePositionMailf=0 | |||||
data%State%Choke%kRatio=1.4 | |||||
data%State%Choke%Cp=0.24 | |||||
data%State%Choke%CL=0.8 | |||||
data%State%Choke%x1=0.5 | |||||
data%State%Choke%LiquidPPG=9. | |||||
data%State%Choke%LiquidDensity=data%State%Choke%LiquidPPG*7.48 !lbm/ft**3 | |||||
data%State%Choke%VL=1.0/data%State%Choke%LiquidDensity !SpecificVolume of Liquid | |||||
data%State%Choke%Cv=data%State%Choke%Cp/data%State%Choke%kRatio | |||||
data%State%Choke%nPolytripic=1+(data%State%Choke%x1*(data%State%Choke%Cp-data%State%Choke%Cv)/(data%State%Choke%x1*data%State%Choke%Cv+(1-data%State%Choke%x1)*data%State%Choke%CL)) | |||||
data%State%Choke%VG1=1./0.748 !lbm/ft**3 Specific Volume of Air, Upstream | |||||
data%State%Choke%Cdrag=0.8 | |||||
data%State%Choke%Pwh=1400. !psi | |||||
data%State%Choke%Patm=14.7 | |||||
data%State%Choke%MixDens2=data%State%Choke%x1*data%State%Choke%VG1 !lbm/ft**3 | |||||
data%State%Choke%epsilon_abs= 1e-5 | |||||
data%State%Choke%epsilon_step= 1e-5 | |||||
!ChokeDiameter= 32/64. !in | |||||
data%State%CHOOKE%PercentClose= 0.0 | |||||
!AreaChoke=0.01334635 | |||||
! data%State%CHOOKE(1)%AreaChoke=0.01334635 | |||||
!ChokeAreaFullyOpen = 123.d0 / 64.d0 ! fully open area is 123/64 in^2 = 0.01334635 ft^2 | |||||
data%State%AirPumpLine%DeltaT_Choke=0.1 | |||||
!TotalStrokes1=0. | |||||
!TotalStrokes2=0. | |||||
data%State%Choke%HydraulicChoke1WashoutCoef= 0.0 | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= 0.0 | |||||
data%State%Choke%ChokePlugTimeDelay = int(180./data%State%AirPumpLine%DeltaT_Choke) ! =1800 = 180/0.1 : for 3 min delay | |||||
data%State%Choke%Present_HydraulicChoke1Plug = REAL(data%problems%ChokeProblems%HydraulicChoke1PluggedPercent)/100. | |||||
data%State%Choke%HydraulicChoke1PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke1PluggedPercent | |||||
data%State%Choke%Plug1TimeCounter= 0 | |||||
data%State%Choke%DeltaPlug1Percent = 0.0 | |||||
data%State%Choke%Present_HydraulicChoke2Plug = REAL(data%problems%ChokeProblems%HydraulicChoke2PluggedPercent)/100. | |||||
data%State%Choke%HydraulicChoke2PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke2PluggedPercent | |||||
data%State%Choke%Plug2TimeCounter= 0 | |||||
data%State%Choke%DeltaPlug2Percent = 0.0 | |||||
!======================AIRPUMP INPUTS(CONSTANTS)=========================== | |||||
data%State%AirPumpLine%CourseBase= 24. !cm | |||||
data%State%CHOOKE%PassedCourse= 0. | |||||
data%Equipments%ChokeControlPanel%ChokePosition=0. | |||||
data%State%AirPumpLine%Acylinder= PI*(8.**2)/4. ! (CM^2), 8=DIAMETER, 24=course , 3785.412: cm^3 to galon | |||||
data%State%CHOOKE%ChokeIsOpening = .false. | |||||
data%State%CHOOKE%ChokeIsClosing = .false. | |||||
data%State%AirPumpLine%P_AIRP=0 | |||||
data%State%AirDrivenPump%cc1 = 0.1354; data%State%AirDrivenPump%cc2 = -2.066; data%State%AirDrivenPump%cc3 = -21.09; data%State%AirDrivenPump%cc4 = -51.36; data%State%AirDrivenPump%cc5 = 5935 ! FOR OUTPUT IN GPM | |||||
! cc1 = 4.754e-07; cc2 = -0.0001676; cc3 = -0.03953; cc4 = -2.223; cc5 = 5935 FOR OUTPUT IN IN^3/MIN | |||||
data%State%AirPumpLine%Pdownstrem= 4950 !+0.01*Pchoke (psi) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | |||||
data%State%AirPumpLine%QITER=5. !(gpm) | |||||
! Q=0.0003585; true | |||||
data%State%AirPumpLine%TIME=0 | |||||
data%State%AirPumpLine%TOL_AIR=0.05 | |||||
data%State%AirPumpLine%alpha_Qair=0 | |||||
data%State%AirPumpLine%alpha_timeair=0 | |||||
data%State%AirPumpLine%alpha_Pdownstrem=data%State%AirPumpLine%Pdownstrem | |||||
data%State%AirPumpLine%alpha_diffpair=0 | |||||
data%State%AirPumpLine%alpha_lossesair=0 | |||||
end | |||||
SUBROUTINE DEALLOCATE_ARRAYS_CHOKE() | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables !@ | |||||
implicit none | |||||
write(*,*) 'deallocateeeeeeeeeeeee' | |||||
!=========================================================================== | |||||
! AIR PUMP LOSSES INPUT | |||||
!=========================================================================== | |||||
!if(allocated(PIPINGS_AIRPUMP)) deallocate(PIPINGS_AIRPUMP) | |||||
DEALLOCATE (data%State%AirPumpLine%PIPINGS_AIRPUMP,data%State%AirPumpLine%DIAM_AIR_INCH, & | |||||
data%State%AirPumpLine%Re_air,data%State%AirPumpLine%AREA_AIR,data%State%AirPumpLine%LENGT_AIR,data%State%AirPumpLine%ROUGHNESS_AIRPLINE,data%State%AirPumpLine%REL_ROUGHAIR, & | |||||
data%State%AirPumpLine%fric_air,data%State%AirPumpLine%fricloss_air) | |||||
!================================================================ | |||||
DEALLOCATE (data%State%AirPumpLine%MINORS_AIRPUMP,data%State%AirPumpLine%MINORDIAM_AIR_INCH, & | |||||
data%State%AirPumpLine%MINORAREA_AIR,data%State%AirPumpLine%LF_AIR,data%State%AirPumpLine%CV_AIR,data%State%AirPumpLine%NOTE_AIR & | |||||
,data%State%AirPumpLine%minlosspa_air,data%State%AirPumpLine%minloss_air) | |||||
END | |||||
SUBROUTINE LOSS_INPUTS_CHOKE() | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables | |||||
implicit none | |||||
Integer I | |||||
!=========================================================================== | |||||
! AIR PUMP LOSSES INPUT | |||||
!=========================================================================== | |||||
data%State%AirPumpLine%NO_PIPINGS_AIRPLINE=1 | |||||
ALLOCATE (data%State%AirPumpLine%PIPINGS_AIRPUMP(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE,3)) | |||||
! ID(INCH) L(MM) ROUGHNESS(MM)=e DESCRIPTION | |||||
data%State%AirPumpLine%PIPINGS_AIRPUMP(1,1:3)= (/0.5, 60960., 0.03/) !Avg.acc.distance | |||||
!60960= 200 ft | |||||
ALLOCATE(data%State%AirPumpLine%DIAM_AIR_INCH(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%Re_air(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%AREA_AIR(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%LENGT_AIR(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%ROUGHNESS_AIRPLINE(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%REL_ROUGHAIR(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%fric_air(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%fricloss_air(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
DO I=1,data%State%AirPumpLine%NO_PIPINGS_AIRPLINE | |||||
data%State%AirPumpLine%DIAM_AIR_INCH(I)=data%State%AirPumpLine%PIPINGS_AIRPUMP(I,1) | |||||
data%State%AirPumpLine%LENGT_AIR(I)=data%State%AirPumpLine%PIPINGS_AIRPUMP(I,2) | |||||
data%State%AirPumpLine%ROUGHNESS_AIRPLINE(I)=data%State%AirPumpLine%PIPINGS_AIRPUMP(I,3) | |||||
data%State%AirPumpLine%AREA_AIR(I)=PI*(data%State%AirPumpLine%DIAM_AIR_INCH(I)*0.0254)**2/4 !D(in), AREA(m) | |||||
data%State%AirPumpLine%REL_ROUGHAIR(I)=data%State%AirPumpLine%ROUGHNESS_AIRPLINE(I)/(data%State%AirPumpLine%DIAM_AIR_INCH(I)*25.4) | |||||
!DIAM_RAMLINE_MM(I)=DIAM_RAMLINE_MM(I)*.001 ! (m) | |||||
data%State%AirPumpLine%LENGT_AIR(I)=data%State%AirPumpLine%LENGT_AIR(I)*.001 ! (m) | |||||
ENDDO | |||||
!================================================================ | |||||
data%State%AirPumpLine%NO_MINORS_AIRPLINE=6 | |||||
ALLOCATE (data%State%AirPumpLine%MINORS_AIRPUMP(data%State%AirPumpLine%NO_MINORS_AIRPLINE,4)) | |||||
! ID(INCH) LF CV NOTE(BAR) DESCRIPTION | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(1,1:4)= (/2., 10., 0., 0./) !Acc.tee | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(2,1:4)= (/2., 11., 0., 0./) !elbow | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(3,1:4)= (/1., 0., 0., 3.4/) !filter | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(4,1:4)= (/2., 0., 105., 0./) !valve | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(5,1:4)= (/1., 0., 9.2, 0./) !valve | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(6,1:4)= (/2., 6.4, 0., 0./) !unionA | |||||
ALLOCATE (data%State%AirPumpLine%MINORDIAM_AIR_INCH(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%MINORAREA_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE), & | |||||
data%State%AirPumpLine%LF_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%CV_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%NOTE_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE) & | |||||
,data%State%AirPumpLine%minlosspa_air(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%minloss_air(data%State%AirPumpLine%NO_MINORS_AIRPLINE)) | |||||
DO I=1,data%State%AirPumpLine%NO_MINORS_AIRPLINE | |||||
data%State%AirPumpLine%MINORDIAM_AIR_INCH(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,1) | |||||
data%State%AirPumpLine%LF_AIR(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,2) | |||||
data%State%AirPumpLine%CV_AIR(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,3) | |||||
data%State%AirPumpLine%NOTE_AIR(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,4) | |||||
data%State%AirPumpLine%MINORAREA_AIR(I)=PI*(data%State%AirPumpLine%MINORDIAM_AIR_INCH(I)*0.0254)**2/4. !D(in), AREA(m) | |||||
ENDDO | |||||
END | |||||
! SUBROUTINE PIPE_RAMS_CHOKE(CHNUMBER) | |||||
! USE CHOKEVARIABLES | |||||
! use ConfigurationVariables !@ | |||||
! Use CSimulationVariables | |||||
! implicit none | |||||
! INTEGER CHNUMBER | |||||
! Integer I | |||||
! loop3: do while (ABS(data%Equipments%ChokeControlPanel%ChokeControlLever)==1.0 .AND. data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch == 1 .AND. data%State%CHOOKE(CHNUMBER)%FailMalf==0 .AND. data%State%AirDrivenPump%ChokeAirFail==0) | |||||
! if (data%Equipments%ChokeControlPanel%ChokeControlLever == 1.0) then | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .true. | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .false. | |||||
! endif | |||||
! if (data%Equipments%ChokeControlPanel%ChokeControlLever == -1.0) then | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .true. | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .false. | |||||
! endif | |||||
! data%State%AirPumpLine%TIME=data%State%AirPumpLine%TIME+data%State%AirPumpLine%DeltaT_Choke !overal time (s) | |||||
! call airpump_code_CHOKE(CHNUMBER) | |||||
! call sleepqq(100) | |||||
! if (IsStopped == .true.) return | |||||
! end do loop3 !while finished_Choke==0 | |||||
! end | |||||
SUBROUTINE airpump_code_CHOKE(CHNUMBER) | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables !@ | |||||
use CChokeManifold | |||||
use SimulationVariables | |||||
use CSounds | |||||
USE CChokeProblemsVariables | |||||
implicit none | |||||
Integer I | |||||
INTEGER CHNUMBER | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirPumpLine%QITER+.1 !(gpm) maximum flow for the start | |||||
data%State%AirPumpLine%diffp_air=-10 | |||||
data%State%AirPumpLine%losses_air=10 | |||||
!=================================================================== | |||||
! AIR OPERATED PUMP | |||||
! MODEL 10-6000W030 RATIO 55:1 | |||||
!=================for air consumption at 100 psig=================== | |||||
do while (data%State%AirPumpLine%diffp_air<0) | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP-.1 | |||||
! Qup=data%State%AirDrivenPump%QAIR_PUMP; | |||||
!cc1 = 1354; cc2 = -2066; cc3 = -2109; cc4 = -513.6; cc5 = 5935 FOR OUTPUT IN GPM | |||||
data%State%AirPumpLine%P_AIRP=data%State%AirDrivenPump%cc1*(data%State%AirDrivenPump%QAIR_PUMP**4) + data%State%AirDrivenPump%cc2*(data%State%AirDrivenPump%QAIR_PUMP**3) + data%State%AirDrivenPump%cc3*(data%State%AirDrivenPump%QAIR_PUMP**2) + data%State%AirDrivenPump%cc4*data%State%AirDrivenPump%QAIR_PUMP + data%State%AirDrivenPump%cc5 !(psig) | |||||
! kinetic_air=sg*wdens*(QAIR_PUMP*6.30902e-5/((1/4.)*pi*(2*0.254e-1)**2))**2/(2*6895) !(psi) | |||||
data%State%AirPumpLine%diffp_air= data%State%AirPumpLine%P_AIRP - data%State%AirPumpLine%Pdownstrem | |||||
end do !returns Qup | |||||
do while (abs((data%State%AirPumpLine%diffp_air-data%State%AirPumpLine%losses_air)/data%State%AirPumpLine%diffp_air)>data%State%AirPumpLine%TOL_AIR) !finding correct QAIR_pump for 1 timecounter_ram | |||||
if (data%State%AirPumpLine%diffp_air-data%State%AirPumpLine%losses_air>0) then | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP+.005 | |||||
else | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP-.005 | |||||
endif | |||||
!=================================================================== | |||||
! AIR OPERATED PUMP | |||||
! MODEL 10-6000W030 RATIO 55:1 | |||||
!=================for air consumption at 100 psig=================== | |||||
data%State%AirPumpLine%P_AIRP=data%State%AirDrivenPump%cc1*(data%State%AirDrivenPump%QAIR_PUMP**4) + data%State%AirDrivenPump%cc2*(data%State%AirDrivenPump%QAIR_PUMP**3) + data%State%AirDrivenPump%cc3*(data%State%AirDrivenPump%QAIR_PUMP**2) + data%State%AirDrivenPump%cc4*data%State%AirDrivenPump%QAIR_PUMP + data%State%AirDrivenPump%cc5 !(psig) | |||||
!kinetic_air=sg*wdens*(QAIR_PUMP*6.30902e-005/((1/4.)*pi*(2*0.254e-1)**2))**2/(2*6895) !(psi) | |||||
data%State%AirPumpLine%diffp_air= data%State%AirPumpLine%P_AIRP - data%State%AirPumpLine%Pdownstrem | |||||
!===========================LOSSES==================================== | |||||
do i=1,data%State%AirPumpLine%NO_PIPINGS_AIRPLINE | |||||
data%State%AirPumpLine%Re_air(i)=data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005*data%State%AirPumpLine%DIAM_AIR_INCH(I)*0.0254/(data%State%AirPumpLine%AREA_AIR(i)*nu) | |||||
enddo | |||||
do i=1,data%State%AirPumpLine%NO_PIPINGS_AIRPLINE | |||||
if (data%State%AirPumpLine%Re_air(i)<Re_cr) then | |||||
data%State%AirPumpLine%fric_air(i)=64/data%State%AirPumpLine%Re_air(i) | |||||
else | |||||
data%State%AirPumpLine%fric_air(i)=1/(-1.8*log10((data%State%AirPumpLine%REL_ROUGHAIR(i)/3.7)**1.11+6.9/data%State%AirPumpLine%Re_air(i)))**2 | |||||
endif | |||||
data%State%AirPumpLine%fricloss_air(i)=((data%State%AirPumpLine%fric_air(i)*(wdens*sg*data%State%AirPumpLine%LENGT_AIR(i)*(data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005/data%State%AirPumpLine%AREA_AIR(i))**2))/(2*data%State%AirPumpLine%DIAM_AIR_INCH(I)*0.0254))/6895 | |||||
enddo | |||||
data%State%AirPumpLine%pipe_loss1air=sum(data%State%AirPumpLine%fricloss_air) !loss before regulator(psi) | |||||
do i=1,data%State%AirPumpLine%NO_MINORS_AIRPLINE | |||||
if (data%State%AirPumpLine%LF_AIR(i)/=0) then | |||||
data%State%AirPumpLine%minlosspa_air(i)=data%State%AirPumpLine%LF_AIR(i)*wdens*sg*(data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005/data%State%AirPumpLine%MINORAREA_AIR(i))**2/2 !(Pa) | |||||
data%State%AirPumpLine%minloss_air(i)=data%State%AirPumpLine%minlosspa_air(i)/6895 !(psi) | |||||
elseif (data%State%AirPumpLine%CV_AIR(i)/=0) then | |||||
data%State%AirPumpLine%minlosspa_air(i)=1000*sg*((11.7*data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005*3600)/(data%State%AirPumpLine%CV_AIR(i)))**2 !(pa) | |||||
data%State%AirPumpLine%minloss_air(i)=data%State%AirPumpLine%minlosspa_air(i)/6895 !(psi) | |||||
else | |||||
data%State%AirPumpLine%minlosspa_air(i)=data%State%AirPumpLine%NOTE_AIR(i)*1e5 !(pa) | |||||
data%State%AirPumpLine%minloss_air(i)=data%State%AirPumpLine%minlosspa_air(i)/6895 !(psi) | |||||
endif | |||||
enddo | |||||
data%State%AirPumpLine%minor_loss1air=sum(data%State%AirPumpLine%minloss_air) !loss before regulator(psi) | |||||
data%State%AirPumpLine%static_loss1air=0 | |||||
data%State%AirPumpLine%losses_air=data%State%AirPumpLine%pipe_loss1air+data%State%AirPumpLine%minor_loss1air+data%State%AirPumpLine%static_loss1air !(psi) | |||||
!========================================================================= | |||||
end do !returns correct QAIR_PUMP for 1 counter | |||||
data%State%AirPumpLine%QITER=data%State%AirDrivenPump%QAIR_PUMP | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP*(data%Equipments%ChokeControlPanel%ChokeRateControlKnob/10.) ! final Q (gpm) | |||||
data%State%Choke%Cumulative_AirVolume_Choke= data%State%Choke%Cumulative_AirVolume_Choke + ((data%State%AirDrivenPump%QAIR_PUMP * data%State%AirPumpLine%DeltaT_Choke / 60.0 ) / (1.5*0.004329004) ) ! =strokes | |||||
if ( data%State%Choke%Cumulative_AirVolume_Choke > 1.0 ) then | |||||
data%State%Choke%SoundChokePump= 60 | |||||
data%State%Choke%Cumulative_AirVolume_Choke= data%State%Choke%Cumulative_AirVolume_Choke - 1.0 | |||||
else | |||||
data%State%Choke%SoundChokePump= 0.0 | |||||
endif | |||||
data%State%AirPumpLine%DELTAV_AIR=data%State%AirDrivenPump%QAIR_PUMP*data%State%AirPumpLine%DeltaT_Choke/60 !(galon) delta_t=1sec , Q(gpm) | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsClosing) data%State%CHOOKE(CHNUMBER)%PassedCourse=data%State%CHOOKE(CHNUMBER)%PassedCourse + (data%State%AirPumpLine%DELTAV_AIR*3785.412/data%State%AirPumpLine%Acylinder)!*(ChokeRateControlKnob/10.) ! 3785.412 : GALON TO CM^3 | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsOpening) data%State%CHOOKE(CHNUMBER)%PassedCourse=data%State%CHOOKE(CHNUMBER)%PassedCourse - (data%State%AirPumpLine%DELTAV_AIR*3785.412/data%State%AirPumpLine%Acylinder)!*(ChokeRateControlKnob/10.) | |||||
!DeltaT_Choke= 1sec or 2sec | |||||
!((((((((IN OUTER LOOP)))))) | |||||
!===============AIR PUMP OUTPUTS========================= | |||||
data%State%AirPumpLine%alpha_timeair=data%State%AirPumpLine%TIME ! overal time (s) | |||||
data%State%AirPumpLine%alpha_Pdownstrem=data%State%AirPumpLine%Pdownstrem | |||||
data%State%AirPumpLine%alpha_pairp=data%State%AirPumpLine%P_AIRP | |||||
data%State%AirPumpLine%alpha_Qair=data%State%AirDrivenPump%QAIR_PUMP | |||||
!write(*,*) 'diffp_air=',diffp_air | |||||
!pause | |||||
data%State%AirPumpLine%alpha_diffpair=data%State%AirPumpLine%diffp_air | |||||
data%State%AirPumpLine%alpha_lossesair=data%State%AirPumpLine%losses_air | |||||
!======================================================== | |||||
!OPEN(150,FILE='CHOKE_AIRPUMP_OUTPUTS.DAT') | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsClosing .AND. data%State%CHOOKE(CHNUMBER)%PassedCourse>data%State%AirPumpLine%CourseBase) then | |||||
data%State%CHOOKE(CHNUMBER)%PassedCourse=data%State%AirPumpLine%CourseBase | |||||
data%State%Choke%SoundChokePump= 0.0 | |||||
endif | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsOpening .AND. data%State%CHOOKE(CHNUMBER)%PassedCourse<0.) then | |||||
data%State%CHOOKE(CHNUMBER)%PassedCourse=0. | |||||
data%State%Choke%SoundChokePump= 0.0 | |||||
endif | |||||
call SetSoundChokePump(data%State%Choke%SoundChokePump) | |||||
data%State%CHOOKE(CHNUMBER)%PercentClose= data%State%CHOOKE(CHNUMBER)%PassedCourse/data%State%AirPumpLine%CourseBase | |||||
IF (data%Equipments%ChokeControlPanel%Choke1LED==1) THEN | |||||
data%Equipments%ChokeControlPanel%ChokePosition= (1 - data%State%Choke%GaugeChokePositionMailf) * data%State%CHOOKE(1)%PercentClose*10 | |||||
ELSE ! Choke2LED==1 | |||||
data%Equipments%ChokeControlPanel%ChokePosition= (1 - data%State%Choke%GaugeChokePositionMailf) * data%State%CHOOKE(2)%PercentClose*10 | |||||
ENDIF | |||||
!CALL SetHydraulicChock1(nint(MIN(data%State%CHOOKE(1)%PercentClose / 0.91 , 1.0)*100)) | |||||
! CALL SetHydraulicChock2(nint(MIN(data%State%CHOOKE(2)%PercentClose / 0.91 , 1.0)*100)) | |||||
! .91 >> 9 percent clearance | |||||
! =================== calculating Area | |||||
! AreaChoke=0.5 | |||||
! .91 >> 9 percent clearance | |||||
data%State%CHOOKE(1)%AreaChoke=0.01334635-(0.01334635* MIN(data%State%CHOOKE(1)%PercentClose / 0.91 , 1.0)) !ft^2 0.01334635 is ChokeAreaFullyOpen (ft^2) | |||||
data%State%CHOOKE(2)%AreaChoke=0.01334635-(0.01334635* MIN(data%State%CHOOKE(2)%PercentClose/ 0.91 , 1.0)) !ft^2 | |||||
data%State%Choke%HydraulicChoke1WashoutCoef= data%State%Choke%HydraulicChoke1WashoutCoef * data%State%CHOOKE(1)%WashoutMalf | |||||
data%State%Choke%HydraulicChoke1WashoutCoef= MIN( 0.5 , data%State%Choke%HydraulicChoke1WashoutCoef+ data%State%CHOOKE(1)%WashoutMalf*(0.5/(60.0/data%State%AirPumpLine%DeltaT_Choke)) ) ! 0.5=maximum washout coef , 60.0 sec= 1min duration time | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= data%State%Choke%HydraulicChoke2WashoutCoef * data%State%CHOOKE(2)%WashoutMalf | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= MIN( 0.5 , data%State%Choke%HydraulicChoke2WashoutCoef+ data%State%CHOOKE(2)%WashoutMalf*(0.5/(60.0/data%State%AirPumpLine%DeltaT_Choke)) ) ! 0.5=maximum washout coef , 60.0 sec= 1min duration time | |||||
!write(*,*) 'HydraulicChoke1WashoutCoef=' , HydraulicChoke1WashoutCoef | |||||
IF (data%State%CHOOKE(1)%PlugMalf == 1) THEN | |||||
data%State%Choke%Present_HydraulicChoke1Plug= data%State%Choke%Present_HydraulicChoke1Plug * data%State%CHOOKE(1)%PlugMalf | |||||
! integer: HydraulicChoke1PluggedPercent,HydraulicChoke1PluggedPercent_Old,PlugTimeCounter,ChokePlugTimeDelay | |||||
! real: Present_HydraulicChoke1Plug,DeltaPlug1Percent | |||||
!write(*,*) 'HydraulicChoke1PluggedPercent=' , HydraulicChoke1PluggedPercent | |||||
if ( (data%problems%ChokeProblems%HydraulicChoke1PluggedPercent - data%State%Choke%HydraulicChoke1PluggedPercent_Old) /= 0) then | |||||
data%State%Choke%DeltaPlug1Percent = (REAL(data%problems%ChokeProblems%HydraulicChoke1PluggedPercent)/100.) - data%State%Choke%Present_HydraulicChoke1Plug | |||||
data%State%Choke%Plug1TimeCounter = 0 | |||||
!write(*,*) 'DeltaPlug1Percent, Present_HydraulicChoke1Plug = ' ,DeltaPlug1Percent , Present_HydraulicChoke1Plug | |||||
endif | |||||
data%State%Choke%Plug1TimeCounter= data%State%Choke%Plug1TimeCounter + 1 | |||||
data%State%Choke%HydraulicChoke1PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke1PluggedPercent | |||||
if (data%State%Choke%Plug1TimeCounter <= data%State%Choke%ChokePlugTimeDelay) then !ChokePlugTimeDelay=600 | |||||
data%State%Choke%Present_HydraulicChoke1Plug = data%State%Choke%Present_HydraulicChoke1Plug + data%State%CHOOKE(1)%PlugMalf* ((data%State%Choke%DeltaPlug1Percent / real(data%State%Choke%ChokePlugTimeDelay))) ! real(ChokePlugTimeDelay)= 600.0 | |||||
endif | |||||
!write(*,*) 'Present_HydraulicChoke1Plug=' , Present_HydraulicChoke1Plug | |||||
ENDIF | |||||
IF (data%State%CHOOKE(2)%PlugMalf == 1) THEN | |||||
data%State%Choke%Present_HydraulicChoke2Plug= data%State%Choke%Present_HydraulicChoke2Plug * data%State%CHOOKE(2)%PlugMalf | |||||
! integer: HydraulicChoke2PluggedPercent,HydraulicChoke2PluggedPercent_Old,PlugTimeCounter,ChokePlugTimeDelay | |||||
! real: Present_HydraulicChoke2Plug,DeltaPlug2Percent | |||||
if ( (data%problems%ChokeProblems%HydraulicChoke2PluggedPercent - data%State%Choke%HydraulicChoke2PluggedPercent_Old) /= 0 ) then | |||||
data%State%Choke%DeltaPlug2Percent = (REAL(data%problems%ChokeProblems%HydraulicChoke2PluggedPercent)/100.) - data%State%Choke%Present_HydraulicChoke2Plug | |||||
data%State%Choke%Plug2TimeCounter = 0 | |||||
endif | |||||
data%State%Choke%Plug2TimeCounter= data%State%Choke%Plug2TimeCounter + 1 | |||||
data%State%Choke%HydraulicChoke2PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke2PluggedPercent | |||||
if (data%State%Choke%Plug2TimeCounter <= data%State%Choke%ChokePlugTimeDelay) then !ChokePlugTimeDelay=600 | |||||
data%State%Choke%Present_HydraulicChoke2Plug = data%State%Choke%Present_HydraulicChoke2Plug + data%State%CHOOKE(2)%PlugMalf *((data%State%Choke%DeltaPlug2Percent / real(data%State%Choke%ChokePlugTimeDelay))) ! real(ChokePlugTimeDelay)= 600.0 | |||||
endif | |||||
ENDIF | |||||
! fully open area is 123/64 in^2 = 0.01334635 ft^2 | |||||
data%State%CHOOKE(1)%AreaChoke=data%State%CHOOKE(1)%AreaChoke+(data%State%CHOOKE(1)%WashoutMalf*data%State%Choke%HydraulicChoke1WashoutCoef*data%State%Choke%ChokeAreaFullyOpen/144.0) ! Initialised in Choke Startup | |||||
!write(*,*) 'data%State%CHOOKE(1)%WashoutMalf , data%State%CHOOKE(1)%AreaChoke=' ,data%State%CHOOKE(1)%WashoutMalf , data%State%CHOOKE(1)%AreaChoke | |||||
data%State%CHOOKE(1)%AreaChoke=data%State%CHOOKE(1)%AreaChoke-(data%State%CHOOKE(1)%PlugMalf* data%State%Choke%Present_HydraulicChoke1Plug *data%State%CHOOKE(1)%AreaChoke) ! Initialised in Choke Startup | |||||
data%State%CHOOKE(2)%AreaChoke=data%State%CHOOKE(2)%AreaChoke+(data%State%CHOOKE(2)%WashoutMalf*data%State%Choke%HydraulicChoke2WashoutCoef*data%State%Choke%ChokeAreaFullyOpen/144.0) ! Initialised in Choke Startup | |||||
data%State%CHOOKE(2)%AreaChoke=data%State%CHOOKE(2)%AreaChoke-(data%State%CHOOKE(2)%PlugMalf* data%State%Choke%Present_HydraulicChoke2Plug *data%State%CHOOKE(2)%AreaChoke) ! Initialised in Choke Startup | |||||
!write(*,*) 'data%State%CHOOKE(2)%WashoutMalf , data%State%CHOOKE(2)%AreaChoke=' ,data%State%CHOOKE(2)%WashoutMalf , data%State%CHOOKE(2)%AreaChoke | |||||
data%State%CHOOKE(1)%AreaChokeFinal= data%State%CHOOKE(1)%AreaChoke | |||||
data%State%CHOOKE(2)%AreaChokeFinal= data%State%CHOOKE(2)%AreaChoke | |||||
! 144: ft^2 to in^2 | |||||
CALL SetHydraulicChock1(100 - nint((data%State%CHOOKE(1)%AreaChokeFinal/(data%State%Choke%ChokeAreaFullyOpen/144.))*100)) ! for manifold valve | |||||
CALL SetHydraulicChock2(100 - nint((data%State%CHOOKE(2)%AreaChokeFinal/(data%State%Choke%ChokeAreaFullyOpen/144.))*100)) ! for manifold valve | |||||
!write(*,*) 'data%State%CHOOKE(1)%PercentClose=' , data%State%CHOOKE(1)%PercentClose ! close percent 0 to 100 | |||||
!write(*,*) 'ChokePosition=' , ChokePosition ! close position 0 to 10 for display | |||||
!write(*,*) 'data%State%CHOOKE(1)%AreaChokeFinal=' , data%State%CHOOKE(1)%AreaChokeFinal ! Open Area (in^2) with clearance | |||||
!write(*,*) '(ChokeAreaFullyOpen/144.)=' , (ChokeAreaFullyOpen/144.) | |||||
!write(*,*) 'valve value=' , 100 - nint((data%State%CHOOKE(1)%AreaChokeFinal/(ChokeAreaFullyOpen/144.))*100) ! percent close 0 to 100 with clearance | |||||
!write(*,*) 'Valve(33)%Status=' , Valve(33)%Status ! T : open , F: close | |||||
! =================== calculating Area | |||||
!write(*,*) 'data%State%CHOOKE(1)%AreaChoke= ' , data%State%CHOOKE(1)%AreaChoke | |||||
!WRITE(150,50) alpha_timeair,alpha_Qair,alpha_pairp, & | |||||
!alpha_Pdownstrem,alpha_diffpair,alpha_lossesair,data%State%CHOOKE(CHNUMBER)%PassedCourse | |||||
!50 FORMAT(7(f15.5)) | |||||
!======================================================================================== | |||||
!======================================================================================== | |||||
! write(*,*) PassedCourse | |||||
end | |||||
end module ChokeControlMain | end module ChokeControlMain |
@@ -1,7 +1,7 @@ | |||||
# 1 "/home/admin/SimulationCore2/Equipments/ChokeControl/ChokeControlMain.f90" | # 1 "/home/admin/SimulationCore2/Equipments/ChokeControl/ChokeControlMain.f90" | ||||
module ChokeControlMain | module ChokeControlMain | ||||
USE CHOKEVARIABLES | USE CHOKEVARIABLES | ||||
use SimulationVariables !@ | |||||
use SimulationVariables !@ | |||||
implicit none | implicit none | ||||
public | public | ||||
contains | contains | ||||
@@ -17,7 +17,7 @@ use SimulationVariables !@ | |||||
! end subroutine | ! end subroutine | ||||
subroutine ChokeControl_Init | subroutine ChokeControl_Init | ||||
call Choke_StartUp | |||||
call Choke_StartUp() | |||||
end subroutine ChokeControl_Init | end subroutine ChokeControl_Init | ||||
subroutine ChokeControl_Step | subroutine ChokeControl_Step | ||||
@@ -25,7 +25,7 @@ use SimulationVariables !@ | |||||
implicit none | implicit none | ||||
INTEGER CHNUMBER | INTEGER CHNUMBER | ||||
IF(data%Equipments%ChokeControlPanel%ChokeSelectorSwitch== 1) THEN | |||||
IF(data%Equipments%ChokeControlPanel%ChokeSelectorSwitch) THEN | |||||
data%Equipments%ChokeControlPanel%Choke1LED=1 | data%Equipments%ChokeControlPanel%Choke1LED=1 | ||||
data%Equipments%ChokeControlPanel%Choke2LED=0 | data%Equipments%ChokeControlPanel%Choke2LED=0 | ||||
CHNUMBER=1 | CHNUMBER=1 | ||||
@@ -34,7 +34,7 @@ use SimulationVariables !@ | |||||
data%Equipments%ChokeControlPanel%Choke1LED=0 | data%Equipments%ChokeControlPanel%Choke1LED=0 | ||||
CHNUMBER=2 | CHNUMBER=2 | ||||
ENDIF | ENDIF | ||||
if(ABS(data%Equipments%ChokeControlPanel%ChokeControlLever)==1.0 .AND. data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch == 1 .AND. data%State%CHOOKE(CHNUMBER)%FailMalf==0 .AND. data%State%AirDrivenPump%ChokeAirFail==0) then | |||||
if(ABS(data%Equipments%ChokeControlPanel%ChokeControlLever)==1.0 .AND. data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch .AND. data%State%CHOOKE(CHNUMBER)%FailMalf==0 .AND. data%State%AirDrivenPump%ChokeAirFail==0) then | |||||
if (data%Equipments%ChokeControlPanel%ChokeControlLever == 1.0) then | if (data%Equipments%ChokeControlPanel%ChokeControlLever == 1.0) then | ||||
data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .true. | data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .true. | ||||
data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .false. | data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .false. | ||||
@@ -86,4 +86,455 @@ use SimulationVariables !@ | |||||
! end subroutine ChokeControlMainBody | ! end subroutine ChokeControlMainBody | ||||
SUBROUTINE Choke_StartUp() | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables | |||||
USE CChokeProblemsVariables | |||||
implicit none | |||||
CALL LOSS_INPUTS_CHOKE() | |||||
!OPEN(150,FILE='CHOKE_AIRPUMP_OUTPUTS.DAT') | |||||
!data%State%CHOOKE(1)%WashoutMalf=1 | |||||
!data%State%CHOOKE(1)%PlugMalf=0 | |||||
!data%State%CHOOKE(1)%FailMalf=0 | |||||
! | |||||
!data%State%CHOOKE(2)%WashoutMalf=1 | |||||
!data%State%CHOOKE(2)%PlugMalf=0 | |||||
!data%State%CHOOKE(2)%FailMalf=0 | |||||
! | |||||
! | |||||
!ChokeAirFail=0 | |||||
! | |||||
!GaugeChokePositionMailf=0 | |||||
data%State%Choke%kRatio=1.4 | |||||
data%State%Choke%Cp=0.24 | |||||
data%State%Choke%CL=0.8 | |||||
data%State%Choke%x1=0.5 | |||||
data%State%Choke%LiquidPPG=9. | |||||
data%State%Choke%LiquidDensity=data%State%Choke%LiquidPPG*7.48 !lbm/ft**3 | |||||
data%State%Choke%VL=1.0/data%State%Choke%LiquidDensity !SpecificVolume of Liquid | |||||
data%State%Choke%Cv=data%State%Choke%Cp/data%State%Choke%kRatio | |||||
data%State%Choke%nPolytripic=1+(data%State%Choke%x1*(data%State%Choke%Cp-data%State%Choke%Cv)/(data%State%Choke%x1*data%State%Choke%Cv+(1-data%State%Choke%x1)*data%State%Choke%CL)) | |||||
data%State%Choke%VG1=1./0.748 !lbm/ft**3 Specific Volume of Air, Upstream | |||||
data%State%Choke%Cdrag=0.8 | |||||
data%State%Choke%Pwh=1400. !psi | |||||
data%State%Choke%Patm=14.7 | |||||
data%State%Choke%MixDens2=data%State%Choke%x1*data%State%Choke%VG1 !lbm/ft**3 | |||||
data%State%Choke%epsilon_abs= 1e-5 | |||||
data%State%Choke%epsilon_step= 1e-5 | |||||
!ChokeDiameter= 32/64. !in | |||||
data%State%CHOOKE%PercentClose= 0.0 | |||||
!AreaChoke=0.01334635 | |||||
! data%State%CHOOKE(1)%AreaChoke=0.01334635 | |||||
!ChokeAreaFullyOpen = 123.d0 / 64.d0 ! fully open area is 123/64 in^2 = 0.01334635 ft^2 | |||||
data%State%AirPumpLine%DeltaT_Choke=0.1 | |||||
!TotalStrokes1=0. | |||||
!TotalStrokes2=0. | |||||
data%State%Choke%HydraulicChoke1WashoutCoef= 0.0 | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= 0.0 | |||||
data%State%Choke%ChokePlugTimeDelay = int(180./data%State%AirPumpLine%DeltaT_Choke) ! =1800 = 180/0.1 : for 3 min delay | |||||
data%State%Choke%Present_HydraulicChoke1Plug = REAL(data%problems%ChokeProblems%HydraulicChoke1PluggedPercent)/100. | |||||
data%State%Choke%HydraulicChoke1PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke1PluggedPercent | |||||
data%State%Choke%Plug1TimeCounter= 0 | |||||
data%State%Choke%DeltaPlug1Percent = 0.0 | |||||
data%State%Choke%Present_HydraulicChoke2Plug = REAL(data%problems%ChokeProblems%HydraulicChoke2PluggedPercent)/100. | |||||
data%State%Choke%HydraulicChoke2PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke2PluggedPercent | |||||
data%State%Choke%Plug2TimeCounter= 0 | |||||
data%State%Choke%DeltaPlug2Percent = 0.0 | |||||
!======================AIRPUMP INPUTS(CONSTANTS)=========================== | |||||
data%State%AirPumpLine%CourseBase= 24. !cm | |||||
data%State%CHOOKE%PassedCourse= 0. | |||||
data%Equipments%ChokeControlPanel%ChokePosition=0. | |||||
data%State%AirPumpLine%Acylinder= PI*(8.**2)/4. ! (CM^2), 8=DIAMETER, 24=course , 3785.412: cm^3 to galon | |||||
data%State%CHOOKE%ChokeIsOpening = .false. | |||||
data%State%CHOOKE%ChokeIsClosing = .false. | |||||
data%State%AirPumpLine%P_AIRP=0 | |||||
data%State%AirDrivenPump%cc1 = 0.1354; data%State%AirDrivenPump%cc2 = -2.066; data%State%AirDrivenPump%cc3 = -21.09; data%State%AirDrivenPump%cc4 = -51.36; data%State%AirDrivenPump%cc5 = 5935 ! FOR OUTPUT IN GPM | |||||
! cc1 = 4.754e-07; cc2 = -0.0001676; cc3 = -0.03953; cc4 = -2.223; cc5 = 5935 FOR OUTPUT IN IN^3/MIN | |||||
data%State%AirPumpLine%Pdownstrem= 4950 !+0.01*Pchoke (psi) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | |||||
data%State%AirPumpLine%QITER=5. !(gpm) | |||||
! Q=0.0003585; true | |||||
data%State%AirPumpLine%TIME=0 | |||||
data%State%AirPumpLine%TOL_AIR=0.05 | |||||
data%State%AirPumpLine%alpha_Qair=0 | |||||
data%State%AirPumpLine%alpha_timeair=0 | |||||
data%State%AirPumpLine%alpha_Pdownstrem=data%State%AirPumpLine%Pdownstrem | |||||
data%State%AirPumpLine%alpha_diffpair=0 | |||||
data%State%AirPumpLine%alpha_lossesair=0 | |||||
end | |||||
SUBROUTINE DEALLOCATE_ARRAYS_CHOKE() | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables !@ | |||||
implicit none | |||||
write(*,*) 'deallocateeeeeeeeeeeee' | |||||
!=========================================================================== | |||||
! AIR PUMP LOSSES INPUT | |||||
!=========================================================================== | |||||
!if(allocated(PIPINGS_AIRPUMP)) deallocate(PIPINGS_AIRPUMP) | |||||
DEALLOCATE (data%State%AirPumpLine%PIPINGS_AIRPUMP,data%State%AirPumpLine%DIAM_AIR_INCH, & | |||||
data%State%AirPumpLine%Re_air,data%State%AirPumpLine%AREA_AIR,data%State%AirPumpLine%LENGT_AIR,data%State%AirPumpLine%ROUGHNESS_AIRPLINE,data%State%AirPumpLine%REL_ROUGHAIR, & | |||||
data%State%AirPumpLine%fric_air,data%State%AirPumpLine%fricloss_air) | |||||
!================================================================ | |||||
DEALLOCATE (data%State%AirPumpLine%MINORS_AIRPUMP,data%State%AirPumpLine%MINORDIAM_AIR_INCH, & | |||||
data%State%AirPumpLine%MINORAREA_AIR,data%State%AirPumpLine%LF_AIR,data%State%AirPumpLine%CV_AIR,data%State%AirPumpLine%NOTE_AIR & | |||||
,data%State%AirPumpLine%minlosspa_air,data%State%AirPumpLine%minloss_air) | |||||
END | |||||
SUBROUTINE LOSS_INPUTS_CHOKE() | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables | |||||
implicit none | |||||
Integer I | |||||
!=========================================================================== | |||||
! AIR PUMP LOSSES INPUT | |||||
!=========================================================================== | |||||
data%State%AirPumpLine%NO_PIPINGS_AIRPLINE=1 | |||||
ALLOCATE (data%State%AirPumpLine%PIPINGS_AIRPUMP(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE,3)) | |||||
! ID(INCH) L(MM) ROUGHNESS(MM)=e DESCRIPTION | |||||
data%State%AirPumpLine%PIPINGS_AIRPUMP(1,1:3)= (/0.5, 60960., 0.03/) !Avg.acc.distance | |||||
!60960= 200 ft | |||||
ALLOCATE(data%State%AirPumpLine%DIAM_AIR_INCH(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%Re_air(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%AREA_AIR(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%LENGT_AIR(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%ROUGHNESS_AIRPLINE(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%REL_ROUGHAIR(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%fric_air(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
ALLOCATE(data%State%AirPumpLine%fricloss_air(data%State%AirPumpLine%NO_PIPINGS_AIRPLINE)) | |||||
DO I=1,data%State%AirPumpLine%NO_PIPINGS_AIRPLINE | |||||
data%State%AirPumpLine%DIAM_AIR_INCH(I)=data%State%AirPumpLine%PIPINGS_AIRPUMP(I,1) | |||||
data%State%AirPumpLine%LENGT_AIR(I)=data%State%AirPumpLine%PIPINGS_AIRPUMP(I,2) | |||||
data%State%AirPumpLine%ROUGHNESS_AIRPLINE(I)=data%State%AirPumpLine%PIPINGS_AIRPUMP(I,3) | |||||
data%State%AirPumpLine%AREA_AIR(I)=PI*(data%State%AirPumpLine%DIAM_AIR_INCH(I)*0.0254)**2/4 !D(in), AREA(m) | |||||
data%State%AirPumpLine%REL_ROUGHAIR(I)=data%State%AirPumpLine%ROUGHNESS_AIRPLINE(I)/(data%State%AirPumpLine%DIAM_AIR_INCH(I)*25.4) | |||||
!DIAM_RAMLINE_MM(I)=DIAM_RAMLINE_MM(I)*.001 ! (m) | |||||
data%State%AirPumpLine%LENGT_AIR(I)=data%State%AirPumpLine%LENGT_AIR(I)*.001 ! (m) | |||||
ENDDO | |||||
!================================================================ | |||||
data%State%AirPumpLine%NO_MINORS_AIRPLINE=6 | |||||
ALLOCATE (data%State%AirPumpLine%MINORS_AIRPUMP(data%State%AirPumpLine%NO_MINORS_AIRPLINE,4)) | |||||
! ID(INCH) LF CV NOTE(BAR) DESCRIPTION | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(1,1:4)= (/2., 10., 0., 0./) !Acc.tee | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(2,1:4)= (/2., 11., 0., 0./) !elbow | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(3,1:4)= (/1., 0., 0., 3.4/) !filter | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(4,1:4)= (/2., 0., 105., 0./) !valve | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(5,1:4)= (/1., 0., 9.2, 0./) !valve | |||||
data%State%AirPumpLine%MINORS_AIRPUMP(6,1:4)= (/2., 6.4, 0., 0./) !unionA | |||||
ALLOCATE (data%State%AirPumpLine%MINORDIAM_AIR_INCH(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%MINORAREA_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE), & | |||||
data%State%AirPumpLine%LF_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%CV_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%NOTE_AIR(data%State%AirPumpLine%NO_MINORS_AIRPLINE) & | |||||
,data%State%AirPumpLine%minlosspa_air(data%State%AirPumpLine%NO_MINORS_AIRPLINE),data%State%AirPumpLine%minloss_air(data%State%AirPumpLine%NO_MINORS_AIRPLINE)) | |||||
DO I=1,data%State%AirPumpLine%NO_MINORS_AIRPLINE | |||||
data%State%AirPumpLine%MINORDIAM_AIR_INCH(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,1) | |||||
data%State%AirPumpLine%LF_AIR(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,2) | |||||
data%State%AirPumpLine%CV_AIR(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,3) | |||||
data%State%AirPumpLine%NOTE_AIR(I)=data%State%AirPumpLine%MINORS_AIRPUMP(I,4) | |||||
data%State%AirPumpLine%MINORAREA_AIR(I)=PI*(data%State%AirPumpLine%MINORDIAM_AIR_INCH(I)*0.0254)**2/4. !D(in), AREA(m) | |||||
ENDDO | |||||
END | |||||
! SUBROUTINE PIPE_RAMS_CHOKE(CHNUMBER) | |||||
! USE CHOKEVARIABLES | |||||
! use ConfigurationVariables !@ | |||||
! Use CSimulationVariables | |||||
! implicit none | |||||
! INTEGER CHNUMBER | |||||
! Integer I | |||||
! loop3: do while (ABS(data%Equipments%ChokeControlPanel%ChokeControlLever)==1.0 .AND. data%Equipments%ChokeControlPanel%ChokePanelRigAirSwitch == 1 .AND. data%State%CHOOKE(CHNUMBER)%FailMalf==0 .AND. data%State%AirDrivenPump%ChokeAirFail==0) | |||||
! if (data%Equipments%ChokeControlPanel%ChokeControlLever == 1.0) then | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .true. | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .false. | |||||
! endif | |||||
! if (data%Equipments%ChokeControlPanel%ChokeControlLever == -1.0) then | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsOpening = .true. | |||||
! data%State%CHOOKE(CHNUMBER)%ChokeIsClosing = .false. | |||||
! endif | |||||
! data%State%AirPumpLine%TIME=data%State%AirPumpLine%TIME+data%State%AirPumpLine%DeltaT_Choke !overal time (s) | |||||
! call airpump_code_CHOKE(CHNUMBER) | |||||
! call sleepqq(100) | |||||
! if (IsStopped == .true.) return | |||||
! end do loop3 !while finished_Choke==0 | |||||
! end | |||||
SUBROUTINE airpump_code_CHOKE(CHNUMBER) | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables !@ | |||||
use CChokeManifold | |||||
use SimulationVariables | |||||
use CSounds | |||||
USE CChokeProblemsVariables | |||||
implicit none | |||||
Integer I | |||||
INTEGER CHNUMBER | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirPumpLine%QITER+.1 !(gpm) maximum flow for the start | |||||
data%State%AirPumpLine%diffp_air=-10 | |||||
data%State%AirPumpLine%losses_air=10 | |||||
!=================================================================== | |||||
! AIR OPERATED PUMP | |||||
! MODEL 10-6000W030 RATIO 55:1 | |||||
!=================for air consumption at 100 psig=================== | |||||
do while (data%State%AirPumpLine%diffp_air<0) | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP-.1 | |||||
! Qup=data%State%AirDrivenPump%QAIR_PUMP; | |||||
!cc1 = 1354; cc2 = -2066; cc3 = -2109; cc4 = -513.6; cc5 = 5935 FOR OUTPUT IN GPM | |||||
data%State%AirPumpLine%P_AIRP=data%State%AirDrivenPump%cc1*(data%State%AirDrivenPump%QAIR_PUMP**4) + data%State%AirDrivenPump%cc2*(data%State%AirDrivenPump%QAIR_PUMP**3) + data%State%AirDrivenPump%cc3*(data%State%AirDrivenPump%QAIR_PUMP**2) + data%State%AirDrivenPump%cc4*data%State%AirDrivenPump%QAIR_PUMP + data%State%AirDrivenPump%cc5 !(psig) | |||||
! kinetic_air=sg*wdens*(QAIR_PUMP*6.30902e-5/((1/4.)*pi*(2*0.254e-1)**2))**2/(2*6895) !(psi) | |||||
data%State%AirPumpLine%diffp_air= data%State%AirPumpLine%P_AIRP - data%State%AirPumpLine%Pdownstrem | |||||
end do !returns Qup | |||||
do while (abs((data%State%AirPumpLine%diffp_air-data%State%AirPumpLine%losses_air)/data%State%AirPumpLine%diffp_air)>data%State%AirPumpLine%TOL_AIR) !finding correct QAIR_pump for 1 timecounter_ram | |||||
if (data%State%AirPumpLine%diffp_air-data%State%AirPumpLine%losses_air>0) then | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP+.005 | |||||
else | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP-.005 | |||||
endif | |||||
!=================================================================== | |||||
! AIR OPERATED PUMP | |||||
! MODEL 10-6000W030 RATIO 55:1 | |||||
!=================for air consumption at 100 psig=================== | |||||
data%State%AirPumpLine%P_AIRP=data%State%AirDrivenPump%cc1*(data%State%AirDrivenPump%QAIR_PUMP**4) + data%State%AirDrivenPump%cc2*(data%State%AirDrivenPump%QAIR_PUMP**3) + data%State%AirDrivenPump%cc3*(data%State%AirDrivenPump%QAIR_PUMP**2) + data%State%AirDrivenPump%cc4*data%State%AirDrivenPump%QAIR_PUMP + data%State%AirDrivenPump%cc5 !(psig) | |||||
!kinetic_air=sg*wdens*(QAIR_PUMP*6.30902e-005/((1/4.)*pi*(2*0.254e-1)**2))**2/(2*6895) !(psi) | |||||
data%State%AirPumpLine%diffp_air= data%State%AirPumpLine%P_AIRP - data%State%AirPumpLine%Pdownstrem | |||||
!===========================LOSSES==================================== | |||||
do i=1,data%State%AirPumpLine%NO_PIPINGS_AIRPLINE | |||||
data%State%AirPumpLine%Re_air(i)=data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005*data%State%AirPumpLine%DIAM_AIR_INCH(I)*0.0254/(data%State%AirPumpLine%AREA_AIR(i)*nu) | |||||
enddo | |||||
do i=1,data%State%AirPumpLine%NO_PIPINGS_AIRPLINE | |||||
if (data%State%AirPumpLine%Re_air(i)<Re_cr) then | |||||
data%State%AirPumpLine%fric_air(i)=64/data%State%AirPumpLine%Re_air(i) | |||||
else | |||||
data%State%AirPumpLine%fric_air(i)=1/(-1.8*log10((data%State%AirPumpLine%REL_ROUGHAIR(i)/3.7)**1.11+6.9/data%State%AirPumpLine%Re_air(i)))**2 | |||||
endif | |||||
data%State%AirPumpLine%fricloss_air(i)=((data%State%AirPumpLine%fric_air(i)*(wdens*sg*data%State%AirPumpLine%LENGT_AIR(i)*(data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005/data%State%AirPumpLine%AREA_AIR(i))**2))/(2*data%State%AirPumpLine%DIAM_AIR_INCH(I)*0.0254))/6895 | |||||
enddo | |||||
data%State%AirPumpLine%pipe_loss1air=sum(data%State%AirPumpLine%fricloss_air) !loss before regulator(psi) | |||||
do i=1,data%State%AirPumpLine%NO_MINORS_AIRPLINE | |||||
if (data%State%AirPumpLine%LF_AIR(i)/=0) then | |||||
data%State%AirPumpLine%minlosspa_air(i)=data%State%AirPumpLine%LF_AIR(i)*wdens*sg*(data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005/data%State%AirPumpLine%MINORAREA_AIR(i))**2/2 !(Pa) | |||||
data%State%AirPumpLine%minloss_air(i)=data%State%AirPumpLine%minlosspa_air(i)/6895 !(psi) | |||||
elseif (data%State%AirPumpLine%CV_AIR(i)/=0) then | |||||
data%State%AirPumpLine%minlosspa_air(i)=1000*sg*((11.7*data%State%AirDrivenPump%QAIR_PUMP*6.30902e-005*3600)/(data%State%AirPumpLine%CV_AIR(i)))**2 !(pa) | |||||
data%State%AirPumpLine%minloss_air(i)=data%State%AirPumpLine%minlosspa_air(i)/6895 !(psi) | |||||
else | |||||
data%State%AirPumpLine%minlosspa_air(i)=data%State%AirPumpLine%NOTE_AIR(i)*1e5 !(pa) | |||||
data%State%AirPumpLine%minloss_air(i)=data%State%AirPumpLine%minlosspa_air(i)/6895 !(psi) | |||||
endif | |||||
enddo | |||||
data%State%AirPumpLine%minor_loss1air=sum(data%State%AirPumpLine%minloss_air) !loss before regulator(psi) | |||||
data%State%AirPumpLine%static_loss1air=0 | |||||
data%State%AirPumpLine%losses_air=data%State%AirPumpLine%pipe_loss1air+data%State%AirPumpLine%minor_loss1air+data%State%AirPumpLine%static_loss1air !(psi) | |||||
!========================================================================= | |||||
end do !returns correct QAIR_PUMP for 1 counter | |||||
data%State%AirPumpLine%QITER=data%State%AirDrivenPump%QAIR_PUMP | |||||
data%State%AirDrivenPump%QAIR_PUMP=data%State%AirDrivenPump%QAIR_PUMP*(data%Equipments%ChokeControlPanel%ChokeRateControlKnob/10.) ! final Q (gpm) | |||||
data%State%Choke%Cumulative_AirVolume_Choke= data%State%Choke%Cumulative_AirVolume_Choke + ((data%State%AirDrivenPump%QAIR_PUMP * data%State%AirPumpLine%DeltaT_Choke / 60.0 ) / (1.5*0.004329004) ) ! =strokes | |||||
if ( data%State%Choke%Cumulative_AirVolume_Choke > 1.0 ) then | |||||
data%State%Choke%SoundChokePump= 60 | |||||
data%State%Choke%Cumulative_AirVolume_Choke= data%State%Choke%Cumulative_AirVolume_Choke - 1.0 | |||||
else | |||||
data%State%Choke%SoundChokePump= 0.0 | |||||
endif | |||||
data%State%AirPumpLine%DELTAV_AIR=data%State%AirDrivenPump%QAIR_PUMP*data%State%AirPumpLine%DeltaT_Choke/60 !(galon) delta_t=1sec , Q(gpm) | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsClosing) data%State%CHOOKE(CHNUMBER)%PassedCourse=data%State%CHOOKE(CHNUMBER)%PassedCourse + (data%State%AirPumpLine%DELTAV_AIR*3785.412/data%State%AirPumpLine%Acylinder)!*(ChokeRateControlKnob/10.) ! 3785.412 : GALON TO CM^3 | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsOpening) data%State%CHOOKE(CHNUMBER)%PassedCourse=data%State%CHOOKE(CHNUMBER)%PassedCourse - (data%State%AirPumpLine%DELTAV_AIR*3785.412/data%State%AirPumpLine%Acylinder)!*(ChokeRateControlKnob/10.) | |||||
!DeltaT_Choke= 1sec or 2sec | |||||
!((((((((IN OUTER LOOP)))))) | |||||
!===============AIR PUMP OUTPUTS========================= | |||||
data%State%AirPumpLine%alpha_timeair=data%State%AirPumpLine%TIME ! overal time (s) | |||||
data%State%AirPumpLine%alpha_Pdownstrem=data%State%AirPumpLine%Pdownstrem | |||||
data%State%AirPumpLine%alpha_pairp=data%State%AirPumpLine%P_AIRP | |||||
data%State%AirPumpLine%alpha_Qair=data%State%AirDrivenPump%QAIR_PUMP | |||||
!write(*,*) 'diffp_air=',diffp_air | |||||
!pause | |||||
data%State%AirPumpLine%alpha_diffpair=data%State%AirPumpLine%diffp_air | |||||
data%State%AirPumpLine%alpha_lossesair=data%State%AirPumpLine%losses_air | |||||
!======================================================== | |||||
!OPEN(150,FILE='CHOKE_AIRPUMP_OUTPUTS.DAT') | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsClosing .AND. data%State%CHOOKE(CHNUMBER)%PassedCourse>data%State%AirPumpLine%CourseBase) then | |||||
data%State%CHOOKE(CHNUMBER)%PassedCourse=data%State%AirPumpLine%CourseBase | |||||
data%State%Choke%SoundChokePump= 0.0 | |||||
endif | |||||
if (data%State%CHOOKE(CHNUMBER)%ChokeIsOpening .AND. data%State%CHOOKE(CHNUMBER)%PassedCourse<0.) then | |||||
data%State%CHOOKE(CHNUMBER)%PassedCourse=0. | |||||
data%State%Choke%SoundChokePump= 0.0 | |||||
endif | |||||
call SetSoundChokePump(data%State%Choke%SoundChokePump) | |||||
data%State%CHOOKE(CHNUMBER)%PercentClose= data%State%CHOOKE(CHNUMBER)%PassedCourse/data%State%AirPumpLine%CourseBase | |||||
IF (data%Equipments%ChokeControlPanel%Choke1LED==1) THEN | |||||
data%Equipments%ChokeControlPanel%ChokePosition= (1 - data%State%Choke%GaugeChokePositionMailf) * data%State%CHOOKE(1)%PercentClose*10 | |||||
ELSE ! Choke2LED==1 | |||||
data%Equipments%ChokeControlPanel%ChokePosition= (1 - data%State%Choke%GaugeChokePositionMailf) * data%State%CHOOKE(2)%PercentClose*10 | |||||
ENDIF | |||||
!CALL SetHydraulicChock1(nint(MIN(data%State%CHOOKE(1)%PercentClose / 0.91 , 1.0)*100)) | |||||
! CALL SetHydraulicChock2(nint(MIN(data%State%CHOOKE(2)%PercentClose / 0.91 , 1.0)*100)) | |||||
! .91 >> 9 percent clearance | |||||
! =================== calculating Area | |||||
! AreaChoke=0.5 | |||||
! .91 >> 9 percent clearance | |||||
data%State%CHOOKE(1)%AreaChoke=0.01334635-(0.01334635* MIN(data%State%CHOOKE(1)%PercentClose / 0.91 , 1.0)) !ft^2 0.01334635 is ChokeAreaFullyOpen (ft^2) | |||||
data%State%CHOOKE(2)%AreaChoke=0.01334635-(0.01334635* MIN(data%State%CHOOKE(2)%PercentClose/ 0.91 , 1.0)) !ft^2 | |||||
data%State%Choke%HydraulicChoke1WashoutCoef= data%State%Choke%HydraulicChoke1WashoutCoef * data%State%CHOOKE(1)%WashoutMalf | |||||
data%State%Choke%HydraulicChoke1WashoutCoef= MIN( 0.5 , data%State%Choke%HydraulicChoke1WashoutCoef+ data%State%CHOOKE(1)%WashoutMalf*(0.5/(60.0/data%State%AirPumpLine%DeltaT_Choke)) ) ! 0.5=maximum washout coef , 60.0 sec= 1min duration time | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= data%State%Choke%HydraulicChoke2WashoutCoef * data%State%CHOOKE(2)%WashoutMalf | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= MIN( 0.5 , data%State%Choke%HydraulicChoke2WashoutCoef+ data%State%CHOOKE(2)%WashoutMalf*(0.5/(60.0/data%State%AirPumpLine%DeltaT_Choke)) ) ! 0.5=maximum washout coef , 60.0 sec= 1min duration time | |||||
!write(*,*) 'HydraulicChoke1WashoutCoef=' , HydraulicChoke1WashoutCoef | |||||
IF (data%State%CHOOKE(1)%PlugMalf == 1) THEN | |||||
data%State%Choke%Present_HydraulicChoke1Plug= data%State%Choke%Present_HydraulicChoke1Plug * data%State%CHOOKE(1)%PlugMalf | |||||
! integer: HydraulicChoke1PluggedPercent,HydraulicChoke1PluggedPercent_Old,PlugTimeCounter,ChokePlugTimeDelay | |||||
! real: Present_HydraulicChoke1Plug,DeltaPlug1Percent | |||||
!write(*,*) 'HydraulicChoke1PluggedPercent=' , HydraulicChoke1PluggedPercent | |||||
if ( (data%problems%ChokeProblems%HydraulicChoke1PluggedPercent - data%State%Choke%HydraulicChoke1PluggedPercent_Old) /= 0) then | |||||
data%State%Choke%DeltaPlug1Percent = (REAL(data%problems%ChokeProblems%HydraulicChoke1PluggedPercent)/100.) - data%State%Choke%Present_HydraulicChoke1Plug | |||||
data%State%Choke%Plug1TimeCounter = 0 | |||||
!write(*,*) 'DeltaPlug1Percent, Present_HydraulicChoke1Plug = ' ,DeltaPlug1Percent , Present_HydraulicChoke1Plug | |||||
endif | |||||
data%State%Choke%Plug1TimeCounter= data%State%Choke%Plug1TimeCounter + 1 | |||||
data%State%Choke%HydraulicChoke1PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke1PluggedPercent | |||||
if (data%State%Choke%Plug1TimeCounter <= data%State%Choke%ChokePlugTimeDelay) then !ChokePlugTimeDelay=600 | |||||
data%State%Choke%Present_HydraulicChoke1Plug = data%State%Choke%Present_HydraulicChoke1Plug + data%State%CHOOKE(1)%PlugMalf* ((data%State%Choke%DeltaPlug1Percent / real(data%State%Choke%ChokePlugTimeDelay))) ! real(ChokePlugTimeDelay)= 600.0 | |||||
endif | |||||
!write(*,*) 'Present_HydraulicChoke1Plug=' , Present_HydraulicChoke1Plug | |||||
ENDIF | |||||
IF (data%State%CHOOKE(2)%PlugMalf == 1) THEN | |||||
data%State%Choke%Present_HydraulicChoke2Plug= data%State%Choke%Present_HydraulicChoke2Plug * data%State%CHOOKE(2)%PlugMalf | |||||
! integer: HydraulicChoke2PluggedPercent,HydraulicChoke2PluggedPercent_Old,PlugTimeCounter,ChokePlugTimeDelay | |||||
! real: Present_HydraulicChoke2Plug,DeltaPlug2Percent | |||||
if ( (data%problems%ChokeProblems%HydraulicChoke2PluggedPercent - data%State%Choke%HydraulicChoke2PluggedPercent_Old) /= 0 ) then | |||||
data%State%Choke%DeltaPlug2Percent = (REAL(data%problems%ChokeProblems%HydraulicChoke2PluggedPercent)/100.) - data%State%Choke%Present_HydraulicChoke2Plug | |||||
data%State%Choke%Plug2TimeCounter = 0 | |||||
endif | |||||
data%State%Choke%Plug2TimeCounter= data%State%Choke%Plug2TimeCounter + 1 | |||||
data%State%Choke%HydraulicChoke2PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke2PluggedPercent | |||||
if (data%State%Choke%Plug2TimeCounter <= data%State%Choke%ChokePlugTimeDelay) then !ChokePlugTimeDelay=600 | |||||
data%State%Choke%Present_HydraulicChoke2Plug = data%State%Choke%Present_HydraulicChoke2Plug + data%State%CHOOKE(2)%PlugMalf *((data%State%Choke%DeltaPlug2Percent / real(data%State%Choke%ChokePlugTimeDelay))) ! real(ChokePlugTimeDelay)= 600.0 | |||||
endif | |||||
ENDIF | |||||
! fully open area is 123/64 in^2 = 0.01334635 ft^2 | |||||
data%State%CHOOKE(1)%AreaChoke=data%State%CHOOKE(1)%AreaChoke+(data%State%CHOOKE(1)%WashoutMalf*data%State%Choke%HydraulicChoke1WashoutCoef*data%State%Choke%ChokeAreaFullyOpen/144.0) ! Initialised in Choke Startup | |||||
!write(*,*) 'data%State%CHOOKE(1)%WashoutMalf , data%State%CHOOKE(1)%AreaChoke=' ,data%State%CHOOKE(1)%WashoutMalf , data%State%CHOOKE(1)%AreaChoke | |||||
data%State%CHOOKE(1)%AreaChoke=data%State%CHOOKE(1)%AreaChoke-(data%State%CHOOKE(1)%PlugMalf* data%State%Choke%Present_HydraulicChoke1Plug *data%State%CHOOKE(1)%AreaChoke) ! Initialised in Choke Startup | |||||
data%State%CHOOKE(2)%AreaChoke=data%State%CHOOKE(2)%AreaChoke+(data%State%CHOOKE(2)%WashoutMalf*data%State%Choke%HydraulicChoke2WashoutCoef*data%State%Choke%ChokeAreaFullyOpen/144.0) ! Initialised in Choke Startup | |||||
data%State%CHOOKE(2)%AreaChoke=data%State%CHOOKE(2)%AreaChoke-(data%State%CHOOKE(2)%PlugMalf* data%State%Choke%Present_HydraulicChoke2Plug *data%State%CHOOKE(2)%AreaChoke) ! Initialised in Choke Startup | |||||
!write(*,*) 'data%State%CHOOKE(2)%WashoutMalf , data%State%CHOOKE(2)%AreaChoke=' ,data%State%CHOOKE(2)%WashoutMalf , data%State%CHOOKE(2)%AreaChoke | |||||
data%State%CHOOKE(1)%AreaChokeFinal= data%State%CHOOKE(1)%AreaChoke | |||||
data%State%CHOOKE(2)%AreaChokeFinal= data%State%CHOOKE(2)%AreaChoke | |||||
! 144: ft^2 to in^2 | |||||
CALL SetHydraulicChock1(100 - nint((data%State%CHOOKE(1)%AreaChokeFinal/(data%State%Choke%ChokeAreaFullyOpen/144.))*100)) ! for manifold valve | |||||
CALL SetHydraulicChock2(100 - nint((data%State%CHOOKE(2)%AreaChokeFinal/(data%State%Choke%ChokeAreaFullyOpen/144.))*100)) ! for manifold valve | |||||
!write(*,*) 'data%State%CHOOKE(1)%PercentClose=' , data%State%CHOOKE(1)%PercentClose ! close percent 0 to 100 | |||||
!write(*,*) 'ChokePosition=' , ChokePosition ! close position 0 to 10 for display | |||||
!write(*,*) 'data%State%CHOOKE(1)%AreaChokeFinal=' , data%State%CHOOKE(1)%AreaChokeFinal ! Open Area (in^2) with clearance | |||||
!write(*,*) '(ChokeAreaFullyOpen/144.)=' , (ChokeAreaFullyOpen/144.) | |||||
!write(*,*) 'valve value=' , 100 - nint((data%State%CHOOKE(1)%AreaChokeFinal/(ChokeAreaFullyOpen/144.))*100) ! percent close 0 to 100 with clearance | |||||
!write(*,*) 'Valve(33)%Status=' , Valve(33)%Status ! T : open , F: close | |||||
! =================== calculating Area | |||||
!write(*,*) 'data%State%CHOOKE(1)%AreaChoke= ' , data%State%CHOOKE(1)%AreaChoke | |||||
!WRITE(150,50) alpha_timeair,alpha_Qair,alpha_pairp, & | |||||
!alpha_Pdownstrem,alpha_diffpair,alpha_lossesair,data%State%CHOOKE(CHNUMBER)%PassedCourse | |||||
!50 FORMAT(7(f15.5)) | |||||
!======================================================================================== | |||||
!======================================================================================== | |||||
! write(*,*) PassedCourse | |||||
end | |||||
end module ChokeControlMain | end module ChokeControlMain |
@@ -1,127 +0,0 @@ | |||||
SUBROUTINE Choke_StartUp() | |||||
USE CHOKEVARIABLES | |||||
use SimulationVariables !@ | |||||
USE CChokeProblemsVariables | |||||
implicit none | |||||
CALL LOSS_INPUTS_CHOKE() | |||||
!OPEN(150,FILE='CHOKE_AIRPUMP_OUTPUTS.DAT') | |||||
!data%State%CHOOKE(1)%WashoutMalf=1 | |||||
!data%State%CHOOKE(1)%PlugMalf=0 | |||||
!data%State%CHOOKE(1)%FailMalf=0 | |||||
! | |||||
!data%State%CHOOKE(2)%WashoutMalf=1 | |||||
!data%State%CHOOKE(2)%PlugMalf=0 | |||||
!data%State%CHOOKE(2)%FailMalf=0 | |||||
! | |||||
! | |||||
!ChokeAirFail=0 | |||||
! | |||||
!GaugeChokePositionMailf=0 | |||||
data%State%Choke%kRatio=1.4 | |||||
data%State%Choke%Cp=0.24 | |||||
data%State%Choke%CL=0.8 | |||||
data%State%Choke%x1=0.5 | |||||
data%State%Choke%LiquidPPG=9. | |||||
data%State%Choke%LiquidDensity=data%State%Choke%LiquidPPG*7.48 !lbm/ft**3 | |||||
data%State%Choke%VL=1.0/data%State%Choke%LiquidDensity !SpecificVolume of Liquid | |||||
data%State%Choke%Cv=data%State%Choke%Cp/data%State%Choke%kRatio | |||||
data%State%Choke%nPolytripic=1+(data%State%Choke%x1*(data%State%Choke%Cp-data%State%Choke%Cv)/(data%State%Choke%x1*data%State%Choke%Cv+(1-data%State%Choke%x1)*data%State%Choke%CL)) | |||||
data%State%Choke%VG1=1./0.748 !lbm/ft**3 Specific Volume of Air, Upstream | |||||
data%State%Choke%Cdrag=0.8 | |||||
data%State%Choke%Pwh=1400. !psi | |||||
data%State%Choke%Patm=14.7 | |||||
data%State%Choke%MixDens2=data%State%Choke%x1*data%State%Choke%VG1 !lbm/ft**3 | |||||
data%State%Choke%epsilon_abs= 1e-5 | |||||
data%State%Choke%epsilon_step= 1e-5 | |||||
!ChokeDiameter= 32/64. !in | |||||
data%State%CHOOKE%PercentClose= 0.0 | |||||
!AreaChoke=0.01334635 | |||||
! data%State%CHOOKE(1)%AreaChoke=0.01334635 | |||||
!ChokeAreaFullyOpen = 123.d0 / 64.d0 ! fully open area is 123/64 in^2 = 0.01334635 ft^2 | |||||
data%State%AirPumpLine%DeltaT_Choke=0.1 | |||||
!TotalStrokes1=0. | |||||
!TotalStrokes2=0. | |||||
data%State%Choke%HydraulicChoke1WashoutCoef= 0.0 | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= 0.0 | |||||
data%State%Choke%ChokePlugTimeDelay = int(180./data%State%AirPumpLine%DeltaT_Choke) ! =1800 = 180/0.1 : for 3 min delay | |||||
data%State%Choke%Present_HydraulicChoke1Plug = REAL(data%problems%ChokeProblems%HydraulicChoke1PluggedPercent)/100. | |||||
data%State%Choke%HydraulicChoke1PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke1PluggedPercent | |||||
data%State%Choke%Plug1TimeCounter= 0 | |||||
data%State%Choke%DeltaPlug1Percent = 0.0 | |||||
data%State%Choke%Present_HydraulicChoke2Plug = REAL(data%problems%ChokeProblems%HydraulicChoke2PluggedPercent)/100. | |||||
data%State%Choke%HydraulicChoke2PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke2PluggedPercent | |||||
data%State%Choke%Plug2TimeCounter= 0 | |||||
data%State%Choke%DeltaPlug2Percent = 0.0 | |||||
!======================AIRPUMP INPUTS(CONSTANTS)=========================== | |||||
data%State%AirPumpLine%CourseBase= 24. !cm | |||||
data%State%CHOOKE%PassedCourse= 0. | |||||
data%Equipments%ChokeControlPanel%ChokePosition=0. | |||||
data%State%AirPumpLine%Acylinder= PI*(8.**2)/4. ! (CM^2), 8=DIAMETER, 24=course , 3785.412: cm^3 to galon | |||||
data%State%CHOOKE%ChokeIsOpening = .false. | |||||
data%State%CHOOKE%ChokeIsClosing = .false. | |||||
data%State%AirPumpLine%P_AIRP=0 | |||||
data%State%AirDrivenPump%cc1 = 0.1354; data%State%AirDrivenPump%cc2 = -2.066; data%State%AirDrivenPump%cc3 = -21.09; data%State%AirDrivenPump%cc4 = -51.36; data%State%AirDrivenPump%cc5 = 5935 ! FOR OUTPUT IN GPM | |||||
! cc1 = 4.754e-07; cc2 = -0.0001676; cc3 = -0.03953; cc4 = -2.223; cc5 = 5935 FOR OUTPUT IN IN^3/MIN | |||||
data%State%AirPumpLine%Pdownstrem= 4950 !+0.01*Pchoke (psi) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | |||||
data%State%AirPumpLine%QITER=5. !(gpm) | |||||
! Q=0.0003585; true | |||||
data%State%AirPumpLine%TIME=0 | |||||
data%State%AirPumpLine%TOL_AIR=0.05 | |||||
data%State%AirPumpLine%alpha_Qair=0 | |||||
data%State%AirPumpLine%alpha_timeair=0 | |||||
data%State%AirPumpLine%alpha_Pdownstrem=data%State%AirPumpLine%Pdownstrem | |||||
data%State%AirPumpLine%alpha_diffpair=0 | |||||
data%State%AirPumpLine%alpha_lossesair=0 | |||||
end |
@@ -1,12 +1,12 @@ | |||||
# 1 "/mnt/c/Projects/VSIM/SimulationCore2/Equipments/ChokeControl/ChokeStartup.f90" | |||||
SUBROUTINE Choke_StartUp() | |||||
# 1 "/home/admin/SimulationCore2/Equipments/ChokeControl/ChokeStartup.f90" | |||||
SUBROUTINE Choke_StartUp() | |||||
USE CHOKEVARIABLES | USE CHOKEVARIABLES | ||||
use SimulationVariables !@ | |||||
use SimulationVariables | |||||
USE CChokeProblemsVariables | USE CChokeProblemsVariables | ||||
implicit none | implicit none | ||||
CALL LOSS_INPUTS_CHOKE() | |||||
CALL LOSS_INPUTS_CHOKE() | |||||
!OPEN(150,FILE='CHOKE_AIRPUMP_OUTPUTS.DAT') | !OPEN(150,FILE='CHOKE_AIRPUMP_OUTPUTS.DAT') | ||||
@@ -31,68 +31,63 @@ use SimulationVariables !@ | |||||
data%State%Choke%kRatio=1.4 | data%State%Choke%kRatio=1.4 | ||||
data%State%Choke%Cp=0.24 | |||||
data%State%Choke%CL=0.8 | |||||
data%State%Choke%Cp=0.24 | |||||
data%State%Choke%CL=0.8 | |||||
data%State%Choke%x1=0.5 | |||||
data%State%Choke%LiquidPPG=9. | |||||
data%State%Choke%LiquidDensity=data%State%Choke%LiquidPPG*7.48 !lbm/ft**3 | |||||
data%State%Choke%x1=0.5 | |||||
data%State%Choke%LiquidPPG=9. | |||||
data%State%Choke%LiquidDensity=data%State%Choke%LiquidPPG*7.48 !lbm/ft**3 | |||||
data%State%Choke%VL=1.0/data%State%Choke%LiquidDensity !SpecificVolume of Liquid | |||||
data%State%Choke%VL=1.0/data%State%Choke%LiquidDensity !SpecificVolume of Liquid | |||||
data%State%Choke%Cv=data%State%Choke%Cp/data%State%Choke%kRatio | |||||
data%State%Choke%Cv=data%State%Choke%Cp/data%State%Choke%kRatio | |||||
data%State%Choke%nPolytripic=1+(data%State%Choke%x1*(data%State%Choke%Cp-data%State%Choke%Cv)/(data%State%Choke%x1*data%State%Choke%Cv+(1-data%State%Choke%x1)*data%State%Choke%CL)) | |||||
data%State%Choke%VG1=1./0.748 !lbm/ft**3 Specific Volume of Air, Upstream | |||||
data%State%Choke%nPolytripic=1+(data%State%Choke%x1*(data%State%Choke%Cp-data%State%Choke%Cv)/(data%State%Choke%x1*data%State%Choke%Cv+(1-data%State%Choke%x1)*data%State%Choke%CL)) | |||||
data%State%Choke%VG1=1./0.748 !lbm/ft**3 Specific Volume of Air, Upstream | |||||
data%State%Choke%Cdrag=0.8 | |||||
data%State%Choke%Pwh=1400. !psi | |||||
data%State%Choke%Cdrag=0.8 | |||||
data%State%Choke%Pwh=1400. !psi | |||||
data%State%Choke%Patm=14.7 | |||||
data%State%Choke%MixDens2=data%State%Choke%x1*data%State%Choke%VG1 !lbm/ft**3 | |||||
data%State%Choke%Patm=14.7 | |||||
data%State%Choke%MixDens2=data%State%Choke%x1*data%State%Choke%VG1 !lbm/ft**3 | |||||
data%State%Choke%epsilon_abs= 1e-5 | |||||
data%State%Choke%epsilon_step= 1e-5 | |||||
data%State%Choke%epsilon_abs= 1e-5 | |||||
data%State%Choke%epsilon_step= 1e-5 | |||||
!ChokeDiameter= 32/64. !in | !ChokeDiameter= 32/64. !in | ||||
data%State%CHOOKE%PercentClose= 0.0 | |||||
data%State%CHOOKE%PercentClose= 0.0 | |||||
!AreaChoke=0.01334635 | !AreaChoke=0.01334635 | ||||
! data%State%CHOOKE(1)%AreaChoke=0.01334635 | ! data%State%CHOOKE(1)%AreaChoke=0.01334635 | ||||
!ChokeAreaFullyOpen = 123.d0 / 64.d0 ! fully open area is 123/64 in^2 = 0.01334635 ft^2 | !ChokeAreaFullyOpen = 123.d0 / 64.d0 ! fully open area is 123/64 in^2 = 0.01334635 ft^2 | ||||
data%State%AirPumpLine%DeltaT_Choke=0.1 | |||||
data%State%AirPumpLine%DeltaT_Choke=0.1 | |||||
!TotalStrokes1=0. | !TotalStrokes1=0. | ||||
!TotalStrokes2=0. | !TotalStrokes2=0. | ||||
data%State%Choke%HydraulicChoke1WashoutCoef= 0.0 | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= 0.0 | |||||
data%State%Choke%HydraulicChoke1WashoutCoef= 0.0 | |||||
data%State%Choke%HydraulicChoke2WashoutCoef= 0.0 | |||||
data%State%Choke%ChokePlugTimeDelay = int(180./data%State%AirPumpLine%DeltaT_Choke) ! =1800 = 180/0.1 : for 3 min delay | |||||
data%State%Choke%Present_HydraulicChoke1Plug = REAL(data%problems%ChokeProblems%HydraulicChoke1PluggedPercent)/100. | |||||
data%State%Choke%HydraulicChoke1PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke1PluggedPercent | |||||
data%State%Choke%Plug1TimeCounter= 0 | |||||
data%State%Choke%DeltaPlug1Percent = 0.0 | |||||
data%State%Choke%Present_HydraulicChoke2Plug = REAL(data%problems%ChokeProblems%HydraulicChoke2PluggedPercent)/100. | |||||
data%State%Choke%HydraulicChoke2PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke2PluggedPercent | |||||
data%State%Choke%Plug2TimeCounter= 0 | |||||
data%State%Choke%DeltaPlug2Percent = 0.0 | |||||
data%State%Choke%ChokePlugTimeDelay = int(180./data%State%AirPumpLine%DeltaT_Choke) ! =1800 = 180/0.1 : for 3 min delay | |||||
data%State%Choke%Present_HydraulicChoke1Plug = REAL(data%problems%ChokeProblems%HydraulicChoke1PluggedPercent)/100. | |||||
data%State%Choke%HydraulicChoke1PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke1PluggedPercent | |||||
data%State%Choke%Plug1TimeCounter= 0 | |||||
data%State%Choke%DeltaPlug1Percent = 0.0 | |||||
data%State%Choke%Present_HydraulicChoke2Plug = REAL(data%problems%ChokeProblems%HydraulicChoke2PluggedPercent)/100. | |||||
data%State%Choke%HydraulicChoke2PluggedPercent_Old= data%problems%ChokeProblems%HydraulicChoke2PluggedPercent | |||||
data%State%Choke%Plug2TimeCounter= 0 | |||||
data%State%Choke%DeltaPlug2Percent = 0.0 | |||||
!======================AIRPUMP INPUTS(CONSTANTS)=========================== | !======================AIRPUMP INPUTS(CONSTANTS)=========================== | ||||
data%State%AirPumpLine%CourseBase= 24. !cm | data%State%AirPumpLine%CourseBase= 24. !cm | ||||
@@ -112,17 +107,17 @@ data%State%Choke%DeltaPlug2Percent = 0.0 | |||||
! cc1 = 4.754e-07; cc2 = -0.0001676; cc3 = -0.03953; cc4 = -2.223; cc5 = 5935 FOR OUTPUT IN IN^3/MIN | ! cc1 = 4.754e-07; cc2 = -0.0001676; cc3 = -0.03953; cc4 = -2.223; cc5 = 5935 FOR OUTPUT IN IN^3/MIN | ||||
data%State%AirPumpLine%Pdownstrem= 4950 !+0.01*Pchoke (psi) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | |||||
data%State%AirPumpLine%QITER=5. !(gpm) | |||||
data%State%AirPumpLine%Pdownstrem= 4950 !+0.01*Pchoke (psi) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | |||||
data%State%AirPumpLine%QITER=5. !(gpm) | |||||
! Q=0.0003585; true | ! Q=0.0003585; true | ||||
data%State%AirPumpLine%TIME=0 | |||||
data%State%AirPumpLine%TOL_AIR=0.05 | |||||
data%State%AirPumpLine%TIME=0 | |||||
data%State%AirPumpLine%TOL_AIR=0.05 | |||||
data%State%AirPumpLine%alpha_Qair=0 | |||||
data%State%AirPumpLine%alpha_timeair=0 | |||||
data%State%AirPumpLine%alpha_Pdownstrem=data%State%AirPumpLine%Pdownstrem | |||||
data%State%AirPumpLine%alpha_diffpair=0 | |||||
data%State%AirPumpLine%alpha_lossesair=0 | |||||
data%State%AirPumpLine%alpha_Qair=0 | |||||
data%State%AirPumpLine%alpha_timeair=0 | |||||
data%State%AirPumpLine%alpha_Pdownstrem=data%State%AirPumpLine%Pdownstrem | |||||
data%State%AirPumpLine%alpha_diffpair=0 | |||||
data%State%AirPumpLine%alpha_lossesair=0 | |||||
end | |||||
end |
@@ -10,21 +10,44 @@ subroutine Drawworks_Direction | |||||
IMPLICIT NONE | IMPLICIT NONE | ||||
if (data%State%Drawworks%Switch==1) then !Up | |||||
! ! if (data%State%Drawworks%Switch==1) then !Up | |||||
! if (data%State%Drawworks%Throttle >= 0.d0) then !Up | |||||
! data%State%Drawworks%motion = +1 | |||||
! data%State%Drawworks%w_old_drum = data%State%Drawworks%w_drum !(pi*(data%State%Drawworks%N_old/data%State%Drawworks%Conv_Ratio)/30.d0) ? | |||||
! data%State%Drawworks%w_drum = (pi*(data%State%Drawworks%Speed/data%State%Drawworks%Conv_Ratio)/30.d0) ![rad/s] | |||||
! data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height+(((data%State%Drawworks%Diameter/2.0)*(data%State%Drawworks%time_step*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum)))/data%State%Drawworks%NumberOfLine) ![m] | |||||
! ! else if (data%State%Drawworks%Switch==-1) then !Down | |||||
! else if (data%State%Drawworks%Throttle < 0.d0) then !Down | |||||
! data%State%Drawworks%motion = -1 | |||||
! data%State%Drawworks%w_old_drum = data%State%Drawworks%w_drum !(pi*(data%State%Drawworks%N_old/data%State%Drawworks%Conv_Ratio)/30.d0) ? | |||||
! data%State%Drawworks%w_drum = (pi*(data%State%Drawworks%Speed/data%State%Drawworks%Conv_Ratio)/30.d0) ![rad/s] | |||||
! data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height-(((data%State%Drawworks%Diameter/2.0)*(data%State%Drawworks%time_step*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum)))/data%State%Drawworks%NumberOfLine) ![m] | |||||
! !else if (data%State%Drawworks%Switch==0) then !Off | |||||
! ! data%State%Drawworks%motion = 0 | |||||
! ! data%State%Drawworks%w_old_drum = 0.d0 | |||||
! ! data%State%Drawworks%w_drum = 0.d0 | |||||
! ! data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height | |||||
! end if | |||||
if ((data%State%Drawworks%Throttle>0.d0) .or. (data%State%Drawworks%Throttle==0.d0 .and. data%State%Drawworks%Speed/=0.d0 .and. data%State%Drawworks%motion==+1)) then !Up | |||||
data%State%Drawworks%motion = +1 | data%State%Drawworks%motion = +1 | ||||
data%State%Drawworks%w_old_drum = data%State%Drawworks%w_drum !(pi*(data%State%Drawworks%N_old/data%State%Drawworks%Conv_Ratio)/30.d0) ? | data%State%Drawworks%w_old_drum = data%State%Drawworks%w_drum !(pi*(data%State%Drawworks%N_old/data%State%Drawworks%Conv_Ratio)/30.d0) ? | ||||
data%State%Drawworks%w_drum = (pi*(data%State%Drawworks%Speed/data%State%Drawworks%Conv_Ratio)/30.d0) ![rad/s] | data%State%Drawworks%w_drum = (pi*(data%State%Drawworks%Speed/data%State%Drawworks%Conv_Ratio)/30.d0) ![rad/s] | ||||
data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height+(((data%State%Drawworks%Diameter/2.0)*(data%State%Drawworks%time_step*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum)))/data%State%Drawworks%NumberOfLine) ![m] | |||||
else if (data%State%Drawworks%Switch==-1) then !Down | |||||
!data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height+(((data%State%Drawworks%Diameter/2.0)*(data%State%Drawworks%time_step*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum)))/data%State%Drawworks%NumberOfLine) ![m] | |||||
data%State%Drawworks%HookLinearVelocity = (((data%State%Drawworks%Diameter/2.0)*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum))/data%State%Drawworks%NumberOfLine) ![m/s] | |||||
else if ((data%State%Drawworks%Throttle<0.d0) .or. (data%State%Drawworks%Throttle==0.d0 .and. data%State%Drawworks%Speed/=0.d0 .and. data%State%Drawworks%motion==-1)) then !Down | |||||
data%State%Drawworks%motion = -1 | data%State%Drawworks%motion = -1 | ||||
data%State%Drawworks%w_old_drum = data%State%Drawworks%w_drum !(pi*(data%State%Drawworks%N_old/data%State%Drawworks%Conv_Ratio)/30.d0) ? | data%State%Drawworks%w_old_drum = data%State%Drawworks%w_drum !(pi*(data%State%Drawworks%N_old/data%State%Drawworks%Conv_Ratio)/30.d0) ? | ||||
data%State%Drawworks%w_drum = (pi*(data%State%Drawworks%Speed/data%State%Drawworks%Conv_Ratio)/30.d0) ![rad/s] | data%State%Drawworks%w_drum = (pi*(data%State%Drawworks%Speed/data%State%Drawworks%Conv_Ratio)/30.d0) ![rad/s] | ||||
data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height-(((data%State%Drawworks%Diameter/2.0)*(data%State%Drawworks%time_step*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum)))/data%State%Drawworks%NumberOfLine) ![m] | |||||
!else if (data%State%Drawworks%Switch==0) then !Off | |||||
! data%State%Drawworks%motion = 0 | |||||
! data%State%Drawworks%w_old_drum = 0.d0 | |||||
! data%State%Drawworks%w_drum = 0.d0 | |||||
! data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height | |||||
!data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height-(((data%State%Drawworks%Diameter/2.0)*(data%State%Drawworks%time_step*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum)))/data%State%Drawworks%NumberOfLine) ![m] | |||||
data%State%Drawworks%HookLinearVelocity = -(((data%State%Drawworks%Diameter/2.0)*0.5d0*(data%State%Drawworks%w_drum+data%State%Drawworks%w_old_drum))/data%State%Drawworks%NumberOfLine) ![m/s] | |||||
else !fixed | |||||
data%State%Drawworks%motion = 0 | |||||
data%State%Drawworks%w_old_drum = 0.d0 | |||||
data%State%Drawworks%w_drum = 0.d0 | |||||
data%State%Drawworks%Hook_Height = data%State%Drawworks%Hook_Height | |||||
!data%State%Drawworks%HookLinearVelocity = 0.d0 ![m/s] | |||||
end if | end if | ||||
@@ -40,8 +63,6 @@ subroutine Drawworks_Direction | |||||
!if (data%State%Drawworks%Conv_Ratio==1.d0) then | !if (data%State%Drawworks%Conv_Ratio==1.d0) then | ||||
! | ! | ||||
! | ! | ||||
@@ -34,8 +34,4 @@ subroutine Drawworks_Outputs | |||||
!!data%State%Drawworks%HookHeight_graph_output | !!data%State%Drawworks%HookHeight_graph_output | ||||
!data%Equipments%DrillingConsole%ParkingBrakeLed = 0 ! in Drawworks_Inputs | !data%Equipments%DrillingConsole%ParkingBrakeLed = 0 ! in Drawworks_Inputs | ||||
end subroutine Drawworks_Outputs | end subroutine Drawworks_Outputs |
@@ -29,13 +29,10 @@ subroutine Drawworks_Outputs | |||||
Call Activate_FloorCollision() | Call Activate_FloorCollision() | ||||
end if | end if | ||||
Call Set_HookHeight( real(data%State%Drawworks%Hook_Height_final) ) ![ft] | |||||
!Call Set_HookHeight( real(data%State%Drawworks%Hook_Height_final) ) ![ft] | |||||
data%State%Drawworks%TDHookHeight = data%State%Drawworks%Hook_Height_final ![ft] | data%State%Drawworks%TDHookHeight = data%State%Drawworks%Hook_Height_final ![ft] | ||||
! = data%State%Drawworks%HookLinearVelocity_final ![ft/s] | |||||
!!data%State%Drawworks%HookHeight_graph_output | !!data%State%Drawworks%HookHeight_graph_output | ||||
!data%Equipments%DrillingConsole%ParkingBrakeLed = 0 ! in Drawworks_Inputs | !data%Equipments%DrillingConsole%ParkingBrakeLed = 0 ! in Drawworks_Inputs | ||||
end subroutine Drawworks_Outputs | end subroutine Drawworks_Outputs |
@@ -23,7 +23,7 @@ subroutine Drawworks_Solver | |||||
!>>>>>>>>>>>>>>>>>>>> Speed <<<<<<<<<<<<<<<<<<<<<<<< | !>>>>>>>>>>>>>>>>>>>> Speed <<<<<<<<<<<<<<<<<<<<<<<< | ||||
data%State%Drawworks%N_Throtle = data%State%Drawworks%Throttle ![rpm] | |||||
data%State%Drawworks%N_Throtle = abs(data%State%Drawworks%Throttle) ![rpm] | |||||
!data%State%Drawworks%N_Accelarator = (data%State%Drawworks%Acceleretor/100.d0)*965.d0 ![rpm] | !data%State%Drawworks%N_Accelarator = (data%State%Drawworks%Acceleretor/100.d0)*965.d0 ![rpm] | ||||
!IF (data%State%Drawworks%N_Throtle>data%State%Drawworks%N_Accelarator) THEN | !IF (data%State%Drawworks%N_Throtle>data%State%Drawworks%N_Accelarator) THEN | ||||
@@ -78,24 +78,25 @@ subroutine Drawworks_Solver | |||||
!==================================================== | |||||
! Crown Collision (Max_Hook_Height) | |||||
!==================================================== | |||||
if ( ((3.280839895d0*data%State%Drawworks%Hook_Height)>=data%State%Drawworks%max_Hook_Height) .and. (any(data%State%Drawworks%DrillModeCond==(/3,4,7,10,11,12,14/))) ) then | |||||
if ( CrownCollision_Status==0 .and. data%State%Drawworks%motion==1 ) then | |||||
CrownCollision_Status = 1 | |||||
data%State%Drawworks%CrownCollision = .true. | |||||
data%State%Drawworks%SoundCrownCollision = .true. | |||||
else | |||||
data%State%Drawworks%SoundCrownCollision = .false. | |||||
end if | |||||
if ( data%State%Drawworks%motion==-1 .and. data%State%Drawworks%CrownCollision==.false. ) then | |||||
data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
else | |||||
Call DWFixModeMotion | |||||
end if | |||||
return | |||||
end if | |||||
! !==================================================== | |||||
! ! Crown Collision (Max_Hook_Height) | |||||
! !==================================================== | |||||
! ?if ( ((3.280839895d0*data%State%Drawworks%Hook_Height)>=data%State%Drawworks%max_Hook_Height) .and. (any(data%State%Drawworks%DrillModeCond==(/3,4,7,10,11,12,14/))) ) then | |||||
! if ( CrownCollision_Status==0 .and. data%State%Drawworks%motion==1 ) then | |||||
! CrownCollision_Status = 1 | |||||
! data%State%Drawworks%CrownCollision = .true. | |||||
! data%State%Drawworks%SoundCrownCollision = .true. | |||||
! else | |||||
! data%State%Drawworks%SoundCrownCollision = .false. | |||||
! end if | |||||
! if ( data%State%Drawworks%motion==-1 .and. data%State%Drawworks%CrownCollision==.false. ) then | |||||
! !data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
! data%State%Drawworks%HookLinearVelocity_final = 3.280839895d0*data%State%Drawworks%HookLinearVelocity ![ft/s] | |||||
! else | |||||
! Call DWFixModeMotion | |||||
! end if | |||||
! return | |||||
! end if | |||||
@@ -103,24 +104,25 @@ subroutine Drawworks_Solver | |||||
!==================================================== | |||||
! Floor Collision (Min_Hook_Height) | |||||
!==================================================== | |||||
if ( ((3.280839895*data%State%Drawworks%Hook_Height)<=data%State%Drawworks%min_Hook_Height) .and. (any(data%State%Drawworks%DrillModeCond==(/3,4,7,10,11,12,14/))) ) then | |||||
if ( FloorCollision_Status==0 .and. data%State%Drawworks%motion==-1 ) then | |||||
FloorCollision_Status = 1 | |||||
data%State%Drawworks%FloorCollision = .true. | |||||
data%State%Drawworks%SoundFloorCollision = .true. | |||||
else | |||||
data%State%Drawworks%SoundFloorCollision = .false. | |||||
end if | |||||
if ( data%State%Drawworks%motion==1 .and. data%State%Drawworks%FloorCollision==.false. ) then | |||||
data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
else | |||||
Call DWFixModeMotion | |||||
end if | |||||
return | |||||
end if | |||||
! !==================================================== | |||||
! ! Floor Collision (Min_Hook_Height) | |||||
! !==================================================== | |||||
! ?if ( ((3.280839895*data%State%Drawworks%Hook_Height)<=data%State%Drawworks%min_Hook_Height) .and. (any(data%State%Drawworks%DrillModeCond==(/3,4,7,10,11,12,14/))) ) then | |||||
! if ( FloorCollision_Status==0 .and. data%State%Drawworks%motion==-1 ) then | |||||
! FloorCollision_Status = 1 | |||||
! data%State%Drawworks%FloorCollision = .true. | |||||
! data%State%Drawworks%SoundFloorCollision = .true. | |||||
! else | |||||
! data%State%Drawworks%SoundFloorCollision = .false. | |||||
! end if | |||||
! if ( data%State%Drawworks%motion==1 .and. data%State%Drawworks%FloorCollision==.false. ) then | |||||
! !data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
! data%State%Drawworks%HookLinearVelocity_final = 3.280839895d0*data%State%Drawworks%HookLinearVelocity ![ft/s] | |||||
! else | |||||
! Call DWFixModeMotion | |||||
! end if | |||||
! return | |||||
! end if | |||||
@@ -129,17 +131,18 @@ subroutine Drawworks_Solver | |||||
!==================================================== | |||||
! Crown Warning | |||||
!==================================================== | |||||
if ( ((3.280839895*data%State%Drawworks%Hook_Height)>=data%State%Drawworks%max_Hook_Height) .and. (any(data%State%Drawworks%DrillModeCond==(/1,2,5,6,8,9,13/))) ) then | |||||
if ( data%State%Drawworks%motion==-1 ) then | |||||
data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
else | |||||
Call DWFixModeMotion | |||||
end if | |||||
return | |||||
end if | |||||
! !==================================================== | |||||
! ! Crown Warning | |||||
! !==================================================== | |||||
! ?if ( ((3.280839895*data%State%Drawworks%Hook_Height)>=data%State%Drawworks%max_Hook_Height) .and. (any(data%State%Drawworks%DrillModeCond==(/1,2,5,6,8,9,13/))) ) then | |||||
! if ( data%State%Drawworks%motion==-1 ) then | |||||
! !data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
! data%State%Drawworks%HookLinearVelocity_final = 3.280839895d0*data%State%Drawworks%HookLinearVelocity ![ft/s] | |||||
! else | |||||
! Call DWFixModeMotion | |||||
! end if | |||||
! return | |||||
! end if | |||||
@@ -147,17 +150,18 @@ subroutine Drawworks_Solver | |||||
!==================================================== | |||||
! Floor Warning | |||||
!==================================================== | |||||
if ( ((3.280839895*data%State%Drawworks%Hook_Height)<=data%State%Drawworks%min_Hook_Height) .and. (any(data%State%Drawworks%DrillModeCond==(/1,2,5,6,8,9,13/))) ) then | |||||
if ( data%State%Drawworks%motion==1 ) then | |||||
data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
else | |||||
Call DWFixModeMotion | |||||
end if | |||||
return | |||||
end if | |||||
! !==================================================== | |||||
! ! Floor Warning | |||||
! !==================================================== | |||||
! ?if ( ((3.280839895*data%State%Drawworks%Hook_Height)<=data%State%Drawworks%min_Hook_Height) .and. (any(data%State%Drawworks%DrillModeCond==(/1,2,5,6,8,9,13/))) ) then | |||||
! if ( data%State%Drawworks%motion==1 ) then | |||||
! !data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
! data%State%Drawworks%HookLinearVelocity_final = 3.280839895d0*data%State%Drawworks%HookLinearVelocity ![ft/s] | |||||
! else | |||||
! Call DWFixModeMotion | |||||
! end if | |||||
! return | |||||
! end if | |||||
@@ -198,7 +202,8 @@ subroutine Drawworks_Solver | |||||
if ( data%State%Drawworks%TDBOPElementNo(j)/=0 ) then | if ( data%State%Drawworks%TDBOPElementNo(j)/=0 ) then | ||||
if ( ((data%State%Drawworks%TDBOPHeight(j)-data%State%Drawworks%TDBOPThickness)<=(data%State%Drawworks%TDDrillStemsTopDepth(data%State%Drawworks%TDBOPElementNo(j))+data%State%Drawworks%TDDrillStemsToolJointRange(data%State%Drawworks%TDBOPElementNo(j)))) .and. ((data%State%Drawworks%TDBOPHeight(j)-data%State%Drawworks%TDBOPThickness)>data%State%Drawworks%TDDrillStemsTopDepth(data%State%Drawworks%TDBOPElementNo(j))) .and. (data%State%Drawworks%TDBOPRamDiam(j)<(2.d0*12.d0*data%State%Drawworks%TDDrillStemsRtoolJoint(data%State%Drawworks%TDBOPElementNo(j)))) ) then | if ( ((data%State%Drawworks%TDBOPHeight(j)-data%State%Drawworks%TDBOPThickness)<=(data%State%Drawworks%TDDrillStemsTopDepth(data%State%Drawworks%TDBOPElementNo(j))+data%State%Drawworks%TDDrillStemsToolJointRange(data%State%Drawworks%TDBOPElementNo(j)))) .and. ((data%State%Drawworks%TDBOPHeight(j)-data%State%Drawworks%TDBOPThickness)>data%State%Drawworks%TDDrillStemsTopDepth(data%State%Drawworks%TDBOPElementNo(j))) .and. (data%State%Drawworks%TDBOPRamDiam(j)<(2.d0*12.d0*data%State%Drawworks%TDDrillStemsRtoolJoint(data%State%Drawworks%TDBOPElementNo(j)))) ) then | ||||
if ( data%State%Drawworks%motion==1 ) then | if ( data%State%Drawworks%motion==1 ) then | ||||
data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
!data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
data%State%Drawworks%HookLinearVelocity_final = 3.280839895d0*data%State%Drawworks%HookLinearVelocity ![ft/s] | |||||
else | else | ||||
Call DWFixModeMotion | Call DWFixModeMotion | ||||
end if | end if | ||||
@@ -222,7 +227,8 @@ subroutine Drawworks_Solver | |||||
if ( data%State%Drawworks%TDBOPElementNo(j)/=0 ) then | if ( data%State%Drawworks%TDBOPElementNo(j)/=0 ) then | ||||
if ( ((data%State%Drawworks%TDBOPHeight(j)+data%State%Drawworks%TDBOPThickness)>=(data%State%Drawworks%TDDrillStemsDownDepth(data%State%Drawworks%TDBOPElementNo(j))-data%State%Drawworks%TDDrillStemsToolJointRange(data%State%Drawworks%TDBOPElementNo(j)))) .and. ((data%State%Drawworks%TDBOPHeight(j)+data%State%Drawworks%TDBOPThickness)<data%State%Drawworks%TDDrillStemsDownDepth(data%State%Drawworks%TDBOPElementNo(j))) .and. (data%State%Drawworks%TDBOPRamDiam(j)<(2.d0*12.d0*data%State%Drawworks%TDDrillStemsRtoolJoint(data%State%Drawworks%TDBOPElementNo(j)))) ) then | if ( ((data%State%Drawworks%TDBOPHeight(j)+data%State%Drawworks%TDBOPThickness)>=(data%State%Drawworks%TDDrillStemsDownDepth(data%State%Drawworks%TDBOPElementNo(j))-data%State%Drawworks%TDDrillStemsToolJointRange(data%State%Drawworks%TDBOPElementNo(j)))) .and. ((data%State%Drawworks%TDBOPHeight(j)+data%State%Drawworks%TDBOPThickness)<data%State%Drawworks%TDDrillStemsDownDepth(data%State%Drawworks%TDBOPElementNo(j))) .and. (data%State%Drawworks%TDBOPRamDiam(j)<(2.d0*12.d0*data%State%Drawworks%TDDrillStemsRtoolJoint(data%State%Drawworks%TDBOPElementNo(j)))) ) then | ||||
if ( data%State%Drawworks%motion==-1 ) then | if ( data%State%Drawworks%motion==-1 ) then | ||||
data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
!data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
data%State%Drawworks%HookLinearVelocity_final = 3.280839895d0*data%State%Drawworks%HookLinearVelocity ![ft/s] | |||||
else | else | ||||
Call DWFixModeMotion | Call DWFixModeMotion | ||||
end if | end if | ||||
@@ -242,25 +248,19 @@ subroutine Drawworks_Solver | |||||
!==================================================== | !==================================================== | ||||
if ( (data%State%Drawworks%DriveType==0) .and. (Get_TdsStemIn()) .and. Get_Slips() == SLIPS_SET_END ) then | if ( (data%State%Drawworks%DriveType==0) .and. (Get_TdsStemIn()) .and. Get_Slips() == SLIPS_SET_END ) then | ||||
if ( data%State%Drawworks%motion==1 ) then | if ( data%State%Drawworks%motion==1 ) then | ||||
data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
!data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
data%State%Drawworks%HookLinearVelocity_final = 3.280839895d0*data%State%Drawworks%HookLinearVelocity ![ft/s] | |||||
else | else | ||||
Call DWFixModeMotion | Call DWFixModeMotion | ||||
end if | end if | ||||
return | return | ||||
end if | end if | ||||
!=====> BottomHole ROP Condition | !=====> BottomHole ROP Condition | ||||
if ( (int(data%State%Drawworks%TDDrillStemBottom*10000.d0)>=(int((data%State%Drawworks%TDWellTotalLength+data%State%Drawworks%TDDlMax)*10000.d0))) .and. (data%State%Drawworks%motion==-1 .or. data%State%Drawworks%motion==0) ) then | if ( (int(data%State%Drawworks%TDDrillStemBottom*10000.d0)>=(int((data%State%Drawworks%TDWellTotalLength+data%State%Drawworks%TDDlMax)*10000.d0))) .and. (data%State%Drawworks%motion==-1 .or. data%State%Drawworks%motion==0) ) then | ||||
if ( data%State%Drawworks%StringIsBottomOfWell==0 ) then | if ( data%State%Drawworks%StringIsBottomOfWell==0 ) then | ||||
data%State%Drawworks%Hook_Height_final = data%State%Drawworks%Hook_Height_final+(data%State%Drawworks%TDDrillStemBottom-(data%State%Drawworks%TDWellTotalLength+data%State%Drawworks%TDDlMax)) | |||||
!?data%State%Drawworks%Hook_Height_final = data%State%Drawworks%Hook_Height_final+(data%State%Drawworks%TDDrillStemBottom-(data%State%Drawworks%TDWellTotalLength+data%State%Drawworks%TDDlMax)) | |||||
data%State%Drawworks%HookLinearVelocity_final = (data%State%Drawworks%TDDrillStemBottom-(data%State%Drawworks%TDWellTotalLength+data%State%Drawworks%TDDlMax))/data%State%Drawworks%time_step ![ft/s] | |||||
data%State%Drawworks%StringIsBottomOfWell = 1 | data%State%Drawworks%StringIsBottomOfWell = 1 | ||||
end if | end if | ||||
Call DWFixModeMotion | Call DWFixModeMotion | ||||
@@ -276,7 +276,8 @@ subroutine Drawworks_Solver | |||||
data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
!data%State%Drawworks%Hook_Height_final = 3.280839895d0*data%State%Drawworks%Hook_Height ![ft] | |||||
data%State%Drawworks%HookLinearVelocity_final = 3.280839895d0*data%State%Drawworks%HookLinearVelocity ![ft/s] | |||||
data%State%Drawworks%HookHeight_graph_output = 0.1189d0*((3.280839895d0*data%State%Drawworks%Hook_Height)-28.d0)-2.6d0 ![ft] | data%State%Drawworks%HookHeight_graph_output = 0.1189d0*((3.280839895d0*data%State%Drawworks%Hook_Height)-28.d0)-2.6d0 ![ft] | ||||