API Reference

wetlandoptimizer.main.COD_Fractionation(pollutants_in)

Fractionates the total COD (CODt) in three parts: COD dissolved biodegradable part (CODdb), COD dissolved inert part (CODdi) and COD particulate part (CODp).

Parameters:

polluants_in (list) – Unfractionnated input concentrations ([TSS]in : polluants_in[0] (gTSS/m3), [BOD5]in : polluants_in[1] (gO2/m3), [TKN]in : polluants_in[2] (gTKN/m3), [CODt]in : polluants_in[3] (gO2/m2)).

Returns:

fractionated_polluants_in – Fractionated input concentrations ([TSS]in : fractionnated_polluants_in[0] (gTSS/m3), [BOD5]in : fractionnated_polluants_in[1] (gO2/m3), [TKN]in : fractionnated_polluants_in[2] (gTKN/m3), [CODdb]in : fractionnated_polluants_in[3] (gO2/m2), [CODdi]in : fractionnated_polluants_in[4] (gO2/m2), [CODp]in : fractionnated_polluants_in[5] (gO2/m2)).

Return type:

list

class wetlandoptimizer.main.PathwayResult(name_stages=<factory>, id=None, surface_stages=<factory>, unsaturated_depth_stages=<factory>, saturated_depth_stages=<factory>, TSS_loading_stages=<factory>, BOD5_loading_stages=<factory>, TKN_loading_stages=<factory>, COD_loading_stages=<factory>, hydraulic_loading_rate_stages=<factory>, total_surface=None, total_volume=None, TSS_concentration=None, BOD5_concentration=None, TKN_concentration=None, COD_concentration=None, NO3N_concentration=None, TN_concentration=None, TP_concentration=None, ecoli_concentration=None, TSS_deviation=None, BOD5_deviation=None, TKN_deviation=None, COD_deviation=None, NO3N_deviation=None, TN_deviation=None, TP_deviation=None, ecoli_deviation=None)
wetlandoptimizer.main.Results_French_VF(Cin, Cobj, Q, climate)

Optimizes the French vertical flow wetland and prints the results for the user.

Parameters:
  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/m3), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [E.Coli]obj : Cobj[7] (UFC/100mL)).

  • Q (float) – Flow rate (m3/day).

  • climate (str) – Climate type, either “temperate” or “tropical”, determining environmental conditions affecting the treatment process.

wetlandoptimizer.main.Results_Global_Generation(Cin, Cobj, Q, stages_max, files_max, climate)

Optimizes and ranks the treatment trains generated exploring all the process combinations, ranks them by volume and prints the results for the user.

Parameters:
  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/m3), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [E.Coli]obj : Cobj[7] (UFC/100mL)).

  • Q (float) – Flow rate (m3/day).

  • climate (str) – Climate type, either “temperate” or “tropical”, determining environmental conditions affecting the treatment process.

  • stages_max (float) – Maximum value for the number of stages in series.

  • files_max (float) – Maximum value for the number of files in parallel.

wetlandoptimizer.main.Results_Global_Generation_All(Cin, Cobj, Q, stages_max, files_max, climate)

Optimizes and ranks the treatment trains generated exploring all the process combinations, ranks them by volume and prints the results for the user.

Parameters:
  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/m3), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

  • Q (float) – Flow rate (m3/day).

  • climate (str) – Climate type, either “temperate” or “tropical”, determining environmental conditions affecting the treatment process.

  • stages_max (float) – Maximum value for the number of stages in series.

  • files_max (float) – Maximum value for the number of files in parallel.

wetlandoptimizer.main.Results_NonSatSat(Cin, Cobj, Q, climate)

Optimizes the French vertical flow wetland and prints the results for the user.

Parameters:
  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/m3), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [E.Coli]obj : Cobj[7] (UFC/100mL)).

  • Q (float) – Flow rate (m3/day).

  • climate (str) – Climate type, either “temperate” or “tropical”, determining environmental conditions affecting the treatment process.

wetlandoptimizer.main.get_ordinal_suffix(number)

Returns the correct ordinal suffix for a number.

class wetlandoptimizer.treatment.Pathway(stages_max, files_max)

A class handling the configuration and generation of valid treatment train pathways.

stages_max

Maximum value for the number of stages in series.

Type:

float

files_max

Maximum value for the number of files in parallel.

Type:

float

Get_Subclasses(cls):

Recursively retrieves all subclasses of a given class.

Possible_Combinations():

Generates all valid process combinations with exactly stages_max steps.

static Get_Subclasses(cls)

Recursively retrieves all subclasses of a given class.

Parameters:

