AQSol Model Configuration

From SysCAD Documentation
Jump to navigation Jump to search

Navigation: Main Page -> Models -> AQSol Models -> AQSol Model Configuration

AQSol Overview AQSol Model Configuration AQSol Direct Calc Model AQSol Side Calc Model AQSol Reactor

New for Build 138. Currently in BETA - contact SysCAD for demonstrations or further information.


General Description

The AQSol program can be used for general phase equilibrium calculations and process simulations for aqueous solutions. It is developed and maintained by Aqueous Solutions ApS, Søborg, Denmark, (refer to www.phasediagram.dk for further information).

This model allows the user to define the AQSol database file to be used in SysCAD and some configuration of its use. The two main functions are to select a AQSol Database File (*.dat) (refer to Referenced File) and then for the selected Database file, 'map' AQSol species/ions to SysCAD species/ions used in the project. This allows the other AQSol models in SysCAD to convert the SysCAD species flow data to AQSol species data (and vice-versa) and use the AQSol functionality to calculate aqueous equilibrium data.

The model does not do any calculations and has no process links to any other models in SysCAD flowsheets. Its sole purpose is for management and configuration of a selected AQSol Database, other unit models performing AQSol calculations will reference this model. Therefore, this model is essential if the user wishes to use the AQSol functionality in SysCAD.

The user must have a AQSol Database file before initialising the SysCAD AQSol Model Configuration. See Referenced File for instructions on how to create this file.

NB The user MUST have a licensed version of AQSol on their computer. Please see www.phasediagram.dk for more information.

Referenced File

The file that will be referenced by the SysCAD AQSol Model Configuration is a user-created AQSol Database (*.dat) file.

At least one AQSol database (.dat) file must be present in order to run the AQSol add-on. Each .dat file points to a valid AQSol dll. The AQSol dll can be purchased from Aqueous Solutions. Each dll requires a license from AQSol to operate.

The species used by AQSol is built into the dll file. AQSol will only evaluate species defined within this dll. The user can check the species list for the AQSolXXX dll via the provided Excel spreadsheet AQSolXXX.xlsm. Information from this file is also used to create the .dat file (required by SysCAD).

To create the .dat file:

  1. Use the same name as the AQSol dll. For example: “AQSol001.dat” for “AQSol001.dll”
  2. The .dat file is a text file, the basic layout (section headings) include:
    • Name of a valid licensed AQSol dll
    • Interface ID (use 0 for the demo AQSol001.dll, use 1 for licensed AQSol dll)
    • Aqueous (add all aqueous species after this line)
    • Solid (add all solid species after this line)
    • Gas (add all gaseous species after this line)
    • Properties (add all the properties to be calculated after this line)

Notes:

  1. This file is essential for the AQSol functionality to work in SysCAD.
  2. The file can be saved at any location - it does not have to be saved in the SysCAD project.

Click here for an example file, AQSol001.dat

Diagram

TPS Model Cfg.png

The diagram shows the default drawing of a AQSol Model Configuration unit model.

Inputs and Outputs

There are no connections to this unit.

Model Theory

AQSol requires a defined input stream which defines almost all species in ionic form (no phase). At the given conditions (temperature, pressure), AQSol returns an output stream which includes aqueous ions in solution and any precipitates (solids) as species.

The AQSol Model Configuration defines the mapping of SysCAD species to AQSol ions/species to define the required input stream, and the convert the AQSol output stream back to SysCAD species.

Notes:

  • Some automatic mapping functions are available to match species based on molecular weights and elements.
  • Users can also manually adjust the mappings by selecting matching ions/species from dropdown lists.
  • Where more than one ionic breakdown reactions is available for a SysCAD species (defined in IonList.txt), the user can choose which one or combination to use.
  • SysCAD species can be selected to bypass the AQSol calculations by excluding them from the defined AQSol input stream.
  • AQSol solid and gaseous species can also be excluded from being formed as part of the AQSol output stream.

Workflow

The suggested workflow for configuring the model is:

  1. On the AQSolModelCfg tab page, browse for required .dat file.
  2. On the AQSolModelCfg tab page, press the Load button to load the .dat file.
  3. Map the AQSol ions and species to SysCAD ions and species on the AQSolConfig tab page. The simplest way to do this is to press the Try Map Species button next to MapByElements on the AQSolConfig tab page.
  4. Make any required adjustments to the SatIndex on the AQSolConfig tab page.
  5. If required, set the species conversion Algorithm on the AppSpRebuild tab page.
  6. If required, make any adjustments to the selection of Ion Breakdown reactions on the IonicBreakdown tab page.

Once these steps are performed and the mappings are checked, the project can be run. Any AQSol Direct Calc Models, AQSol Side Calc Models or AQSol Reactors referencing this AQSol Model Configuration unit model will use the mappings defined.

Data Sections

The tabs and variable names are described in detail in the following tables.

  1. AQSolModelCfg tab - This first tab requires the user select the AQSol database file and has various related options and parameters.
  2. AQSolConfig tab - This tab requires the user to map the AQSol ions/species to the equivalent species/ions in SysCAD, so that AQSol stream compositions can be converted to a SysCAD stream and vice-versa.
  3. ScdSpMap tab - This tab reports the SysCAD to AQSol species mapping as a result of choices made on the AQSolConfig tab page, so the SysCAD stream composition can be converted to a AQSolstream.
  4. ScdIonMap tab - This tab reports the SysCAD to AQSol ion mapping as a result of choices made on the AQSolConfig tab page, so the SysCAD stream composition can be converted to a AQSolstream.
  5. IonicBreakdown tab - This tab lists the Ion Breakdown reactions for SysCAD species and allows the user to select which ones to use.
  6. Engines tab - This tab contains information about the AQSol Engines.
  7. Info tab - contains general settings for the unit and allows the user to include documentation about the unit and create Hyperlinks to external documents.

AQSol Model Configuration tab page

Unit Type: AQSolModelCfg - The first tab page in the access window will have this name.

Tag (Long/Short) Input / Calc Description/Calculated Variables / Options

Common Data on First Tab Page

======== BETA VERSION ========
This program contains AQSol Copyright Aqueous Solutions Aps, Denmark
Interface...
Acknowledgement Display This program contains AQSol Copyright Aqueous Solutions Aps, Denmark
Website Web Link //https://www.usgs.gov/software/phreeqc
Version Display This displays the version of AQSol dll present on the user's computer
Model...
Select AQSol database file
FileName Input This is the name of the database file that was created by the user, e.g. AQSol001.dat
Folder Display The folder where the database file shown above is saved.
Edit TPS Edit Button.png Opens the AQSol database file (.dat) file for editing.
Browse Browse.png Click on this button to browse to the required database file.
CheckSpListForDuplicates Tickbox If enabled this will check the AQSol species list for duplicates.
Load Init and Load.png
Load.png
Click on this button to load the required database file. If the model has not been initialised, then the button will show "Init and Load" and when pressed the model will first be initialised and then the database file will be loaded.
DefnStatus List If the model has been loaded and no errors have been detected then will show OK, otherwise will show error message.
SpDBCount Display The number of species loaded from the AQSol database file.
ElemCount Display The number of elements loaded from the AQSol database file.
ElemList Display The list of the elements used in the AQSol database file.
Mapping Tolerances
Discard.Tol.SigDigits Input This provides an easy way to change the Discard.Tol.Rel value. For example, 4 here will set 1.00e-4 to Discard.Tol.Rel. If user changes the Discard.Tol.Rel value, this value will also be updated.
Discard.Tol.Rel Input The relative tolerance for ignoring species produced from the AQSol calculations. If the mass fraction of a species is > DiscardTol and it is not mapped to a SysCAD species/ion then an error is generated.
Convergence Tolerances
ElemBal.Tol.SigDigits Input This provides an easy way to change the ElemBal.Tol.Rel value. For example, 4 here will set 1.00e-4 to ElemBal.Tol.Rel. If user changes the ElemBal.Tol.Rel value, this value will also be updated.
ElemBal.Tol.Rel Input The relative tolerance for Element Balance (Input - Output). If the relative error is > ElemBal.Tol.Rel then an error is generated. The ElemBal is used in AQSol Side Calc Model and AQSol Reactor.
EnthConv.Tol.SigDigits Input This provides an easy way to change the EnthConv.Tol.Rel value. For example, 4 here will set 1.00e-4 to EnthConv.Tol.Rel. If user changes the EnthConv.Tol.Rel value, this value will also be updated.
EnthConv.Tol.Rel Input Enthalpy convergence tolerance. This is used for iterative enthalpy convergence calculations in SysCAD.

AQSol Config tab page

