SMS:Command Objects

From XMS Wiki
Jump to navigationJump to search

Command objects provide the ability to provide additional commands for TUFLOW simulations using the TUFLOW command file syntax. The SMS interface provides some guidance for using these commands and allows linking to objects created in SMS. Command objects can be used for:

  • Create scenarios to do multiple runs using the same simulation.
  • Share commands between multiple simulations or 2D geometry components.
  • Utilize commands not available in the SMS interface.
  • Enter commands to read GIS data generated outside of SMS.

TUFLOW command object syntax is described in the TUFLOW manual. Each line (except for blank/comment lines) has a command identifier. After the identifier most commands have are followed by a double equals “==” and a command value. In some cases, the command value may have multiple parts separated by blank spaces or “|.” A few commands don’t have any arguments and do not have a “==” at all.

Types of Commands

There are several kinds of commands that can be utilized through command objects. The types of commands that can be issued used include: 2D model control commands (*.tcf), 1D model control commands (ecf), 2D geometry commands (tgc), Boundary conditions commands (*.tbc), and commands for specific events (*.tef). The event commands are defined with each event when using composite events. The rest are managed in the project explorer as command objects.

The appendix of the TUFLOW manual contains a complete list of the commands that are available, the purpose of each command, and its syntax. The identifiers above in parentheses (*.tcf, *.ecf, *.tgc, *.tbc, and *.tef) are the abbreviations used by TUFLOW for file naming and also used to find the appropriate section of the appendix for a set of commands.

Creating Command Objects

Command objects are created using right-click commands in the Project Explorer. After creating a TUFLOW simulation, a folder named “TUFLOW Command Objects Folder.svg Command Objects” in the TUFLOW root folder should appear. Create command objects by right-clicking on the “TUFLOW Command Objects Folder.svg Command Objects” folder, choosing Create Command Object, and choosing the appropriate type from the submenu. This will create a folder for command objects of this type along with a new command object TUFLOW Command Object Icon.svg. This approach can be repeated to create additional command objects of the same or different type.

Editing Command Object Contents

TUFLOW object Command Editor dialog

When command objects are first created, their contents are blank. Edit the contents of a command object by double-clicking on the object, or right-clicking and choosing Edit Commands. This will bring up the Command Editor dialog.

The Command Editor dialog has two main parts. One part consists only of a text editor. The text in this editor is what is stored with the command object and will be used with the TUFLOW model. The commands for the object may be typed directly into the editor. Comments may be added and must start with the exclamation mark (!).

The other part of the dialog contains controls to assist in creating commands for the command object. There is a control showing the list of commands in a tree structure organized by the appendix where the command is found in the TUFLOW manual. This part of the dialog will also contain other controls based upon the command that is selected in tree control. For example, if the command requires a single floating point value a edit control will show where to specify the value for the command.

Once the command creation controls have been specified as desired, the command is inserted into the command text using the insert button. Once this has been done, editing of the command must be done in the editor. It is not possible to edit commands already created using the create command controls. Delete an existing command and insert another to use the controls to setup the command text.

Using Command Objects in Simulations

With the exception of event command objects (discussed later), command objects are used by creating links to the objects from simulations and geometry components. Links are created by dragging the command object under the simulation object. 2d model control command objects and 1d model control command objects are linked to simulations. 2D geometry commands and boundary condition commands are linked to 2D geometry components.

When a command object is linked to a simulation or geometry component, SMS writes a file with the exact text from the command object and links to the file from the TCF or TGC file as appropriate. Command objects are always used after any commands specified in the SMS interface and therefore will override duplicate specifications. Multiple command objects can be linked to the same object and will be used in order from top to bottom. Command objects can override settings defined in command objects used previously.

Scenarios in Command Objects

TUFLOW command objects can define scenarios in order to setup multiple models that have shared data without the need for separate simulation objects. Anything not specified for one or more scenarios is used in all scenarios for the simulation. Scenarios could be used to model different geometries by including z-lines or tins for specific scenarios but not others.

Scenarios can only be defined using command objects. Scenarios are defined by using the following commands:

  • If Scenario
  • Else If Scenario
  • Else
  • End If

A scenario block must start with “If Scenario” and end with “End If.” The other commands are optional.

Related Topics