View this message online  |  Forward to a friend  |  Share:      

Exclusive KBC prizes waiting to be won!

Look out for our fortnightly "Software Tip" which provides some useful tips that could potentially
save you time and produce unexpected results at your fingertips. Contest details below.

Tip 1: Creating a Script Property in Petro-SIM


Does your company or institution have unique stream property correlations?  Would you like to implement these in Petro-SIM™ so they can be calculated instantly alongside other stream properties?


Petro-SIM™ has a wealth of stream properties relevant to the Upstream and Downstream industries which are natively available to you.  Many industry standard index properties are also included in this list, such as smoke point index, viscosity index, RVP index, and cold flow property indices.  However, there are times when you may have different indices, proprietary stream property correlations, or want to derive a new stream property, and wish to model these in Petro-SIM™. 

This can be done with a user-defined script property in Petro-SIM™.  Script properties can be used in other parts of your simulation just like any other stream property.


In the following section, brief steps show how to create a user-defined script property and implement it in a stream.  If you have further questions on how to create and use a script property, please feel free to contact the KBC software helpdesk (

  1. Open the Property Manager and scroll to Script Properties in the list. 

  2. Click the Add new script property  button to create a blank script property.

  3. Notice that an example template provides syntax, layout, and sequencing for you to follow when writing your script property.
  4. Begin writing out the script property using the following steps: 

    • Define variables
    • Test for empty values
    • Calculate property
    • Report results  

    The script below is used to sum up the total amount of 2-butenes in a stream.

  5. The first step is to define variables and call them into the script.  Define new variables “cis” and “trans” in the script, as seen below. 

  6. Assign values to these new variables by clicking Stream Values... and choosing values from the list.

  7. Select cis2-Butene By Wt and trans2-Butene By Wt, ensure that the units dropdown is set to the correct units for the variables to match with the calculations that will be performed, and choose Paste To Script so they are assigned to “cis” and “trans”.

  8. The next step is to test whether the variables have values. The command “<> PSEmpty” allows you to test whether a variable has a value, as seen below.  All variables are tested to ensure the calculation can proceed.

  9. If they do, then the calculation will be performed.  Otherwise, <empty> will be returned for the script property.

  10. The result and its units are then defined based on the calculation just performed.

  11. Select a Test Stream with which to validate the new script property.  Then click Run and verify the Result and Units in the window.  In this case, a mixed C4 stream called “BB” is selected.

  12. Notice it returns a value of 29.3448 wt%.  Upon checking the 2-butene values in the actual “BB” stream, the same value is obtained for the sum of tr2-Butene and cis2-Butene.

  13. Once the script property result has been validated, it can be attached to a stream by clicking on the Append New Property  button available on the Properties page on the stream itself.

  14. Scroll to the section called Script Properties, and expand this entry to show the new script property, 2 Butenes By Wt.  Click on this property, then click Apply and Close.  Scrolling to the bottom of the list of Properties in the “BB” stream list, you can see 2 Butenes By Wt [wt%] has been added.

  15. This property can then be used in other parts of the simulation just like any other stream property, including the LP Utility.  
  16. The use of script properties can easily be extended to more complex property correlations and include various logic statements.  

    Note:   The default scripting language used in Petro-SIM™ is VBScript.  However, if you prefer a different scripting language, such as Java, you may define this at the beginning of the script.

We will be checking on how well you do by asking some simple questions in November. Three lucky winners will be picked and receive KBC exclusive prizes. Do keep a look out for our periodic email.

Visit our TECHNOLOGY page for more information


Contact Us:
EMEIA: +44 (0) 1932 242424
AMER: +1 281 293 8200

APAC: +65 6735 5488  |

Connect With Us:


KBC has a unique blend of talent, experience and capabilities that allows us to provide a full spectrum of services to our clients, including strategic investment support, asset optimisation and sustainable workforce development. With KBC's market-leading software solutions and intellectual property, clients can capture the information needed to realise millions of dollars of profit improvement through process modelling of all aspects of oil and gas production fluids through upstream and downstream processing.

Copyright © 2015 KBC Advanced Technologies plc. All rights reserved.
42-50 Hersham Road, Walton on Thames KT12 1RZ, UK
This email was sent to Joanne at because you expressed an interest in KBC Advanced Technologies.
Click here to opt out