This tab is used to map the AQSol species/ions to the SysCAD species/ions.

Tag (Long/Short) Input / Calc Description/Calculated Variables / Options
AQSolConfig...
Show Unmapped
ShowUnmapped Tickbox When enabled, all species will be displayed. When disabled, only species that are mapped to a SysCAD species will be shown.
Filter View
Filter Button - Filter On.png
Button - Filter Off.png
This button will enable or disable the species filter options.
FilterType
(Only visible if Filter is enabled)
Phase Filter species by phase.
Liquid-HideIons Only show liquid species with neutral charge. Hide other species including liquid ions.
ContainsElem Only show species with specified elements within them
Elements Input Only visible if FilterType = ContainsElem. Specify elements to display separated by a comma. Elements are case sensitive.
ApplyFilter ApplyFilterButton.png Only visible if FilterType = ContainsElem. Apply element filter.
PhApplyToAll Tickbox Only visible if FilterType = Phase. When enabled, the following phase options will be enabled, and all species/ions will be displayed. When disabled, the following phase options will be also be disabled, and all species/ions will be hidden.
Aqueous.Selected / Sel Tickbox Only visible if FilterType = Phase. If enabled, aqueous species/ions will be displayed, otherwise they will be hidden.
Solid.Selected / Sel Tickbox Only visible if FilterType = Phase. If enabled, solid species will be displayed, otherwise they will be hidden.
Gas.Selected / Sel Tickbox Only visible if FilterType = Phase. If enabled, gaseous species will be displayed, otherwise they will be hidden.
Map AQSol species/ions to SysCAD species/ions
MapByElements Try Map Species.png This will try to map the AQSol species/ions to the SysCAD species/ions based on their Elemental compositions.
CheckMapByElements Check Mapping Button.png This will check the mapping of the AQSol species/ions to the SysCAD species/ions based on their Elemental compositions. Any unexpected results in the current mappings will be displayed as warnings in the Messages Window.
AllowMaptoNeutralIons / NeutIons.Map Tickbox If enabled, allows neutral ions to be mapped.
MaximumMWDiff / MaxMWDiff Input This is the maximum allowed difference between molecular weights.
MaximumChargeDiff / MaxChargeDiff Input This is the maximum allowed charge difference when mapping species.
SpDBCount Display The number of species/ions defined in the AQSol database.
SpUsedCount Display The number of species/ions in the AQSol database that are used in the project. These are shown on the AQSolConfig tab page.
SpMappedCount Display The number of species/ions in the AQSol database that have been mapped to equivalent SysCAD species/ions.
DetailedGridView Tickbox Global selection. If enabled, more fields will be shown in grid views (tables) including the tables on this page.
(The following tables (one per phase) display the AQSol species/ions from the selected database and the mapped SysCAD species/ions. The user can choose, or change, the mapped SysCAD species/ions using the dropdown list.)
(Each table has the following columns (one row per AQSol species/ion):)
SatIdx Input The user specified Saturation Index of the AQSol species. This is only available for solid and gas species.
MoleWt Display The Molecular Weight of the AQSol species/ion.
Charge Display Only shown if DetailedGridView has been enabled. The electrical charge of the AQSol species/ion.
Index Display Only shown if DetailedGridView has been enabled. The index of the AQSol species/ion.
MappedIon List The user may select the most appropriate SysCAD ion from a dropdown list to map to the AQSol ion. The relationship between ions and species in SysCAD is defined on the IonicBreakdown tab page. It is expected that AQSol ions would be mapped to SysCAD ions. This column is not shown for solid and gas species.
MappedSpecies List The user may select the most appropriate SysCAD species from a dropdown list to map to the AQSol species.
MapSpByEl Button Only shown if DetailedGridView has been enabled. If pressed, SysCAD will try to find the most appropriate SysCAD species to map to this AQSol species by matching elemental compositions.

ScdSpMap tab page

This tab is used to display the mapping of SysCAD species to AQSol species. This is often a 1 to 1 mapping.

