-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nutrient concentrations #72
Conversation
I have added Mirjam Blokker as a reviewer since she has more experience with the nutrients part of simdeum |
pysimdeum/data/NL/ww_nutrients.toml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the Wc, I can imagine you would have different values for a full flush (faeces) and half flush (urine). For the dishwasher and washing machine you may also want to discern between first discharge (dirt and grease), second discharge (soap residu added) and 3rd + 4th discharge (mainly water). This may be too much detail for now, but would be nice to at least have a simple solution in a later version. We may want to discuss this next week
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense. Wc
we think we've got the data to do that quite easily. For WashingMachine
and Dishwasher
we're looking around. I've set up an issue about this which we'll address next week so we can get this PR closed. #76
pysimdeum/core/house.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the greywater and blackwater type. In the future this may be extended to light grey and dark grey, blue, green and yellow water :-)
xr.Dataset: The updated xarray.Dataset containing the discharge data and the nutrient concentrations. | ||
""" | ||
|
||
toml_file_path = os.path.join(DATA_DIR, 'NL', 'ww_nutrients.toml') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hard coded 'NL'
will need an update with the roll out of PR 73, as well as a new config file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, we'll address that in your PR when pulling from master #77
pysim-nutrients.ipynb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a useful addition!
This PR makes an addition for calculating nutrient concentrations of discharge flows. This first pass makes some simplistic assumptions that:
ww_nutrients.toml
are given ing/l
Firstly, a small addition is made that categorises the wastewater of each enduse into
blackwater
orgreywater
discharge types. This allows for summarising across discharge types such asdischarge.sum(["enduse","user"]).sel(dischargetypes="greywater").plot()
Nutrient concentrations
The main section of this PR is an addition to calculate nutrient concentrations from the discharge flows of each enduse. You can think of this as post-processing analysis applied after the simulation stage. As this occurs after the simulation, I thought it would be better to not edit the
discharge
object directly. Instead withprocess_discharge_nutrients
I've made use of thexarray.Dataset
which allows you to store axarray.DataArray
(thedischarge
object) in it as well as a number of other variables.dataset_to_df
converts these Dataset variables back to apd.DataFrame
I've included a notebook
pysim-nutrients.ipynb
showing how to run this for you to check more easily. will tidy before merging.Note that values in
ww_nutrients.toml
are just dummy values for now.