sutra2.Transport_Removal module
- class sutra2.Transport_Removal.MicrobialOrganism(organism_name, alpha0_suboxic: Optional[int] = None, alpha0_anoxic: Optional[int] = None, alpha0_deeply_anoxic: Optional[int] = None, pH0_suboxic: Optional[int] = None, pH0_anoxic: Optional[int] = None, pH0_deeply_anoxic: Optional[int] = None, mu1_suboxic: Optional[int] = None, mu1_anoxic: Optional[int] = None, mu1_deeply_anoxic: Optional[int] = None, organism_diam: Optional[int] = None)
Bases:
objectPlaceholder class which will later be replaced by the QSAR functionality of AquaPriori ?!
For removal of microbial organisms (‘mbo’) / pathogen
- Returns
microbial_species_dict (dict)
removal_function = ‘mbo’
- class sutra2.Transport_Removal.Substance(substance_name, molar_mass: Optional[int] = None, partition_coefficient_water_organic_carbon: Optional[int] = None, dissociation_constant: Optional[int] = None, halflife_suboxic: Optional[int] = None, halflife_anoxic: Optional[int] = None, halflife_deeply_anoxic: Optional[int] = None)
Bases:
objectPlaceholder class which will later be replaced by the QSAR functionality of AquaPriori.
For removal of organic micro pollutants (omp)
- Returns
microbial_species_dict (dict)
removal_function = ‘omp’
- class sutra2.Transport_Removal.Transport(well: AnalyticalWell, pollutant: Substance)
Bases:
object# @Steven –> verander in ‘Transport’ Substance + Organism –> Pollutant Returns concentration in a groundwater well for a given Organic Micro Pollutant or microbial species.
- well
The AnalyticalWell object for the schematisation of the aquifer type.
- Type
object
- omp_inialized
Boolian indicating whether the Substance object has been initialized
- Type
bool
- df_flowline
Column ‘flowline_id’: int Column ‘flowline_type’: string Column ‘flowline_discharge’: float Column ‘particle_release_day’: float Column ‘input_concentration’: float Column ‘endpoint_id’: int Column ‘well_discharge’: float Column ‘name’: string Column ‘removal_function’: string Column ‘total_breakthrough_travel_time’: float Column ‘breakthrough_concentration’: float
- Type
pandas.DataFrame
- df_particle
Column ‘flowline_id’: int Column ‘zone’: string Column ‘travel_time’: float Column ‘xcoord’: float Column ‘ycoord’: float Column ‘zcoord’: float Column ‘redox’: float Column ‘temp_water’: float Column ‘travel_distance’: float Column ‘porosity’: float Column ‘dissolved_organic_carbon’: float Column ‘pH’: float Column ‘fraction_organic_carbon’: float Column ‘solid_density’: float Column ‘input_concentration’: float Column ‘steady_state_concentration’: float Column ‘omp_half_life’: float Column ‘log_Koc’: float Column ‘pKa’: float Column ‘Koc_temperature_correction’: float Column ‘omp_half_life_temperature_corrected’: float Column ‘retardation’: float Column ‘breakthrough_travel_time’: float
- Type
pandas.DataFrame
- substance: object
The Substance object with the OMP of interest.
- substance_dict: dictionary
Nested dictionary with the following per substance.
- substance_name: String,
substance_name of the substance (for now limited dictionary to ‘benzene’, ‘AMPA’, ‘benzo(a)pyrene’
- log Koc: float
distribution coefficient of organic carbon and water [-]
- molar_mass: float
molar mass of substance [g/mol]
- pKa: float
disassociation constant for acic H-OMP [-]
- omp_half_life: float
per redox zone (‘suboxic’, ‘anoxic’, deeply_anoxic’), [days]
- organism: object
The microbial organism object with the microbial organism (mbo) of interest
- organism_dict: dictionary
- ‘alpha0’: float
reference_collision_efficiency [-] per redox zone (‘suboxic’, ‘anoxic’, deeply_anoxic’)
- ‘pH0’: float
reference pH for calculating collision efficiency [-] per redox zone (‘suboxic’, ‘anoxic’, deeply_anoxic’)
- ‘organism_diam’: float
diameter of pathogen/species [m]
- ‘mu1’: float
inactivation coefficient [1/day] per redox zone (‘suboxic’, ‘anoxic’, deeply_anoxic’)
- calc_advective_microbial_removal(df_particle: Optional[DataFrame] = None, df_flowline: Optional[DataFrame] = None, endpoint_id: str = 'well1', trackingdirection='forward', grainsize=0.00025, temp_water=11.0, rho_water=999.703, redox='anoxic', por_eff=0.33, pH=7.5, organism_name=None, organism_diam=2.33e-08, mu1=0.023, alpha0=1e-05, pH0=6.8, conc_start=1.0, conc_gw=0.0)
Calculate the steady state concentration along traveled distance per node for each pathline from startpoint to endpoint_id’ after advective microbial removal.
- For more information about the advective microbial removal calculation:
BTO2012.015: Ch 6.7 (page 71-74)
#SR_todo: remove df_flowline ‘substance’, ‘removal_function’, ‘input_concentration’ [species independent vars] #SR todo: remove df_particle ‘lamda’ # –> not input, but output (replace ‘substance’ by ‘name’ of OMP or MBO)
- df_particle
Column ‘flowline_id’: int Column ‘xcoord’: float Column ‘ycoord’: float Column ‘zcoord’: float Column ‘relative_distance’: float Column ‘travel_time’: float Column ‘total_travel_time’: float Column ‘porosity’: float Column ‘porewater_velocity’: float
- Type
pandas.DataFrame
- df_flowline
- Column ‘flowline_id’: int or str
Identifier of pathline
- Column ‘flowline_type’: str
Source of contamination [‘diffuse_source’,’point_source’,]
- Column ‘flowline_discharge’: float
Flux per flowline (=’pathline’) [m^3 d-1]
- Column ‘particle_release_day’: float or int
Delay in release of contaminants [days]
- Column ‘endpoint_id’: int or str
Endpoint id of the flowline
- Column ‘well_discharge’: float
Cumulative flux of flowlines to well [m^3 d-1]
- Type
pandas.DataFrame
- endpoint_id
ID for which to calculate the final concentration.
- Type
str or int
- tracking_direction
tracking direction of particles [‘forward’,’backward’]
- Type
str
- grainsize
grain diameter of sediment [m]
- Type
float
- temp_water
Water temperature [degrees celcius]
- Type
float
- rho_water
Water density [kg m-3]
- Type
float
- redox
redox condition [‘suboxic’,’anoxic’,’deeply_anoxic’]
- Type
str
- por_eff
effective porosity [-]
- Type
float
- pH
pH of the water [-]
- Type
float
- mu1
inactivation coefficient [day-1]
- Type
float
- pH0
reference pH for which alpha0 was determined
- Type
float
- alpha
‘sticky coefficient’ [-], pH corrected
- Type
float
- alpha0
‘reference sticky coefficient’, for a reference pH [pH0]
- Type
float
- organism_diam
organism/species diameter [m]
- Type
float
- v_por
porewater velocity [m/d]
- Type
float
- conc_start
starting concentration
- Type
float
- conc_gw
initial groundwater concentration
- Type
float
- distance_traveled
distance between points [m]
- Type
float
- traveltime
time between start and endpoint [days]
- Type
float
- Returns
df_flowline (pandas.DataFrame) –
- Column “name”: str
organism name of organism to calculate removal for
- Column “organism_diam”: str
organism diam of organism to calculate removal for
- Column “removal_function”: str
filled with ‘mbo’ -> removal function for microbial organisms other option -> ‘omp’ -> for removal of organic micropollutants
- Column “input_concentration”: float
Starting concentration of OMP or mbo of interest [N/L]
- Column “input_concentration_gw”: float
Starting concentration in ambient groundwater [N/L]
- Column “breakthrough_concentration”: float
Breakthrough_concentration over flowline (after reaching endpoint_id) [N/L]
- Column “breakthrough_travel_time”: float
Cumulative traveltime per flowline from start to endpoint [days]
- Column “concentration_in_well”: float
Steady-state concentration in well for endpoint_id (assuming all flowlines were contaminated a traveltime duration ago)
df_particle (pandas.DataFrame) –
- Column “relative_distance”: float
distance between previous and current node
- Column “porewater_velocity”: float
groundwater velocity between previous and current node
- Column “k_att”: float
’attachment coefficient’ [day-1]
- Column “lamda”: float
’removal rate’ [day-1] (redox dependent) –> calculated
- Column “alpha”: float
’sticky coefficient’ [-], pH corrected
- Column “steady_state_concentration”: float
Steady-state concentration at each node, calculated [N/L]
- calc_lambda(df_particle, df_flowline, redox='anoxic', mu1=0.149, por_eff=0.33, grainsize=0.00025, alpha0=0.001, pH=7.5, pH0=7.5, temp_water=10.0, rho_water=999.703, organism_diam=2.33e-08, v_por=0.01)
For more information about the advective microbial removal calculation: BTO2012.015: Ch 6.7 (page 71-74)
Calculate removal coefficient lambda [/day].
- Parameters
redox (str) – redox condition [‘suboxic’,’anoxic’,’deeply_anoxic’]
mu1 (float) – inactivation coefficient [day-1]
por_eff (float) – effective porosity [-]
grainsize (float) – grain diameter of sediment [m]
alpha0 (float) – ‘reference sticky coefficient’, for a reference pH [pH0]
pH (float) – pH of the water [-]
pH0 (float) – reference pH for which alpha0 was determined
temp_water (float) – Water temperature [degrees celcius]
rho_water (float) – Water density [kg m-3]
alpha (float) – ‘sticky coefficient’ [-], pH corrected
organism_diam (float) – Organism/species diameter [m]
v_por (float) – porewater velocity [m/d]
const_BM (float) – Boltzmann constant [1,38 × 10-23 J K-1]
- Returns
df_flowline (pandas.DataFrame) – Column “organism_diam” for each node
df_particle (pandas.DataFrame) – Column “relative_distance” for each node Column “porewater_velocity” for each node Column “k_att” for each node Column “lamda” for each node Column “alpha” for each node
- compute_concentration_in_well_at_date()
Calculates the concentration in the well up to a specific date, taking into account the start and end date of the contamiantion and start date of the well.
- Returns
df_well_concentration –
- Column ‘time’: float
- Array of time starting at minimum of the ‘start_date_well’ or ‘start_date_contamination’ as time = 0
and the other value is set as negative.
- Column ‘date’: datetime.date
Array of dates starting at the minimum of the ‘start_date_well’ or ‘start_date_contamination’
- Column total_concentration_in_well: float
Summed concentration of the OMP in the well.
- Return type
pandas.dataframe
- compute_omp_removal()
Calculates the concentration in the well of each flowline. Returns the values in ‘df_flowline’ and ‘df_particle’ as attributes of the object.
- Returns
df_flowline (pandas.DataFrame) – Column ‘flowline_id’: Integer Column ‘flowline_type’: string Column ‘flowline_discharge’: Float Column ‘particle_release_day’: Float Column ‘input_concentration’: float Column ‘endpoint_id’: Integer Column ‘well_discharge’: float Column ‘name’: string Column ‘removal_function’: string Column ‘total_breakthrough_travel_time’: float The breakthrough concentration in the well for the OMP taking into account retardation. Column ‘breakthrough_concentration’: float The breakthrough concentration in the well for the OMP taking into account sorption and biodegradation.
df_particle (pandas.DataFrame) – Column ‘flowline_id’: int Column ‘zone’: string Column ‘travel_time’: float Column ‘xcoord’: float Column ‘ycoord’: float Column ‘zcoord’: float Column ‘redox’: float Column ‘temp_water’: float Column ‘travel_distance’: float Column ‘porosity’: float Column ‘dissolved_organic_carbon’: float Column ‘pH’: float Column ‘fraction_organic_carbon’: float Column ‘solid_density’: float Column ‘input_concentration’: float Column ‘steady_state_concentration’: float The steady state concentration at the well of the OMP for the flowline, [mass/L] Column ‘omp_half_life’: float Column ‘log_Koc’: float Column ‘pKa’: float Column ‘Koc_temperature_correction’: float The temperature corrected Koc value, only if ‘temp_correction_Koc’ is ‘True’ in the HydroChemicalSchematisation. Column ‘omp_half_life_temperature_corrected’: float The temperature corrected OMP half-life value, if ‘temp_correction_halflife’ is ‘True’ in the HydroChemicalSchematisation. Column ‘retardation’: float Column ‘breakthrough_travel_time’: float
- compute_pathogen_removal()
- plot_age_distribution(df_particle: DataFrame, vmin=0.0, vmax=1.0, orientation={'row': 0}, fpathfig=None, figtext=None, x_text=0, y_text=0, lognorm=True, xmin=0.0, xmax=None, ymin=None, ymax=None, line_dist=1, dpi=192, trackingdirection='forward', cmap='viridis_r', show_vadose=True)
Create pathline plots with residence times using colours as indicator. with: - df_particle: dataframe containing xyzt-points of the particle paths. - fpathfig = output location of plots figtext: figure text to show within plot starting at x-location ‘x_text’ and y-location ‘y_text’. lognorm: True/False (if vmin <= 0. –> vmin = 1.e-5) xmin: left boundary figure xmax: right boundary figure ymin: lower boundary figure ymax: upper boundary figure line_dist: min. distance between well pathlines at source (m) line_freq: show every ‘X’ pathlines dpi: pixel density trackingdirection: direction of calculating flow along pathlines” cmap: Uses colormap ‘viridis_r’ (viridis reversed as default) show_vadose: T/F (if True, include vadose zone flow lines; default = True)
- plot_concentration(xlim=None, ylim=None, as_fraction_input=None, x_axis='Date')
Plot the concentration of the given OMP as a function of time since the start of the contamination
- Parameters
x_axis (string) – Choice of the x-axis as ‘Time’ in years starting at 0, or as the ‘Date’ since the minimum of ‘start_date_well’ or ‘start_date_contamination’
as_fraction_input (bool) – If ‘True’ plots concentration on y-axis as a fraction of the sum of the input concentration (diffuse and point source), [C/C0]
xlim (array) – The x-axis limits
ylim (array) – The y-axis limits
here? (ReturnVage @MartinK what to put) –
- plot_logremoval(df_particle: DataFrame, df_flowline: DataFrame, vmin=0.0, vmax=1.0, orientation={'row': 0}, fpathfig=None, figtext=None, x_text=0, y_text=0, lognorm=True, xmin=0.0, xmax=None, line_dist=1, dpi=192, trackingdirection='forward', cmap='viridis_r')
Create pathline plots with log removal using colours as indicator. with: - df_particle: dataframe containing xyzt-points of the particle paths. - fpathfig = output location of plots figtext: figure text to show within plot starting at x-location ‘x_text’ and y-location ‘y_text’. lognorm: True/False (if vmin <= 0. –> vmin = 1.e-5) line_dist: min. distance between well pathlines at source (m) line_freq: show every ‘X’ pathlines dpi: pixel density trackingdirection: direction of calculating flow along pathlines” cmap: Uses colormap ‘viridis_r’ (viridis reversed as default)
- plot_travel_time_distribution(df_particle, times_col='total_travel_time', distance_col='xcoord', index_col='flowline_id', fpath_fig=None)
Plot cumululative travel times using column ‘times_col’ relative to distance ‘distance_col’ per pathline with index column ‘index_col’.