User Property Calculations

From SysCAD Documentation
Jump to navigation Jump to search

Navigation: User Guide ➔ Edit ➔ Project Configuration (cfg File) ➔ Calculation Configuration ➔ User Property Calculations

Edit Configuration Step 2 of 2 - Calculation Tab
Calculation Configuration (Summary) User Property Calculations User Property Expressions Species Calculations Species Calculation Expressions


User Property Calculations

The user may add any number of User Property Calculations to the configuration file. These calculations will be displayed on the Qi/Qo tab of the Pipe, Qo tab of the DirectLink and QFeed/QProd tab of many unit operations' Access Window. They will also be shown on the Content tab of dynamic units with surge. The calculations will be performed on solve or run.

Adding a New Calculation to the Configuration File

UserPropCalc.png
Button Small 1.png On the Calculations tab page, click on the User Property Calculations section Add button.
Button Small 2.png A new calculation with a default name such as Prop01 appears. Click on this and type in the required calculation name.
  • For example: Ferrous, please note that the calculation name must be unique, and follow some naming rules, see Model Tag naming rules. Please make sure you have not used any illegal characters in the variable name and there are matching pairs of any brackets used.
Button Small 3.png The actual expression for the calculation is entered in the 'Expression' panel. Click on this editing box to activate the panel buttons.
Button Small 4.png Click on the Terms button to open the "Select Term for User Property Calculation" box, see User Property Terms (next heading)
  • Insert any of the expressions shown in the list by double clicking on the required expression (or by selecting and pressing OK).
  • Alternatively, users may type the required expression, when typing in the expressions manually, please ensure that terms are enclosed in square brackets.
Button Small 5.png Users can assign a conversion type to the calculation using the Cnv Type dropdown list, for example: choose "Qm" for mass flow. This allows the user to change conversion units to t/h or kg/h in the access window. If the conversion units is left at "None", then the value shown will be in the default SI units. e.g. Mass flows (Qm) will shown in kg/s.
Button Small 6.png The check box Concealed may be used to create a calculation hidden from the user in the access window. This is useful if it is an intermediate result to be referenced in other calculations. For example Ferrous can be used to calculate the ratio of "Ferrous/Ferric" and "Ferrous/Sulfate", and can be marked as concealed.
Button Small 7.png Users can check for syntax errors by clicking on the Check All button. This will place a ! next to any calculations that have errors. Note: If the user does not check expressions, and then loads a project, SysCAD will check the expressions at load time and will NOT load the project if there are any errors in the calculations. The user will receive an error message in the Messages window.
Button Small 8.pngThe User Property Calculations can be displayed on its own tab page if the Create New Tab ("User") for User Property Calculations tick box is checked.
Button Small 9.png User can add Labels to separate out groups of tags to make them easier to read on the access window by pressing the Add Label button.
Button Small 10.png Press the OK button to close the Edit configuration dialogue box when finished editing calculations.

User Property Terms

Clicking on the Terms button will open a dialog box which contains a list of all available expressions, including all species in the configuration file and any previously defined User Property Calculations.

Calculationseg9b.png

The top line of the Terms dialog box are filters, please make the selection to show the required species / element / phase:

OPTION TYPE DESCRIPTION NOTES
Species List Box Use this box to select the required species This is used by the Species Functions groups
Element List Box Use this box to select the required element This is used by the Elemental Functions group
Phase List Box Use this box to select the required phase This is used by the Stream, Phase and Elemental Functions groups
With T and P Tick Box Select this tick box if the expression requires user defined Temperature and Pressure This is used by the Stream and Species Functions groups

The functions are divided into groups, the group headings are highlighted in green in the above picture. The terms required for the definition of 'Ferrous' (=m:[FeSO4(aq)]*MW(Fe)/MW(FeSO4(aq))) have a red dot next to them and are highlighted in yellow.

Double clicking on any of these expressions will add it to the Expression window. Alternatively, the user may define a calculation by typing in the expression.

The allowed expressions are listed in the User Property Expressions Table. Please refer to this table for an explanation of all the available expressions and some simple expression examples.

Operators Allowed in Calculations

The main operators used in calculations are addition (+), subtraction (-), multiplication (*), division (/) and power (^).

Opening '(' and closing ')' brackets can be used when defining calculations.

Comparison operators >, >=, ==, <>, <= and < can also be used. The result of a comparison operation will be 1 (for true) or 0 (for false).

Useful Functions Allowed in Calculations

The conditional If function is very useful to perform a function based on a criteria or simply return a zero. It can also be used to prevent divide by zero and meaningless results.

Functions such as Range, Min and Max can be used to keep the terms or results of functions valid, including avoiding silly results from a divide by zero.

Mathematical functions such as Sin, Cos, Ln, Abs, etc. are available.

User Defined Constants

SysCAD allows a limited number of user defined variables (12 maximum) to be used in the custom calculations. These variables are called Project User Values (PUV) and are defined in the Plant Model - Project Tab. These PUVs can be manipulated by the user during a project solve without having to go back to the calculation tab to adjust them. Useful for data/equation fitting. These are shown in the picture below.

UserPropsPUV.png

Other predefined variables users can manipulate are the Environment Function constants. These are defined in the Plant Model - Environment Tab.

Editing and Removing Calculations