cls (type) – The class whose subclasses are to be retrieved.

Returns:

List of all found subclasses.

Return type:

list

Possible_Combinations()

Generates all valid process combinations with exactly stages_max steps.

Returns:

Set of valid process combinations as tuples.

Return type:

set

class wetlandoptimizer.treatment.Process(Name, Lim_TSS, Lim_BOD, Lim_TKN, Lim_COD, Nb_parallel, Material, Mat_cost, Xmin, Xmax, Zmin, Zmax, Amin, Amax, Param_TSS, Param_BOD, Param_TKN_a, Param_TKN_b, Param_CODsb, Cin=[], Cobj=[], V_values=[], Q=None, climate=None)

A class to represent a treatment wetland process.

Name

Name of the process.

Type:

str

Lim_TSS

Surfacic TSS load limit (gTSS/m2/day).

Type:

float

Lim_BOD

Surfacic BOD5 load limit (gO2/m2/day).

Type:

float

Lim_TKN

Surfacic TKN load limit (gTKN/m2/day).

Type:

float

Lim_COD

Surfacic COD load limit (gO2/m2/day).

Type:

float

Nb_parallel

Number of parallel processes for load alternance.

Type:

int

Material

Material used (gravel or sand).

Type:

str

Mat_cost

Ton of material cost compared to the cost of one ton of gravel ((Tmat€/m3)/(Tgravel€/m3)).

Type:

float

Xmin

Hydraulic minimum surface loading rate (m/day).

Type:

float

Xmax

Hydraulic maximum surface loading rate (m/day).

Type:

float

Zmin

Minimum unsaturated depth (m).

Type:

float

Zmax

Maximum unsaturated depth (m).

Type:

float

Amin

Minimum saturated depth (m).

Amax

Maximum saturated depth (m).

param_TSS

Reduction parameter related to TSS.

Type:

float

param_BOD

Reduction parameter related to BOD.

Type:

float

param_TKN_a

Reduction parameter related to TKN (a).

Type:

float

param_TKN_b

Reduction parameter related to TKN (b).

Type:

float

param_CODsb

Reduction parameter related to CODsb.

Type:

float

Cin

Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[7] (UFC/100mL)).

Type:

list

Cobj

Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Type:

list

V_values

Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

Type:

list

Q

Flow rate (m3/day).

Type:

float

Reduction_Function(V_values, Cin, Q):

Reduction function for the process.

Create_Constraint_TSS(V_values, Cin):

Create TSS constraint, corresponding to the difference between the TSS load constraint and the actual TSS inlet load.

Create_Constraint_BOD(V_values, Cin):

Create BOD5 constraint, corresponding to the difference between the DOB5 load constraint and the actual BOD5 inlet load.

Create_Constraint_TKN(V_values, Cin):

Create TKN constraint, corresponding to the difference between the TKN load constraint and the actual TKN inlet load.

Create_Constraint_COD(V_values, Cin):

Create CODt constraint, corresponding to the difference between the CODt load constraint and the actual CODt inlet load.

Surface_Area_Function(V_values, Q):

Calculate the total surface area of the process.

Depth_Function_Unsat(V_values):

Return the unsaturated depth of the process.

Depth_Function_Sat(self, V_values):

Return the saturated depth of the process.

Depth_Function_Tot(self, V_values):

Return the total depth of the process.

Volume_Function_Unsat(V_values, Q):

Calculate the unsaturated volume of the process.

Volume_Function_Sat(self, V_values, Q):

Calculate the saturated volume of the process.

Volume_Function_Tot(self, V_values, Q):

Calculate the total volume of the process.

Supplementary_Objective_Function(V_values, Cin, Cobj):

Supplementary objective function for the process.

Validate_Position(self):

Defines the rules for the position of the process in the treatment train.

Create_Constraint_BOD(V_values, Cin, climate)

Create BOD5 constraint, corresponding to the difference between the BOD5 load constraint and the actual BOD5 inlet load.

Parameters:
  • V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

Returns:

BOD5 constraint value.

Return type:

float

Create_Constraint_COD(V_values, Cin, climate)

Create CODt constraint, corresponding to the difference between the CODt load constraint and the actual CODt inlet load.

Parameters:
  • V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

Returns:

CODt constraint value.

Return type:

float

Create_Constraint_TKN(V_values, Cin, climate)

Create TKN constraint, corresponding to the difference between the TKN load constraint and the actual TKN inlet load.

Parameters:
  • V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

Returns:

TKN constraint value.

Return type:

float

Create_Constraint_TSS(V_values, Cin, climate)

