diff --git a/documentation/advancedsim.rst b/documentation/advancedsim.rst index 1944c9c70..cb295bdd3 100644 --- a/documentation/advancedsim.rst +++ b/documentation/advancedsim.rst @@ -281,7 +281,7 @@ reference. ... """J. B. Burkhardt, et al. (2020) https://doi.org/10.1061/(asce)wr.1943-5452.0001304""" ... ) >>> msx - MultispeciesQualityModel(name='lead_ppm') + MsxModel(name='lead_ppm') Model options are added as follows: diff --git a/documentation/waterquality_msx.rst b/documentation/waterquality_msx.rst index d6314097c..3ffcf6145 100644 --- a/documentation/waterquality_msx.rst +++ b/documentation/waterquality_msx.rst @@ -8,10 +8,10 @@ >>> import wntr >>> try: ... wn = wntr.network.model.WaterNetworkModel('../examples/networks/Net3.inp') - ... msx_filename = '../examples/data/something.msx' + ... wn.msx = wntr.msx.MsxModel('../examples/data/Net3_arsenic.msx') ... except: ... wn = wntr.network.model.WaterNetworkModel('examples/networks/Net3.inp') - ... msx_filename = 'examples/data/something.msx' + ... wn.msx = wntr.msx.MsxModel('examples/data/Net3_arsenic.msx') .. _msx_water_quality: @@ -28,11 +28,13 @@ In this example, the MsxModel is created from a MSX file (see [SRU23]_ for more .. doctest:: - >>> msx_filename = 'data/something.msx') # doctest: +SKIP - >>> wn.msx = wntr.msx.MsxModel(msx_filename) + >>> import wntr # doctest: +SKIP + + >>> wn = wntr.network.WaterNetworkModel('networks/Net3.inp') # doctest: +SKIP + >>> wn.msx = wntr.msx.MsxModel('data/Net3_arsenic.msx') # doctest: +SKIP + >>> sim = wntr.sim.EpanetSimulator(wn) >>> results = sim.run_sim() -[TODO add an msx file that uses Net3 to the examples folder for documentation examples] The results include a quality value for each node, link, and species (see :ref:`simulation_results` for more details). @@ -74,20 +76,29 @@ Examples that illustrate how to build MSX models in WNTR are included in :ref:`a Reaction library ----------------- -WNTR also contains a library of MSX models that are accessed through the :class:`~wntr.msx.library.ReactionLibrary`. +WNTR also contains a library of MSX models that are accessed through the +:class:`~wntr.msx.library.ReactionLibrary`. This includes the following models: -* `Arsenic Chloramine model `_ [SRU23]_ -* `Lead Plumbosolvency model `_ [BWMS20]_ -[TODO change the 2 links to usepa, add other models if they are referenced] +* `Arsenic oxidation/adsorption `_ [SRU23]_ +* `Batch chloramine decay `_ +* `Lead plumbosolvency `_ [BWMS20]_ +* `Nicotine/chlorine reaction `_ +* `Nicotine/chlorine reaction with reactive intermediate `_ The models are stored in JSON format. Additional models can be loaded into the library by setting a user specified path. -Additional models could also be added to the WNTR Reactions library. +Additional models could also be added directly to the WNTR Reactions library. -The following example loads a MsxModel from the ReactionLibrary. +The following example loads the Lead plumbosolvency model (lead_ppm) from the ReactionLibrary. .. doctest:: - >>> msx_model = ... -[TODO finish this example] + >>> reaction_library = wntr.msx.library.ReactionLibrary() + + >>> print(reaction_library.model_name_list()) + ['arsenic_chloramine', 'batch_chloramine_decay', 'lead_ppm', 'nicotine', 'nicotine_ri'] + + >>> lead_ppm = reaction_library.get_model("lead_ppm") + >>> print(lead_ppm) + MsxModel(name='lead_ppm') diff --git a/examples/msx/example.msx b/examples/data/Net3_arsenic.msx similarity index 97% rename from examples/msx/example.msx rename to examples/data/Net3_arsenic.msx index b20e0854b..2b7cb2a81 100644 --- a/examples/msx/example.msx +++ b/examples/data/Net3_arsenic.msx @@ -46,8 +46,8 @@ Arsenic Oxidation/Adsorption Example [QUALITY] ;Initial conditions (= 0 if not specified here) - NODE Source AS3 10.0 - NODE Source NH2CL 2.5 + NODE River AS3 10.0 + NODE River NH2CL 2.5 [REPORT] NODES C D ;Report results for nodes C and D diff --git a/examples/msx/example.inp b/examples/msx/example.inp deleted file mode 100644 index 0887e00db..000000000 --- a/examples/msx/example.inp +++ /dev/null @@ -1,36 +0,0 @@ -[TITLE] -EPANET-MSX Example Network - -[JUNCTIONS] -;ID Elev Demand Pattern - A 0 4.1 - B 0 3.4 - C 0 5.5 - D 0 2.3 - -[RESERVOIRS] -;ID Head Pattern - Source 100 - -[PIPES] -;ID Node1 Node2 Length Diameter Roughness - 1 Source A 1000 200 100 - 2 A B 800 150 100 - 3 A C 1200 200 100 - 4 B C 1000 150 100 - 5 C D 2000 150 100 - -[TIMES] - Duration 48 - Hydraulic Timestep 1:00 - Quality Timestep 0:05 - Report Timestep 2 - Report Start 0 - Statistic NONE - -[OPTIONS] - Units CMH - Headloss H-W - Quality NONE - -[END]