This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Multi Species Analysis

Trying to use the Monochloramine Decomposition multi species analysis setup that was imported from the engineering library, but I keep getting an error that reads "Could not solve reaction equilibrium expressions".  What am I setting up wrong in my Model Configuration?

Multi Species Analysis Setup

[TITLE]
Monochloramine Decomposition
; MSX sample, see MSX manual Page 64 ff.
; This example illustrates a complex chemical reaction system involving
; both kinetic rate expressions and nonlinear equilibrium relationships.
; The system being studied is the auto-decomposition of monochloramine
; to ammonia in the presence of natural organic matter (NOM).
; When chloramines are used as a secondary disinfectant care must be
; taken to avoid producing excessive amounts of free ammonia that can
; contribute to biological nitrification episodes within the
; distribution system.

[OPTIONS]
RATE_UNITS HR
SOLVER ROS2
COUPLING NONE
TIMESTEP 300
RTOL 0.0001
ATOL 1.0e-8

[SPECIES]
BULK HOCL MOLES ;hypochlorous acid
BULK NH3 MOLES ;ammonia
BULK NH2CL MOLES ;monochloramine
BULK NHCL2 MOLES ;dichloramine
BULK I MOLES ;unknown intermediate
BULK OCL MOLES ;hypochlorite ion
BULK NH4 MOLES ;ammonium ion
BULK ALK MOLES ;total alkalinity
BULK TOC MOLES ;total organic carbon
BULK H MOLES ;hydrogen ion
BULK OH MOLES ;hydroxide ion
BULK CO3 MOLES ;carbonate ion
BULK HCO3 MOLES ;bicarbonate ion
BULK H2CO3 MOLES ;dissolved carbon dioxide

[COEFFICIENTS]
PARAMETER k1 1.5e10
PARAMETER k2 7.6e-2
PARAMETER k3 1.0e6
PARAMETER k4 2.3e-3
PARAMETER k6 2.2e8
PARAMETER k7 4.0e5
PARAMETER k8 1.0e8
PARAMETER k9 3.0e7
PARAMETER k10 55.0
PARAMETER k11 3.0E4
PARAMETER k12 6.5E5
CONSTANT S1 0.02
CONSTANT S2 0.50

[TERMS]
k5 (2.5e7*H) + (4.0e4*H2CO3) + (800*HCO3)
a1 k1*HOCL*NH3
a2 k2*NH2CL
a3 k3*HOCL*NH2CL
a4 k4*NHCL2
a5 k5*NH2CL*NH2CL
a6 k6*NHCL2*NH3*H
a7 k7*NHCL2*OH
a8 k8*I*NHCL2
a9 k9*I*NH2CL
a10 k10*NH2CL*NHCL2
a11 k11*S1*TOC*NH2CL
a12 k12*S2*TOC*HOCL

[PIPES]
RATE HOCL -a1 + a2 - a3 + a4 + a8 – a12
RATE NH3 -a1 + a2 + a5 - a6 + a11
RATE NH2CL a1 - a2 - a3 + a4 - a5 + a6 - a9 - a10 – a11
RATE NHCL2 a3 - a4 + a5 - a6 - a7 - a8 - a10
RATE I a7 - a8 - a9
RATE H 0
RATE ALK 0
RATE TOC 0
EQUIL OCL H*OCL - 3.16E-8*HOCL
EQUIL NH4 H*NH3 - 5.01E-10*NH4
EQUIL CO3 H*CO3 - 5.01E-11*HCO3
EQUIL H2CO3 H*HCO3 - 5.01E-7*H2CO3
EQUIL HCO3 ALK - HCO3 - 2*CO3 - OH + H
EQUIL OH H*OH - 1.0E-14

Model Configuration:

[SOURCES]
SETPOINT 534 NH2CL 6E-5

[QUALITY]
GLOBAL ALK 0.004
GLOBAL H 2.818E-8

Parents Reply Children
  • Hello Steven,

    I could not reproduce the issue you are having.

    Here are the steps I completed in attempt to reproduce

    1. Open: C:\Program Files (x86)\Bentley\WaterGEMS\Samples\Example9.wtg
    2. Set the current scenario to "Chlorine tracking via Multi Species Analysis with ROS2-Solver".
    3. Edited the calculation option "Y2000 - Chlorine tracking via Multi Species Analysis with ROS2-Solver"
      1. Set "Multi Species Analysis Setup" to "Monochloramine Decomposition". I imported this from the Engineering Libraries, which is identical to the one you posted. 
      2. Edited the "Model Configuration" to match the one you posted. The only change I made was to the [SOURCES] <nodeID> to 112, to match this example model.
    4. The model computed successfully, without any user notifications.

    I will note that the error you are receiving "Could not solve reaction equilibrium expressions" is mentioned in the "EPANET Multi-Species Extension User's Manual" on page 112.

    Error 514: could not solve reaction equilibrium expressions.
    The nonlinear equation solver employed by EPANET-MSX could not successfully solve the system’s set of equilibrium equations at the current simulation time. Users must insure that the initial conditions set throughout the pipe network are sufficient and consistent so that a solution exists for the governing set of equilibrium equations.

    Do you receive any user notifications if you set the calculation options Calculation Type to "Hydraulics Only"?
    What product and version are you using?
    As Sushma requested, please provide your model files so we can provide specific suggestions.

     

    Regards,

    Craig Calvin

    Bentley Technical Support

  • 201802 Model_DFW.wtgpkg.zip

    Sushma, Craig,

    Thank you for your response.  The requested file is uploaded.  THere are no user notifications when using a "hydraulics Only" Calculation Type.  I am using WaterCAD CONNECT Eddition Update 1.

    Thanks,

    Steven Swain

  • Hi Steven, I wanted to let you know that we are still actively looking into this and will keep you updated as soon as we have a solution. Thanks for your patience.


    Regards,

    Jesse Dringoli
    Technical Support Manager, OpenFlows
    Bentley Communities Site Administrator
    Bentley Systems, Inc.

  • Hi Steven,

    The issue is related to the tank inflow being applied with negative demand at a junction.

    Try the following:
    1. Apply half of the negative demands applied at junctions "_FortWorthSupply" and "_DallasSupply" directly to the respective adjacent tanks.
    2. Delete those junctions.
    3. The model should run without an error.

    Note: The model will compute slowly (it took me 11min 30 sec). We are currently looking into the cause of that [Reference #: 866057].

    If you want the model to compute faster, you may want to consider modeling the hydraulically close tanks, with rapid flow oscillation, as a single equivalent tank as explained in the following article.

    Rapid flow oscillation between hydraulically close tanks

    For example:
    1. Increase the diameter of tank "East_GST-2" from 141.5ft to 200.11ft
    [2*PI*(141.5/2)^2=PI(D/2)^2  ->  D=200.11ft]
    2. Delete tank "East_GST-1"
    3. Increase the diameter of tank "West_GST-1" from 141.5 to 200.11ft
    4. Delete tank "West_GST-2"

    After I made these changes the model computed in 4min 21 sec.

     

    Regards,

    Craig Calvin

    Bentley Technical Support

    Answer Verified By: Sushma Choure