Script Scenarios
One of the strengths of Enersight lies with the ability to compare scenarios. Quite often users will take a scenario, copy it, make modifications in that copy and then compare these changes with the base version. Scenario scripting in Enersight streamlines this process by enabling you to write text scripts to modify specific project variables. Users can write a single line of text code that generates a new scenario. Since the scripted scenario is dependent on a base version, changes can be made in the base version and the scripted version updates when you click calculate. This can be very useful when repeatably looking at different views of a base case, such as sensitivity testing, or viewing unconstrained and constrained side by side. They can also now be automatically saved to a PDS, allowing for streamlined recovery of previously undertaken analysis.
Script scenarios can be accessed in the Scenarios tab.
Click image to expand or minimize.
Individual scripts may be created, or multiple scripts including multiple command lines each may be copied and pasted into the interface.
Click image to expand or minimize.
Below is a summary of each of the inputs when create a script scenario.
Scenario Details
- New Scenario Name: Name of the script scenario
- Source Scenario: Target scenario that you wish to modify
Change Details
Available inputs:
- Blank: Script scenario will target all assets in the source scenario
- Asset name: Entering a specific asset name will apply to that single asset
- UserDataFieldName: Value|Value|Value – i.e., Reservoir: a|b applies to all assets that match the user data fields Reservoir = a or b
Command: Specify a command to modify the source scenario. A list of available commands is shown in the under the Commands link in the Scenarios tab or viewable here .
Arg #: Includes multipliers for risking, on/off identifiers, or data unique to the argument.
Saving Details (Optional)
- Result Asset Name: The name of an asset within the scenario from which the results will be recorded. Blank = Scenario Level Results. All = All Assets. Multiple discrete assets may be selected with their names being separated by the ‘|’ character. To Target an Auto-Added Asset you must start your results list with ‘Auto:’
- PDS Name: The name of a PDS that the results of the calculation will be stored in
- PDS Version: The name of a PDS Version the results of the calculation will be stored in
- PDS Prefix: The results will create an opportunity in the PDS Version prefixed with this string. i.e., MyPDSPrefix_PriceHigh [Optional]
After populating all of the required inputs, the script scenario will appear in the list of scenarios, and must be calculated to see results. A script scenario will be dependent upon the Source Scenario that is specified in the inputs and the data can only be accessed if the source scenario is also calculated. This dependency can be removed by converting the script scenario to a permanent scenario by clicking the icon next to the scenario name. Subsequently deleting the scenario will restore it to be script based.
The results from a script may also be cleared using the Refresh button.
Click image to expand or minimize.
Risk Scripting Examples
Selecting multiple fields with user data:
Click image to expand or minimize.
Adjust rate and reserves for a specific type curve area:
Click image to expand or minimize.
Using Uploaded Excel Files in Scripts
In Enersight 2.17, three new scripting commands were added: DrillingProgram:WellList, Resources:ReplaceAll, and UserDataTable:Replace. All three of these allow references to Excel files that have been uploaded to the Enersight Documents library to provide a Script Scenario/Risk Script run with a different set of inputs, a different Well List, Resource Definition, or updated User Data Table values. This capability provides more flexibility in the changes that can be made to a model during a script run.
Uploading a Document
These commands rely on an Excel document that has been uploaded into Enersight using the Enterprise > Documents menu entry.
To upload Excel files that can be used in scripts, click Choose File to find your file, give it a name, and choose ScenarioScriptingInputs as the document type. Check the Public to Company Users checkbox if you want all users to be able to access this file. Otherwise only the uploader will be able to see and use it. Click Upload to add a new file to the documents library or click Upload and Replace.
DrillingProgram:WellList Example
To replace a Well List in a script run, use the command DrillingProgram:WellList. This will replace the entire well list with the definition provided in the uploaded Excel file.
Command: DrillingProgram:WellList
Argument 1: Document Name (not the file name, but rather the name in the 'Name' column of the Documents screen).
Argument 2: Drilling Program Name.
Argument 3 (optional): Worksheet name. You can have multiple Well Lists in the same workbook. Defaults to the first sheet in the workbook if there is no input here.
Resources:ReplaceAll Example
To replace the Resource Definitions in a script run, use the command Resources:ReplaceAll. This will replace the entire set of Resources with the definition provided in the uploaded Excel file.
Command: Resources:ReplaceAll
Argument 1: Document Name (not the file name, but rather the name in the 'Name' column of the Documents screen).
Argument 2 (optional): Worksheet name. You can have multiple Resource Definitions in the same workbook. Defaults to the first sheet in the workbook if there is no input here.
UserDataTable:Replace Example
Using the command UserDataTable:Replace, you can update the values in an existing User Data Table. Note that you cannot create new User Data Tables or append new values to an existing table using this command. All values will be replaced with those provided in the uploaded Excel file. Be aware that the Comments column must exist in your Excel file even if it is empty.
Command: UserDataTable:Replace
Argument 1: Document Name (not the file name, but rather the name in the 'Name' column of the Documents screen).
Argument 2: Name of User Data Table.
Argument 3 (optional): Worksheet name. You can have multiple User Data Tables in the same workbook. Defaults to the first sheet in the workbook if there is no input here.