$ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
$
$   This is a sample of how to perform a transportation analysis with the
$   MOSES native commands similar to that done by the transporation tools.
$   It produces most of the output the tools produce.  There really is
$   many more loops needed, and more variable needed to reproduce what
$   installation tools do.  Here we are just trying to show that there
$   really is a great deal of work at keep track of just what are is
$   needed for a bare-bones transporation analysis.
$
$ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
&device -oecho no -silent yes
&dimen -dimen feet kips
&env -depth 91
inmodel -offset
$
$   put barge at 10ft draft leave the barge deck at 10ft above MWL.
$   put jacket 5 above barge deck
&describe part jacket -move 200 0 25 0 0 0
&instate -locate tow_brg    0 0 -10 000 0 0    
$
$  ****************     Use model edit to make connections between 
$                       barge and jacket.  Need connectors so the 
$                       jacket loads can be transfered to the barge.
medit
$  ****************     Classes for cans and tiedowns  
~vert    tube 20 1
~tiedown tube 20 1
$  ****************     Sea fastening
$                       Do not release moment at barge end
&describe part can pconnect
 pconnect  0  0  -5 ~vert -rela my mz  *db1 *b@
 pconnect  0  0  -5 ~vert -rela my mz  *db2 *b@
 pconnect  0  0  -5 ~vert -rela my mz  *db3 *b@
 pconnect  0  0  -5 ~vert -rela my mz  *db4 *b@
end_medit
$
$
$                       
$  ****************     Add mass to put body in equilibrium
$                       body is barge, jacket, cans, and tiedowns
&describe process still
&weight -compute tow_brg 10 .32*90 300*.29 300*.29
&equi -ignore x y rz
&equi -ignore
&event_store 1
$
$
$                       
&describe process tran|a
medit
&describe part tiedown pconnect
pconnect  4  4 -5 ~tiedown *db1 *b@
pconnect  4 -4 -5 ~tiedown *db1 *b@
pconnect -4  4 -5 ~tiedown *db1 *b@
pconnect -4 -4 -5 ~tiedown *db1 *b@
$
pconnect  4  4 -5 ~tiedown *db2 *b@
pconnect  4 -4 -5 ~tiedown *db2 *b@
pconnect -4  4 -5 ~tiedown *db2 *b@
pconnect -4 -4 -5 ~tiedown *db2 *b@
$
pconnect  4  4 -5 ~tiedown *db3 *b@
pconnect  4 -4 -5 ~tiedown *db3 *b@
pconnect -4  4 -5 ~tiedown *db3 *b@
pconnect -4 -4 -5 ~tiedown *db3 *b@
$
pconnect  4  4 -5 ~tiedown *db4 *b@
pconnect  4 -4 -5 ~tiedown *db4 *b@
pconnect -4  4 -5 ~tiedown *db4 *b@
pconnect -4 -4 -5 ~tiedown *db4 *b@
end_medit
$
$                       
$  ****************     Add mass to put body in equilibrium
$                       body is barge, jacket, cans, and tiedowns
&weight -compute tow_brg 10 .32*90 300*.29 300*.29
&equi -ignore x y rz 
&equi -ignore
&event_store 2
$
$ *****************    Write many of the summary model reports
&status param -hard
&summary
   &rep_sel -part tow_brg 
   compart_sum piece
   &rep_sel -selall
$
   &rep_sel -part jacket 
   categ
   beam_sum scf vortex -w_velocity 40
   &rep_sel -selall
   class dimension material
$
   &rep_sel -part tiedown
   beam properties ends
   &rep_sel -selall
end
&status sn -hard
$
$  ****************     Make some pictures
&picture iso
&picture starb
&picture bow
&picture top
$
$  ****************     Hyrostatics: righting and wind arm calculations
hstatic
   rarm 2 25 -wind 100
      report
      plot 2 6 8 -rax  10 -no
   end
end
$  ****************     Transporation configuration summaries
&status configur  -hard                         
&status b_w -hard
&status force -hard
&status compart -hard
&status cat -hard
&status draft -hard
$
$  ****************     Calculate the hydrodynamic database
hydrodynamics
   g_pressure tow_brg -heading 0 45 90 135 180 225 270 315 \
                    -period  4 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 13 15 20
