Approaches for Integrating GoldSim Models and Supporting

Download Report

Transcript Approaches for Integrating GoldSim Models and Supporting

Approaches for Modeling
Complex Processes through
Integration of GoldSim and
Specialized Supporting Models
Ted Eary
MWH Americas, Inc.
Fort Collins, Colorado
([email protected])
GoldSim 2007 User Conference, San Francisco
Integration Approaches
1.
2.
3.
Submodel Abstraction & Incorporation
Independent Models linked through
inputs and/or outputs
Direct Linkage
Approach 1:
Submodel Abstraction & Incorporation
Input
GoldSim Model
Simplified Submodel
(Specific Process:
solubility, reaction
kinetics, runoff, infiltration,
evaporation, …)
Output
Specialized Supporting Models
Data or abstracted
submodel
• Geochemistry
• Hydrology
• Limnology
• Climate
• etc…
Example:
Water Treatment Plant
Neutralizers, flocculants, polishing
agents, filtration, aeration, etc.
Acid Water
Clean Water
Sludge
Problem: How much sludge will be produced?
Approach for Submodel Incorporation
Know: Sludge mass ≈ function(amount of chemicals added,
time, pH, etc.)
Solution: Develop submodels of specific processes from a
combination of experimental data and theoretical calculations
(e.g., supporting models).
Solubilities calculated with PHREEQC
Ferrihydrite - Fe(OH)3
1.0E+03
Concentration, mg/L
1.0E+02
Al(OH)3(am)
pH
Fe mg/L
Al, mg/L Zn, mg/L
Zincite
5.0
3.6E-02
8.6E-01
---
5.5
1.1E-02
3.0E-02
---
6.0
3.4E-03
1.3E-03
---
6.5
1.2E-03
2.0E-04
3.6E+04
7.0
4.9E-04
2.4E-04
3.0E+03
7.5
2.8E-04
6.7E-04
2.3E+02
8.0
2.2E-04
2.1E-03
2.3E+01
8.5
2.2E-04
6.6E-03
2.9E+00
9.0
3.0E-04
2.1E-02
8.5E-01
9.5
5.5E-04
6.6E-02
6.4E-01
10.0
1.4E-03
2.1E-01
6.3E-01
1.0E+01
Zinc
1.0E+00
Gypsum
1.0E-01
Aluminum
1.0E-02
Iron
1.0E-03
1.0E-04
3
4
5
6
7
8
9
pH
Create Lookup Table
elements for GoldSim
10
11
GoldSim Model of Water Treatment System
Solubilities are
defined in the fluid
properties element
as Lookup Table
functions, i.e.,
individual
submodels.
Tonnes
Total Sludge
Lime Added
Some
Results
Time, days
Concentration, mg/L
Lime Tank
Aeration Tank
Influent
Effluent pH
Time, days
Submodel Abstraction &
Incorporation

Advantages



Simple relationships focused on the most
important processes
Can use a combination of empirical and
theoretical approaches
Disadvantages


Potentially limited range of applicability
Abstraction may make it difficult to
understand relationships
Approach 2:
Independent Models Sequentially Linked through Inputs
and/or Outputs
Input
Supporting Model
Input
GoldSim Model
(e.g., Geochemistry, Hydrology,
Limnology, etc…)
Output (Excel)
Output to Excel
Input
Input from Excel
Supporting Model
GoldSim Model
Output (Excel)
(e.g., Geochemistry, Hydrology,
Limnology, etc…)
Output
Example:
Solution Mixing Chemistry
Acidic pH,
High metal water,
Runoff (variable
flow rate)
Alkaline pH,
Clean water,
Constant flow rate
Mixing and
Reactions
Problem: How to calculate
solution chemistry after
mixing and reactions?
Approach
Know: Mixed solution chemistry is a function(mixing proportions of
two solutions – one acidic and one alkaline).
Solution:
• Use the independent supporting model to calculate all possible
outcomes and put the results in an Excel worksheet
( e.g., 1% acidic + 99%alkaline, 2% acidic + 98% alkaline, 3% acidic + 97%
alkaline, etc……)
• Import the data from Excel into a Lookup Table element.
• Define an index in GoldSim to retrieve the appropriate mixed
solution composition.
Specialized Supporting Model
PHREEQC
(chemistry)
Output
(Excel)
Input
from
Excel
Main Model
GoldSim
(Water Balance)
GoldSim Model
(Details in next slide)
Chemistry Lookup Table
(TableOfMixFractionChemistries)
Mixing Index down
Species across
Mixing Only
Mixing and Reaction
Some
Results
Al: Mixing
Fe: Mixing
Al: Mixing and Reaction
Fe: Mixing and Reaction
Independent Models


Advantages
• Easy to set up and run
• Leverage most of the capabilities of the
independent supporting models with careful
design
Disadvantages
• Limited to representing either the starting
point or ending point
• Need to understand the system very well to
make sure that the supporting model
represents all possible inputs or outcomes
Approach 3: Direct Linkage
Input
GoldSim Model
Output
Input
Supporting Model
(e.g., Geochemistry, Hydrology,
GIS, Chemical Processing,…)
Output
Data transfer for every time
step. Two approaches:
• Excel (Spreadsheet Element)
• Dynamic Link Library
(External DLL Element)
DLL Data Flow Between GoldSim
and the External Model
GoldSim Model
External DLL Program

External DLL
Element
Each time step
DLL Functions
Receive and format input data
 Run Supporting Model
 Get Output from Supporting Model
 Return output to GoldSim
Supporting Model
Output
Same Example:
Solution Mixing Chemistry
Acidic pH,
High metal water,
Runoff (variable
flow rate)
Alkaline pH,
Clean water,
Constant flow rate
Mixing and
Reactions
Problem: How to calculate
solution chemistry after mixing
and reactions?
Solution: Use DLL to link to the
PHREEQC geochemical model.
GoldSim
Model
DLL Element
Inside the DLL Interface tab
Inputs to external DLL
Outputs from external DLL
Mixing Only
Mixing and Reaction
Some
Results
Al: Mixing
Fe: Mixing
Al: Mixing and Reaction
Fe: Mixing and Reaction
Direct Linkage through Dynamic Link
Libraries (DLLs)


Advantages
• Supporting model used each time step
• Leverage most of the capabilities of the
independent supporting models
Disadvantages
• Execution time increased
• Custom software code needed to
construct the correct interface to the
supporting model
Relative Speed
(Solution Mixing, 5-year, 1-day time step)
Mechanism
Lookup Table
GoldSim
Execution Time
1-2 sec
DLL – External Element
5 min 9 sec
Excel-Spreadsheet Element 25 min 59 sec
Summary



Many ways to model complex
processes;
Advantages and disadvantages for
each approach; and
Choice of approach depends on the
system simulated and goals of the
model.
Thanks
Examples available for downloads:
http://www.goldsim.com/ModuleSiteMap.asp
Model ID: 57 – Linking Geochemical Codes to
GoldSim
Model ID:69 - Simulation of Water Treatment
for Acid Mine Drainage
Model ID:70 - Calculating the Solubility Using
Equilibrium Chemistry
Early geochemists describe
the first dirt molecule
(Go Rockies
Beat Red Sox)