SUBROUTINE DEALLOCATE_ARRAYS() use SimulationVariables implicit none !=========================================================================== ! RAMLINE MINOR LOSSES INPUT !=========================================================================== DEALLOCATE (data%State%BopStackInput%MINORS1,data%State%RamLine%MINORDIAMETER_RAMLINE,data%State%RamLine%AREAMINOR_RAMLINE & ,data%State%RamLine%LF_RAMLINE,data%State%RamLine%CV_RAMLINE,data%State%RamLine%NOTE_RAMLINE,data%State%RAMS%minlosspa,data%State%RAMS%minloss) !=========================================================================== ! RAMLINE PIPNING LOSSES INPUT !=========================================================================== DEALLOCATE (data%State%BopStackInput%PIPINGS_RAMLINE,data%State%RamLine%DIAM_RAMLINE_INCH, & data%State%RamLine%AREA_RAMLINE,data%State%RamLine%LENGT_RAMLINE,data%State%RamLine%ROUGHNESS_RAMLINE,data%State%RamLine%RELROUGH_RAMLINE & ,data%State%RAMS%Re_ramline,data%State%RAMS%fric,data%State%RAMS%fricloss) !=========================================================================== ! ANNULAR MINOR LOSSES INPUT !=========================================================================== DEALLOCATE (data%State%BopStackInput%MINORS_ANNULAR,data%State%AnnularComputational%MINORDIAMETER_ANNULARLINE,data%State%AnnularComputational%AREAMINOR_ANNULARLINE & ,data%State%AnnularComputational%LF_ANNULARLINE,data%State%AnnularComputational%CV_ANNULARLINE,data%State%AnnularComputational%NOTE_ANNULARLINE,data%State%AnnularComputational%minlosspa_ANNULAR,data%State%AnnularComputational%minloss_ANNULAR) !=========================================================================== ! ANNULAR PIPNING LOSSES INPUT !=========================================================================== DEALLOCATE (data%State%BopStackInput%PIPINGS_ANNULAR,data%State%AnnularComputational%DIAM_ANNULARLINE_INCH,data%State%AnnularComputational%AREA_ANNULARLINE, & data%State%AnnularComputational%LENGT_ANNULARLINE,data%State%AnnularComputational%ROUGHNESS_ANNULARLINE,data%State%AnnularComputational%RELROUGH_ANNULARLINE & ,data%State%AnnularComputational%Re_ANNULARline,data%State%AnnularComputational%fricANNULAR,data%State%AnnularComputational%friclossANNULAR) !=========================================================================== ! AIR PUMP LOSSES INPUT !=========================================================================== DEALLOCATE (data%State%BopStackInput%PIPINGS_AIRPUMP,data%State%RamLine%DIAM_AIR_INCH, & data%State%RamLine%Re_air,data%State%RamLine%AREA_AIR,data%State%RamLine%LENGT_AIR,data%State%RamLine%ROUGHNESS_AIRPLINE,data%State%RamLine%REL_ROUGHAIR, & data%State%RamLine%fric_air,data%State%RamLine%fricloss_air) !================================================================ DEALLOCATE (data%State%BopStackInput%MINORS_AIRPUMP,data%State%RamLine%MINORDIAM_AIR_INCH, & data%State%RamLine%MINORAREA_AIR,data%State%RamLine%LF_AIR,data%State%RamLine%CV_AIR,data%State%RamLine%NOTE_AIR & ,data%State%RamLine%minlosspa_air,data%State%RamLine%minloss_air) !=========================================================================== ! DELAY ARRAYS !=========================================================================== call data%State%AnnularComputational%Pannular_regDelay%Empty() END SUBROUTINE LOSS_INPUTS() use SimulationVariables implicit none INTEGER I !=========================================================================== ! RAMLINE MINOR LOSSES INPUT !=========================================================================== data%State%RamLine%NO_MINORSRAMLINE=34 ALLOCATE (data%State%BopStackInput%MINORS1(data%State%RamLine%NO_MINORSRAMLINE,4)) ! ID(INCH) LF CV NOTE(BAR) DESCRIPTION data%State%BopStackInput%MINORS1(1,1:4)= (/2., 2., 0., 0./) !Acc.tee data%State%BopStackInput%MINORS1(2,1:4)= (/2., 0.9, 0., 0./) !Avg.acc.tee data%State%BopStackInput%MINORS1(3,1:4)= (/2., 0.9, 0., 0./) !Avg.acc.tee data%State%BopStackInput%MINORS1(4,1:4)= (/2., 0.9, 0., 0./) !Avg.acc.tee data%State%BopStackInput%MINORS1(5,1:4)= (/2., 0.9, 0., 0./) !tee data%State%BopStackInput%MINORS1(6,1:4)= (/2., 2., 0., 0./) !tee data%State%BopStackInput%MINORS1(7,1:4)= (/2., 0., 105., 0./) !valve data%State%BopStackInput%MINORS1(8,1:4)= (/2., 0.9, 0., 0./) !tee data%State%BopStackInput%MINORS1(9,1:4)= (/2., 0., 105., 0./) !valve data%State%BopStackInput%MINORS1(10,1:4)= (/2., 0.42, 0., 0./) !elbow data%State%BopStackInput%MINORS1(11,1:4)= (/2., 0.42, 0., 0./) !elbow data%State%BopStackInput%MINORS1(12,1:4)= (/2., 0.8, 0., 0./) !unionA data%State%BopStackInput%MINORS1(13,1:4)= (/2., 0.8, 0., 0./) !unionA data%State%BopStackInput%MINORS1(14,1:4)= (/2., 1.5, 0., 0./) !elbow data%State%BopStackInput%MINORS1(15,1:4)= (/2., 0., 425., 0./) !valve data%State%BopStackInput%MINORS1(16,1:4)= (/2., 2., 0., 0./) !tee data%State%BopStackInput%MINORS1(17,1:4)= (/0.75, 0., 1.5, 0./) !REGULATOR data%State%BopStackInput%MINORS1(18,1:4)= (/1., 2., 0., 0./) !tee data%State%BopStackInput%MINORS1(19,1:4)= (/1., 1.5, 0., 0./) !elbow data%State%BopStackInput%MINORS1(20,1:4)= (/1., 0.42, 0., 0./) !elbow data%State%BopStackInput%MINORS1(21,1:4)= (/1., 0.42, 0., 0./) !elbow data%State%BopStackInput%MINORS1(22,1:4)= (/1., 1.5, 0., 0./) !elbow data%State%BopStackInput%MINORS1(23,1:4)= (/1., 0., 105., 0./) !valve data%State%BopStackInput%MINORS1(24,1:4)= (/1., 0.9, 0., 0./) !tee data%State%BopStackInput%MINORS1(25,1:4)= (/1., 0., 0., 0.5/) !FT data%State%BopStackInput%MINORS1(26,1:4)= (/1., 0., 0., 3.4/) !filter data%State%BopStackInput%MINORS1(27,1:4)= (/1., 0., 105., 0./) !valve data%State%BopStackInput%MINORS1(28,1:4)= (/1., 0.9, 0., 0./) !tee data%State%BopStackInput%MINORS1(29,1:4)= (/1., 1.5, 0., 0./) !elbow data%State%BopStackInput%MINORS1(30,1:4)= (/1., 1.5, 0., 0./) !elbow data%State%BopStackInput%MINORS1(31,1:4)= (/1., 0., 9.2, 0./) !valve data%State%BopStackInput%MINORS1(32,1:4)= (/1., 0.8, 0., 0./) !unionA data%State%BopStackInput%MINORS1(33,1:4)= (/1., 0.8, 0., 0./) !unionA data%State%BopStackInput%MINORS1(34,1:4)= (/0.75, 0.35, 0., 0./) !contraction ALLOCATE (data%State%RamLine%MINORDIAMETER_RAMLINE(data%State%RamLine%NO_MINORSRAMLINE),data%State%RamLine%AREAMINOR_RAMLINE(data%State%RamLine%NO_MINORSRAMLINE),data%State%RamLine%LF_RAMLINE(data%State%RamLine%NO_MINORSRAMLINE),data%State%RamLine%CV_RAMLINE(data%State%RamLine%NO_MINORSRAMLINE) & ,data%State%RamLine%NOTE_RAMLINE(data%State%RamLine%NO_MINORSRAMLINE),data%State%RAMS%minlosspa(6,data%State%RamLine%NO_MINORSRAMLINE),data%State%RAMS%minloss(6,data%State%RamLine%NO_MINORSRAMLINE)) DO I=1,data%State%RamLine%NO_MINORSRAMLINE data%State%RamLine%MINORDIAMETER_RAMLINE(I)=data%State%BopStackInput%MINORS1(I,1) data%State%RamLine%LF_RAMLINE(I)=data%State%BopStackInput%MINORS1(I,2) data%State%RamLine%CV_RAMLINE(I)=data%State%BopStackInput%MINORS1(I,3) data%State%RamLine%NOTE_RAMLINE(I)=data%State%BopStackInput%MINORS1(I,4) data%State%RamLine%AREAMINOR_RAMLINE(I)=PI*(data%State%RamLine%MINORDIAMETER_RAMLINE(I)*0.0254)**2/4. !D(in), AREA(m) ENDDO !=========================================================================== ! RAMLINE PIPNING LOSSES INPUT !=========================================================================== data%State%RamLine%NO_PIPINGSRAMLINE=15 ALLOCATE (data%State%BopStackInput%PIPINGS_RAMLINE(data%State%RamLine%NO_PIPINGSRAMLINE,3)) ! ID(INCH) L(MM) ROUGHNESS(MM)=e DESCRIPTION data%State%BopStackInput%PIPINGS_RAMLINE(1,1:3)= (/2., 1035., 0.03/) !Avg.acc.distance data%State%BopStackInput%PIPINGS_RAMLINE(2,1:3)= (/2., 730., 0.03/) !Acc.end.horizontal data%State%BopStackInput%PIPINGS_RAMLINE(3,1:3)= (/2., 2000., 0.03/) !Acc.end.vertical data%State%BopStackInput%PIPINGS_RAMLINE(4,1:3)= (/2., 6000., 0.05/) !Hyd.hose data%State%BopStackInput%PIPINGS_RAMLINE(5,1:3)= (/2., 2370., 0.03/) !Corner.vertical1 data%State%BopStackInput%PIPINGS_RAMLINE(6,1:3)= (/2., 210., 0.03/) !Add.from.bend data%State%BopStackInput%PIPINGS_RAMLINE(7,1:3)= (/1., 780., 0.03/) !Corner.horizontal1 data%State%BopStackInput%PIPINGS_RAMLINE(8,1:3)= (/1., 780., 0.03/) !Corner.horizontal2 data%State%BopStackInput%PIPINGS_RAMLINE(9,1:3)= (/1., 750., 0.03/) !Extra.length.back data%State%BopStackInput%PIPINGS_RAMLINE(10,1:3)= (/1., 800., 0.03/) !Corner.horizontal3 data%State%BopStackInput%PIPINGS_RAMLINE(11,1:3)= (/1., 1650., 0.03/) !Corner.vertical2 data%State%BopStackInput%PIPINGS_RAMLINE(12,1:3)= (/1., 340., 0.03/) !12.Valves.horizontal data%State%BopStackInput%PIPINGS_RAMLINE(13,1:3)= (/1., 1650., 0.03/) !Valves.vertical data%State%BopStackInput%PIPINGS_RAMLINE(14,1:3)= (/1., 31000., 10./) !Hyd.hose data%State%BopStackInput%PIPINGS_RAMLINE(15,1:3)= (/1., 526., 0.03/) !Add.from.bend ALLOCATE (data%State%RamLine%DIAM_RAMLINE_INCH(data%State%RamLine%NO_PIPINGSRAMLINE), & data%State%RamLine%AREA_RAMLINE(data%State%RamLine%NO_PIPINGSRAMLINE),data%State%RamLine%LENGT_RAMLINE(data%State%RamLine%NO_PIPINGSRAMLINE),data%State%RamLine%ROUGHNESS_RAMLINE(data%State%RamLine%NO_PIPINGSRAMLINE),data%State%RamLine%RELROUGH_RAMLINE(data%State%RamLine%NO_PIPINGSRAMLINE) & ,data%State%RAMS%Re_ramline(6,data%State%RamLine%NO_PIPINGSRAMLINE),data%State%RAMS%fric(6,data%State%RamLine%NO_PIPINGSRAMLINE),data%State%RAMS%fricloss(6,data%State%RamLine%NO_PIPINGSRAMLINE)) DO I=1,data%State%RamLine%NO_PIPINGSRAMLINE data%State%RamLine%DIAM_RAMLINE_INCH(I)=data%State%BopStackInput%PIPINGS_RAMLINE(I,1) data%State%RamLine%LENGT_RAMLINE(I)=data%State%BopStackInput%PIPINGS_RAMLINE(I,2) data%State%RamLine%ROUGHNESS_RAMLINE(I)=data%State%BopStackInput%PIPINGS_RAMLINE(I,3) data%State%RamLine%AREA_RAMLINE(I)=PI*(data%State%RamLine%DIAM_RAMLINE_INCH(I)*0.0254)**2/4 !D(in), AREA(m) data%State%RamLine%RELROUGH_RAMLINE(I)=data%State%RamLine%ROUGHNESS_RAMLINE(I)/(data%State%RamLine%DIAM_RAMLINE_INCH(I)*25.4) !e/D !DIAM_RAMLINE_MM(I)=DIAM_RAMLINE_MM(I)*.001 ! (m) data%State%RamLine%LENGT_RAMLINE(I)=data%State%RamLine%LENGT_RAMLINE(I)*.001 ! (m) ENDDO !=========================================================================== ! ANNULAR PREVENTER MINOR LOSSES INPUT !=========================================================================== data%State%AnnularComputational%NO_MinorsAnnularLine=29 ALLOCATE (data%State%BopStackInput%MINORS_ANNULAR(data%State%AnnularComputational%NO_MinorsAnnularLine,4)) ! ID(INCH) LF CV NOTE(BAR) DESCRIPTION data%State%BopStackInput%MINORS_ANNULAR(1,1:4)= (/2., 2., 0., 0./) !Acc.tee data%State%BopStackInput%MINORS_ANNULAR(2,1:4)= (/2., 0.9, 0., 0./) !Avg.acc.tee data%State%BopStackInput%MINORS_ANNULAR(3,1:4)= (/2., 0.9, 0., 0./) !Avg.acc.tee data%State%BopStackInput%MINORS_ANNULAR(4,1:4)= (/2., 0.9, 0., 0./) !Avg.acc.tee data%State%BopStackInput%MINORS_ANNULAR(5,1:4)= (/2., 0.9, 0., 0./) !tee data%State%BopStackInput%MINORS_ANNULAR(6,1:4)= (/2., 2., 0., 0./) !tee data%State%BopStackInput%MINORS_ANNULAR(7,1:4)= (/2., 0., 105., 0./) !valve data%State%BopStackInput%MINORS_ANNULAR(8,1:4)= (/2., 0.9, 0., 0./) !tee data%State%BopStackInput%MINORS_ANNULAR(9,1:4)= (/2., 0., 105., 0./) !valve data%State%BopStackInput%MINORS_ANNULAR(10,1:4)= (/2., 0.42, 0., 0./) !elbow data%State%BopStackInput%MINORS_ANNULAR(11,1:4)= (/2., 0.42, 0., 0./) !elbow data%State%BopStackInput%MINORS_ANNULAR(12,1:4)= (/2., 0.8, 0., 0./) !unionA data%State%BopStackInput%MINORS_ANNULAR(13,1:4)= (/2., 0.8, 0., 0./) !unionA data%State%BopStackInput%MINORS_ANNULAR(14,1:4)= (/2., 1.5, 0., 0./) !elbow data%State%BopStackInput%MINORS_ANNULAR(15,1:4)= (/2., 0., 425., 0./) !valve data%State%BopStackInput%MINORS_ANNULAR(16,1:4)= (/2., 2., 0., 0./) !tee data%State%BopStackInput%MINORS_ANNULAR(17,1:4)= (/0.75, 0., 1.5, 0./) !REGULATOR data%State%BopStackInput%MINORS_ANNULAR(18,1:4)= (/1., 2., 0., 0./) !tee data%State%BopStackInput%MINORS_ANNULAR(19,1:4)= (/1., 1.5, 0., 0./) !elbow data%State%BopStackInput%MINORS_ANNULAR(20,1:4)= (/1., 0.42, 0., 0./) !elbow data%State%BopStackInput%MINORS_ANNULAR(21,1:4)= (/1., 0.42, 0., 0./) !elbow data%State%BopStackInput%MINORS_ANNULAR(22,1:4)= (/1., 1.5, 0., 0./) !elbow data%State%BopStackInput%MINORS_ANNULAR(23,1:4)= (/1., 0., 3.2, 0./) !valve data%State%BopStackInput%MINORS_ANNULAR(24,1:4)= (/1., 2., 0., 0./) !tee data%State%BopStackInput%MINORS_ANNULAR(25,1:4)= (/1., 1.5, 0., 0./) !elbow data%State%BopStackInput%MINORS_ANNULAR(26,1:4)= (/1., 0.42, 0., 0./) !elbow data%State%BopStackInput%MINORS_ANNULAR(27,1:4)= (/1., 0.42, 0., 0./) !elbow data%State%BopStackInput%MINORS_ANNULAR(28,1:4)= (/1., 1.5, 0., 0./) !elbow data%State%BopStackInput%MINORS_ANNULAR(29,1:4)= (/1., 0., 3.2, 0./) !valve ALLOCATE (data%State%AnnularComputational%MINORDIAMETER_ANNULARLINE(data%State%AnnularComputational%NO_MinorsAnnularLine),data%State%AnnularComputational%AREAMINOR_ANNULARLINE(data%State%AnnularComputational%NO_MinorsAnnularLine),data%State%AnnularComputational%LF_ANNULARLINE(data%State%AnnularComputational%NO_MinorsAnnularLine) & ,data%State%AnnularComputational%CV_ANNULARLINE(data%State%AnnularComputational%NO_MinorsAnnularLine),data%State%AnnularComputational%NOTE_ANNULARLINE(data%State%AnnularComputational%NO_MinorsAnnularLine),data%State%AnnularComputational%minlosspa_ANNULAR(data%State%AnnularComputational%NO_MinorsAnnularLine),data%State%AnnularComputational%minloss_ANNULAR(data%State%AnnularComputational%NO_MinorsAnnularLine)) DO I=1,data%State%AnnularComputational%NO_MinorsAnnularLine data%State%AnnularComputational%MINORDIAMETER_ANNULARLINE(I)=data%State%BopStackInput%MINORS_ANNULAR(I,1) data%State%AnnularComputational%LF_ANNULARLINE(I)=data%State%BopStackInput%MINORS_ANNULAR(I,2) data%State%AnnularComputational%CV_ANNULARLINE(I)=data%State%BopStackInput%MINORS_ANNULAR(I,3) data%State%AnnularComputational%NOTE_ANNULARLINE(I)=data%State%BopStackInput%MINORS_ANNULAR(I,4) data%State%AnnularComputational%AREAMINOR_ANNULARLINE(I)=PI*(data%State%AnnularComputational%MINORDIAMETER_ANNULARLINE(I)*0.0254)**2/4. !D(in), AREA(m) ENDDO !=========================================================================== ! ANNULAR PREVENTER PIPNING LOSSES INPUT !=========================================================================== data%State%AnnularComputational%NO_PipingsAnnularLine=10 ALLOCATE (data%State%BopStackInput%PIPINGS_ANNULAR(data%State%AnnularComputational%NO_PipingsAnnularLine,3)) ! ID(INCH) L(MM) ROUGHNESS(MM)=e DESCRIPTION data%State%BopStackInput%PIPINGS_ANNULAR(1,1:3)= (/2., 1035., 0.03/) !Avg.acc.distance data%State%BopStackInput%PIPINGS_ANNULAR(2,1:3)= (/2., 730., 0.03/) !Acc.endhorizontal data%State%BopStackInput%PIPINGS_ANNULAR(3,1:3)= (/2., 2000., 0.03/) !Acc.endvertical data%State%BopStackInput%PIPINGS_ANNULAR(4,1:3)= (/2., 6000., 0.03/) !Hyd.hose data%State%BopStackInput%PIPINGS_ANNULAR(5,1:3)= (/2., 2370., 0.03/) !Corner.vertical1 data%State%BopStackInput%PIPINGS_ANNULAR(6,1:3)= (/2., 210., 0.03/) !Add.frombend data%State%BopStackInput%PIPINGS_ANNULAR(7,1:3)= (/2., 1000., 0.03/) !manifold data%State%BopStackInput%PIPINGS_ANNULAR(8,1:3)= (/1., 46000., 0.03/) !pipe data%State%BopStackInput%PIPINGS_ANNULAR(9,1:3)= (/2., 1000., 0.03/) !manifold data%State%BopStackInput%PIPINGS_ANNULAR(10,1:3)= (/1., 46000., 0.03/) !pipe ALLOCATE (data%State%AnnularComputational%DIAM_ANNULARLINE_INCH(data%State%AnnularComputational%NO_PipingsAnnularLine),data%State%AnnularComputational%AREA_ANNULARLINE(data%State%AnnularComputational%NO_PipingsAnnularLine),data%State%AnnularComputational%LENGT_ANNULARLINE(data%State%AnnularComputational%NO_PipingsAnnularLine) & ,data%State%AnnularComputational%ROUGHNESS_ANNULARLINE(data%State%AnnularComputational%NO_PipingsAnnularLine),data%State%AnnularComputational%RELROUGH_ANNULARLINE(data%State%AnnularComputational%NO_PipingsAnnularLine) & ,data%State%AnnularComputational%Re_ANNULARline(data%State%AnnularComputational%NO_PipingsAnnularLine),data%State%AnnularComputational%fricANNULAR(data%State%AnnularComputational%NO_PipingsAnnularLine),data%State%AnnularComputational%friclossANNULAR(data%State%AnnularComputational%NO_PipingsAnnularLine)) DO I=1,data%State%AnnularComputational%NO_PipingsAnnularLine data%State%AnnularComputational%DIAM_ANNULARLINE_INCH(I)=data%State%BopStackInput%PIPINGS_ANNULAR(I,1) data%State%AnnularComputational%LENGT_ANNULARLINE(I)=data%State%BopStackInput%PIPINGS_ANNULAR(I,2) data%State%AnnularComputational%ROUGHNESS_ANNULARLINE(I)=data%State%BopStackInput%PIPINGS_ANNULAR(I,3) data%State%AnnularComputational%AREA_ANNULARLINE(I)=PI*(data%State%AnnularComputational%DIAM_ANNULARLINE_INCH(I)*0.0254)**2/4. !D(in), AREA(m) data%State%AnnularComputational%RELROUGH_ANNULARLINE(I)=data%State%AnnularComputational%ROUGHNESS_ANNULARLINE(I)/(data%State%AnnularComputational%DIAM_ANNULARLINE_INCH(I)*25.4) !DIAM_ANNULARLINE_MM(I)=DIAM_ANNULARLINE_MM(I)*.001 ! (m) data%State%AnnularComputational%LENGT_ANNULARLINE(I)=data%State%AnnularComputational%LENGT_ANNULARLINE(I)*.001 ! (m) ENDDO !=========================================================================== ! AIR PUMP LOSSES INPUT !=========================================================================== data%State%RamLine%NO_PIPINGS_AIRPLINE=1 ALLOCATE (data%State%BopStackInput%PIPINGS_AIRPUMP(data%State%RamLine%NO_PIPINGS_AIRPLINE,3)) ! ID(INCH) L(MM) ROUGHNESS(MM)=e DESCRIPTION data%State%BopStackInput%PIPINGS_AIRPUMP(1,1:3)= (/2., 10000., 0.03/) !Avg.acc.distance ALLOCATE (data%State%RamLine%DIAM_AIR_INCH(data%State%RamLine%NO_PIPINGS_AIRPLINE),data%State%RamLine%Re_air(data%State%RamLine%NO_PIPINGS_AIRPLINE),data%State%RamLine%AREA_AIR(data%State%RamLine%NO_PIPINGS_AIRPLINE), & data%State%RamLine%LENGT_AIR(data%State%RamLine%NO_PIPINGS_AIRPLINE),data%State%RamLine%ROUGHNESS_AIRPLINE(data%State%RamLine%NO_PIPINGS_AIRPLINE),data%State%RamLine%REL_ROUGHAIR(data%State%RamLine%NO_PIPINGS_AIRPLINE), & data%State%RamLine%fric_air(data%State%RamLine%NO_PIPINGS_AIRPLINE),data%State%RamLine%fricloss_air(data%State%RamLine%NO_PIPINGS_AIRPLINE)) DO I=1,data%State%RamLine%NO_PIPINGS_AIRPLINE data%State%RamLine%DIAM_AIR_INCH(I)=data%State%BopStackInput%PIPINGS_AIRPUMP(I,1) data%State%RamLine%LENGT_AIR(I)=data%State%BopStackInput%PIPINGS_AIRPUMP(I,2) data%State%RamLine%ROUGHNESS_AIRPLINE(I)=data%State%BopStackInput%PIPINGS_AIRPUMP(I,3) data%State%RamLine%AREA_AIR(I)=PI*(data%State%RamLine%DIAM_AIR_INCH(I)*0.0254)**2/4 !D(in), AREA(m) data%State%RamLine%REL_ROUGHAIR(I)=data%State%RamLine%ROUGHNESS_AIRPLINE(I)/(data%State%RamLine%DIAM_AIR_INCH(I)*25.4) !DIAM_RAMLINE_MM(I)=DIAM_RAMLINE_MM(I)*.001 ! (m) data%State%RamLine%LENGT_AIR(I)=data%State%RamLine%LENGT_AIR(I)*.001 ! (m) ENDDO !================================================================ data%State%RamLine%NO_MINORS_AIRPLINE=6 ALLOCATE (data%State%BopStackInput%MINORS_AIRPUMP(data%State%RamLine%NO_MINORS_AIRPLINE,4)) ! ID(INCH) LF CV NOTE(BAR) DESCRIPTION data%State%BopStackInput%MINORS_AIRPUMP(1,1:4)= (/2., 10., 0., 0./) !Acc.tee data%State%BopStackInput%MINORS_AIRPUMP(2,1:4)= (/2., 11., 0., 0./) !elbow data%State%BopStackInput%MINORS_AIRPUMP(3,1:4)= (/1., 0., 0., 3.4/) !filter data%State%BopStackInput%MINORS_AIRPUMP(4,1:4)= (/2., 0., 105., 0./) !valve data%State%BopStackInput%MINORS_AIRPUMP(5,1:4)= (/1., 0., 9.2, 0./) !valve data%State%BopStackInput%MINORS_AIRPUMP(6,1:4)= (/2., 6.4, 0., 0./) !unionA ALLOCATE (data%State%RamLine%MINORDIAM_AIR_INCH(data%State%RamLine%NO_MINORS_AIRPLINE),data%State%RamLine%MINORAREA_AIR(data%State%RamLine%NO_MINORS_AIRPLINE), & data%State%RamLine%LF_AIR(data%State%RamLine%NO_MINORS_AIRPLINE),data%State%RamLine%CV_AIR(data%State%RamLine%NO_MINORS_AIRPLINE),data%State%RamLine%NOTE_AIR(data%State%RamLine%NO_MINORS_AIRPLINE) & ,data%State%RamLine%minlosspa_air(data%State%RamLine%NO_MINORS_AIRPLINE),data%State%RamLine%minloss_air(data%State%RamLine%NO_MINORS_AIRPLINE)) DO I=1,data%State%RamLine%NO_MINORS_AIRPLINE data%State%RamLine%MINORDIAM_AIR_INCH(I)=data%State%BopStackInput%MINORS_AIRPUMP(I,1) data%State%RamLine%LF_AIR(I)=data%State%BopStackInput%MINORS_AIRPUMP(I,2) data%State%RamLine%CV_AIR(I)=data%State%BopStackInput%MINORS_AIRPUMP(I,3) data%State%RamLine%NOTE_AIR(I)=data%State%BopStackInput%MINORS_AIRPUMP(I,4) data%State%RamLine%MINORAREA_AIR(I)=PI*(data%State%RamLine%MINORDIAM_AIR_INCH(I)*0.0254)**2/4. !D(in), AREA(m) ENDDO END SUBROUTINE pumps_charge_bottle() use SimulationVariables USE CAccumulatorVariables USE CBopStackVariables use CBopControlPanel use SimulationVariables USE CEquipmentsConstants ! use CSimulationVariables implicit none !Pannular_regset=min(AnnularRegulatorSetControl,1700.) ! for changing its set conditions instantaneously !write(*,*) 'pumps_charge_bottle' if(data%Equipments%BopControlPanel%ByePassValve == -1.0) then data%State%BopStackAcc%ByPassOld= -1.0 elseif(data%Equipments%BopControlPanel%ByePassValve == 1.0) then data%State%BopStackAcc%ByPassOld= 1.0 endif !===================================================================== ! ACCUMULATOR !=====for a 10 gal bottle,precharge=1000psig curve BOSCH-isotherm===== !for charging bottles by the pump !((((((((IN OUTER LOOP)))))) ! ba1=1003; ba2=.03375; ba3=4.014; ba4=.2458; if (data%State%RamLine%AIRP_SWITCH==0) data%State%Pumps%DELTAV_AIR=0 data%State%RamLine%FVR=data%State%RamLine%FVR+data%State%Pumps%DELTAV_AIR+data%State%Pumps%DELTAV_ELECP data%State%RamLine%pacc_before=data%State%RamLine%P_ACC data%State%RamLine%P_ACC=data%State%RamLine%B1*exp(data%State%RamLine%B2*data%State%RamLine%FVR/data%State%BopStackAcc%NOBOTTLES)+data%State%RamLine%B3*exp(data%State%RamLine%B4*data%State%RamLine%FVR/data%State%BopStackAcc%NOBOTTLES) ! adiabatic(psig)<<<< 8=no. of bottles !===================================================================== if(data%State%BopStackAcc%ByPassOld == 1.0) then if (data%State%BopStackAcc%pram_reg BaseDifferenceP) then data%State%BopStackAcc%pram_reg= data%State%BopStackAcc%pram_reg + (data%State%BopStackAcc%PressureDifference/PressureDifferenceSteps) ! PressureDifferenceSteps = 20. else if (data%State%BopStackAcc%pram_reg BaseDifferenceP) then data%State%BopStackAcc%pram_reg= data%State%BopStackAcc%pram_reg + (data%State%BopStackAcc%PressureDifference/PressureDifferenceSteps) ! PressureDifferenceSteps = 20. else data%State%BopStackAcc%pram_reg= data%State%RamLine%P_ACC- MAXVAL(data%State%RAM%loss_before) endif endif !Pannular_reg= min(p_acc,Pannular_regset) end SUBROUTINE airpump_code() use SimulationVariables use CSounds implicit none INTEGER I data%State%Pumps%QAIR=data%State%Pumps%Qiter+.1 !(gpm) maximum flow for the start data%State%RamLine%diffp_air=-10 data%State%RamLine%losses_air=10 !=================================================================== ! AIR OPERATED PUMP !=================for air consumption at 8 bar====================== do while (data%State%RamLine%diffp_air<0) data%State%Pumps%QAIR=data%State%Pumps%QAIR-.1 ! Qup=QAIR_PUMP; ! bba1 =31.8; bba2 =-725.7 ; bba3 =4154; data%State%Pumps%P_AIRP=data%State%RamLine%BBA1*data%State%Pumps%QAIR**2+data%State%RamLine%BBA2*data%State%Pumps%QAIR+data%State%RamLine%BBA3 !(psig) data%State%RamLine%kinetic_air=sg*wdens*(data%State%Pumps%QAIR*6.30902e-5/((1/4.)*pi*(2*0.254e-1)**2))**2/(2*6895) !(psi) data%State%RamLine%diffp_air=data%State%Pumps%P_AIRP+data%State%RamLine%kinetic_air-data%State%RamLine%P_ACC end do !returns Qup do while (abs((data%State%RamLine%diffp_air-data%State%RamLine%losses_air)/data%State%RamLine%diffp_air)>data%State%Pumps%TOL_AIR) !finding correct QAIR_pump for 1 timecounter_ram if (data%State%RamLine%diffp_air-data%State%RamLine%losses_air>0) then data%State%Pumps%QAIR=data%State%Pumps%QAIR+.01 else data%State%Pumps%QAIR=data%State%Pumps%QAIR-.01 endif !=================================================================== ! AIR OPERATED PUMP ! Maximator - Model: GX (35) !=================for air consumption at 8 bar====================== data%State%Pumps%P_AIRP=data%State%RamLine%BBA1*data%State%Pumps%QAIR**2+data%State%RamLine%BBA2*data%State%Pumps%QAIR+data%State%RamLine%BBA3 !(psig) data%State%RamLine%kinetic_air=sg*wdens*(data%State%Pumps%QAIR*6.30902e-005/((1/4.)*pi*(2*0.254e-1)**2))**2/(2*6895) !(psi) data%State%RamLine%diffp_air=data%State%Pumps%P_AIRP+data%State%RamLine%kinetic_air-data%State%RamLine%P_ACC !===========================LOSSES==================================== do i=1,data%State%RamLine%NO_PIPINGS_AIRPLINE data%State%RamLine%Re_air(i)=data%State%Pumps%QAIR*6.30902e-005*data%State%RamLine%DIAM_AIR_INCH(I)*0.0254/(data%State%RamLine%AREA_AIR(i)*nu) enddo do i=1,data%State%RamLine%NO_PIPINGS_AIRPLINE if (data%State%RamLine%Re_air(i)data%State%ShearRAM%NeededVolumeShearRams) then data%State%RamLine%ShearBop_closed=1 !ShearBop_closed_withPossibility= ShearBop_closed * TD_BOPConnectionPossibility(3) data%State%BopStackAcc%pram_reg=data%State%BopStackAcc%pram_reg+data%State%RAMS%minloss(RNUMBER,17) data%State%RamLine%P_ACC= data%State%RAM(RNUMBER)%p_acccheck if (data%State%RamLine%ShearRamIsClosing) then data%State%ShearRAM%IDshearBop=0. + data%State%ShearRAM%ShearIsNotAllowed*data%State%ShearRAM%ODDrillpipe_inShearRam data%Equipments%BopControlPanel%MiddleRamsCloseLED = LedOn data%State%BopStackInput%MiddleRamsCloseLEDMine = LedOn data%Equipments%BopControlPanel%MiddleRamsOpenLED = LedOff data%State%BopStackInput%MiddleRamsOpenLEDMine = LedOff if (data%State%TD_BOP%BOPConnectionPossibility(3) == 1 .and. data%State%ShearRAM%ShearIsNotAllowed==0) then CALL CloseMiddleRams data%State%RamLine%ShearBop_Situation_forTD= 1 ! closed - for TD code endif endif if (data%State%RamLine%ShearRamIsOpening) then data%State%ShearRAM%IDshearBop=data%State%ShearRAM%IDshearBopBase data%Equipments%BopControlPanel%MiddleRamsOpenLED = LedOn data%State%BopStackInput%MiddleRamsOpenLEDMine = LedOn data%Equipments%BopControlPanel%MiddleRamsCloseLED = LedOff data%State%BopStackInput%MiddleRamsCloseLEDMine = LedOff CALL OpenMiddleRams data%State%RamLine%ShearBop_Situation_forTD= 0 ! open - for TD code endif endif data%State%ShearRAM%IDshearBopFinal= data%State%ShearRAM%IDshearBop ! for output data endif if (ramtype==2) then !for pipe ram1 if (data%State%PipeRam1%IsClosing) then data%State%PipeRam1%ID=(2.*(data%State%PipeRam1%NeededVolume- data%State%RAM(RNUMBER)%vdis_tot)*231./data%State%PipeRam1%A)+max(data%State%PipeRam1%ODDrillpipe_in,data%State%PipeRam1%ODDrillpipe_inBase) endif if (data%State%PipeRam1%IsOpening) then data%State%PipeRam1%ID=data%State%PipeRam1%IDBase-2.*(data%State%PipeRam1%NeededVolume- data%State%RAM(RNUMBER)%vdis_tot)*231./data%State%PipeRam1%A endif if ( data%State%RAM(RNUMBER)%vdis_tot>data%State%PipeRam1%NeededVolume) then data%State%PipeRam1%closed=1 !PipeRam1_Situation_forTD= PipeRam1_closed * TD_BOPConnectionPossibility(2) data%State%BopStackAcc%pram_reg=data%State%BopStackAcc%pram_reg+data%State%RAMS%minloss(RNUMBER,17) data%State%RamLine%P_ACC= data%State%RAM(RNUMBER)%p_acccheck if (data%State%PipeRam1%IsClosing) then data%State%PipeRam1%ID=max(data%State%PipeRam1%ODDrillpipe_in,data%State%PipeRam1%ODDrillpipe_inBase) data%Equipments%BopControlPanel%UpperRamsCloseLED = LedOn data%State%BopStackInput%UpperRamsCloseLEDMine = LedOn data%Equipments%BopControlPanel%UpperRamsOpenLED = LedOff data%State%BopStackInput%UpperRamsOpenLEDMine = LedOff if (data%State%TD_BOP%BOPConnectionPossibility(2) == 1) then CALL CloseUpperRams ! for C code call Set_BlowoutFromAnnular(.true.) data%State%PipeRam1%Situation_forTD= 1 ! closed - for TD code endif endif if (data%State%PipeRam1%IsOpening) then data%State%PipeRam1%ID=data%State%PipeRam1%IDBase data%Equipments%BopControlPanel%UpperRamsOpenLED = LedOn data%State%BopStackInput%UpperRamsOpenLEDMine = LedOn data%Equipments%BopControlPanel%UpperRamsCloseLED = LedOff data%State%BopStackInput%UpperRamsCloseLEDMine = LedOff Call OpenUpperRams ! for C code data%State%PipeRam1%Situation_forTD= 0 ! open - for TD code endif endif data%State%ShearRAM%IDPipeRam1Final= data%State%PipeRam1%ID ! for output data endif if (ramtype==3) then !for pipe ram2 if (data%State%PipeRam2%IsClosing) then data%State%PipeRam2%ID=(2.*(data%State%PipeRam2%NeededVolume- data%State%RAM(RNUMBER)%vdis_tot)*231./data%State%PipeRam1%A)+max(data%State%PipeRam2%ODDrillpipe_in,data%State%PipeRam1%ODDrillpipe_inBase) endif if (data%State%PipeRam2%IsOpening) then data%State%PipeRam2%ID=data%State%PipeRam1%IDBase-2.*(data%State%PipeRam2%NeededVolume- data%State%RAM(RNUMBER)%vdis_tot)*231./data%State%PipeRam1%A endif if ( data%State%RAM(RNUMBER)%vdis_tot>data%State%PipeRam2%NeededVolume) then data%State%PipeRam2%closed=1 !PipeRam2_closed_withPossibility= PipeRam2_closed * TD_BOPConnectionPossibility(4) data%State%BopStackAcc%pram_reg=data%State%BopStackAcc%pram_reg+data%State%RAMS%minloss(RNUMBER,17) data%State%RamLine%P_ACC= data%State%RAM(RNUMBER)%p_acccheck if (data%State%PipeRam2%IsClosing) then data%State%PipeRam2%ID=max(data%State%PipeRam2%ODDrillpipe_in,data%State%PipeRam1%ODDrillpipe_inBase) data%Equipments%BopControlPanel%LowerRamsCloseLED = LedOn data%State%BopStackInput%LowerRamsCloseLEDMine = LedOn data%Equipments%BopControlPanel%LowerRamsOpenLED = LedOff data%State%BopStackInput%LowerRamsOpenLEDMine = LedOff if (data%State%TD_BOP%BOPConnectionPossibility(4) == 1) then CALL CloseLowerRams data%State%PipeRam2%Situation_forTD= 1 ! closed - for TD code endif endif if (data%State%PipeRam2%IsOpening) then data%State%PipeRam2%ID=data%State%PipeRam1%IDBase data%Equipments%BopControlPanel%LowerRamsOpenLED = LedOn data%State%BopStackInput%LowerRamsOpenLEDMine = LedOn data%Equipments%BopControlPanel%LowerRamsCloseLED = LedOff data%State%BopStackInput%LowerRamsCloseLEDMine = LedOff CALL OpenLowerRams data%State%PipeRam2%Situation_forTD= 0 ! open - for TD code endif endif data%State%ShearRAM%IDPipeRam2Final= data%State%PipeRam2%ID ! for output data endif if (ramtype==4) then !for Choke Line if (data%State%ChokeLine%IsClosing) then data%State%ChokeLine%ID=(2.*(data%State%ChokeLine%NeededVolume- data%State%RAM(RNUMBER)%vdis_tot)*231./data%State%ChokeLine%Abop)+max(data%State%ChokeLine%ODDrillpipe_in,data%State%ChokeLine%ODDrillpipe_inBase) endif if (data%State%ChokeLine%IsOpening) then data%State%ChokeLine%ID=data%State%ChokeLine%IDBase-2.*(data%State%ChokeLine%NeededVolume- data%State%RAM(RNUMBER)%vdis_tot)*231./data%State%ChokeLine%Abop endif if ( data%State%RAM(RNUMBER)%vdis_tot>data%State%ChokeLine%NeededVolume) then data%State%ChokeLine%closed=1 data%State%BopStackAcc%pram_reg=data%State%BopStackAcc%pram_reg+data%State%RAMS%minloss(RNUMBER,17) data%State%RamLine%P_ACC= data%State%RAM(RNUMBER)%p_acccheck if (data%State%ChokeLine%IsClosing) then data%State%ChokeLine%ID=max(data%State%ChokeLine%ODDrillpipe_in,data%State%ChokeLine%ODDrillpipe_inBase) data%Equipments%BopControlPanel%ChokeLineCloseLED = LedOn data%State%BopStackInput%ChokeLineCloseLEDMine = LedOn data%Equipments%BopControlPanel%ChokeLineOpenLED = LedOff data%State%BopStackInput%ChokeLineOpenLEDMine = LedOff CALL CloseChokeLine endif if (data%State%ChokeLine%IsOpening) then data%State%ChokeLine%ID=data%State%ChokeLine%IDBase data%Equipments%BopControlPanel%ChokeLineOpenLED = LedOn data%State%BopStackInput%ChokeLineOpenLEDMine = LedOn data%Equipments%BopControlPanel%ChokeLineCloseLED = LedOff data%State%BopStackInput%ChokeLineCloseLEDMine = LedOff CALL OpenChokeLine endif endif endif if (ramtype==5) then !for Kill Line if (data%State%KillLine%IsClosing) then data%State%KillLine%ID=(2.*(data%State%KillLine%NeededVolume- data%State%RAM(RNUMBER)%vdis_tot)*231./data%State%KillLine%Abop)+max(data%State%KillLine%ODDrillpipe_in,data%State%KillLine%ODDrillpipe_inBase) endif if (data%State%KillLine%IsOpening) then data%State%KillLine%ID=data%State%KillLine%IDBase-2.*(data%State%KillLine%NeededVolume- data%State%RAM(RNUMBER)%vdis_tot)*231./data%State%KillLine%Abop endif if ( data%State%RAM(RNUMBER)%vdis_tot>data%State%KillLine%NeededVolume) then data%State%KillLine%closed=1 data%State%BopStackAcc%pram_reg=data%State%BopStackAcc%pram_reg+data%State%RAMS%minloss(RNUMBER,17) data%State%RamLine%P_ACC= data%State%RAM(RNUMBER)%p_acccheck if (data%State%KillLine%IsClosing) then data%State%KillLine%ID=max(data%State%KillLine%ODDrillpipe_in,data%State%KillLine%ODDrillpipe_inBase) data%Equipments%BopControlPanel%KillLineCloseLED = LedOn data%State%BopStackInput%KillLineCloseLedMine = LedOn data%Equipments%BopControlPanel%KillLineOpenLED = LedOff data%State%BopStackInput%KillLineOpenLedMine = LedOff CALL CloseKillLine endif if (data%State%KillLine%IsOpening) then data%State%KillLine%ID=data%State%KillLine%IDBase data%Equipments%BopControlPanel%KillLineOpenLED = LedOn data%State%BopStackInput%KillLineOpenLedMine = LedOn data%Equipments%BopControlPanel%KillLineCloseLED = LedOff data%State%BopStackInput%KillLineCloseLedMine = LedOff CALL OpenKillLine endif endif endif !if (ramtype==4) then !for annular ! if (AnnularIsClosing) then ! IDAnnular=((NeededVolumeAnnular-vdis_tot)*231./AbopAnnular)+ODDrillpipe_inAnnular ! endif ! ! if (AnnularIsOpening) then ! IDAnnular=IDAnnularBase-(NeededVolumeAnnular-vdis_tot)*231./AbopAnnular ! endif ! ! if (vdis_tot>NeededVolumeAnnular) then ! ! Annular_closed=1 ! p_acc= data%State%RAM(RNUMBER)%p_acccheck ! ! if (AnnularIsClosing) then ! IDAnnular=ODDrillpipe_inAnnular ! AnnularCloseLed = LedOn ! AnnularOpenLed = LedOff ! endif ! ! if (AnnularIsOpening) then ! IDAnnular=IDAnnularBase ! AnnularOpenLed = LedOn ! AnnularCloseLed = LedOff ! endif ! ! endif ! !endif end SUBROUTINE bop_codeAnnular(RNUMBER) use SimulationVariables use CBopControlPanel use SimulationVariables USE CEquipmentsConstants use SimulationVariables !@ implicit none INTEGER RNUMBER, I !Pannular_regset=min(AnnularRegulatorSetControl,1700.) ! for changing its set conditions instantaneously !==================================================== ! BOP back pressure without DP !==================================================== !if (bop_type==3) then !p_annular=510.725-(30.145*IDAnnular) data%State%AnnularComputational%p_annular=448-(19.7*data%State%Annular%IDAnnular) ! Q=flow ! endif data%State%RAM(RNUMBER)%clock=0 !======================Losses============================ data%State%RAM(RNUMBER)%loss_after=0 !initial value data%State%RAM(RNUMBER)%diffp_ram=1000 !initial value data%State%RAM(RNUMBER)%loss_before=0 !Q=0.0055; %initial flow rate (m^3/s) data%State%RAM(RNUMBER)%Q=data%State%RAM(RNUMBER)%flow !write(*,*) 'Q1=' , Q !write(*,*) 'tol=' , tol do while (abs( data%State%RAM(RNUMBER)%diffp_ram- data%State%RAM(RNUMBER)%loss_after)/ data%State%RAM(RNUMBER)%diffp_ram>data%State%Annular%tolAnnular) if (data%State%RAM(RNUMBER)%Bottles_Charged_MalfActive==.true.) exit ! while abs( data%State%RAM(RNUMBER)%diffp_ram- data%State%RAM(RNUMBER)%loss_after)>10 data%State%RAM(RNUMBER)%clock= data%State%RAM(RNUMBER)%clock+1 if ( data%State%RAM(RNUMBER)%clock>20) then ! tclock=clock data%State%Annular%tolAnnular=data%State%Annular%tolzeroAnnular+(floor( data%State%RAM(RNUMBER)%clock/10)-1)*.001 endif ! if (clock==1) continue if ( data%State%RAM(RNUMBER)%clock/=1 .and. data%State%RAM(RNUMBER)%loss_after> data%State%RAM(RNUMBER)%diffp_ram) then data%State%RAM(RNUMBER)%Q=data%State%RAM(RNUMBER)%Q-.1 elseif ( data%State%RAM(RNUMBER)%clock/=1 .and. data%State%RAM(RNUMBER)%loss_after<= data%State%RAM(RNUMBER)%diffp_ram) then data%State%RAM(RNUMBER)%Q=data%State%RAM(RNUMBER)%Q+.01 endif !====================Before Regulator========================= do i=1,data%State%AnnularComputational%NO_PipingsAnnularLine data%State%AnnularComputational%Re_ANNULARline(i)=data%State%RAM(RNUMBER)%Q*6.30902e-5*data%State%AnnularComputational%DIAM_ANNULARLINE_INCH(i)*0.0254/(data%State%AnnularComputational%AREA_ANNULARLINE(i)*nu) enddo do i=1,data%State%AnnularComputational%NO_PipingsAnnularLine if (data%State%AnnularComputational%Re_ANNULARline(i)