<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling</link><pubDate>Fri, 04 Aug 2023 16:52:24 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Scott Kampa</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Current Revision posted to OpenFlows | Water Infrastructure Wiki by Scott Kampa on 8/4/2023 4:52:24 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;CONNECT Edition, 08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater (including CONNECT Edition).&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation, or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Custom Calculations and Parameters&lt;/h1&gt;
&lt;p&gt;In some cases of multi species analysis, it is required to utilize pre-defined parameters or internally computed values to generate specific equations or set of equations to run.&lt;/p&gt;
&lt;p&gt;This can be achieved by using the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;&amp;ldquo;[TERMS]&amp;rdquo;&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;feature available in an MSX run. See more here: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;Smaller FTOL values should provide more accurate results but if set too low, numerical error can be introduced from low flow pipes. The exact value to use may be different for each system and the user may need to experiment to get good results&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;After computing a multi-species run, a result field will be automatically generated for each of the species involved. You can find these under the section &amp;quot;Results (multi species analysis)&amp;quot;. You can color code, annotate, graph, etc just like any other result field.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " border="0" src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-32/MSXResults.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A note on filtering and exporting MSX results:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &amp;quot;Constant&amp;quot; and &amp;quot;Variable&amp;quot; options for the Reporting Time Step calculation option are not currently supported with MSX. You must set this to &amp;quot;&amp;lt;All&amp;gt;&amp;quot; and use the hydraulic timestep to control the amount of output. (reference # 918545). This is because this option filters the hydraulic results which then get passed to the MSX engine, and the MSX engine requires regular/constant reporting intervals.&lt;/li&gt;
&lt;li&gt;If you need to perform a long simulation (for example two weeks) and export the results to Excel (using File &amp;gt; Export &amp;gt; Export to Excel) you may want to filter the results to avoid long delays in exporting large amounts of output. First, consider creating Flextables with just the fields you want to export, and use the check boxes on the left side of the Excel Export dialog to reduce the amount of output. Next, you can utilize the &lt;strong&gt;time step export options&lt;/strong&gt; in the lower-right corner of the Excel Export dialog. This feature is available in version 10.04.00.XX and greater and enables you to filter the MSX results using a Constant output step, or a Variable output step (where you can choose between No results, All results or a constant output step, for multiple time ranges, just like the calculation option). Note that this feature applies a filter on top of the existing computed results, and the setting you choose is persisted across all models (be sure to adjust it for other models as needed). Note that the Excel file format is limited to roughly 1 million rows, so if you encounter &amp;quot;Export to Excel failed&amp;quot;, try reducing the amount of output or consider using the CSV file format option (using the dropdown in the bottom-left corner of the Excel Export dialog.) See more here: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29064/export-time-series-data-to-excel-or-csv-format"&gt;Export time series data to Excel or CSV format&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;If you have an earlier version, you may need to consider using the advanced &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38583/automatic-processing-of-results-or-other-data-using-an-extensible-data-exchange-framework"&gt;Data Integrator tool&lt;/a&gt; to avoid long delays in exporting all timesteps in the Excel Export feature.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Example Model&lt;/h1&gt;
&lt;p&gt;For examples, see the MSX manual, or the Example9 model found in the Samples folder within your product installation folder. In this model, there are several scenarios with &amp;quot;Multi Species&amp;quot; in the name.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Starting with build 10.02.03.06 (with the &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18977/cumulative-patch-sets-for-hydraulics-and-hydrology-products"&gt;patch&lt;/a&gt; installed), you can have up to about 2.1 million characters in the Multi-Species Analysis Model Configuration. Prior to build 10.02.03.06, there was currently a limit of&amp;nbsp;32767 characters allowed in the&amp;nbsp;in the Multi-Species Analysis Model Configuration dialog.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;The calculation fails midway through with the following user notification:&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;The model is slow to compute.&lt;/h3&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;Report results are listed as N/A after a certain period of time.&lt;/h3&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;span&gt;Issue: the calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Issue: the different tank mixing model options do not seem to be working (results do not change)&lt;/h3&gt;
&lt;p&gt;There is a known issue with the EPANET MSX code as of June 2022 in which only the &amp;quot;completely mixed&amp;quot; option worked correctly while the others (LIFO, FIFO and 2-compartment) did not produce expected results. (reference #&amp;nbsp;&lt;span&gt;897360)&lt;/span&gt; This has been fixed in a cumulative patch set for WaterCAD and WaterGEMS 10.03.05.05. Contact Technical Support for the patch (available for subscribers) or &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175.downloading-haestad-hydraulics-and-hydrology-software"&gt;upgrade to a newer version&lt;/a&gt; when available. Also for FIFO, ensure that you are using the&amp;nbsp;&lt;span&gt;WaterGEMS 2.00.10 (or EPANET 2.00.10) compatibility mode, and use the Euler (EUL) solver for MSX (NOT the ROS2 solver).&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;Issue: I am trying to simulate water age results with MSX but they do not match WaterGEMS age results&lt;/h3&gt;
&lt;p&gt;To compare results between WaterGEMS&amp;rsquo; Age calculation and the MSX equivalent of Age, you will need to use the WaterGEMS 2.00.10 (or EPANET 2.00.10) compatibility mode, and use the Euler (EUL) solver for MSX. Also make sure tank mixing models are set right for both runs and&amp;nbsp;see the note above regarding a known issue with tank mixing models.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/25</link><pubDate>Mon, 29 Aug 2022 16:50:49 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 25 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 8/29/2022 4:50:49 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;CONNECT Edition, 08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater (including CONNECT Edition).&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation, or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Custom Calculations and Parameters&lt;/h1&gt;
&lt;p&gt;In some cases of multi species analysis, it is required to utilize pre-defined parameters or internally computed values to generate specific equations or set of equations to run.&lt;/p&gt;
&lt;p&gt;This can be achieved by using the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;&amp;ldquo;[TERMS]&amp;rdquo;&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;feature available in an MSX run. See more here: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;After computing a multi-species run, a result field will be automatically generated for each of the species involved. You can find these under the section &amp;quot;Results (multi species analysis)&amp;quot;. You can color code, annotate, graph, etc just like any other result field.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " border="0" src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-32/MSXResults.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A note on filtering and exporting MSX results:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &amp;quot;Constant&amp;quot; and &amp;quot;Variable&amp;quot; options for the Reporting Time Step calculation option are not currently supported with MSX. You must set this to &amp;quot;&amp;lt;All&amp;gt;&amp;quot; and use the hydraulic timestep to control the amount of output. (reference # 918545). This is because this option filters the hydraulic results which then get passed to the MSX engine, and the MSX engine requires regular/constant reporting intervals.&lt;/li&gt;
&lt;li&gt;If you need to perform a long simulation (for example two weeks) and export the results to Excel (using File &amp;gt; Export &amp;gt; Export to Excel) you may want to filter the results to avoid long delays in exporting large amounts of output. First, consider creating Flextables with just the fields you want to export, and use the check boxes on the left side of the Excel Export dialog to reduce the amount of output. Next, you can utilize the &lt;strong&gt;time step export options&lt;/strong&gt; in the lower-right corner of the Excel Export dialog. This feature is available in version 10.04.00.XX and greater and enables you to filter the MSX results using a Constant output step, or a Variable output step (where you can choose between No results, All results or a constant output step, for multiple time ranges, just like the calculation option). Note that this feature applies a filter on top of the existing computed results, and the setting you choose is persisted across all models (be sure to adjust it for other models as needed). Note that the Excel file format is limited to roughly 1 million rows, so if you encounter &amp;quot;Export to Excel failed&amp;quot;, try reducing the amount of output or consider using the CSV file format option (using the dropdown in the bottom-left corner of the Excel Export dialog.) See more here: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29064/export-time-series-data-to-excel-or-csv-format"&gt;Export time series data to Excel or CSV format&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;If you have an earlier version, you may need to consider using the advanced &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38583/automatic-processing-of-results-or-other-data-using-an-extensible-data-exchange-framework"&gt;Data Integrator tool&lt;/a&gt; to avoid long delays in exporting all timesteps in the Excel Export feature.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Example Model&lt;/h1&gt;
&lt;p&gt;For examples, see the MSX manual, or the Example9 model found in the Samples folder within your product installation folder. In this model, there are several scenarios with &amp;quot;Multi Species&amp;quot; in the name.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Starting with build 10.02.03.06 (with the &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18977/cumulative-patch-sets-for-hydraulics-and-hydrology-products"&gt;patch&lt;/a&gt; installed), you can have up to about 2.1 million characters in the Multi-Species Analysis Model Configuration. Prior to build 10.02.03.06, there was currently a limit of&amp;nbsp;32767 characters allowed in the&amp;nbsp;in the Multi-Species Analysis Model Configuration dialog.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;The calculation fails midway through with the following user notification:&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;The model is slow to compute.&lt;/h3&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;Report results are listed as N/A after a certain period of time.&lt;/h3&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;span&gt;Issue: the calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Issue: the different tank mixing model options do not seem to be working (results do not change)&lt;/h3&gt;
&lt;p&gt;There is a known issue with the EPANET MSX code as of June 2022 in which only the &amp;quot;completely mixed&amp;quot; option worked correctly while the others (LIFO, FIFO and 2-compartment) did not produce expected results. (reference #&amp;nbsp;&lt;span&gt;897360)&lt;/span&gt; This has been fixed in a cumulative patch set for WaterCAD and WaterGEMS 10.03.05.05. Contact Technical Support for the patch (available for subscribers) or &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175.downloading-haestad-hydraulics-and-hydrology-software"&gt;upgrade to a newer version&lt;/a&gt; when available. Also for FIFO, ensure that you are using the&amp;nbsp;&lt;span&gt;WaterGEMS 2.00.10 (or EPANET 2.00.10) compatibility mode, and use the Euler (EUL) solver for MSX (NOT the ROS2 solver).&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;Issue: I am trying to simulate water age results with MSX but they do not match WaterGEMS age results&lt;/h3&gt;
&lt;p&gt;To compare results between WaterGEMS&amp;rsquo; Age calculation and the MSX equivalent of Age, you will need to use the WaterGEMS 2.00.10 (or EPANET 2.00.10) compatibility mode, and use the Euler (EUL) solver for MSX. Also make sure tank mixing models are set right for both runs and&amp;nbsp;see the note above regarding a known issue with tank mixing models.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/24</link><pubDate>Wed, 27 Jul 2022 17:44:30 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 24 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 7/27/2022 5:44:30 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;CONNECT Edition, 08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater (including CONNECT Edition).&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation, or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Custom Calculations and Parameters&lt;/h1&gt;
&lt;p&gt;In some cases of multi species analysis, it is required to utilize pre-defined parameters or internally computed values to generate specific equations or set of equations to run.&lt;/p&gt;
&lt;p&gt;This can be achieved by using the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;&amp;ldquo;[TERMS]&amp;rdquo;&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;feature available in an MSX run. See more here: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;After computing a multi-species run, a result field will be automatically generated for each of the species involved. You can find these under the section &amp;quot;Results (multi species analysis)&amp;quot;. You can color code, annotate, graph, etc just like any other result field.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " border="0" src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-32/MSXResults.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A note on filtering and exporting MSX results:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &amp;quot;Constant&amp;quot; and &amp;quot;Variable&amp;quot; options for the Reporting Time Step calculation option are not currently supported with MSX. You must set this to &amp;quot;&amp;lt;All&amp;gt;&amp;quot; and use the hydraulic timestep to control the amount of output. (reference # 918545). This is because this option filters the hydraulic results which then get passed to the MSX engine, and the MSX engine requires regular/constant reporting intervals.&lt;/li&gt;
&lt;li&gt;If you need to perform a long simulation (for example two weeks) and export the results to Excel (using File &amp;gt; Export &amp;gt; Export to Excel) you may want to filter the results to avoid long delays in exporting large amounts of output. First, consider creating Flextables with just the fields you want to export, and use the check boxes on the left side of the Excel Export dialog to reduce the amount of output. Next, you can utilize the &lt;strong&gt;time step export options&lt;/strong&gt; in the lower-right corner of the Excel Export dialog. This feature is available in version 10.04.00.XX and greater and enables you to filter the MSX results using a Constant output step, or a Variable output step (where you can choose between No results, All results or a constant output step, for multiple time ranges, just like the calculation option). Note that this feature applies a filter on top of the existing computed results, and the setting you choose is persisted across all models (be sure to adjust it for other models as needed). See more here: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29064/export-time-series-data-to-excel-or-csv-format"&gt;Export time series data to Excel or CSV format&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;If you have an earlier version, you may need to consider using the advanced &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38583/automatic-processing-of-results-or-other-data-using-an-extensible-data-exchange-framework"&gt;Data Integrator tool&lt;/a&gt; to avoid long delays in exporting all timesteps in the Excel Export feature.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Example Model&lt;/h1&gt;
&lt;p&gt;For examples, see the MSX manual, or the Example9 model found in the Samples folder within your product installation folder. In this model, there are several scenarios with &amp;quot;Multi Species&amp;quot; in the name.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Starting with build 10.02.03.06 (with the &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18977/cumulative-patch-sets-for-hydraulics-and-hydrology-products"&gt;patch&lt;/a&gt; installed), you can have up to about 2.1 million characters in the Multi-Species Analysis Model Configuration. Prior to build 10.02.03.06, there was currently a limit of&amp;nbsp;32767 characters allowed in the&amp;nbsp;in the Multi-Species Analysis Model Configuration dialog.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;The calculation fails midway through with the following user notification:&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;The model is slow to compute.&lt;/h3&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;Report results are listed as N/A after a certain period of time.&lt;/h3&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;span&gt;Issue: the calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Issue: the different tank mixing model options do not seem to be working (results do not change)&lt;/h3&gt;
&lt;p&gt;There is a known issue with the EPANET MSX code as of June 2022 in which only the &amp;quot;completely mixed&amp;quot; option worked correctly while the others (LIFO, FIFO and 2-compartment) did not produce expected results. (reference #&amp;nbsp;&lt;span&gt;897360)&lt;/span&gt; This has been fixed in a cumulative patch set for WaterCAD and WaterGEMS 10.03.05.05. Contact Technical Support for the patch (available for subscribers) or &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175.downloading-haestad-hydraulics-and-hydrology-software"&gt;upgrade to a newer version&lt;/a&gt; when available. Also for FIFO, ensure that you are using the&amp;nbsp;&lt;span&gt;WaterGEMS 2.00.10 (or EPANET 2.00.10) compatibility mode, and use the Euler (EUL) solver for MSX (NOT the ROS2 solver).&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;Issue: I am trying to simulate water age results with MSX but they do not match WaterGEMS age results&lt;/h3&gt;
&lt;p&gt;To compare results between WaterGEMS&amp;rsquo; Age calculation and the MSX equivalent of Age, you will need to use the WaterGEMS 2.00.10 (or EPANET 2.00.10) compatibility mode, and use the Euler (EUL) solver for MSX. Also make sure tank mixing models are set right for both runs and&amp;nbsp;see the note above regarding a known issue with tank mixing models.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/23</link><pubDate>Tue, 26 Jul 2022 14:57:43 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 23 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 7/26/2022 2:57:43 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;CONNECT Edition, 08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater (including CONNECT Edition).&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation, or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Custom Calculations and Parameters&lt;/h1&gt;
&lt;p&gt;In some cases of multi species analysis, it is required to utilize pre-defined parameters or internally computed values to generate specific equations or set of equations to run.&lt;/p&gt;
&lt;p&gt;This can be achieved by using the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;&amp;ldquo;[TERMS]&amp;rdquo;&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;feature available in an MSX run. See more here: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;After computing a multi-species run, a result field will be automatically generated for each of the species involved. You can find these under the section &amp;quot;Results (multi species analysis)&amp;quot;. You can color code, annotate, graph, etc just like any other result field.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " border="0" src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-32/MSXResults.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: the &amp;quot;Constant&amp;quot; and &amp;quot;Variable&amp;quot; options for the Reporting Time Step calculation are not currently supported with MSX. You must set this to &amp;quot;&amp;lt;All&amp;gt;&amp;quot; and use the hydraulic timestep to control the amount of output. (reference # 918545)&lt;/p&gt;
&lt;p&gt;If you need to perform a long term simulation (for example two weeks) and export the results to Excel for example, you may need to consider using the advanced &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38583/automatic-processing-of-results-or-other-data-using-an-extensible-data-exchange-framework"&gt;Data Integrator tool&lt;/a&gt; to avoid long delays in exporting all timesteps in the Excel Export feature.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Example Model&lt;/h1&gt;
&lt;p&gt;For examples, see the MSX manual, or the Example9 model found in the Samples folder within your product installation folder. In this model, there are several scenarios with &amp;quot;Multi Species&amp;quot; in the name.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Starting with build 10.02.03.06 (with the &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18977/cumulative-patch-sets-for-hydraulics-and-hydrology-products"&gt;patch&lt;/a&gt; installed), you can have up to about 2.1 million characters in the Multi-Species Analysis Model Configuration. Prior to build 10.02.03.06, there was currently a limit of&amp;nbsp;32767 characters allowed in the&amp;nbsp;in the Multi-Species Analysis Model Configuration dialog.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;The calculation fails midway through with the following user notification:&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;The model is slow to compute.&lt;/h3&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;Report results are listed as N/A after a certain period of time.&lt;/h3&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;span&gt;Issue: the calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Issue: the different tank mixing model options do not seem to be working (results do not change)&lt;/h3&gt;
&lt;p&gt;There is a known issue with the EPANET MSX code as of June 2022 in which only the &amp;quot;completely mixed&amp;quot; option worked correctly while the others (LIFO, FIFO and 2-compartment) did not produce expected results. (reference #&amp;nbsp;&lt;span&gt;897360)&lt;/span&gt; This has been fixed in a cumulative patch set for WaterCAD and WaterGEMS 10.03.05.05. Contact Technical Support for the patch (available for subscribers) or &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175.downloading-haestad-hydraulics-and-hydrology-software"&gt;upgrade to a newer version&lt;/a&gt; when available. Also for FIFO, ensure that you are using the&amp;nbsp;&lt;span&gt;WaterGEMS 2.00.10 (or EPANET 2.00.10) compatibility mode, and use the Euler (EUL) solver for MSX (NOT the ROS2 solver).&lt;/span&gt;&lt;/p&gt;
&lt;h3&gt;Issue: I am trying to simulate water age results with MSX but they do not match WaterGEMS age results&lt;/h3&gt;
&lt;p&gt;To compare results between WaterGEMS&amp;rsquo; Age calculation and the MSX equivalent of Age, you will need to use the WaterGEMS 2.00.10 (or EPANET 2.00.10) compatibility mode, and use the Euler (EUL) solver for MSX. Also make sure tank mixing models are set right for both runs and&amp;nbsp;see the note above regarding a known issue with tank mixing models.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/22</link><pubDate>Fri, 15 Jul 2022 16:25:34 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 22 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 7/15/2022 4:25:34 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;CONNECT Edition, 08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater (including CONNECT Edition).&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation, or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Custom Calculations and Parameters&lt;/h1&gt;
&lt;p&gt;In some cases of multi species analysis, it is required to utilize pre-defined parameters or internally computed values to generate specific equations or set of equations to run.&lt;/p&gt;
&lt;p&gt;This can be achieved by using the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;&amp;ldquo;[TERMS]&amp;rdquo;&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;feature available in an MSX run. See more here: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;After computing a multi-species run, a result field will be automatically generated for each of the species involved. You can find these under the section &amp;quot;Results (multi species analysis)&amp;quot;. You can color code, annotate, graph, etc just like any other result field.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " border="0" src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-32/MSXResults.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: the &amp;quot;Constant&amp;quot; and &amp;quot;Variable&amp;quot; options for the Reporting Time Step calculation are not currently supported with MSX. You must set this to &amp;quot;&amp;lt;All&amp;gt;&amp;quot; and use the hydraulic timestep to control the amount of output. (reference # 918545)&lt;/p&gt;
&lt;p&gt;If you need to perform a long term simulation (for example two weeks) and export the results to Excel for example, you may need to consider using the advanced &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38583/automatic-processing-of-results-or-other-data-using-an-extensible-data-exchange-framework"&gt;Data Integrator tool&lt;/a&gt; to avoid long delays in exporting all timesteps in the Excel Export feature.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Example Model&lt;/h1&gt;
&lt;p&gt;For examples, see the MSX manual, or the Example9 model found in the Samples folder within your product installation folder. In this model, there are several scenarios with &amp;quot;Multi Species&amp;quot; in the name.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Starting with build 10.02.03.06 (with the &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18977/cumulative-patch-sets-for-hydraulics-and-hydrology-products"&gt;patch&lt;/a&gt; installed), you can have up to about 2.1 million characters in the Multi-Species Analysis Model Configuration. Prior to build 10.02.03.06, there was currently a limit of&amp;nbsp;32767 characters allowed in the&amp;nbsp;in the Multi-Species Analysis Model Configuration dialog.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;The calculation fails midway through with the following user notification:&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;The model is slow to compute.&lt;/h3&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;Report results are listed as N/A after a certain period of time.&lt;/h3&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;span&gt;Issue: the calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Issue: the different tank mixing model options do not seem to be working (results do not change)&lt;/h3&gt;
&lt;p&gt;There is a known issue with the EPANET MSX code as of June 2022 in which only the &amp;quot;completely mixed&amp;quot; option worked correctly while the others (LIFO, FIFO and 2-compartment) did not produce expected results. (reference #&amp;nbsp;&lt;span&gt;897360)&lt;/span&gt; This has been fixed in a cumulative patch set for WaterCAD and WaterGEMS 10.03.05.05. Contact Technical Support for the patch (available for subscribers) or &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175.downloading-haestad-hydraulics-and-hydrology-software"&gt;upgrade to a newer version&lt;/a&gt; when available.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/21</link><pubDate>Thu, 02 Jun 2022 15:25:49 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 21 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 6/2/2022 3:25:49 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation, or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Custom Calculations and Parameters&lt;/h1&gt;
&lt;p&gt;In some cases of multi species analysis, it is required to utilize pre-defined parameters or internally computed values to generate specific equations or set of equations to run.&lt;/p&gt;
&lt;p&gt;This can be achieved by using the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;&amp;ldquo;[TERMS]&amp;rdquo;&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;feature available in an MSX run. See more here: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;After computing a multi-species run, a result field will be automatically generated for each of the species involved. You can find these under the section &amp;quot;Results (multi species analysis)&amp;quot;. You can color code, annotate, graph, etc just like any other result field.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " border="0" src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-32/MSXResults.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Example Model&lt;/h1&gt;
&lt;p&gt;For examples, see the MSX manual, or the Example9 model found in the Samples folder within your product installation folder. In this model, there are several scenarios with &amp;quot;Multi Species&amp;quot; in the name.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Starting with build 10.02.03.06 (with the &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18977/cumulative-patch-sets-for-hydraulics-and-hydrology-products"&gt;patch&lt;/a&gt; installed), you can have up to about 2.1 million characters in the Multi-Species Analysis Model Configuration. Prior to build 10.02.03.06, there was currently a limit of&amp;nbsp;32767 characters allowed in the&amp;nbsp;in the Multi-Species Analysis Model Configuration dialog.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;The calculation fails midway through with the following user notification:&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;The model is slow to compute.&lt;/h3&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Issue:&amp;nbsp;&lt;/strong&gt;Report results are listed as N/A after a certain period of time.&lt;/h3&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;h3&gt;&lt;span&gt;Issue: the calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Issue: the different tank mixing model options do not seem to be working (results do not change)&lt;/h3&gt;
&lt;p&gt;There is a known issue with the EPANET MSX code as of June 2022 in which only the &amp;quot;completely mixed&amp;quot; option worked correctly while the others (LIFO, FIFO and 2-compartment) did not produce expected results. (reference #&amp;nbsp;&lt;span&gt;897360)&lt;/span&gt; This has been fixed in a cumulative patch set for WaterCAD and WaterGEMS 10.03.05.05. Contact Technical Support for the patch (available for subscribers) or &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175.downloading-haestad-hydraulics-and-hydrology-software"&gt;upgrade to a newer version&lt;/a&gt; when available.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/20</link><pubDate>Fri, 18 Feb 2022 18:52:29 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 20 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 2/18/2022 6:52:29 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation, or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Custom Calculations and Parameters&lt;/h1&gt;
&lt;p&gt;In some cases of multi species analysis, it is required to utilize pre-defined parameters or internally computed values to generate specific equations or set of equations to run.&lt;/p&gt;
&lt;p&gt;This can be achieved by using the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;&amp;ldquo;[TERMS]&amp;rdquo;&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;feature available in an MSX run. See more here: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;After computing a multi-species run, a result field will be automatically generated for each of the species involved. You can find these under the section &amp;quot;Results (multi species analysis)&amp;quot;. You can color code, annotate, graph, etc just like any other result field.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " border="0" src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-32/MSXResults.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Example Model&lt;/h1&gt;
&lt;p&gt;For examples, see the MSX manual, or the Example9 model found in the Samples folder within your product installation folder. In this model, there are several scenarios with &amp;quot;Multi Species&amp;quot; in the name.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Starting with build 10.02.03.06 (with the &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18977/cumulative-patch-sets-for-hydraulics-and-hydrology-products"&gt;patch&lt;/a&gt; installed), you can have up to about 2.1 million characters in the Multi-Species Analysis Model Configuration. Prior to build 10.02.03.06, there was currently a limit of&amp;nbsp;32767 characters allowed in the&amp;nbsp;in the Multi-Species Analysis Model Configuration dialog.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - The calculation fails midway through with the following user notification:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 3&lt;/strong&gt; - Report results are listed as N/A after a certain period of time.&lt;/p&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 4&lt;/strong&gt; - &lt;span&gt;The calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/43712/adding-custom-parameters-and-equations-with-multi-species-extension-msx"&gt;Adding custom parameters and equations with Multi Species Extension (MSX)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/19</link><pubDate>Mon, 13 Jan 2020 17:47:40 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Scott Kampa</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 19 posted to OpenFlows | Water Infrastructure Wiki by Scott Kampa on 1/13/2020 5:47:40 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation, or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;After computing a multi-species run, a result field will be automatically generated for each of the species involved. You can find these under the section &amp;quot;Results (multi species analysis)&amp;quot;. You can color code, annotate, graph, etc just like any other result field.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " border="0" src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-32/MSXResults.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Example Model&lt;/h1&gt;
&lt;p&gt;For examples, see the MSX manual, or the Example9 model found in the Samples folder within your product installation folder. In this model, there are several scenarios with &amp;quot;Multi Species&amp;quot; in the name.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Starting with build 10.02.03.06 (with the &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18977/cumulative-patch-sets-for-hydraulics-and-hydrology-products"&gt;patch&lt;/a&gt; installed), you can have up to about 2.1 million characters in the Multi-Species Analysis Model Configuration. Prior to build 10.02.03.06, there was currently a limit of&amp;nbsp;32767 characters allowed in the&amp;nbsp;in the Multi-Species Analysis Model Configuration dialog.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - The calculation fails midway through with the following user notification:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 3&lt;/strong&gt; - Report results are listed as N/A after a certain period of time.&lt;/p&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 4&lt;/strong&gt; - &lt;span&gt;The calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/18</link><pubDate>Mon, 13 Jan 2020 17:23:34 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Scott Kampa</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 18 posted to OpenFlows | Water Infrastructure Wiki by Scott Kampa on 1/13/2020 5:23:34 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation, or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;After computing a multi-species run, a result field will be automatically generated for each of the species involved. You can find these under the section &amp;quot;Results (multi species analysis)&amp;quot;. You can color code, annotate, graph, etc just like any other result field.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " border="0" src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-32/MSXResults.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Example Model&lt;/h1&gt;
&lt;p&gt;For examples, see the MSX manual, or the Example9 model found in the Samples folder within your product installation folder. In this model, there are several scenarios with &amp;quot;Multi Species&amp;quot; in the name.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Starting with build 10.02.03.06 (with the patch installed), you can have up to about 2.1 million characters in the Multi-Species Analysis Model Configuration. Prior to build 10.02.03.06, there was currently a limit of&amp;nbsp;32767 characters allowed in the&amp;nbsp;in the Multi-Species Analysis Model Configuration dialog.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - The calculation fails midway through with the following user notification:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 3&lt;/strong&gt; - Report results are listed as N/A after a certain period of time.&lt;/p&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 4&lt;/strong&gt; - &lt;span&gt;The calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/17</link><pubDate>Mon, 30 Dec 2019 15:02:37 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Scott Kampa</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 17 posted to OpenFlows | Water Infrastructure Wiki by Scott Kampa on 12/30/2019 3:02:37 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation, or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;After computing a multi-species run, a result field will be automatically generated for each of the species involved. You can find these under the section &amp;quot;Results (multi species analysis)&amp;quot;. You can color code, annotate, graph, etc just like any other result field.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " border="0" src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-32/MSXResults.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Example Model&lt;/h1&gt;
&lt;p&gt;For examples, see the MSX manual, or the Example9 model found in the Samples folder within your product installation folder. In this model, there are several scenarios with &amp;quot;Multi Species&amp;quot; in the name.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There is currently a limit of&amp;nbsp;32767 characters allowed in the&amp;nbsp;in the Multi-Species Analysis Model Configuration dialog.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - The calculation fails midway through with the following user notification:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 3&lt;/strong&gt; - Report results are listed as N/A after a certain period of time.&lt;/p&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 4&lt;/strong&gt; - &lt;span&gt;The calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/16</link><pubDate>Mon, 16 Sep 2019 17:34:59 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 16 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 9/16/2019 5:34:59 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation, or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;After computing a multi-species run, a result field will be automatically generated for each of the species involved. You can find these under the section &amp;quot;Results (multi species analysis)&amp;quot;. You can color code, annotate, graph, etc just like any other result field.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " border="0" src="/cfs-file/__key/communityserver-wikis-components-files/00-00-00-00-32/MSXResults.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Example Model&lt;/h1&gt;
&lt;p&gt;For examples, see the MSX manual, or the Example9 model found in the Samples folder within your product installation folder. In this model, there are several scenarios with &amp;quot;Multi Species&amp;quot; in the name.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - The calculation fails midway through with the following user notification:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 3&lt;/strong&gt; - Report results are listed as N/A after a certain period of time.&lt;/p&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 4&lt;/strong&gt; - &lt;span&gt;The calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/15</link><pubDate>Thu, 02 Aug 2018 03:29:15 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 15 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 8/2/2018 3:29:15 AM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation, or the &lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - The calculation fails midway through with the following user notification:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 3&lt;/strong&gt; - Report results are listed as N/A after a certain period of time.&lt;/p&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 4&lt;/strong&gt; - &lt;span&gt;The calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/14</link><pubDate>Thu, 02 Aug 2018 03:23:56 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 14 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 8/2/2018 3:23:56 AM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the EPANET-MSX manual.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note: if you modify the TIMESTEP parameter and your model calculation fails with &amp;quot;could not read hydraulic results file&amp;quot;, the model run duration may not be divisible by the timestep you selected (for example 250 seconds for a 144.0 hour simulation).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reference :&lt;/strong&gt;&amp;nbsp;More information about Multi Species analysis can be found in the EPA MSX manual.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - The calculation fails midway through with the following user notification:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 3&lt;/strong&gt; - Report results are listed as N/A after a certain period of time.&lt;/p&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 4&lt;/strong&gt; - &lt;span&gt;The calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/13</link><pubDate>Wed, 01 Aug 2018 17:55:56 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 13 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 8/1/2018 5:55:56 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. You can import existing setups from engineering library if desired. This contains global information about your constituents. For more details information on each of the parameters in the Setup area, see the relevant Help topic or the EPANET-MSX manual.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note:&amp;nbsp;the interval for the &lt;strong&gt;[PATTERNS]&lt;/strong&gt; is taken from the [TIMES] section of the EPANET input file. For WaterGEMS and WaterCAD, this is the calculation timestep.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select &lt;strong&gt;Multi Species Analysis&lt;/strong&gt; as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate &lt;strong&gt;Multi Species analysis setup&lt;/strong&gt;. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Lastly, configure the &lt;strong&gt;Model Configuration&lt;/strong&gt;, which can be accessed from the field below the Multi-Species Analysis field in the calculation options.&amp;nbsp;Multi-species model configuration consists of data for multi-species analysis that is dependent on the model (as opposed to setup data which is independent of the model). For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1533145975292v1.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reference :&lt;/strong&gt;&amp;nbsp;More information about Multi Species analysis can be found in the EPA MSX manual.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - The calculation fails midway through with the following user notification:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 3&lt;/strong&gt; - Report results are listed as N/A after a certain period of time.&lt;/p&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 4&lt;/strong&gt; - &lt;span&gt;The calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/12</link><pubDate>Fri, 29 Jun 2018 18:35:09 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 12 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 6/29/2018 6:35:09 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a Multi Species analysis setup. You can import existing setups from engineering library if desired.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select Multi Species Analysis as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate Multi Species analysis setup. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support. You can add them under the &amp;quot;[OPTIONS]&amp;quot; section of your MSX Setup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance &lt;strong&gt;in feet&lt;/strong&gt; (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance &lt;strong&gt;in gal/min&lt;/strong&gt; (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/1040x0/__key/communityserver-wikis-components-files/00-00-00-00-32/NewMSXOptions.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE :&lt;/strong&gt; For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196706787v6.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reference :&lt;/strong&gt;&amp;nbsp;More information about Multi Species analysis can be found in the EPA MSX manual.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - The calculation fails midway through with the following user notification:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 3&lt;/strong&gt; - Report results are listed as N/A after a certain period of time.&lt;/p&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 4&lt;/strong&gt; - &lt;span&gt;The calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/11</link><pubDate>Fri, 29 Jun 2018 18:30:22 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 11 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 6/29/2018 6:30:22 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a Multi Species analysis setup. You can import existing setups from engineering library if desired.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select Multi Species Analysis as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate Multi Species analysis setup. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Advanced [OPTIONS] Parameters&lt;/h2&gt;
&lt;p&gt;The following Parameters&amp;nbsp;are planned to be available in the next major version released &lt;strong&gt;after&lt;/strong&gt; 10.01.01.04. If you have 10.01.01.04 and a newer version is not yet available, please contact Technical Support.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LTOL&lt;/strong&gt; - An optional length tolerance in feet (if not supplied defaults to 0). Wall reaction calculations will be skipped for pipes with length below this tolerance.&amp;nbsp;Segments still get transported (and are subject to bulk reactions) as normal. By default, pipes with a length of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;FTOL&lt;/strong&gt; - An optional flow tolerance in gal/min (if not supplied defaults to 0).&amp;nbsp;&lt;span&gt;Wall reaction calculations will be skipped for pipes with flow below this tolerance, at each given timestep&lt;/span&gt;&lt;span&gt;.&amp;nbsp;&lt;/span&gt;&lt;span&gt;Segments still get transported (and are subject to bulk reactions) as normal.&amp;nbsp;&lt;/span&gt;&lt;span&gt;By default, pipes with a flow of zero are ignored in this fashion; this option extends that to a tolerance that you can specify.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ERRCHECK&lt;/strong&gt; - An optional flag for specifying whether MSX error checking is enabled (if not supplied defaults to ON; valid options OFF or ON). If set to &amp;quot;OFF&amp;quot;, then error conditions that would otherwise cause the calculation to fail, will be suppressed and the calculation will proceed. For example Care must be taken in this case to closely review the concentration results which could be compromised. Further reporting on failures when error checking is ignored, are planned to be included in a future release.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE :&lt;/strong&gt; For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196706787v6.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reference :&lt;/strong&gt;&amp;nbsp;More information about Multi Species analysis can be found in the EPA MSX manual.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - The calculation fails midway through with the following user notification:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 3&lt;/strong&gt; - Report results are listed as N/A after a certain period of time.&lt;/p&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 4&lt;/strong&gt; - &lt;span&gt;The calculation fails midway through with the following user notification&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;ldquo;illegal math operation occurred in pipe rate for specie: ___&amp;rdquo;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;First, double check the equations in your MSX setup to ensure for issues such as a condition that could could a divide by zero situation or a negative number raised to an exponent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This has also been known to occur in the past in models with pipes that had very low flow or very small pipe lengths. It is unknown at this time exactly what causes this, but the following are some things that may help:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Review the network topology for unnecessary elements such as pipes at a dead end with no demand&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe lengths and consider lengthening them (while keeping things hydraulically equivalent) with Skelebrator&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Review pipe flows and consider removing sections with very low flow that are not necessary for the analysis. This could be done manually, using active topology (to make those sections inactive) or with Skelebrator.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Use the FTOL, LTOL and ERRCHECK parameters in the [OPTIONS] section of the MSX setup to either ignore offending pipes or suppress the errors. See note further above under the &amp;quot;Advanced [OPTIONS] Parameters&amp;quot; section for details - these options are available&amp;nbsp;for version 10.01.01.04 by contacting Technical Support, or by upgrading to a newer version (check the list of features in the respective &amp;quot;what&amp;#39;s new?&amp;quot; article upon release, which should be listed &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/4163/watergems-and-watercad-technotes-and-faqs"&gt;here&lt;/a&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/10</link><pubDate>Thu, 31 May 2018 18:53:59 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 10 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 5/31/2018 6:53:59 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a Multi Species analysis setup. You can import existing setups from engineering library if desired.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select Multi Species Analysis as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate Multi Species analysis setup. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The timestep for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE :&lt;/strong&gt; For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196706787v6.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reference :&lt;/strong&gt;&amp;nbsp;More information about Multi Species analysis can be found in the EPA MSX manual.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - When computing, the&amp;nbsp;following user notification is returned.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 3&lt;/strong&gt; - Report results are listed as N/A after a certain period of time.&lt;/p&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/9</link><pubDate>Tue, 24 Apr 2018 17:43:09 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Scott Kampa</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 9 posted to OpenFlows | Water Infrastructure Wiki by Scott Kampa on 4/24/2018 5:43:09 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a Multi Species analysis setup. You can import existing setups from engineering library if desired.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select Multi Species Analysis as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate Multi Species analysis setup. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The time step for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE :&lt;/strong&gt; For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196706787v6.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reference :&lt;/strong&gt;&amp;nbsp;More information about Multi Species analysis can be found in the EPA MSX manual.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - When computing, the&amp;nbsp;following user notification is returned.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 3&lt;/strong&gt; - Report results are listed as N/A after a certain period of time.&lt;/p&gt;
&lt;p&gt;There was an upper limit on the report size when running MSX in some versions of WaterGEMS and WaterCAD. This would result in results listed as &amp;quot;N/A&amp;quot; after some time for either long model runs or runs with small time steps. Starting with an updated to CONNECT Edition Update 1 (build 10.01.00.72), this upper limit is not longer an issue. If an upgrade is available, &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/8175/downloading-haestad-hydraulics-and-hydrology-software"&gt;download&lt;/a&gt; and install it and that should help. Alternatives include running the model for less time or trying a larger time step.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, Troubleshooting, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/8</link><pubDate>Fri, 13 Apr 2018 03:24:14 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Jesse Dringoli</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 8 posted to OpenFlows | Water Infrastructure Wiki by Jesse Dringoli on 4/13/2018 3:24:14 AM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a Multi Species analysis setup. You can import existing setups from engineering library if desired.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select Multi Species Analysis as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate Multi Species analysis setup. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The time step for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE :&lt;/strong&gt; For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196706787v6.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reference :&lt;/strong&gt;&amp;nbsp;More information about Multi Species analysis can be found in the EPA MSX manual.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - When computing, the&amp;nbsp;following user notification is returned.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/38211/error-when-running-msx---could-not-solve-reaction-equilibrium-expressions"&gt;Error when running MSX - Could not solve reaction equilibrium expressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/7</link><pubDate>Mon, 26 Mar 2018 15:28:43 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Craig Calvin</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 7 posted to OpenFlows | Water Infrastructure Wiki by Craig Calvin on 3/26/2018 3:28:43 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a Multi Species analysis setup. You can import existing setups from engineering library if desired.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select Multi Species Analysis as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate Multi Species analysis setup. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The time step for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE :&lt;/strong&gt; For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196706787v6.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reference :&lt;/strong&gt;&amp;nbsp;More information about Multi Species analysis can be found in the EPA MSX manual.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type&amp;nbsp;set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - When computing, the&amp;nbsp;following user notification is returned.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, WaterCAD&lt;/div&gt;
</description></item><item><title>Using Multi-Species Extension (MSX) for advanced water quality modeling</title><link>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling/revision/6</link><pubDate>Mon, 26 Mar 2018 15:18:25 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:126ba720-8d22-4796-89d7-0c46dc12b397</guid><dc:creator>Craig Calvin</dc:creator><comments>https://communities.bentley.com/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37941/using-multi-species-extension-msx-for-advanced-water-quality-modeling#comments</comments><description>Revision 6 posted to OpenFlows | Water Infrastructure Wiki by Craig Calvin on 3/26/2018 3:18:25 PM&lt;br /&gt;
&lt;table style="background-color:#dce5f0;border:0px solid #dce5f0;" border="0"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Product(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;WaterGEMS, WaterCAD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Version(s):&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;08.11.05.61 and higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align:right;"&gt;&lt;strong&gt;Area:&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modeling&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This technote&amp;nbsp;explains how to configure a Multi-species analysis (MSX) which is an advanced Water Quality Modeling extension.&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Background&lt;/h1&gt;
&lt;p&gt;Using a constituent analysis, a user can track a single constituent through a water distribution system, provided the constituent behaves according to one of the kinetic models (e.g. first order decay). However, some constituents (E.g. Multi-source chlorine decay) cannot be modeled this way because they are involved in significant multi-species reactions or their kinetics do not fit one of the existing models. To handle these cases, &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;and WaterCAD provides Multi-species Analysis, based on the EPANET-MSX&amp;nbsp;model with a &lt;span class="ph"&gt; WaterGEMS&lt;/span&gt;&amp;nbsp;or WaterCAD user interface. This is available in V8i SELECTseries 5 and greater.&lt;/p&gt;
&lt;p&gt;Multi-species analysis allows for consideration of multiple interacting species in the bulk flow and on the pipe walls.&lt;/p&gt;
&lt;p&gt;It can be accessed from Components &amp;gt; Water quality &amp;gt; Multi Species analysis setups (or&amp;nbsp;Components&amp;gt;Multi Species analysis setups. for V8i)&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521195867316v2.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Workflow&lt;/h1&gt;
&lt;p&gt;To perform a multi-species analysis,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, configure a Multi Species analysis setup. You can import existing setups from engineering library if desired.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196363886v3.png" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Next, create a new scenario and calculation options, if required as you would do for a water quality analysis. Select Multi Species Analysis as the Calculation Type in the Calculation Options for your scenario.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Select the appropriate Multi Species analysis setup. Use&amp;nbsp;the one you created earlier or choose &amp;quot;Edit Multi Species analysis setup&amp;quot; to create a new one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196474826v4.png" /&gt;&lt;/p&gt;
&lt;h1&gt;Calculations&lt;/h1&gt;
&lt;p&gt;The time step for&amp;nbsp;calculations that is used in the multi-species analysis is the one which is defined in the &lt;strong&gt;OPTIONS &lt;/strong&gt;section of the Multi Species analysis setup. If it is not defined in the options of Multi Species analysis, then the default water quality time step is used which is 1/10&lt;sup&gt;th&lt;/sup&gt; of the hydraulic time step.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196621864v5.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE :&lt;/strong&gt; For detailed information on Multi Species analysis and Multi Species analysis model configuration, please navigate to the related topic in the in-program Help documentation.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/640x480/__key/communityserver-wikis-components-files/00-00-00-00-32/pastedimage1521196706787v6.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reference :&lt;/strong&gt;&amp;nbsp;More information about Multi Species analysis can be found in the EPA MSX manual.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;h1&gt;Troubleshooting&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;General Troubleshooting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the multi species analysis fails to compute, try computing in a small test model for debugging purposes (to determine what is causing the failure).&lt;/p&gt;
&lt;p&gt;For the actual model, ensure that the basic&amp;nbsp;EPS is in good shape&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Compute and validate&amp;nbsp;the model with the&amp;nbsp;calculation options calculation type is set to &amp;quot;Hydraulics Only&amp;quot; and correct the user notifications.&lt;/li&gt;
&lt;li&gt;Check for things that generate additional intermediate time steps,&amp;nbsp;such as&amp;nbsp;empty/full tanks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 1&lt;/strong&gt; - When computing, the&amp;nbsp;following user notification is returned.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Could not solve reaction equilibrium expressions&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If the model has a negative demand applied at a junction upstream of a tank try one of the following&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply the negative demand directly to the adjacent tank.&lt;/li&gt;
&lt;li&gt;If possible, instead of using a negative demand it may be better to model back to the actual source (assuming there is more to the network, upstream of the negative demand).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue 2&lt;/strong&gt; - The model is slow to compute.&lt;/p&gt;
&lt;p&gt;If there are adjacent tanks, that are hydraulically close, try combining them into a single equivalent composite tank.&lt;/p&gt;
&lt;p&gt;See: &lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;See Also&lt;/h1&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/29320/mixing-chlorine-and-chloramines" rel="noopener noreferrer" target="_blank"&gt;Mixing Chlorine and Chloramines&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/37851/understanding-the-water-quality-time-step" rel="noopener noreferrer" target="_blank"&gt;Understanding the Water Quality Time Step&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/18970/modeling-dbp-formation-water-quality-analysis" rel="noopener noreferrer" target="_blank"&gt;Modeling DBP Formation - Water Quality Analysis&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://cfpub.epa.gov/si/si_public_record_report.cfm?address=nhsrc/&amp;amp;dirEntryId=218488" rel="noopener noreferrer" target="_blank"&gt;EPANET Multi-Species Extension Software and User&amp;rsquo;s Manual&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/products/hydraulics___hydrology/w/hydraulics_and_hydrology__wiki/12655/rapid-flow-oscillation-between-hydraulically-close-tanks"&gt;Rapid flow oscillation between hydraulically close tanks&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Forum: &lt;a href="/products/hydraulics___hydrology/f/haestad-hydraulics-and-hydrology-forum/148441/multi-species-analysis/452503#452503"&gt;Multi Species Analysis&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: MSX, Multi-species analysis, Multi Species Extension, WaterGEMS, water quality analysis, constituent analysis, WaterCAD&lt;/div&gt;
</description></item></channel></rss>