Skip to content

Instantly share code, notes, and snippets.

@sergiolucero
Created August 13, 2017 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergiolucero/35cca12ae59b0d555480a7db618bec66 to your computer and use it in GitHub Desktop.
Save sergiolucero/35cca12ae59b0d555480a7db618bec66 to your computer and use it in GitHub Desktop.
how to solve the groundwater remediation problem
from pflotran import Flow, Transport
from randomsoils import soil_generator
import pandas as pd
nYears = 30; time_step = 1/12 # allow change every month
grid, wells = pd.read_csv('basic_grid_and_wells.csv')
for ix in range(nRuns): # run a few simulations
modified_soil = soil_generator(grid)
pumping_schedule = pd.random(wells, range(0,nYears,time_step))
contamination_levels = Transport(Flow(pumping_schedule, grid))
pumping_cost = well_cost*pumping_schedule
penalty_cost = sum(max(contamination_levels-THRESHOLD,0), observation_wells)
print('TOTAL_COST = %f', pumping_cost + penalty_cost)
@sergiolucero
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment