`RUN FILE BY S.DARDEL/ NDAR AUG 2014:

`SIMULATING A FLOODING TIMELINE WITH 2 CONSECUTIVE COMPARTMENT FLOODING

`USING COMMAND "LOAD FLOWC" AS  ALTERNATIVE TO DEFINING COMPLETE BERNOULLI's EQUATION.

`+USING CRTPT WITH SUBPARAMETERS "/TANK" "/INSIDE" and "/OPENING"

`**********

`DISCLAIMER

`This run file is an example and should be used 'as is'. No warranties are made on the calculations nor results

 

clear

proj INFLOW

read tanker.gf

 

enter pm

modify hull

margin 0

/

 

write tanker.gf1

quit

 

dr 4

vcg 6

so we lcg

 

crtpt (1) "breach_EXT" 50f 7.85s 3 /tank:CGS4.s /opening:0.5                  `declares exterior breach, opening 0.5mē, associated to tank CG4.s

crtpt (2) "breach_INT" 50f 4.70s 4 /inside:CGS4.s /tank:CGC4.c  /opening:0.5  `declares inner breach, associated to tank CG4.c, and protected by tank CG4.s

 

display (*) status profile, plan, body@50f /yesempty /sync

 

part CGS4.s

cont SEA

part CGC4.c

cont SEA

 

v HE,HI           `declare variables for heights of outer and inner breaches respectively

v COUNT=0         `a counter

v FLV1, FLV2      `declare variables for flooded volumes inside the two tanks

v t=0

v t-interv=10     `setting time interval to 10s

v minut

set minut = {t-interv} div 60  `convert to minutes

 

macro FL

set COUNT = {COUNT} plus 1  `counter

set t= {t} plus {t-interv}  `time increment

part hull

set HE = {HEIGHT}     `HE is monitoring the height of hull REFPT relative to external waterplane

part CGS4.s, CGC4.c

lozd flowc:0.1 MINUTE       `With CT = Cd.t with Cd=0.6, t=10seconds hence Ct=0.6*10/60=0.1

                          `Note that factor "SQRT(2.g)" is implicitly included by GHS. See LOAD FLOWC command for details

 

part CGS4.s

set HI = {HEIGHT}     `HI is monitoring the height of tank REFPT relative to internal waterplane

set FLV1 = {TVOLUME}

part CGC4.c

set FLV2 = {TVOLUME}

so                     `solve after change to tank volumes due to flowC

\{ t}  { FLV1:2}   { FLV2:2}  { HEEL:1}  { FREEBD:3}    `Goes into report

me (report) graph1.txt /append     `create a temp text file

me me {t} {FLV1} {FLV2}            `Goes into temporary txt file for custom plot

me (report) off

me (report) graph2.txt /append

me me {t} {HEEL} {FREEBD}    `Goes into temporary txt file for custom plot

me (report) off

 

wait 0.5     `create a 1s interval between increments

if {HE} >= {HI} then exit       `will stop the loop when HE equates HI (ie internal and external waterplans coincide

exit fl    `creates the endless loop. Only stopped with IF condition above

/

 

 

report flow /box:color         `start a report

 

me repstart                     `Custom report. See MESSAGE command help for further enhancement

\FLOODING TIMELINE\

\

part CGS4.s,CGC4.c

\Flooded tanks: {PNAME}    `list the flooded tank names

\

\TIME  FLOOD VOL 1  FLOOD VOL 2    HEEL      FREEBOARD        `creates custom table

\ (s)-----(m3)---------(m3)-------(deg)--------(m)

.FL                                                           `executes macro FL

\Units SI---\

\

me reptitle

\Equilibrium after flooding reached after {t} seconds\

\

me repend

st /vol /we

page

display (*) status profile, plan, body@50f /yesempty

 

me plotstart "Flooding Timeline - Flooded volumes"             `Custom Plot. See MESSAGE command help for further enhancement

me plotlabel "Time (s)", "Flood vol. 1(m3)", "Flood vol. 2(m3)"

run graph1.txt /call                        `Use plot data from txt file created above

me plotend

 

me plotstart "Flooding Timeline - Heel and Freeboard"             `Custom Plot. See MESSAGE command help for further enhancement

me plotlabel "Time (s)", "Heel (deg.)", "Freeboard (m)"

run graph2.txt /call                        `Use plot data from txt file created above

me plotend

 

erase graph1.txt    `delete the temp files

erase graph2.txt

 

print report /preview