/ Title: Static and dynamic pipelay analysis with J-Lay method in 2000 m water
/ PLDYN test input file: SI units [m,N,sec]

/ Copyright 2022 Ibrahim Konuk
/ model number =<100>=
/ filename = pldynJ5_combocircl.pi


set_param(echo_OFF);


flow_director(to_output="Pipelay new analysis with J-Lay on slope in 2000 m water");
flow_director(to_console="Pipelay new analysis with J-Lay on slope in 2000 m water");

/.......................................................................................
/ ......... first load required data from databases and execute new analysis ...........
/.......................................................................................


/ initial pipe profile determined:
/   given departure angle =<-72>=
/   given overband length =<60>=
/          sagband length =<2649.99>=
/        jlay tower angle =<-90>=
/   overband profile type =<circle>=
/         overband radius =<200>=
/      total model length =<3542.82>=
/             tensioner.x =<70>=
/             tensioner.y =<17.5>=
/             touchdown.x =<1666.44>=
/             touchdown.y =<-1999.63>=


file_operation(open,FILE_NAME=pldynJ5_newcircl);

/ file_operation(close);


/.......................................................................................
/ ............................ modify model 100 for curved route .......................
/.......................................................................................


 MODEL_SETUP(
/-------------------------------------------
 MODEL_NAME ="TEST_MODEL",
 TITLE ="Curved Route Analysis J-Lay",
/-------------------------------------------
                  MODEL_NUMBER = 100      ,
                 ANALYSIS_TYPE = 2        ,
                   CASE_NUMBER = 102      ,
              OPTIMIZATION_SET = 100      ,
                   CONTROL_SET = 100      );
/-------------------------------------------
/ Total value fields =<10>=
/ Total alpha fields =<2>=
/ Total key fields   =<1>=


 PIPELAY_MODEL(
/-------------------------------------------
 LABEL ="TEST",
/-------------------------------------------
                  MODEL_NUMBER = 100      ,
                   CASE_NUMBER = 102      ,
               ANALYSIS_METHOD = 4        ,
                 EQUIPMENT_SET = 100      ,
                     OCEAN_SET = 100      ,
                BATHYMETRY_SET = 100      ,
                      LOAD_SET = 100      ,
                    FIXITY_SET = 000      );
/-------------------------------------------



/ seabed bathymetry parameters ..........................................................

 BATHYMETRY_DATA(
/-------------------------------------------
 LABEL ="Test",
/-------------------------------------------
                BATHYMETRY_SET = 100      ,
                  SEABED_SLOPE = 05.00    ,
                 SLOPE_HEADING = 10.00    ,
               BATHYMETRY_FILE = "testing");
/-------------------------------------------


/ update route parameters ................................................................

 OCEAN_DATA(
/-------------------------------------------
 LABEL ="BLOCK_G",
/-------------------------------------------
		     OCEAN_SET = 100      ,
            DEFAULT_SEABED_SET = 100      ,
                   CURRENT_SET = 100      ,
                      WAVE_SET = 100      ,
                   WATER_DEPTH = 2000.00  ,
              SEA_WATER_WEIGHT = 1.024e+04,
                   ROUTE_ANGLE = 60.000   ,
                  ROUTE_RADIUS = 3000.0   ,
                    ROUTE_TYPE = 2        ,	/ circle route
               ARC_FROM_VERTEX = 400.00   );
/-------------------------------------------
/ Total value fields =<13>=
/ Total alpha fields =<1>=
/ Total key fields   =<1>=



 JLAYBARGE_DATA(
/-------------------------------------------
 LABEL ="SAIPEM 7000",
/-------------------------------------------
                  BARGE_NUMBER = 7000     ,
                    ROLLER_SET = 98       ,
                 BARGE_HEADING = 0.0      ,
                  BARGE_OFFSET = 00.00    ,
                   BARGE_PITCH = 0.0     );
/-------------------------------------------
/ Total value fields =<14>=
/ Total alpha fields =<1>=
/ Total key fields   =<1>=

MODEL_SETUP(ASSEMBLE,MODEL_NUMBER=100);

EXIT(CLOSEIFERROR);

 MODEL_SETUP(EXECUTE,MODEL_NUMBER=100);
 / first run

/ file_operation(close);

/.......................................................................................
/ .............................. modify model 100 for dynamic ..........................
/.......................................................................................


flow_director(to_output="Preparing for dynamic analysis");
flow_director(to_console="Preparing for dynamic analysis");

/ clean load set for conventrated force: force cannot be kept constant during dynamic analysis

 ELEMENT_DATA(delete,DISCRETE_FORCE);


 MODEL_SETUP(
/-------------------------------------------
 MODEL_NAME ="TEST_MODEL",
 TITLE ="Dynamic Analysis J-Lay with tensioner",
/-------------------------------------------
                  MODEL_NUMBER = 100      ,
                 ANALYSIS_TYPE = 2        ,
                   CASE_NUMBER = 103      ,
              OPTIMIZATION_SET = 100      ,
                   CONTROL_SET = 100      );
/-------------------------------------------
/ Total value fields =<10>=
/ Total alpha fields =<2>=
/ Total key fields   =<1>=


 PIPELAY_MODEL(
/-------------------------------------------
 LABEL ="TEST",
/-------------------------------------------
                  MODEL_NUMBER = 100      ,
                   CASE_NUMBER = 103      ,
               ANALYSIS_METHOD = 3        ,
                 EQUIPMENT_SET = 100      ,
                     OCEAN_SET = 100      ,
                      LOAD_SET = 100      ,
                    FIXITY_SET = 000      );
/-------------------------------------------


/ define bottom fixity to replace tension ...............................................

PIPE_FIXITY_SETS(
/-------------------------------------------------------------
  [FIXITY_SET,FIRST_NODE, LAST_NODE,FIXITY_CLA,     LABEL  ],
/-------------------------------------------------------------
  (       100,       100,       100,       100,    "TD#Z"  ) );
/-------------------------------------------------------------

 FIXITY_CLASS(
/-----------------------------------------------------------------------------------
  [CLASS_NUMB,       DOF,FIXITY_TYP, AMPLITUDE,    PERIOD,     PHASE,     LABEL  ],
/-----------------------------------------------------------------------------------
  (       100,         1,         1,       0.0,       0.0,       0.0,  "SEABED"  ) );
/-----------------------------------------------------------------------------------


/ assemble and execute ..................................................................

set_param(echo_ON); 

MODEL_SETUP(ASSEMBLE,MODEL_NUMBER=100);

MODEL_SETUP(EXECUTE,MODEL_NUMBER=100);


 / save some of the results from database to an OUTPUT databse ..........................

 set_param(echo_OFF);

/ gives number of record produced by this run:
NODAL_OUTPUT(SELECT,CASE_NUMBER=103);

NODAL_OUTPUT(delete,FROM_SELECTED);

/ gives time series for node position for one node:
NODAL_OUTPUT(SELECT,CASE_NUMBER=103,NODE_NUMBER=500);
NODAL_OUTPUT([save,TIME_STEP,NODE_NUMBE,X_COORD,DX_COORD,Y_COORD,DY_COORD,FROM_SELECTED]);

NODAL_OUTPUT(delete,FROM_SELECTED);

/ gives select nodal output for one time step and displays important fields:
NODAL_OUTPUT(SELECT,CASE_NUMBER=103,TIME_STEP=30.19500);

NODAL_OUTPUT([SAVE,TIME_STEP,NODE_NUMBE,X_COORD,DX_COORD,Y_COORD,DY_COORD,Z_COORD,DZ_COORD,FROM_SELECTED]);

/ gives select force output for one time step and displays important fields:
FORCE_OUTPUT(SELECT,CASE_NUMBER=103,TIME_STEP=30.19500);

FORCE_OUTPUT([save,TIME_STEP,NODE_NUMBE,AXIAL,X_FORCE,Y_FORCE,MY_MOMENT,MZ_MOMENT,ARC_LENGTH,FROM_SELECTED]);

/ roller forces at time step 
ROLLER_FORCES(SELECT,CASE_NUMBER=103,TIME_STEP=30.19500);

ROLLER_FORCES([save,ROLLER_ORD,X_FORCE,Y_FORCE,Z_FORCE,CONTACT_EL,LOCATION ,FROM_SELECTED,LABEL]);

ROLLER_FORCES(delete,FROM_SELECTED);

/ roller force time series for one roller
ROLLER_FORCES(SELECT,CASE_NUMBER=103,ROLLER_ORDER=8);

ROLLER_FORCES([SAVE,ROLLER_ORD,TIME_STEP,X_FORCE,Y_FORCE,Z_FORCE,CONTACT_EL,LOCATION ,FROM_SELECTED]);

ROLLER_FORCES(delete,FROM_SELECTED);

/ roller force time series for one roller
ROLLER_FORCES(SELECT,CASE_NUMBER=103,ROLLER_ORDER=8);

 flow_director(to_output=" *** test with model 100 completed ***");
 flow_director(to_console=" *** test with model 100 completed ***");


 file_operation(close);

/........................................................................................
/........................................................................................
/- end of file

NODAL_OUTPUT([DISPLAY,TIME_STEP,NODE_NUMBE,X_COORD,DX_COORD,Y_COORD,DY_COORD,Z_COORD,DZ_COORD,FROM_SELECTED]);

ROLLER_FORCES([DISPLAY,PENET,TIME_STEP,ROLLER_ORD,X_FORCE,Y_FORCE,Z_FORCE,CONTACT_EL,LOCATION ,FROM_SELECTED,LABEL]);

ROLLER_FORCES([DISPLAY,ROLLER_ORD,TIME_STEP,X_FORCE,Y_FORCE,Z_FORCE,CONTACT_EL,LOCATION ,FROM_SELECTED]);