Create TSS constraint, corresponding to the difference between the TSS load constraint and the actual TSS inlet load.

Parameters:
  • V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

Returns:

TSS constraint value.

Return type:

float

Depth_Function_Sat(V_values)

Return the saturated depth of the process.

Parameters:

V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

Returns:

Saturated depth of the process (m).

Return type:

float

Depth_Function_Tot(V_values)

Calculate the total depth of the process.

Parameters:

V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

Returns:

Total depth of the process (m).

Return type:

float

Depth_Function_Unsat(V_values)

Return the unsaturated depth of the process.

Parameters:

V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

Returns:

Unsaturated depth of the process (m).

Return type:

float

Reduction_Function(V_values, Cin, Q, climate)

Reduction function for the process.

Parameters:
  • V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

  • Q (float) – Flow rate (m3/day).

Returns:

Output concentrations after reduction ([TSS]out : Cout[0] (mgTSS/L), [BOD5]out : Cout[1] (mgDOD5/L), [TKN]out : Cout[2] (mgTKN/L), [CODdb]out : Cout[3] (mgCODdb/L), [CODdi]out : Cout[4] (mgCODdi/L), [CODp]out : Cout[5] (mgCODp/L), [N-NO3]out : Cout[6] (mgN-NO3/L), [TN]out : Cout[7] (mgN/L), [P]out : Cout[8] (mgP/L), [EColi]out : Cin[9] (UFC/100mL)).

Return type:

list

Supplementary_Objective_Function(V_values, Cin, Cobj)

Supplementary objective function for the process.

Parameters:
  • V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Returns:

Value of the supplementary objective function if there is one.

Return type:

float

Surface_Area_Function(V_values, Q)

Calculate the total surface area of the process.

Parameters:
  • V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Q (float) – Flow rate (m3/day).

Returns:

Surface area of the process (m2).

Return type:

float

Validate_Position()

Defines the rules for the position of the process in the treatment train.

Returns:

True if the position is valid, otherwise False.

Return type:

bool

Volume_Function_Sat(V_values, Q)

Calculate the saturated volume of the process.

Parameters:
  • V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Q (float) – Flow rate (m3/day).

Returns:

Saturated volume of the process (m3).

Return type:

float

Volume_Function_Tot(V_values, Q)

Calculate the total volume of the process.

Parameters:
  • V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Q (float) – Flow rate (m3/day).

Returns:

Total volume of the process (m3).

Return type:

float

Volume_Function_Unsat(V_values, Q)

Calculate the unsaturated volume of the process.

Parameters:
  • V_values (list) – Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Q (float) – Flow rate (m3/day).

Returns:

Unsaturated volume of the process (m3).

Return type:

float

class wetlandoptimizer.treatment.Treatment_Train(pathway, V, Cin, Cobj, Q, climate)

A class to represent a two stages wastewater treatment train.

pathway

List of treatment processes in the train.

Type:

list

Cin

Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

Type:

list

Cobj

Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Type:

list

Q

Flow rate (m3/day).

Type:

float

V

Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

Type:

list

Output_Function(V, Q):

Calculate the total treatment train output concentration of pollutants, by using each of the two stages reduction functions.

Create_Constraints_TSS(V, Q):

Combinate total treatment train load constraints for TSS.

Create_Constraints_BOD(V, Q):

Combinate total treatment train load constraints for BOD5.

Create_Constraints_TKN(V, Q):

Combinate total treatment train load constraints for TKN.

Create_Constraints_COD(V, Q):

Combinate total treatment train load constraints for CODt.

Create_Constraints_TSSout(V, Cobj, Q):

Create total treatment train output constraints for TSS, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Create_Constraints_BODout(V, Cobj, Q):

Create total treatment train output constraints for BOD5, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Create_Constraints_TKNout(V, Cobj, Q):

Create total treatment train output constraints for TKN, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Create_Constraints_CODout(V, Cobj, Q):

Create total treatment train output constraints for CODt, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Create_Constraints_N-NO3out(V, Cobj, Q):

Create total treatment train output constraints for N-NO3, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Create_Constraints_TNout(V, Cobj, Q):

Create total treatment train output constraints for TN, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Total_Volume_Function(V, Q):

Calculate the total volume of the treatment train.

Total_Surface_Area_Function(self, V, Q) :

Calculate the total surrface area of the treatment train.

Create_Objective_Function(V, Cin, Cobj, Q):

Combinate the different objective function subparts (volume with economic weighting and supplementary objective function for the first stage) for optimization.

Single_Objective_Function(V, Cin, Cobj, Q):

Sum of the different results of the objective function subparts and constraints, to optimize a single fitness value.

Create_Constraints_BOD(V, Q, climate)

Combinate total treatment train load constraints for BOD5.

Parameters:

V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

Returns:

constraints – List of BOD5 load constraint values.

Return type:

list

Create_Constraints_BODout(V, Cobj, Q, Cin, climate)

Create total treatment train output constraints for BOD5, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Parameters:
  • V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Returns:

constraint – BOD5 output constraint value.

Return type:

list

Create_Constraints_COD(V, Q, climate)

Combinate total treatment train load constraints for CODt.

Parameters:

V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

Returns:

constraints – List of CODt load constraint values.

Return type:

list

Create_Constraints_CODout(V, Cobj, Q, Cin, climate)

Create total treatment train output constraints for COD, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Parameters:
  • V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Returns:

constraint – COD output constraint value.

Return type:

list

Create_Constraints_EColiout(V, Cobj, Q, Cin, climate)

Create total treatment train output constraints for N-NO3, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Parameters:
  • V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Returns:

constraint – N-NO3 output constraint value.

Return type:

list

Create_Constraints_N_NO3out(V, Cobj, Q, Cin, climate)

Create total treatment train output constraints for N-NO3, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Parameters:
  • V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Returns:

constraint – N-NO3 output constraint value.

Return type:

list

Create_Constraints_Pout(V, Cobj, Q, Cin, climate)

Create total treatment train output constraints for N-NO3, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Parameters:
  • V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Returns:

constraint – N-NO3 output constraint value.

Return type:

list

Create_Constraints_TKN(V, Q, climate)

Combinate total treatment train load constraints for TKN.

Parameters:

V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

Returns:

constraints – List of TKN load constraint values.

Return type:

list

Create_Constraints_TKNout(V, Cobj, Q, Cin, climate)

Create total treatment train output constraints for TKN, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Parameters:
  • V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Returns:

constraint – TKN output constraint value.

Return type:

list

Create_Constraints_TNout(V, Cobj, Q, Cin, climate)

Create total treatment train output constraints for TN, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Parameters:
  • V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Returns:

constraint – TN output constraint value.

Return type:

list

Create_Constraints_TSS(V, Q, climate)

Combinate total treatment train load constraints for TSS.

Parameters:

V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

Returns:

constraints – List of TSS load constraint values.

Return type:

list

Create_Constraints_TSSout(V, Cobj, Q, Cin, climate)

Create total treatment train output constraints for TSS, corresponding to the difference between the objective outlet concentration and the actuel outlet concentration.

Parameters:
  • V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Returns:

constraint – TSS output constraint value.

Return type:

list

Create_Objective_Function(V, Cin, Cobj, Q, climate)

Combinate the different objective function subparts (volume with economic weighting and supplementary objective function for the first stage) for optimization.

Parameters:
  • V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

  • Q (float) – Flow rate (m3/day).

Returns:

objective – List of objective function subparts values for optimization (volume with economic weighting for VdNS1: objective[0], supplementary objective function for VdNS1: objective[1], volume with economic weighting for VdNS2[2], supplementary objective function for VdNS2 (null): objective[3]).

Return type:

list

Output_Function(V, Q, climate)

Calculate the total treatment train output concentration of pollutants, by using each of the two stages reduction functions.

Parameters:

V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

Returns:

output – Final output concentration of pollutants ([TSS]out : Cout[0] (mgTSS/L), [BOD5]out : Cout[1] (mgDOD5/L), [TKN]out : Cout[2] (mgTKN/L), [CODdb]out : Cout[3] (mgCODdb/L), [CODdi]out : Cout[4] (mgCODdi/L), [CODp]out : Cout[5] (mgCODp/L), [N-NO3]out : Cout[4] (mgN-NO3/L), [TN]out : Cout[5] (mgN/L)).

Return type:

list

Single_Objective_Function(V, Cin, Cobj, Q, climate)

Sum of the different results of the objective function subparts and constraints, to optimize a single fitness value.

Parameters:
  • V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

  • Q (float) – Flow rate (m3/day).

Returns:

fitness – Fitness value.

Return type:

float

Total_Surface_Area_Function(V, Q)

Calculate the total surface area of the treatment train.

Parameters:
  • V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

  • Q (float) – Flow rate (m3/day).

Returns:

surface_area – Total surface area of the treatment train (m2).

Return type:

float

Total_Volume_Function(V, Q)

Calculate the total volume of the treatment train.

Parameters:
  • V (list) – Total treatment train volume values (Q / surface area of the first stage: V[0] (m/day) and depth of the first stage: V[1] (m), Q / surface area of the second stage: V[2] (m/day) and depth of the second stage: V[3] (m)).

  • Q (float) – Flow rate (m3/day).

Returns:

volume – Total volume of the treatment train (m3).

Return type:

float

class wetlandoptimizer.treatment.VdNS1(Name, Lim_TSS, Lim_BOD, Lim_TKN, Lim_COD, Nb_parallel, Material, Mat_cost, Xmin, Xmax, Zmin, Zmax, Amin, Amax, Param_TSS, Param_BOD, Param_TKN_a, Param_TKN_b, Param_CODsb, Cin=[], Cobj=[], V_values=[], Q=None, climate=None)

A class to represent a first stage type treatment wetland process (VdNS1).

Name

Name of the process.

Type:

str

Lim_TSS

Surfacic TSS load limit (gTSS/m2/day).

Type:

float

Lim_BOD

Surfacic BOD5 load limit (gO2/m2/day).

Type:

float

Lim_TKN

Surfacic TKN load limit (gTKN/m2/day).

Type:

float

Lim_COD

Surfacic COD load limit (gO2/m2/day).

Type:

float

Nb_parallel

Number of parallel processes for load alternance.

Type:

int

Material

Material used (gravel or sand).

Type:

str

Mat_cost

Ton of material cost compared to the cost of one ton of gravel ((Tmat€/m3)/(Tgravel€/m3)).

Type:

float

Xmin

Hydraulic minimum surface loading rate (m/day).

Type:

float

Xmax

Hydraulic maximum surface loading rate (m/day).

Type:

float

Zmin

Minimum unsaturated depth (m).

Type:

float

Zmax

Maximum unsaturated depth (m).

Type:

float

Amin

Minimum saturated depth (m).

Amax

Maximum saturated depth (m).

param_TSS

Reduction parameter related to TSS.

Type:

float

param_BOD

Reduction parameter related to BOD.

Type:

float

param_TKN_a

Reduction parameter related to TKN (a).

Type:

float

param_TKN_b

Reduction parameter related to TKN (b).

Type:

float

param_CODsb

Reduction parameter related to CODsb.

Type:

float

Cin

Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

Type:

list

Cobj

Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Type:

list

V_values

Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

Type:

list

Q

Flow rate (m3/day).

Type:

float

Supplementary_Objective_Function(V_values, Cin, Cobj):

Supplementary objective function for the process.

Reduction_Function(V_values, Cin, Q):

Reduction function for the process.

Create_Constraint_TSS(V_values, Cin):

Create TSS constraint, corresponding to the difference between the TSS load constraint and the actual TSS inlet load.

Create_Constraint_BOD(V_values, Cin):

Create BOD5 constraint, corresponding to the difference between the DOB5 load constraint and the actual BOD5 inlet load.

Create_Constraint_TKN(V_values, Cin):

Create TKN constraint, corresponding to the difference between the TKN load constraint and the actual TKN inlet load.

Create_Constraint_COD(V_values, Cin):

Create CODt constraint, corresponding to the difference between the CODt load constraint and the actual CODt inlet load.

Surface_Area_Function(V_values, Q):

Calculate the total surface area of the process.

Depth_Function_Unsat(V_values):

Return the unsaturated depth of the process.

Depth_Function_Sat(self, V_values):

Return the saturated depth of the process.

Depth_Function_Tot(self, V_values):

Return the total depth of the process.

Volume_Function_Unsat(V_values, Q):

Calculate the unsaturated volume of the process.

Volume_Function_Sat(self, V_values, Q):

Calculate the saturated volume of the process.

Volume_Function_Tot(self, V_values, Q):

Calculate the total volume of the process.

Optimal_COD_Load(x):

Calculate the optimal CODt load, as a function of the TKN objective concentration.

Validate_Position(self):

Defines the rules for the position of the process in the treatment train.

Optimal_COD_Load(x)

Calculate the optimal CODt load, as a function of the TKN objective concentration.

Parameters:

x (float) – TKN objective concentration (gTKN/m3).

Returns:

Optimal CODt load.

Return type:

float

Reduction_Function(V_values, Cin, Q, climate)

Reduction functions for the first stage type VdNS process.

Parameters:
  • V_values (list) – VdNS1 volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

  • Q (float) – Flow rate (m3/day).

Returns:

Output concentrations after reduction ([TSS]out : Cout[0] (mgTSS/L), [BOD5]out : Cout[1] (mgDOD5/L), [TKN]out : Cout[2] (mgTKN/L), [CODdb]out : Cout[3] (mgCODdb/L), [CODdi]out : Cout[4] (mgCODdi/L), [CODp]out : Cout[5] (mgCODp/L), [N-NO3]out : Cout[6] (mgN-NO3/L), [TN]out : Cout[7] (mgN/L), [P]out : Cout[8] (mgP/L), [EColi]out : Cin[9] (UFC/100mL)).