To edit a previously defined calculation, select it from the list. It can be renamed by clicking on the current name and the expression can be edited in the expression window.

To remove a calculation, select the calculation in the list and press the Remove button. If this is pressed by mistake, press the cancel button at the bottom of the window and this change will not be saved.

User Property Conversions

User Property Calculations will always be displayed on the Qi/Qo/QFeed/QProd tab page. The calculation will not change as a result of a change of view. The user has the ability to define the conversion type of the calculated value using the Cnv Type drop down box. The list of available conversion types will include all quantities defined in SysCAD, such as mass flow (Qm), volume flow (Qv), fractional (frac), etc. See Conversions Table for a list of available conversion types.

SysCAD assumes all calculation results are in terms of SI units. The default SI units used are displayed in brackets after the conversion family in the Cnvs column.

User Property Display

The User Property Calculations will all appear in a group on the Qo/QFeed(etc.) material flow or material content tab pages. The examples below shows the calculations in a pipe.

  • If user has selected the Create New Tab ("User") for User Property Calculation option, then the calculations will be shown on its own tab page, this is useful when the user has a long list of user properties:
UserPropCalcDisplay.png
  • User can also show the calculation formula in the access window by selecting ShowUserFormulas on the Plant Model - Views Tab:
UserPropCalcDisplay2.png
  • Calculations displayed in the images above are shown in the Examples of User Property Calculations table below.
  • The order in which they will appear on the page will match the order they are displayed in the list on the Calculations tab page.
  • The user may change the order of the calculations using the Move Up and Move Down buttons which appear next to the list.

Examples of User Property Calculations

Most of the calculations presented here have equivalent calculations in the Examples of Species Calculations table. Please note that we have used different names due to the unique naming rule.

Caution: The User Property Calculations and Species Calculations functions may look similar, but they have subtle differences, they cannot be copied directly from one section to another.

Tag Expression Cnv Type Description Notes
Aqueous/Organic if(v:SumIPhase(o)>0.000001, v:SumIPhase(aq)/v:SumIPhase(o), 0) VolRatio
(Volume Ratio)
  • Ratio of aqueous volumetric flow to organic volumetric flow.
  • The if statement is used to avoid division by zero errors.
Ferrous m:[FeSO4(aq)] * MW(Fe)/MW(FeSO4(aq)) OR
ml:[FeSO4(aq)]*MW(Fe)
Qm
(Mass Flow)
  • The mass flow of ferrous ion.
  • This can be a concealed calculation.
Can add to the Species Calculation section for more display views.
Ferric m:[Fe2[SO4]3(aq)] * MW(Fe)*2/MW(Fe2[SO4]3(aq)) OR
ml:[Fe2[SO4]3(aq)]*2*MW(Fe)
Qm
(Mass Flow)
  • The mass flow of ferric ion.
  • This can be a concealed calculation.
Can add to the Species Calculation section for more display views.
Ferrous/Ferric if([Ferric]>0.000000001, [Ferrous]/[Ferric], 0) MRatio
(Mass Ratio)
  • The ratio of ferrous ion to ferric ion.
  • Both Ferrous and Ferric must have been defined first.
  • The if statement is used to avoid division by zero errors.
Sulfate (m:[Fe2[SO4]3(aq)]/MW(Fe2[SO4]3(aq)) * 3 + m:[FeSO4(aq)]/MW(FeSO4(aq))
+ m:[H2SO4(aq)]/MW(H2SO4(aq))) * MW(S1O4) OR
(ml:[Fe2[SO4]3(aq)] * 3 + ml:[FeSO4(aq)] + ml:[H2SO4(aq)]) * MW(S1O4)
Qm
(Mass Flow)
  • The mass flow of sulfate ion (counting ferrous, ferric sulfate and sulfuric acid only).
  • This can be a concealed calculation.
Can add to the Species Calculation section for more display views.
SulfateFrac [Sulfate]/m:SumPhase(s,l) Frac
(Fraction)
  • The fraction of Sulfate ion in slurry (both solid and liquid phases).
  • Sulfate must have been defined before using it in a calculation.
If Sulfate is added to the species calculation, this value will be displayed in the MassFrac view.
Ferrous/Sulfate if([Sulfate]>0.000000001, [Ferrous]/[Sulfate], 0) MRatio
(Mass Ratio)
  • The ratio of ferrous ion to sulfate ion.
  • Both Ferrous and Sulfate must have been defined first.
  • The if statement is used to avoid division by zero errors.
S_as_SO4 m:SumElemPhase(S,l)*MW(S1O4)/MW(S) Qm
(Mass Flow)
  • The mass flow of sulfate ion, assumes all S (Sulphur) in aqueous phase are present as SO4.
  • This can be a concealed calculation.
Can add to the Species Calculation section for more display views.
NitrogenEquiv m:SumElemIPhase(N,aq) Qm
(Mass Flow)
  • Mass flow of aqueous species containing nitrogen (ammonia) compounds displayed as the nitrogen equivalent.
Can add to the Species Calculation section for more display views.
MolFlow_DryGas ml:SumPhase(g) - ml:[H2O(g)] QKgMl
(Molar Flow)
  • The molar flow of dry gas.
Can add to the Species Calculation section for more display views.
Alumina Properties Examples - More examples of the Alumina Properties replicated using Calculations