Batch processing: Script commands

The script commands are executed in the context of an active model. This can be either an OrcaFlex model containing vessels, lines etc., or a fatigue analysis. The active model defaults, at the start of script execution to being an OrcaFlex model. The active model can change due to a Load/LoadData command, or following a NewModel/NewVariationModel/NewRestartAnalysis/NewFatigue command. Some of the commands have different interpretations, depending on what type of model is active, as described below.

The following batch script commands are available. You need to put quotes round file names or other parameters that include spaces or non-alphanumeric characters.

Load <FileName>

Opens the OrcaFlex file named <FileName>. The file can be a data file, a simulation file or a fatigue analysis file.

LoadData <FileName>

Opens the data from the OrcaFlex data file named <FileName>.

RunStatics <FileName>

Perform statics for the current model and save the resulting simulation to <FileName>. After the file is saved the model is reset.

RunDynamics <FileName>

Run dynamics for the current model and save the resulting simulation to <FileName>. After the file is saved the model is reset.

Note: We no longer recommend that you use the RunStatics and RunDynamics commands. The commands in a batch script are executed sequentially. This means that if your machine has multiple processors, those processors will not be fully utilised. The recommended approach is to use the batch script to generate OrcaFlex data files and then add those to the batch job list. This will result in the most effective use of processor resources.

Run <FileName>   (OrcaFlex model active)

This command is identical to RunDynamics.

Run <FileName>   (Fatigue active)

This command:

  1. Performs the fatigue analysis.
  2. Saves the results to <FileName> which should have the .ftg extension.
  3. Saves tabular results to an Excel workbook with the same name, but an .xlsx extension.

Save <FileName>   (OrcaFlex model active)

Save the current model to <FileName>. If calculation results (either statics or dynamics) are available then a simulation file will be saved. Otherwise a data file will be saved. When saving data, if the file extension is .yml then a text data file will be saved; otherwise a binary data file will be saved.

Save <FileName>   (Fatigue active)

Saves the fatigue model to <FileName> which should have the .ftg extension.

SaveData <FileName>

Save the data from the current model to <FileName>.

If the file extension is .yml then a text data file will be saved; otherwise a binary data file will be saved.

Note: In the Load/LoadData, Save/SaveData and RunStatics/RunDynamics/Run commands, if <FileName> is a relative path then it is taken to be relative to the directory from which the script file was loaded.

ExtendSimulation <StageDuration>

Adds a new stage of length <StageDuration>. This command is equivalent to the Calculation | Extend dynamic simulation menu item. You would normally follow this command with a Save command.

Reset

Resets the current model. This command is equivalent to the Calculation | Reset menu item.

NewModel

This command makes the active model an OrcaFlex model, deletes all objects from the model and then resets data to default values. This command is equivalent to the File | New menu item.

NewVariationModel <ParentFileName>

This command makes the active model an OrcaFlex model, and creates a new variation model, tracking changes against the specified parent model. This command is equivalent to the File | New variation model menu item.

NewRestartAnalysis <ParentFileName>

This command makes the active model an OrcaFlex model, and creates a new restart analysis, restarting from the specified parent model. This command is equivalent to the File | New restart analysis menu item.

NewFatigue

This command makes the active model a fatigue analysis and then resets data to default values. This command is equivalent to the fatigue analysis File | New menu item.

Create <ObjectType> [<ObjectName>]

Creates a new object of type <ObjectType>. The new object is automatically selected which means that subsequent assignment commands apply to this new object.

The <ObjectType> parameter can be "Line type", "Vessel type", "Line", "Winch" etc. Select Edit | Add from the model browser menu to see a list of possible values for this parameter.

Alternatively variable data sources can be created by setting the <ObjectType> parameter to "Bending stiffness", "Drag coefficient" etc. The list of possible variable data source object types can be found in the data source type tree on the variable data form.

If the optional <ObjectName> parameter is included then the new object will be given that name.

Delete <ObjectName>

Deletes the object called <ObjectName>.

Select [<Object Type>] <ObjectName>

Specify the object to which subsequent assignment commands will apply.

The <ObjectType> parameter is optional, and by default is 'object', meaning select the named object. <ObjectName> must then be either the name of an object that exists in the current model or one of the reserved names 'General' (for the general data form) or 'Environment' (for the environment data form).

Some examples of the select and assignment commands are given in examples of setting data.

Other <ObjectType> values only need to be specified in the following special cases.

If the environment has been selected and there is more than one wave train, then before you can specify any wave train data you must give another select command to select the wave train. This second select command has the form:

Select WaveTrain <WaveTrainName>

So, for example:

Select Environment
  Select WaveTrain Primary
    WaveDirection = 30.0

Similarly, if the environment has been selected and there is more than one current data set, then you must select one of them before specifying any current data. For example:

Select Environment
  Select Current Current2
    RefCurrentDirection = 270.0

Note that this is not the same as setting the active current. In fact, you should avoid setting up multiple current data in batch scripts if possible: this is best done interactively on the environment form.

If a vessel type has been selected and it has more than one draught, then before specifying any draught-dependent data you must give another select command that selects the draught. This second select command has the form:

Select Draught <DraughtName>

Before specifying data for RAOs you need to specify the type of RAOs – this can be Displacement, WaveLoad or QTF. This is done with a command of the form:

Select RAOs <RAO type>

Similarly, before specifying vessel type data for a given wave direction you must give another select command to select that direction. This takes the form:

Select Direction <Direction>

So, for example:

Select "Vessel Type1"
  Select Draught Transit
    Select RAOs Displacement
      RAOOriginX = 10
      RAOOriginY = 0
      RAOOriginZ = 2
      Select Direction 45
        RAOSurgeAmplitude[2] = 0.1
      Select Direction 90
        RAOSurgeAmplitude[2] = 0.16

When a fatigue analysis is active, you need to select S-N and T-N curves before assigning their data. For example:

Select SNcurve "S-N Curve1"
  SNDataA = 23.0
Select TNcurve "T-N Curve1"
  TNcurvem = 2.8

Note: Indentation with spaces or tabs is optional, but makes scripts more readable.

Assignment

Assignment commands take the form

DataName = Value

The DataName on the left-hand side must be one of the recognised data names and the named variable must exist in the currently selected object. The Value on the right-hand side must be in the appropriate form for that variable (i.e. numeric or text) and it must be given in the same units as used in the current model.

For example:

Select Vessel1
  Length = 110
  Draught = "Operating draught"

If DataName is the name of a variable that appears as a check box in OrcaFlex then the Value should be Yes or No. For example:

Select Environment
  CurrentRamp = Yes

If DataName is the name of a variable that appears in a table in OrcaFlex, then its row number must be given. The row number is given as an index enclosed by either square or round brackets (do not mix them on the same line), and is always 1-based, i.e. [1] is the first row of the table. Note that this sometimes requires care, since in OrcaFlex the table might not be 1-based. For example, when setting the prescribed motion for a vessel, the command

PrescribedMotionVelocity[2] = 4.8

sets the velocity in the second row of the table, but in this case the first row of the table is stage 0 (the build-up stage) so this command (slightly confusingly) sets the velocity for stage 1.

More examples of the select and assignment commands are given in examples of setting data.

InvokeWizard

Sets the data for the selected object using either the line type wizard or the plasticity wizard. The selected object must be either a line type or a bend stiffness variable data source. The input data for the wizard should first be set using data assignment commands.

An example of how to use this command is given in examples of setting data.

InvokeLineSetupWizard

Invokes the line setup wizard calculation. The input data for the wizard should first be set using data assignment commands.

An example of how to use this command is given in examples of setting data.

WaveSearch <FileName>

Exports the wave search spreadsheet to the specified file. The file can be an Excel spreadsheet (.xlsx or .xls), a tab-delimited file (.txt) or a comma-separated file (.csv). The file type is chosen based on the file extension that you specify. The input data for the wave search should first be set using data assignment commands.

DisplacementRAOsReport <FileName> [<VesselName>]
SpectralResponseReport <FileName> [<VesselName>]

Exports the vessel response report spreadsheets to the specified file for the specified vessel. The file can be an Excel spreadsheet (.xlsx or .xls), a tab delimited file (.txt) or a comma separated file (.csv). The file type is chosen based on the file extension that you specify. If no vessel is specified, and there is only one vessel in the model, then that vessel will be used. The input data for the response reports should first be set using data assignment commands.

SHEAR7DataFile <LineName> <FileName>

Exports to <FileName> a SHEAR7 data file for the line named <LineName>.

SHEAR7MdsFile <LineName> <FileName> [<FirstMode> <LastMode>] [<IncludeCoupledObjects>]

Exports to <FileName> a SHEAR7 modes file for the line named <LineName>.

The <FirstMode> and <LastMode> parameters are optional. If they are specified then mode numbers in the range <FirstMode> to <LastMode> inclusive are exported. If these parameters are omitted then all modes are exported.

The <IncludeCoupledObjects> parameter is optional. If specified it determines whether or not coupled objects are included in the modal analysis. If omitted, coupled objects are not included.

Only the transverse and mostly transverse modes are included in the exported file. If you have specified first and last modes to export, then these mode numbers refer to the transverse and mostly transverse modes. OrcaFlex takes the following steps:

  1. Calculate all modes.
  2. Sort the modes into order of decreasing period / increasing frequency.
  3. Remove all modes which are not transverse or mostly transverse.
  4. Export the modes in the range <FirstMode> to <LastMode> inclusive.
Note: If you have specified that SHEAR7 is to analyse inline response, then inline and mostly inline modes are exported.

SHEAR7OutputFile <LineName> <FileName>

Exports to <FileName> the SHEAR7 output file for the line named <LineName>. The file extension that you specify (e.g. .out, .plt etc.) is used to determine which output file is exported. This command is only available if the SHEAR7 interface is in use.