Return type:

list

Supplementary_Objective_Function(V_values, Cin, Cobj)

Supplementary objective function for the first stage type VdNS process, corresponding to the normalized squared error between the optimal CODt load and the actual CODt load.

Parameters:
  • V_values (list) – VdNS1 volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Returns:

Result of the supplementary objective function.

Return type:

float

Validate_Position(combination)

Defines the rules for the position of the first stage type VdNS process in the treatment train.

Returns:

True if the position is valid, otherwise False.

Return type:

bool

class wetlandoptimizer.treatment.VdNS2(Name, Lim_TSS, Lim_BOD, Lim_TKN, Lim_COD, Nb_parallel, Material, Mat_cost, Xmin, Xmax, Zmin, Zmax, Amin, Amax, Param_TSS, Param_BOD, Param_TKN_a, Param_TKN_b, Param_CODsb, Cin=[], Cobj=[], V_values=[], Q=None, climate=None)

A class to represent a second stage type treatment wetland process (VdNS2).

Name

Name of the process.

Type:

str

Lim_TSS

Surfacic TSS load limit (gTSS/m2/day).

Type:

float

Lim_BOD

Surfacic BOD5 load limit (gO2/m2/day).

Type:

float

Lim_TKN

Surfacic TKN load limit (gTKN/m2/day).

Type:

float

Lim_COD

Surfacic COD load limit (gO2/m2/day).

Type:

float

Nb_parallel

Number of parallel processes for load alternance.

Type:

int

Material

Material used (gravel or sand).

Type:

str

Mat_cost

Ton of material cost compared to the cost of one ton of gravel ((Tmat€/m3)/(Tgravel€/m3)).

Type:

float

Xmin

Hydraulic minimum surface loading rate (m/day).

Type:

float

Xmax

Hydraulic maximum surface loading rate (m/day).

Type:

float

Zmin

Minimum unsaturated depth (m).

Type:

float

Zmax

Maximum unsaturated depth (m).

Type:

float

Amin

Minimum saturated depth (m).

Amax

Maximum saturated depth (m).

param_TSS

Reduction parameter related to TSS.

Type:

float

param_BOD

Reduction parameter related to BOD.

Type:

float

param_TKN_a

Reduction parameter related to TKN (a).

Type:

float

param_TKN_b

Reduction parameter related to TKN (b).

Type:

float

param_CODsb

Reduction parameter related to CODsb.

Type:

float

Cin

Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

Type:

list

Cobj

Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Type:

list

V_values

Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

Type:

list

Q

Flow rate (m3/day).

Type:

float

Supplementary_Objective_Function(V_values, Cin, Cobj):

Supplementary objective function for the process.

Reduction_Function(V_values, Cin, Q):

Reduction function for the process.

Create_Constraint_TSS(V_values, Cin):

Create TSS constraint, corresponding to the difference between the TSS load constraint and the actual TSS inlet load.

Create_Constraint_BOD(V_values, Cin):

Create BOD5 constraint, corresponding to the difference between the DOB5 load constraint and the actual BOD5 inlet load.

Create_Constraint_TKN(V_values, Cin):

Create TKN constraint, corresponding to the difference between the TKN load constraint and the actual TKN inlet load.

Create_Constraint_COD(V_values, Cin):

Create CODt constraint, corresponding to the difference between the CODt load constraint and the actual CODt inlet load.

Surface_Area_Function(V_values, Q):

Calculate the total surface area of the process.

Depth_Function_Unsat(V_values):

Return the unsaturated depth of the process.

Depth_Function_Sat(self, V_values):

Return the saturated depth of the process.

Depth_Function_Tot(self, V_values):

Return the total depth of the process.

Volume_Function_Unsat(V_values, Q):

Calculate the unsaturated volume of the process.

Volume_Function_Sat(self, V_values, Q):

Calculate the saturated volume of the process.

Volume_Function_Tot(self, V_values, Q):

Calculate the total volume of the process.

Optimal_COD_Load(x):

Calculate the optimal CODt load, as a function of the TKN objective concentration.

Validate_Position(self):

Defines the rules for the position of the process in the treatment train.

Reduction_Function(V_values, Cin, Q, climate)

Reduction functions for the second stage type VdNS process.

Parameters:
  • V_values (list) – VdNS1 volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

  • Q (float) – Flow rate (m3/day).

