Skip to content

shre279/gw_Opti

Repository files navigation

Optimisation of pumping rates of Wells in a given area with MODFLOW and Python

Design of an algorithm to optimize the pumping rates of hundreds of wells in Ground Water models provided by GMS. The optimisation take into consideration lot of concepts around the Ground-Water field such as the drawdown, the heads, the aquifers-river exchanges, etc. Therefore, the optimisation is not a single objective optimisation but a multi-objective optimisation. The purpose is to developped to optimise this multiobjective function in Python and using the software MODFLOW to modelise the GW model.

Table of Contents

General Information

  • Using MODFLOW and a GMS object to build multi-objective fitness function to optimise.
  • Optimise the Multi-Objective function.
  • Give flexible and accessible features to be changed in a menu.

Technologies Used

  • Python - version 3.9.12
  • Numpy - version 1.19.5
  • Matplotlib - version 3.5.2
  • MODFLOW - version 2000 or 2005
  • GMS - version 10.4.7

Architecture

.
├── wells_opti                                  # Project folder
  ├── data                                      # Folder containing the models and the results of the optimisations
  ├── image                                     # Image storing
  ├── scripts                                   # Python scripts folder

.
├── data                                        # Close up on the data folder
  ├── optimisationx                             # Folder containing the results of the optimisations
    ├── model_name_output                       # Folder containing the outputs of the optimisations
    ├── model_name_input_variables.json         # Json file containing the input variables

In the following We will detail the files inside an "optimisationx" folder and in the scripts folder.

Optimisationx folder

.
├── optimisationx                                             # Folder containing the results of the optimisations
    ├── model_name_output
        ├── cluster.csv                                       # Each row is a cluster and it contains the cell id of the Well
        ├── mopso_costs-N_iter-N_pop_model_name.csv           # Each row is a generation and each column is a particles, it contains the multi-cost
        ├── mopso_pareto_opt-N_iter-N_pop_model_name.csv      # Each row is a generation and each column is a pareto optimum, it contains the multi-cost
        ├── mopso_penalties_opt-N_iter-N_pop_model_name.csv   # Each row is a generation and each column is a pareto optimum, it contains the penalty
        ├── mopso_memory-N_iter-N_pop_model_name.txt          # .txt file of the history of the optimisation. Decision variables of the particles can be found here.
    ├── model_name_input_variables.json                       # Json file containing the input variables

Scripts folder

.
├── scripts                                    # Folder containing the Python scripts
    ├── data_management_tools.py               # Reads the output data from GMS and computes the fitness function
    ├── display_data.py                        # Displays the output of the optimisation and the map (River + Wells + Areas)
    ├── global_var.py                          # Sets up all the default variables (they are then modified by main.py) 
    ├── GMS_objects.py                         # Contains the classes of objects from GMS (River, Well, Cell) and Area = set of Wells
    ├── main_MOopti.py                         # Puts the input data in the optimisation algorithms and runs them
    ├── main.py                                # Display the API which will collect the input data
    ├── modules.py                             # Imports the packages
    ├── moga_tools.py                          # Multi-Objective Genetic Algorithm
    ├── mopso_tools.py                         # Multi-Objective Particle Swarm Optimisation
    ├── wells_clustering.py                    # Creates the Area by performing a chosen clustering method on the set of Wells
    ├── README.md                              # This file which explain how to use the code

The main files which are suceptible to be modified are the following: data_management_tools.py (to modify the fitness function or the penalty), mopso/moga_tools.py (to improve the optimisation algorithms), wells_clustering.py (to add a new clustering method or change the clustering parameters).

Setup

This project will work with GMS MODFLOW 2000 or 2005 and GMS 10.4.7. We cannot ensure the well behaving of the code with other version because many files from MODFLOW and GMS are encrypted in bytes under a special format, and We are reading them manually and according to this format. If the structure of the binary files, output from MODFLOW and GMS came to a change It can deeply affect the code functionning.

Furthermore, It is required to keep the exact same architecture as It is described here. Otherwise, the different paths and pointers in the code will fail.

Project Status

Project is: / complete

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages