A scripted rule is an advanced operation rule that provides you with the ability to write your own Release Function rule so that you can perform complex calculations or address a complex set of constraints to arrive at a desired release. The scripted rule must be written in Jython, a Java implementation of the Python programming language. Python and Jython tutorials and book references can be found at www.python.org and www.jython.org.

To create a scripted rule:

  • Open the Reservoir Editor and select the Operations tab.
  • Select the operation set in which you want to use the scripted rule.
  • Right-click on a zone in the Zone-Rules tree and select Add New Rule… from the context menu.

  • The New Operating Rule dialog will open ("Figure: New Operating Rule Dialog - Script").

    Figure: New Operating Rule Dialog - Script


  • Select the release element for which you want the scripted rule to influence.
  • Set the Rule Type to Script.
  • Enter a name for your new rule and click OK.
  • The new Scripted Rule will appear at the bottom of the selected zone. The rule will be the selected node in the Zone-Rules tree and the edit panel will display the Scripted Rule Editor ("Figure: Scripted Rule Editor - "Default" Template"). And, as with state variables, the Text Editor pane of the Scripted Rule Editor will include the text of a template that provides the framework for your new rule script.

    Figure: Scripted Rule Editor - "Default" Template

Since a scripted rule is just another rule type to ResSim, all the rule management functions described in "Managing Rules", like renaming, deleting, and prioritizing, apply to scripted rules.