Returns:

Output concentrations after reduction ([TSS]out : Cout[0] (mgTSS/L), [BOD5]out : Cout[1] (mgDOD5/L), [TKN]out : Cout[2] (mgTKN/L), [CODdb]out : Cout[3] (mgCODdb/L), [CODdi]out : Cout[4] (mgCODdi/L), [CODp]out : Cout[5] (mgCODp/L), [N-NO3]out : Cout[6] (mgN-NO3/L), [TN]out : Cout[7] (mgN/L), [P]out : Cout[8] (mgP/L), [EColi]out : Cin[9] (UFC/100mL)).

Return type:

list

Supplementary_Objective_Function(V_values, Cin, Cobj)

Supplementary objective function for the second stage type VdNS process, which is equal to zero for this process.

Parameters:
  • V_values (list) – VdNS1 volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Returns:

Result of the supplementary objective function.

Return type:

float

Validate_Position(combination)

Defines the rules for the position of the second stage type VdNS process in the treatment train.

Returns:

True if the position is valid, otherwise False.

Return type:

bool

class wetlandoptimizer.treatment.VdNSS(Name, Lim_TSS, Lim_BOD, Lim_TKN, Lim_COD, Nb_parallel, Material, Mat_cost, Xmin, Xmax, Zmin, Zmax, Amin, Amax, Param_TSS, Param_BOD, Param_TKN_a, Param_TKN_b, Param_CODsb, Cin=[], Cobj=[], V_values=[], Q=None, climate=None)

A class to represent a first stage with a saturated bottom type treatment wetland process (VdNSS).

Name

Name of the process.

Type:

str

Lim_TSS

Surfacic TSS load limit (gTSS/m2/day).

Type:

float

Lim_BOD

Surfacic BOD5 load limit (gO2/m2/day).

Type:

float

Lim_TKN

Surfacic TKN load limit (gTKN/m2/day).

Type:

float

Lim_COD

Surfacic COD load limit (gO2/m2/day).

Type:

float

Nb_parallel

Number of parallel processes for load alternance.

Type:

int

Material

Material used (gravel or sand).

Type:

str

Mat_cost

Ton of material cost compared to the cost of one ton of gravel ((Tmat€/m3)/(Tgravel€/m3)).

Type:

float

Xmin

Hydraulic minimum surface loading rate (m/day).

Type:

float

Xmax

Hydraulic maximum surface loading rate (m/day).

Type:

float

Zmin

Minimum unsaturated depth (m).

Type:

float

Zmax

Maximum unsaturated depth (m).

Type:

float

Amin

Minimum saturated depth (m).

Amax

Maximum saturated depth (m).

param_TSS

Reduction parameter related to TSS.

Type:

float

param_BOD

Reduction parameter related to BOD.

Type:

float

param_TKN_a

Reduction parameter related to TKN (a).

Type:

float

param_TKN_b

Reduction parameter related to TKN (b).

Type:

float

param_CODsb

Reduction parameter related to CODsb.

Type:

float

Cin

Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

Type:

list

Cobj

Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Type:

list

V_values

Process volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

Type:

list

Q

Flow rate (m3/day).

Type:

float

Supplementary_Objective_Function(V_values, Cin, Cobj):

Supplementary objective function for the process.

Reduction_Function(V_values, Cin, Q):

Reduction function for the process.

Create_Constraint_TSS(V_values, Cin):

Create TSS constraint, corresponding to the difference between the TSS load constraint and the actual TSS inlet load.

Create_Constraint_BOD(V_values, Cin):

Create BOD5 constraint, corresponding to the difference between the DOB5 load constraint and the actual BOD5 inlet load.

Create_Constraint_TKN(V_values, Cin):

Create TKN constraint, corresponding to the difference between the TKN load constraint and the actual TKN inlet load.

Create_Constraint_COD(V_values, Cin):

Create CODt constraint, corresponding to the difference between the CODt load constraint and the actual CODt inlet load.

Surface_Area_Function(V_values, Q):

Calculate the total surface area of the process.

Depth_Function_Unsat(V_values):

Return the unsaturated depth of the process.

Depth_Function_Sat(self, V_values):

Return the saturated depth of the process.

Depth_Function_Tot(self, V_values):

Return the total depth of the process.

Volume_Function_Unsat(V_values, Q):

Calculate the unsaturated volume of the process.

Volume_Function_Sat(self, V_values, Q):

Calculate the saturated volume of the process.

Volume_Function_Tot(self, V_values, Q):

Calculate the total volume of the process.

Validate_Position(self):

Defines the rules for the position of the process in the treatment train.

Reduction_Function(V_values, Cin, Q, climate)

Reduction functions for the first stage with a saturated bottom type process.

Parameters:
  • V_values (list) – VdNS1 volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

  • Q (float) – Flow rate (m3/day).

Returns:

Output concentrations after reduction ([TSS]out : Cout[0] (mgTSS/L), [BOD5]out : Cout[1] (mgDOD5/L), [TKN]out : Cout[2] (mgTKN/L), [CODdb]out : Cout[3] (mgCODdb/L), [CODdi]out : Cout[4] (mgCODdi/L), [CODp]out : Cout[5] (mgCODp/L), [N-NO3]out : Cout[6] (mgN-NO3/L), [TN]out : Cout[7] (mgN/L), [P]out : Cout[8] (mgP/L), [EColi]out : Cin[9] (UFC/100mL)).

Return type:

list

Supplementary_Objective_Function(V_values, Cin, Cobj)

Supplementary objective function for the first stage with a saturated bottom type process, corresponding to the normalized squared error between the optimal CODt load and the actual CODt load.

Parameters:
  • V_values (list) – VdNS1 volume values (Q / surface area : V[0] (m/day) and depth : V[1] (m)).

  • Cin (list) – Input concentrations ([TSS]in : Cin[0] (mgTSS/L), [BOD5]in : Cin[1] (mgBOD5/L), [TKN]in : Cin[2] (mgTKN/L), [CODdb]in : Cin[3] (mgCODdb/L), [CODdi]in : Cin[4] (mgCODdi/m3), [CODp]in : Cin[5] (mgCODp/L), [N-NO3]in : Cin[6] (mgN-NO3/L), [P]in : Cin[7] (mgP/L), [EColi]in : Cin[8] (UFC/100mL)).

  • Cobj (list) – Objective concentrations ([TSS]obj : Cobj[0] (mgTSS/L), [BOD5]obj : Cobj[1] (mgBOD5/L), [TKN]obj : Cobj[2] (mgTKN/L), [CODt]obj : Cobj[3] (mgCODt/L), [N-NO3]obj : Cobj[4] (mgN-NO3/L), [TN]obj : Cobj[5] (mgN/L), [P]obj : Cobj[6] (mgP/L), [EColi]obj : Cobj[7] (UFC/100mL)).

Returns:

Result of the supplementary objective function.

Return type:

float

Validate_Position(combination)

Defines the rules for the position of the first stage with a staurated bottom type process in the treatment train.

Returns:

True if the position is valid, otherwise False.

Return type:

bool

class wetlandoptimizer.optimization.Optimizer_French_VF(treatment_train)

A class to perform CMA-ES optimization for the French vertical flow wetland.

treatment_train

The treatment train to optimize.

Type:

Treatment_Train

Optimize():

Performs the optimization.

Optimize()

Performs the optimization.

Returns:

best_solution_cma – Best solution found by CMA-ES.

Return type:

list

class wetlandoptimizer.optimization.Optimizer_Gobal_Generation(treatment_train, stages_max, files_max)

A class to perform CMA-ES optimization for the French vertical flow wetland.

treatment_train

The treatment train to optimize.

Type:

Treatment_Train

Optimize():

Performs the optimization for a single treatment train.

Optimize_Best_Pathway():

Generate the possible combinations and call the Optimize() function for each generated treatment train.

Optimize(pathway)

Performs the optimization.

Parameters:

pathway (Pathway) – The pathway of the treatment train to optimize.

Returns:

best_solution_cma – Best solution found by CMA-ES.

Return type:

list

Optimize_Best_Pathway()

Generate the possible combinations and call the Optimize() function for each generated treatment train.

Returns:

sorted_results – List of optimized and possible combinations.

Return type:

list

class wetlandoptimizer.optimization.Optimizer_Gobal_Generation_All(treatment_train, stages_max, files_max)

A class to perform CMA-ES optimization for the French vertical flow wetland.

treatment_train

The treatment train to optimize.

Type:

Treatment_Train

Optimize():

Performs the optimization for a single treatment train.

Optimize_Best_Pathway():

Generate the possible combinations and call the Optimize() function for each generated treatment train.

Optimize(pathway)

Performs the optimization.

Parameters:

pathway (Pathway) – The pathway of the treatment train to optimize.

Returns:

best_solution_cma – Best solution found by CMA-ES.

Return type:

list

Optimize_Best_Pathway()

Generate the possible combinations and call the Optimize() function for each generated treatment train.

Returns:

sorted_results – List of optimized and possible combinations.

Return type:

list