watertap.examples.edb package

Submodules

watertap.examples.edb.simple_acid module

This file demonstrates how to use EDB to create a simple acid problem.

  1. Before we can start, you must install MongoDB (which is installed separately)

    [See more information on the ReadTheDocs under ‘Getting Started –> Installing WaterTAP’]

  2. After installing MongoDB, you will need to ‘load’ the database using the command line function ‘edb load -b’. This will load the default database that WaterTAP is bundled with.

    [NOTE: If you need to ‘reload’ the database, simply use the command ‘edb drop -d electrolytedb’

    in the command line. The database on MongoDB is named “electrolytedb”]

    [NOTE 2: You can invoke the command line utility with the “help” keyword to

    get more information on funtionality. Command: ‘edb –help’ or ‘edb [arg] –help’]

  3. To use EDB in python, start by importing the interface class object ‘ElectrolyteDB’

  4. Invoke the ‘ElectrolyteDB’ object to connect to the database

  5. Grab a ‘base’ for a configuration dictionary, and place it into a class object This time, we will grab a base that is for a Liq only problem using FpcTP state variables.

  6. Get the chemcial species/components for a simulation case. There are a number of ways to do this. In this example, we will grab them by finding all components that contain only specific elements. Then, we add those components and their associated parameters to the configuration dictionary being built from the ‘base’.

    [NOTE: An alternative method is to provide a list of the names of components you want]

  7. Get the set of reactions you want in your system and put into a ‘base’ object. In this case, we are getting all reactions associated with a system of water and carbonic acid. We should get three reactions:

    H2O <--> H_+ + OH_-
    H2CO3 <--> H_+ + HCO3_-
    HCO3_- <--> H_+ + CO3_2-
    
  8. When using an reactor object in IDAES, you must always provide a ‘reaction_config’ to match with the ‘thermo_config’. We can create a base ‘reaction’ config from the database and add reactions to that config in the same way we do for the ‘thermo_config’ when adding reactions as inherent.

    [NOTE: If a reaction is added to a ‘thermo_config’ as ‘inherent’, it should

    NOT be added to a ‘reaction_config’ as ‘equilibrium’]

  9. [NEW Step] Build an equilibrium reactor from the ‘thermo_config’ and ‘reaction_config’ that were generated from the EDB.

watertap.examples.edb.solid_precipitation_reactions module

This file demonstrates how to use EDB to create a chemical reactor that involves solid precipitation reactions.

  1. Before we can start, you must install MongoDB (which is installed separately)

    [See more information on the ReadTheDocs under ‘Getting Started –> Installing WaterTAP’]

  2. After installing MongoDB, you will need to ‘load’ the database using the command line function ‘edb load -b’. This will load the default database that WaterTAP is bundled with.

    [NOTE: If you need to ‘reload’ the database, simply use the command ‘edb drop -d electrolytedb’

    in the command line. The database on MongoDB is named “electrolytedb”]

    [NOTE 2: You can invoke the command line utility with the “help” keyword to

    get more information on funtionality. Command: ‘edb –help’ or ‘edb [arg] –help’]

  3. To use EDB in python, start by importing the interface class object ‘ElectrolyteDB’

  4. Invoke the ‘ElectrolyteDB’ object to connect to the database

  5. Grab a ‘base’ for a configuration dictionary, and place it into a class object This time, we will grab a base that is for a Liq-Vap problem using FpcTP state variables.

  6. Get the chemcial species/components for a simulation case. There are a number of ways to do this. In this example, we will grab them by finding all components that contain only specific elements. Then, we add those components and their associated parameters to the configuration dictionary being built from the ‘base’.

    [NOTE: An alternative method is to provide a list of the names of components you want]

  7. Get the set of reactions you want in your system and put into a ‘base’ object. In this case, we are getting all reactions associated with a system of water and lime (Ca[OH]2). We should get three reactions now:

    H2O <--> H_+ + OH_-
    CaOH <--> Ca + OH
    Ca(OH)2 <--> Ca + 2 OH
    
    [NOTE: If you provide a list of ‘phases’ to the ‘get_reactions’ function, then you

    can control they types of reactions you get back. For instance, if you ONLY want the ‘Liq’ phase reactions, then pass [“Liq”] as the phase list.]

  8. When using an reactor object in IDAES, you must always provide a ‘reaction_config’ to match with the ‘thermo_config’. We can create a base ‘reaction’ config from the database and add reactions to that config in the same way we do for the ‘thermo_config’ when adding reactions as inherent.

    [NOTE: If a reaction is added to a ‘thermo_config’ as ‘inherent’, it should

    NOT be added to a ‘reaction_config’ as ‘equilibrium’]

  9. Build an equilibrium reactor from the ‘thermo_config’ and ‘reaction_config’ that were generated from the EDB.