Tag (Long/Short) Input / Calc Description/Calculated Variables / Options
SysCAD to AQSol mapping
ScdSpMap...
(The following table displays all the SysCAD species in the project with its mapped AQSol species (if there is one).)
(The table has the following columns (one row per SysCAD species):)
Mapping Display The name of the first mapped AQSol species (if there is one).
MapType Direct There is an exact match of species between "SysCAD species database/cfg file" and the loaded AQSol database, and the species is allowed by the license option and mapped directly on the AQSolConfig page.
Ions The species is not mapped on the AQSolConfig page, but can be broken down to valid ions (ionlist.txt).
Unmapped Species exist in the loaded AQSol database, but not in the "SysCAD species database/cfg file". User may consider adding the species to the SysCAD database if it is required.
Unlicensed There is an exact match of species between "SysCAD species database/cfg file" and the loaded AQSol database, but the species is not allowed by the license option.
MapCount Display The number of AQSol species that are mapped to the relevant SysCAD species.
MW_Diff Display The difference in Molecular Weights between the SysCAD species and the first mapped AQSol species (shown in the name column).

ScdIonMap tab page

This tab is used to display the mapping of SysCAD ions to AQSol ions. This is usually a 1 to 1 mapping.

Tag (Long/Short) Input / Calc Description/Calculated Variables / Options
SysCAD Ions to AQSol mapping
ScdIonMap...
(The following table displays all the SysCAD ions in the project with its mapped AQSol ion (if there is one).)
(The table has the following columns (one row per SysCAD ion):)
Name Display The name of the mapped AQSol ion (if there is one).
MW_Diff Display The difference in Molecular Weights between the SysCAD ion and the the mapped AQSol ion (shown in the name column).
CalcFormableSp Tickbox If selected, SysCAD will show the SysCAD molecular species that can be formed from the selected ions.
(The following fields are only shown if the CalcFormableSp option has been enabled for at least one ion.
Selected Ions:
x formable species from y selected ions
Formable...
SpX Display The name of a SysCAD molecular species that can be formed from one or more of the selected ions.

IonicBreakdown tab page

This tab displays the Ion Breakdown reaction for the SysCAD species. These are defined in the IonList.txt file, normally located in the c:\SysCAD138\BaseFiles folder. Where more than one reaction has been defined for a species, the user can choose how to split the species between the different reactions.

Tag (Long/Short) Input / Calc Description/Calculated Variables / Options
IBR...
Ion Breakdown Reactions for Species
(The following table displays all the SysCAD species in the project with their Ion Breakdown reaction/s. The table has the following column (one row per breakdown reaction, X=reaction number):)
RX.Extent Input / Display The fraction of the relevant SysCAD species that is assumed to breakdown as per the specified reaction. If there is only one reaction for a species, the value will be 100%. If there is more than one reaction for a species, the user can choose how to split the species between the different reactions (must add to 100%).
Ion Breakdown Reactions for Larger Ions
(The following table displays all the complex ions in the project (if any) with their Ion Breakdown reaction/s to simpler ions.)

Engines tab page

Tag (Long/Short) Input / Calc Description/Calculated Variables / Options
Status OK The model has been initialised correctly and the database file has been found and loaded correctly.
Init Required The model needs to be initialised.
Init Failed The model initialisation has been attempted but failed.
Init Init Button.png If the user clicks on the 'Init' button, then it will initialise the model.
Exit Exit Button.png If the user clicks on the 'Exit' button, then the AQSol program will be released and the user will need to initialise the model and load the database before the next run.
InitTime Display The time taken to initialise the model on the last attempt.
TotalCalcCount Display The number of calculations that have been performed mapping the AQSol species data to the SysCAD species data. The mappings are required for other units such as the AQSol Direct Calc Model, AQSol Side Calc Model or AQSol Reactor . This is cumulative and may include multiple iterations. It is reset to zero at the beginning of a run.
TotalCalcTime Display The cumulative amount of time used to map the AQSol species to the SysCAD species. This is cumulative and may include multiple runs.
AverageCalcTime Display The average amount of time required to map the AQSol species to the SysCAD species for this unit. AverageCalcTime = TotalCalcTime/TotalCalcCount.
Times that Engine instances are locked
(The following parameter is shown for 1 AQSol Engine (Engine1):)
TimeLocked Display The time that the relevant Engine is locked.

Adding this Model to a Project

Insert into Configuration file

Sort either by DLL or Group.

 

DLL:

ScdAQSol.dll

Units/Links

AQSol: AQSol Chem Model Configuration

or

Group:

General

Units/Links

AQSol: AQSol Chem Model Configuration

See Project Configuration for more information on adding models to the configuration file.


Insert into Project

 

Insert Unit

AQSol

AQSol Chem Model Configuration

See Insert Unit for general information on inserting units.