end_hydrodynamics
$
$  ****************     Set up the environments
&data env
   env h090 -sea issc  90 5 10 -use_mean yes
   env h135 -sea issc 135 5 10 -use_mean yes
   env h180 -sea issc 180 5 10 -use_mean yes
   env s090 -sea issc  90 4 11 -use_mean yes
   env s135 -sea issc 135 4 11 -use_mean yes
   env s135z -sea issc 135 4 11 -use_mean no 
   env s180 -sea issc 180 4 11 -use_mean yes
   env v090 -sea issc  90 6 12 -use_mean yes
   env v135 -sea issc 135 6 12 -use_mean yes
   env v180 -sea issc 180 6 12 -use_mean yes
end
$
$  ****************     Frequency-response (i.e. linearized analysis)
freq_response
$
$  ****************     calculate Response Amplitude Operators
 rao                   
$  ****************     report at body apparent cg
$                       i.e. system cg
 fr_point &body(a_cg tow_brg -b)                       
    report                                         
 end
$
$  ****************     report the forces at the cg of jacket
 fr_point &part(cg jacket -b)                       
 end
$
$  ****************     calculate force response
   fr_fcargo
   end
$
$  ****************     report the forces at the cg
$                       need a loop to have a report for
$                       each environment defined
&loop ename (h090 s090 v090 h135 s135 v135 h180 s180 v180 )
 &subtitle Environment %ename
 &env %ename
 st_fcargo %ename  
    report                                         
 end                                               
&endloop
&subtitle 
$
$  ****************     report the forces at the cg for a range of
$                       mean spectral periods
$                       we need to use the -sea option because the
$                       period used to define the environment needs to
$                       be the smallest of the list of periods
&loop jjj (180 135 90)
 &subtitle Head %jjj Unit Wave Height
 st_fcargo -sea issc %jjj 1 4 \
           -e_period 18 17 16 15 14 13 12 11 10 9 8 7 6 5 
    plot 1 2  3 4 -rax 5 6 7 -no
    report
 end                                               
&endloop
$
$  ****************     exit the frequency domain menu
end_freq_response
$
$  ****************     clear some entries
&env none  
&subtitle 
$
$  ****************     make list of parts for structural analysis
&select :no_tie -select jacket  can
&select :parts  -select jacket tiedown can
$
$  ****************     start structural analysis
$&describe process still 
$&describe process tran|a
struct
$
$  ****************     make load cases based on RAOs
   lcase -process loadouta 1
$   s_rest ~\$wat@ ~tre@
   s_rest ~\$vlway ~\$wat@ ~tre@ ~r_barge@
   s_part tow_brg @ jacket @ can @
   ssolve -nonlinear 
end
$
&describe process tran|a
struct
   lcase -rao a
   s_rest ~\$vlway ~\$wat@ ~tre@ ~r_barge@
   s_part tow_brg @ lway @ jacket @ can @ tiedown @  
   reduce 
   ssolve  -nonlinear                  
end
$
$
$  This just makes spectral load cases.  
$  It does not take care to include the wind.
$  Does not care about signs.
strpost
   &select :j_only -select @ -except ~barge ~tiedown ~vert
   cases -spect s090 s135 s180 h090 h135 h180 v135 v180 v090 s135z
$
   cases -combine mean frqmeana 1
$  Here is where it cares about the sign 
   cases -combine s135as loadouta 1 s135z  1
   cases -combine s135au loadouta 1 s135z -1
$
   cases -amod 1.33 s090 s135 s180 h090 h135 h180 v135 v180 v090 s135as s135au
   &select :load -s static  s090 s135 s180 h090 h135 h180 v135 v180 v090 loadouta
   &subtitle ALL AVAILABLE LOAD CASES
   &status r_case -hard
   &subtitle LOAD CASES WE ARE INTERESTED IN
   &status r_case -load :load -hard
   &status amod -hard
   &subtitle STILL WATER LOAD CASES
   beam code -load loadouta   -class :j_only
   beam code -load loadouta   -class ~vert
   &subtitle  SUMMARY OF ENVIRONMENT SPECTRAL LOAD CASES
   beam code -load :load -class :j_only
   &subtitle  S135 SPECTRAL LOAD CASE
   beam code -load loadouta -class :j_only $ -ele b1
   beam code -load s135as   -class :j_only $ -ele b1
   beam code -load s135au   -class :j_only $ -ele b1
   &insert ../data/env.dat
   cases -process tran|a -fatigue TOW
   &subtitle ALL PARTS
   beam nt_fatigue
   beam nt_fatigue -class :j_only
end
&picture iso -type struct -color ratio
&finish