watertap.examples.edb.the_basics module

This file demonstrates the basics of working with and using the electrolyte database (EDB).

  1. Before we can start, you must install MongoDB (which is installed separately)

    [See more information on the ReadTheDocs under ‘Getting Started –> Installing WaterTAP’]

  2. After installing MongoDB, you will need to ‘load’ the database using the command line function ‘edb load -b’. This will load the default database that WaterTAP is bundled with.

    [NOTE: If you need to ‘reload’ the database, simply use the command ‘edb drop -d electrolytedb’

    in the command line. The database on MongoDB is named “electrolytedb”]

    [NOTE 2: You can invoke the command line utility with the “help” keyword to

    get more information on funtionality. Command: ‘edb –help’ or ‘edb [arg] –help’]

  3. To use EDB in python, start by importing the interface class object ‘ElectrolyteDB’

  4. Invoke the ‘ElectrolyteDB’ object to connect to the database

  5. Grab a ‘base’ for a configuration dictionary, and place it into a class object

  6. Get the chemcial species/components for a simulation case. There are a number of ways to do this. In this example, we will grab them by finding all components that contain only specific elements. Then, we add those components and their associated parameters to the configuration dictionary being built from the ‘base’.

    [NOTE: An alternative method is to provide a list of the names of components you want]

  7. Get the set of reactions you want in your system and put into a ‘base’ object. That ‘base’ can be either a ‘thermo’ base or a ‘reaction’ (as in this case) base. IF you are adding reactions to a ‘thermo’ base, they should be added as ‘inherent’ reactions. IF you are adding reactions to a ‘reaction’ base, they should be added as ‘equilibrium’ (or other) reactions.

  8. When using an reactor object in IDAES, you must always provide a ‘reaction_config’ to match with the ‘thermo_config’. We can create a base ‘reaction’ config from the database and add reactions to that config in the same way we do for the ‘thermo_config’ when adding reactions as inherent.

    [NOTE: If a reaction is added to a ‘thermo_config’ as ‘inherent’, this it should

    NOT be added to a ‘reaction_config’ as ‘equilibrium’]

watertap.examples.edb.vapor_liquid_equilibrium module

This file demonstrates how to use EDB to create a chemical reactor that involves vapor-liquid equilibrium.

  1. Before we can start, you must install MongoDB (which is installed separately)

    [See more information on the ReadTheDocs under ‘Getting Started –> Installing WaterTAP’]

  2. After installing MongoDB, you will need to ‘load’ the database using the command line function ‘edb load -b’. This will load the default database that WaterTAP is bundled with.

    [NOTE: If you need to ‘reload’ the database, simply use the command ‘edb drop -d electrolytedb’

    in the command line. The database on MongoDB is named “electrolytedb”]

    [NOTE 2: You can invoke the command line utility with the “help” keyword to

    get more information on funtionality. Command: ‘edb –help’ or ‘edb [arg] –help’]

  3. To use EDB in python, start by importing the interface class object ‘ElectrolyteDB’

  4. Invoke the ‘ElectrolyteDB’ object to connect to the database

  5. Grab a ‘base’ for a configuration dictionary, and place it into a class object This time, we will grab a base that is for a Liq-Vap problem using FpcTP state variables.

  6. Get the chemcial species/components for a simulation case. There are a number of ways to do this. In this example, we will grab them by finding all components that contain only specific elements. Then, we add those components and their associated parameters to the configuration dictionary being built from the ‘base’.

    [NOTE: An alternative method is to provide a list of the names of components you want]

  7. Get the set of reactions you want in your system and put into a ‘base’ object. In this case, we are getting all reactions associated with a system of water and carbonic acid. We should get four reactions now:

    H2O <--> H_+ + OH_-
    H2CO3 <--> H_+ + HCO3_-
    HCO3_- <--> H_+ + CO3_2-
    CO2 + H2O <--> H2CO3
    
  8. When using an reactor object in IDAES, you must always provide a ‘reaction_config’ to match with the ‘thermo_config’. We can create a base ‘reaction’ config from the database and add reactions to that config in the same way we do for the ‘thermo_config’ when adding reactions as inherent.

    [NOTE: If a reaction is added to a ‘thermo_config’ as ‘inherent’, it should

    NOT be added to a ‘reaction_config’ as ‘equilibrium’]

  9. Build an equilibrium reactor from the ‘thermo_config’ and ‘reaction_config’ that were generated from the EDB.

Module contents