Calculation Configuration
From SysCAD Documentation
Navigation: User Guide - General -> Project Configuration (cfg File) -> Calculation Configuration
Related Links: Examples of Entering Calculations, Material Flow Section
This page is valid for SysCAD 9.2 and later builds. Refer to Models Configuration (.cfg File) for SysCAD 9.1.
This page is the fourth of five main sections of the Project Configuration (cfg File). The sections are:
Calculation Configuration
Contents |
Introduction
This tab page allows the user to create and organise a list of custom calculations for projects using this configuration file. The calculations will be displayed in all streams in the projects. There are two types of calculations which can be defined:
- Species Calculations: these calculations will appear on the same tab page as the stream composition. The calculations will change as the user changes from mass to volume view etc. These calculations will also appear on the content composition tab page in dynamic units with surge.
- User Property Calculations: these calculations will appear on the Qi/Qo tab page. These calculations will also appear on the content tab page in dynamic units with surge.
- When you have finished editing the calculation configuration tab, you must click on the OK button to accept all of your changes, or the Cancel button to discard all of your changes.
General
This section describes the features of calculations which are common to both Species Calculations and User Property Calculations.
The user may add any number of calculations to the configuration file. They are displayed in SysCAD like all other tags and can then be referenced for use in controllers or reported in Excel reports.
Examples of calculations that may be used are:
- Ratio of two species or elements,
- Flow of particular ions, such as Ferric or Ferrous,
- Flow of a species or elements shown as an equivalent flow of another species - e.g. NH3 shown as Nitrogen equivalent.
Adding a New Calculation to the Configuration File
- On the Calculations tab page, click on the appropriate Add button, depending on if a Species Calculation or User Property Calculation is required.
- A new calculation with a default name such as CalcXX or PropXX appears in the appropriate list. The user may click on this and type in the required calculation name. Note: Calculation names may NOT have spaces and must be unique.
- The actual expression for the calculation may be inserted into the 'Expression' window.
- The user may type the required expression, or click on the 'Terms' button and insert any of the expressions shown in the list by double clicking on the required expression or by selecting and pressing OK.
- The options for type of conversion units (Cnv Type) are different between the two types of calculations and will be explained the sections below.
- The check box Concealed may be used to create a calculation hidden from the user in the access window. This is useful as an intermediate result to be referenced in other calculations.
- The options for where the calculation will be displayed are different between the two types of calculations and will be explained the sections below.
- When the user has finished entering the calculation expression they can check that there are no syntax errors by clicking on the Check 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.
For a more detailed explanation of how to enter calculations, see Examples of Entering Calculations.
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.
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).
Expressions Allowed in Calculations
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 calculations. 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 expressions. The allowed expressions are different between the two types of calculations and will be explained the sections below.
Species Calculations
The user may add any number of Species Calculations to the configuration file. These calculations will be displayed on the species flow tab of the pipe Access Window in SysCAD. They will also be shown on the Content composition tab page of dynamic units with surge. The calculations will change as the user changes from mass to volume view etc.
For example, if the user creates a calculation called Steamflow = [H2O(g)], then:
- in the mass flow view: this will display the mass flow of steam
- in the mass frac view: this will display the mass fraction of steam
- in the volume flow view: this will display the volume flow of steam
- in the volume frac view: this will display the volume fraction of steam
- in the mole flow view: this will display the molar flow of steam
- in the mole frac view: this will display the molar fraction of steam
For a detailed explanation of how to enter a Species Calculation, refer to Examples of Entering Calculations.
Species 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 calculations. 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 expressions. For convenience, the terms are grouped into View terms and Molecular Weight terms. View terms include individual species flows, functions such as sum of phases and elemental flows, as well as other user defined calculations. Molecular Weight terms include the molecular weight functions for all species and all elements within the project. The group of terms displayed in the Terms dialog box is dependent on the user selecting the desired group at the bottom of the box (see dialog box below).
The allowed expressions are shown in the table below:
| Group | Expression | Description | Syntax | Examples | Notes
|
| View | Species Flow | Flow of individual species | [speciesname(phase)] | [H2O(g)] | This will return the flow/fraction of this individual species, dependent on the view chosen. |
| View | Stream Temperature | The stream temperature | T(units) | T(K) | SI Units (K) is returned. |
| View | Stream Pressure | The stream pressure | P(units) | P(kPa) | SI Units (kPa) is returned. |
| View | Standard Temperature | The standard temperature in the project | StdT(units) | StdT(K) | SI Units (K) is returned. |
| View | Standard Pressure | The standard pressure in the project | StdP(units) | StdP(kPa) | SI Units (kPa) is returned. |
| View | Phase Flows | The flow of a single or multiple phases | SumPhase(s,l,g) | SumPhase(l) will return the flow of the liquid phase only SumPhase(s,l) will return the flow of the slurry (solid and liquid phases) SumPhase(s,l,g) will return the entire flow | |
| View | Individual Phase Flows | The flow of a single individual phase or multiple individual phases | SumIPhase(s,l,aq,o,g,...) | SumIPhase(aq) will return the flow of the aqueous phase SumIPhase(sl) will return the flow of the slag phase SumIPhase(aq,l) will return the flow of all liquid and aqueous species | The user must have defined species with individual phases (aq) or (sl) for the examples to be valid. |
| View | Elemental Phase Flows | The flow of a single or multiple phases for a single element | SumElemPhase(El,s,l,g) | SumElemPhase(S,l) will return the flow of Sulfur in the liquid phase only SumElemPhase(S,s,l) will return the flow of Sulfur in the slurry (solid and liquid phases) SumElemPhase(S,s,l,g) will return the entire flow of Sulfur | Elemental flows are only valid in Mass or Molar views. Any calculations involving the elemental functions will not be shown in a volume view. |
| View | Elemental Individual Phase Flows | The flow of a single individual phase or multiple individual phases for a single element | SumElemIPhase(El,s,l,aq,o,g,...) | SumElemIPhase(H,aq) will return the flow of Hydrogen in the aqueous phase SumElemIPhase(H,sl) will return the flow of the Hydrogen in the slag phase SumElemIPhase(H,aq,l) will return the flow of Hydrogen in all liquid and aqueous species | The user must have defined species with individual phases (aq) or (sl) for the examples to be valid. Elemental flows are only valid in Mass or Molar views. Any calculations involving the elemental functions will not be shown in a volume view. |
| View | User Defined | Any previously defined calculations can be used as part of a new calculation | N/A | TotalFe = Fe2+ + Fe3+ | The user must have defined Fe2+ and Fe3+ for the example to be valid. For example: Fe2+ = [FeSO4(aq)] * MW(Fe)/MW(FeSO4(aq)) and Fe3+ = [Fe2[SO4]3(aq)] * 2 * MW(Fe)/MW(Fe2[SO4]3(aq)) |
| Molecular Wt | Species Molecular Weight | Molecular weight of species | MW(speciename(phase)) or MW(AxBy) | MW(H2SO4(aq)) (where H2SO4(aq) IS in the configuration file) MW(Fe1O1) (where FeO is NOT in the configuration file) | If the species is NOT in the project, then the user must specify the elemental breakdown of the species. |
| Molecular Wt | Elemental Molecular Weight | Molecular weight of an element | MW(Element) | MW(Al) | The molecular weight of ANY element can be accessed. |
Species Conversions
Species Calculations will always be displayed on the Species Flow tab. The user may change the view of this page between Mass Flow, Mass Fraction, Concentration, etc. The user has the ability to define the way in which the UNITS of the calculated value are displayed using the Cnv Type drop down box. The three options for Cnv Type for a Species Calculation are described in the table below. NOTE: The Cnv ID drop down will only be available if the Frac Cnv Type is chosen.
| Type | Description | Example of when to use this Type | Notes
|
| FromView | The conversion type will change as the species view changes. Eg. if Mass Flow is chosen, then conversion type will be Qm (mass flow). | [H2O(g)] | The units and calculation will change with the view, mass flow, volume flow, etc. |
| None | There will be no units for this calculation. This is used for dimensionless calculations such as a ratio of two quantities with the same conversion type. | [H2SO4(aq)]/[H2O(l)] | This is a dimensionless ratio, it will be a ratio of mass flows, or ratio of volume flows, etc. |
| Frac | The calculation is a fraction of a total. The calculation result will not follow the display view, but the user may display the result as any of the units within fraction, i.e. %, Frac, ppm, etc. using the Cnv ID drop down box. | [H2O(l)]/[SumPhase(l)] | The result of this calculation will vary between 0 and 1 depending on how much water is present compared to other liquid species. |
Species Views
Some calculations are only valid in certain views, such as a mass view. To prevent users from seeing calculations displayed which do not make sense, the user may define which view the calculation is shown in using the View drop down box. The three groups of views to choose from are Mass, Volume and Molar. Users may choose only one of these groups or any combination of the three.
The main groups of Views are explained further in the following table:
| View Group | Description | Example of when to use this Group | Notes
|
| Mass | This group includes MassFlow, MassFrac and SpeciesConc. | [FeSO4(aq)] * MW(Fe)/MW(FeSO4(aq)) | This calculation is only valid when mass is used. |
| Volume | This group includes VolFlow, VolFrac, NormVolFlow and NormVolFrac. | [R(o)]/[H2O(l)] | This dimensionless ratio may only be meaningful on a volume basis. |
| Molar | This group includes MoleFlow and MoleFrac. | 2*[Fe2[SO4]3(aq)] | This calculation is only valid when moles is used. |
| Mass,Molar | This includes all those described above for Mass and Molar | [SumElemPhase(S,l)] | This calculation is only valid when mass or moles is used. |
| Mass,Volume,Molar | This includes all those described above for Mass, Volume and Molar | [H2O(l)] | This calculation is valid in mass, volume and molar views. |
NOTE: Calculations are not shown in the following views: PartialP, PartialPFrac, ElemntFlow, ElemntFrac, ElemntConc, ElemntConc25, CompntFlow, CompntFrac, CompntConc, CompntConc25, CompntMlFlow, CompntMlFrac, CompntMlConc and CompntMlConc25.
Species Display
The Species Calculations are ordered alphabetically in the Species Calculation list. The order in which they will appear on the Species View tab page will depend on the Order chosen on the Species Tab Page.
- If the one of the default orders are chosen (SLG, GLS or LSG), then the user can have calculations displayed with a particular group of species using the Display With drop down box. There are four options as described in the table below:
| Option | Description
|
| All | The calculation will be displayed at the bottom of the list of species. |
| Solid | The calculation will be displayed at the bottom of the list of solid species. |
| Liquid | The calculation will be displayed at the bottom of the list of liquid species. |
| Gas | The calculation will be displayed at the bottom of the list of gaseous species. |
Each set of calculations with the same Displayed With settings will be listed alphabetically.
- If instead the Custom order is chosen, then the user can move the calculations to wherever they would like it to appear within the list of species on the Species Tab Page, using the Move Up and Move Down buttons.
Examples of Species Calculations
| Expression | Cnv Type | View | Description
|
| Aqueous:Organic = SumIPhase(aq)/SumIPhase(o) | None | Volume | Ratio of aqueous volumetric flow to organic volumetric flow. The Cnv Type selected is None as the calculation is dimensionless. The View chosen is Volume since this ratio is only relevant on a volume basis. |
| Ferrous = [FeSO4(aq)]*MW(Fe)/MW(FeSO4(aq)) | FromView | Mass | The mass flow of ferrous ion. The Cnv Type is FromView, so that the displayed value will change with a change of units. The View chosen is Mass since this calculation is only valid on a mass basis. |
| Sulfate = ([Fe2[SO4]3(aq)]/MW(Fe2[SO4]3(aq))*3 + [FeSO4(aq)]/MW(FeSO4(aq)) + [H2SO4(aq)]/MW(H2SO4(aq))) * MW(S1O4) | FromView | Mass | The mass flow of sulfate ion. The Cnv Type is FromView, so that the displayed value will change with a change of units. The View chosen is Mass since this calculation is only valid on a mass basis. |
| Ferrous:Sulfate = Ferrous/Sulfate | None | Mass | The ratio of ferrous ion to sulfate ion. The Cnv Type selected is None as the calculation is dimensionless. The View chosen is Mass since the previously defined calculations are only valid on a mass basis. Note: Both Ferrous and Sulfate must have been defined before using them in a calculation. |
| PercentSulfate = Sulfate/SumPhase(s,l) * 100 | Frac (%) | Mass | The percentage of Sulfate ion in slurry (both solid and liquid phases). The Cnv Type is set to 'Frac' with a Cnv ID of %. At run time the user may change the displayed view to any of the fractional conversions allowed. The View chosen is Mass since the previously defined calculation is only valid on a mass basis. Note: Sulfate must have been defined before using it in a calculation. |
| DryGas = SumPhase(g)-[H2O(g)] | FromView | Mass,Volume,Molar | The flow of dry gas. The Cnv Type is FromView, so that the displayed value will change with a change of units and/or view. The View chosen is Mass,Volume,Molar as the calculation is valid for in all views. |
| NitrogenEquiv = SumElemIPhase(N,aq)*MW(N) | FromView | Mass | Mass flow of aqueous species containing nitrogen (ammonia) compounds displayed as the nitrogen equivalent. The Cnv Type is FromView, so that the displayed value will change with a change of units. The View chosen is Mass since this calculation is only valid on a mass basis. |
User Property Calculations
The user may add any number of User Property Calculations to the configuration file. These calculations will be displayed at on the Qi/Qo tab of the pipe Access Window in SysCAD. They will also be shown on the Content tab of dynamic units with surge. The calculations will only change when the stream changes.
For example,
- if the user creates a calculation called Steamflow = m:[H2O(g)], then this will always return the mass flow of steam.
- if the user creates a calculation called Steamflow = v:[H2O(g)], then this will always return the volumetric flow of steam.
- if the user creates a calculation called Steamflow = ml:[H2O(g)], then this will always return the molar flow of steam.
For a detailed explanation of how to enter a User Property Calculation, refer to Examples of Entering 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 calculations. 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 expressions. For convenience, the terms are grouped into five groups of terms which are described below. The first four groups of terms are almost identical except that each species term has a different prefix to indicate the basis. All allowed variations of the SumPhase, SumIPhase, SumElemPhase and SumElemIPhase functions are shown for the first four groups of terms. Previously defined calculations are also shown for the first four groups of terms.
- Mass - species terms are based on mass flow and have a prefix of m:
- Moles - species terms are based on molar flow and have a prefix of ml:
- Volume - species terms are based on volume flow and have a prefix of v:
- NVolume - species terms are based on normal volume flow and have a prefix of nv:
- Molecular Wt - the molecular weight functions for all species and all elements within the project
The group of terms displayed in the Terms dialog box is dependent on the user selecting the desired group at the bottom of the box (see dialog box below).
The allowed expressions are shown in the table below:
| Group | Expression | Description | Syntax | Examples | Notes
|
| Mass/Moles/Volume/NVolume | Specie Flow | Flow of individual specie | p:[speciename(phase)] | m:[H2O(g)] v:[H2O(g)] | Mass flow of steam Volume flow of steam |
| Mass/Moles/Volume/NVolume | Stream Temperature | The stream temperature | T(units) | T(K) | SI Units (K) is returned. |
| Mass/Moles/Volume/NVolume | Stream Pressure | The stream pressure | P(units) | P(kPa) | SI Units (kPa) is returned. |
| Mass/Moles/Volume/NVolume | Standard Temperature | The standard temperature in the project | StdT(units) | StdT(K) | SI Units (K) is returned. |
| Mass/Moles/Volume/NVolume | Standard Pressure | The standard pressure in the project | StdP(units) | StdP(kPa) | SI Units (kPa) is returned. |
| Mass/Moles/Volume/NVolume* | Phase Flows | The flow of a single or multiple phases | p:SumPhase(s,l,g) | m:SumPhase(l) will return the mass flow of the liquid phase only v:SumPhase(s,l) will return the volume flow of the slurry (solid and liquid phases) ml:SumPhase(s,l,g) will return the entire molar flow | |
| Mass/Moles/Volume/NVolume* | Individual Phase Flows | The flow of a single individual phase or multiple individual phases | p:SumIPhase(s,l,aq,o,g,...) | m:SumIPhase(aq) will return the mass flow of the aqueous phase nv:SumIPhase(sl) will return the normal volume flow of the slag phase ml:SumIPhase(aq,l) will return the molar flow of all liquid and aqueous species | The user must have defined species with individual phases (aq) or (sl) for the examples to be valid. |
| Mass/Moles/Volume/NVolume* | User Defined | Any previously defined calculations can be used as part of a new calculation | N/A | TotalFe = Fe2+ + Fe3+ | The user must have defined Fe2+ and Fe3+ for the example to be valid. For example: Fe2+ = m:[FeSO4(aq)] * MW(Fe)/MW(FeSO4(aq)) and Fe3+ = m:[Fe2[SO4]3(aq)] * 2 * MW(Fe)/MW(Fe2[SO4]3(aq)) |
| Mass/Moles* | Elemental Phase Flows | The flow of a single or multiple phases for a single element | p:SumElemPhase(El,s,l,g) | m:SumElemPhase(S,l) will return the mass flow of Sulfur in the liquid phase only ml:SumElemPhase(S,s,l) will return the flow of Sulfur in the slurry (solid and liquid phases) | Elemental flows are only valid with Mass (m) or Molar (ml) prefix. |
| Mass/Moles* | Elemental Individual Phase Flows | The flow of a single individual phase or multiple individual phases for a single element | p:SumElemIPhase(El,s,l,aq,o,g,...) | m:SumElemIPhase(H,aq) will return the mass flow of Hydrogen in the aqueous phase ml:SumElemIPhase(H,aq,l) will return the molar flow of Hydrogen in all liquid and aqueous species | The user must have defined species with individual phases (aq) or (sl) for the examples to be valid. Elemental flows are only valid with Mass (m) or Molar (ml) prefix. |
| Molecular Wt | Specie Molecular Weight | Molecular weight of species | MW(speciename(phase)) or MW(AxBy) | MW(H2SO4(aq)) (where H2SO4(aq) IS in the configuration file) MW(Fe1O1) (where FeO is NOT in the configuration file) | If the specie is NOT in the project, then the user must specify the elemental breakdown of the specie. |
| Molecular Wt | Elemental Molecular Weight | Molecular weight of an element | MW(Element) | MW(Al) | The molecular weight of ANY element can be accessed. |
*NOTE: All allowed variations of the SumPhase, SumIPhase, SumElemPhase and SumElemIPhase functions are shown for Mass, Moles, Volume and NVolume types. Previously defined calculations are also shown for Mass, Moles, Volume and NVolume types.
User Property Conversions
User Property Calculations will always be displayed on the Qi/Qo 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.
NOTE: In a dynamic project, the calculations will be shown on the content page of any units with surge as well as the pipe access windows. The units that users choose for their calculations should be based on how it will appear in a pipe. For units with surge, SysCAD will convert the units to a non-time based unit. For example, if the user defined mass flow (Qm), then SysCAD will display the result in mass on the content page.
User Property Display
The User Property Calculations will all appear in a group on the Qi/Qo tab page. 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
| Expression | Cnv Type | Description
|
| Aqueous:Organic = v:SumIPhase(aq)/v:SumIPhase(o) | (None) | Ratio of aqueous volumetric flow to organic volumetric flow. The Cnv Type selected is None as the calculation is dimensionless. |
| Ferrous = m:[FeSO4(aq)] * MW(Fe)/MW(FeSO4(aq)) | Qm | The mass flow of ferrous ion. The Cnv Type is Qm (mass flow), so that the displayed value will have units of mass flow which can be changed. |
| 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) | Qm | The mass flow of sulfate ion. The Cnv Type is Qm (mass flow), so that the displayed value will have units of mass flow which can be changed. |
| Ferrous:Sulfate = Ferrous/Sulfate | (None) | The ratio of ferrous ion to sulfate ion. The Cnv Type selected is None as the calculation is dimensionless. Note: Both Ferrous and Sulfate must have been defined before using them in a calculation. |
| PercentSulfate = Sulfate/m:SumPhase(s,l)*100 | Frac (%) | The percentage of Sulfate ion in slurry (both solid and liquid phases). The Cnv Type is set to 'Frac' with a Cnv ID of %. At run time the user may change the displayed view to any of the fractional conversions allowed. Note: Sulfate must have been defined before using it in a calculation. |
| MolFlow_DryGas = ml:SumPhase(g) - ml:[H2O(g)] | QKgMl | The molar flow of dry gas. The Cnv Type is QKgMl (molar flow), so that the displayed value will have units of molar flow which can be changed. |
| NitrogenEquiv = m:SumElemIPhase(N,aq)*MW(N) | Qm | Mass flow of aqueous species containing nitrogen (ammonia) compounds displayed as the nitrogen equivalent. The Cnv Type is Qm (mass flow), so that the displayed value will have units of mass flow which can be changed. |
| Alumina Properties Examples | More examples of the Alumina Properties replicated using Calculations |
See Size Configuration for editing the size distribution tab pages.
Calculations in Example Projects
A number of the Example Projects distributed with SysCAD contain user defined calculations. These may be helpful when setting up your own calculations:
- Nickel Copper Project - demonstrates the use of Species calculations. The values for the Ferric (Fe+++) and Ferrous (Fe++) ions are calculated and displayed in the species view window for every stream.
- Gold Project - demonstrates the use of User Property calculations. The values for Gold and Copper in the ore, and Gold and Copper on the carbon, all in ppm, are calculated and displayed on the Qo window for every stream.



