API Reference - Storage (reservoir, river, groundwater)
This section of the documentation provides a reference for the API of the nodes.storage module.
Created on Mon Nov 15 14:20:36 2021.
@author: bdobson Converted to totals on 2022-05-03
Groundwater
Bases: Storage
Source code in wsimod/nodes/storage.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
|
__init__(residence_time=200, infiltration_threshold=1, infiltration_pct=0, data_input_dict={}, **kwargs)
A storage with a residence time for groundwater. Can also infiltrate to sewers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
residence_time
|
float
|
Residence time (see nodes.py/ ResidenceTank). Defaults to 200. |
200
|
infiltration_threshold
|
float
|
Proportion of storage capacity that must be exceeded to generate infiltration. Defaults to 1. |
1
|
infiltration_pct
|
float
|
Proportion of storage above the threshold that is square rooted and infiltrated. Defaults to 0. |
0
|
data_input_dict
|
dict
|
Dictionary of data inputs relevant for the node (though I don't think it is used). Defaults to {}. |
{}
|
Functions intended to call in orchestration
infiltrate (before sewers are discharged)
distribute
Key assumptions
- Conceptualises groundwater as a tank.
- Baseflow is generated following a residence-time method.
- Baseflow is sent to
storage.py/River
,nodes.py/Node
orwaste.py/Waste
nodes. - Infiltration to
sewer.py/Sewer
nodes occurs when the storage in the tank is greater than a specified threshold, at a rate proportional to the sqrt of volume above the threshold. (Note, this behaviour is not validated and a high uncertainty process in general) - If
decays
are provided to model water quality transformations, seecore.py/DecayObj
.
Input data and parameter requirements
- Groundwater tank
capacity
,area
, anddatum
. Units: cubic metres, squared metres, metres - Infiltration behaviour determined by an
infiltration_threshold
andinfiltration_pct
. Units: proportion of capacity - Optional dictionary of decays with pollutants as keys and decay parameters (a constant and a temperature sensitivity exponent) as values. Units: -
Source code in wsimod/nodes/storage.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|
apply_overrides(overrides=Dict[str, Any])
Override parameters.
Enables a user to override any of the following parameters: residence_time, infiltration_threshold, infiltration_pct.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides
|
Dict[str, Any]
|
Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. |
Dict[str, Any]
|
Source code in wsimod/nodes/storage.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
|
distribute()
Calculate outflow with residence time and send to Nodes or Rivers.
Source code in wsimod/nodes/storage.py
222 223 224 225 226 227 228 229 |
|
infiltrate()
Calculate amount of water available for infiltration and send to sewers.
Source code in wsimod/nodes/storage.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
|
QueueGroundwater
Bases: Storage
Source code in wsimod/nodes/storage.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
|
__init__(timearea={0: 1}, data_input_dict={}, **kwargs)
Alternate formulation of Groundwater that uses a timearea property to enable more nonlinear time behaviour of baseflow routing. Uses the QueueTank or DecayQueueTank (see nodes.py/Tank subclassses).
NOTE: abstraction behaviour from this kind of node need careful checking
Parameters:
Name | Type | Description | Default |
---|---|---|---|
timearea
|
dict
|
Time area diagram that enables flows to take a range of different durations to 'traverse' the tank. The keys of the dict are the number of timesteps while the values are the proportion of flow. E.g., {0 : 0.7, 1 : 0.3} means 70% of flow takes 0 timesteps and 30% takes 1 timesteps. Defaults to {0 : 1}. |
{0: 1}
|
data_input_dict
|
dict
|
Dictionary of data inputs relevant for the node (though I don't think it is used). Defaults to {}. |
{}
|
Functions intended to call in orchestration
distribute
Key assumptions
- Conceptualises groundwater as a tank.
- Baseflow is generated following a timearea method.
- Baseflow is sent to
storage.py/River
,nodes.py/Node
orwaste.py/Waste
nodes. - No infiltration to sewers is modelled.
- If
decays
are provided to model water quality transformations, seecore.py/DecayObj
.
Input data and parameter requirements
- Groundwater tank
capacity
,area
, anddatum
. Units: cubic metres, squared metres, metres timearea
is a dictionary containing the timearea diagram. Units: duration of flow (in timesteps) and proportion of flow- Optional dictionary of decays with pollutants as keys and decay parameters (a constant and a temperature sensitivity exponent) as values. Units: -
Source code in wsimod/nodes/storage.py
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
|
apply_overrides(overrides=Dict[str, Any])
Override parameters.
Enables a user to override any of the following parameters: timearea.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides
|
Dict[str, Any]
|
Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. |
Dict[str, Any]
|
Source code in wsimod/nodes/storage.py
317 318 319 320 321 322 323 324 325 326 327 328 |
|
distribute()
Update internal arc, push active_storage onwards, update tank.
Source code in wsimod/nodes/storage.py
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
|
infiltrate()
Source code in wsimod/nodes/storage.py
366 367 368 |
|
pull_check_active(vqip=None)
A pull check that returns the active storage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP that can be used to limit the volume in the return value (only volume key is used). Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
dict
|
A VQIP amount that is available to pull |
Source code in wsimod/nodes/storage.py
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
|
pull_set_active(vqip)
Pull proportionately from both the active storage and the queue. Adjudging groundwater abstractions to not be particularly sensitive to the within catchment travel time.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP amount to be pulled (only volume key is used) |
required |
Returns:
Name | Type | Description |
---|---|---|
pulled |
dict
|
A VQIP amount that was successfully pulled |
Source code in wsimod/nodes/storage.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
|
push_set_timearea(vqip)
Push setting that enables timearea behaviour, (see init for description).Used to receive flow that is assumed to occur widely across some kind of catchment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP that has been pushed |
required |
Returns:
Name | Type | Description |
---|---|---|
reply |
dict
|
A VQIP amount that was not successfuly receivesd |
Source code in wsimod/nodes/storage.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
|
Reservoir
Bases: Storage
Source code in wsimod/nodes/storage.py
958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 |
|
__init__(**kwargs)
Storage node that makes abstractions by calling pull_distributed.
Functions intended to call in orchestration
make_abstractions (before any river routing)
Key assumptions
- Conceptualised as a
Tank
. - Recharged only via pumped abstractions.
- Evaporation/precipitation onto surface area currently ignored.
- If
decays
are provided to model water quality transformations, seecore.py/DecayObj
.
Input data and parameter requirements
- Tank
capacity
,area
, anddatum
. Units: cubic metres, squared metres, metres - Optional dictionary of decays with pollutants as keys and decay parameters (a constant and a temperature sensitivity exponent) as values. Units: -
Source code in wsimod/nodes/storage.py
961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 |
|
make_abstractions()
Pulls water and updates tanks.
Source code in wsimod/nodes/storage.py
983 984 985 986 987 988 989 |
|
River
Bases: Storage
Source code in wsimod/nodes/storage.py
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 |
|
__init__(depth=2, length=200, width=20, velocity=0.2 * constants.M_S_TO_M_DT, damp=0.1, mrf=0, **kwargs)
Node that contains extensive in-river biochemical processes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
depth
|
float
|
River tank depth. Defaults to 2. length (float, |
2
|
optional)
|
River tank length. Defaults to 200. width (float, optional): |
required | |
River
|
tank width. Defaults to 20. velocity (float
|
River velocity |
required |
damp
|
float
|
Flow delay and attentuation parameter. Defaults to 0.1. |
0.1
|
mrf
|
float
|
Minimum required flow in river (volume per timestep), can limit pulls made to the river. Defaults to 0. |
0
|
Functions intended to call in orchestration
distribute
Key assumptions
- River is conceptualised as a water tank that receives flows from various sources (e.g., runoffs from urban and rural land, baseflow from groundwater), interacts with water infrastructure (e.g., abstraction for irrigation and domestic supply, sewage and treated effluent discharge), and discharges flows downstream. It has length and width as shape parameters, average velocity to indicate flow speed and capacity to indicate the maximum storage limit.
- Flows from different sources into rivers will fully mix. River tank is assumed to have delay and attenuation effects when generate outflows. These effects are simulated based on the average velocity.
- In-river biochemical processes are simulated as sources/sinks of nutrients in the river tank, including - denitrification (for nitrogen) - phytoplankton absorption/release (for nitrogen and phosphorus) - macrophyte uptake (for nitrogen and phosphorus) These processes are affected by river temperature.
Input data and parameter requirements
- depth, length, width Units: m
- velocity Units: m/day
- damping coefficient Units: -
- minimum required flow Units: m3/day
Source code in wsimod/nodes/storage.py
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 |
|
apply_overrides(overrides=Dict[str, Any])
Override parameters.
Enables a user to override any of the following parameters: timearea.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides
|
Dict[str, Any]
|
Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. |
Dict[str, Any]
|
Source code in wsimod/nodes/storage.py
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
|
biochemical_processes()
Runs all biochemical processes and updates pollutant amounts.
Returns:
Name | Type | Description |
---|---|---|
in_ |
dict
|
A VQIP amount that represents total gain in pollutant amounts |
out_ |
dict
|
A VQIP amount that represents total loss in pollutant amounts |
Source code in wsimod/nodes/storage.py
738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 |
|
calculate_discharge()
Source code in wsimod/nodes/storage.py
917 918 919 920 921 922 923 924 |
|
distribute()
Run biochemical processes, track mass balance, and distribute water.
Source code in wsimod/nodes/storage.py
926 927 928 929 930 931 932 933 934 935 936 |
|
end_timestep_()
Update state variables.
Source code in wsimod/nodes/storage.py
951 952 953 954 955 |
|
get_din_pool()
Get total dissolved inorganic nitrogen from tank storage.
Returns:
Type | Description |
---|---|
float
|
total din |
Source code in wsimod/nodes/storage.py
727 728 729 730 731 732 733 734 735 |
|
get_riverrc()
Get river outflow coefficient (i.e., how much water leaves the tank in this timestep).
Returns:
Name | Type | Description |
---|---|---|
riverrc |
float
|
outflow coeffficient |
Source code in wsimod/nodes/storage.py
900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 |
|
pull_check_fp(vqip=None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
|
None
|
Returns:
Source code in wsimod/nodes/storage.py
938 939 940 941 942 943 944 945 946 947 948 949 |
|
pull_check_river(vqip=None)
Check amount of water that can be pulled from river tank and upstream.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
Maximum water required (only 'volume' is used) |
None
|
Returns:
Name | Type | Description |
---|---|---|
avail |
dict
|
A VQIP amount that can be pulled |
Source code in wsimod/nodes/storage.py
660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 |
|
pull_set_river(vqip)
Pull from river tank and upstream, acknowledging MRF with pull_check.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP amount to pull (only volume key used) |
required |
Returns:
Type | Description |
---|---|
dict
|
A VQIP amount that was pulled |
Source code in wsimod/nodes/storage.py
688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 |
|
push_set_river(vqip)
Push to river tank, currently forced.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP amount to push |
required |
Returns:
Type | Description |
---|---|
dict
|
A VQIP amount that was not successfully received |
Source code in wsimod/nodes/storage.py
711 712 713 714 715 716 717 718 719 720 721 |
|
update_depth()
Recalculate depth.
Source code in wsimod/nodes/storage.py
723 724 725 |
|
RiverReservoir
Bases: Reservoir
Source code in wsimod/nodes/storage.py
992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 |
|
__init__(environmental_flow=0, **kwargs)
A reservoir with a natural river inflow, includes an environmental downstream flow to satisfy.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
environmental_flow
|
float
|
Downstream environmental flow. Defaults to 0. |
0
|
Functions intended to call in orchestration
make_abstractions (if any)
satisfy_environmental (before river routing.. possibly before downstream river abstractions depending on licence)
Key assumptions
- Conceptualised as a
Tank
. - Recharged via pumped abstractions and receives water from inflowing arcs.
- Reservoir aims to satisfy a static
environmental_flow
. - If tank capacity is exceeded, reservoir spills downstream
towards
nodes.py/Node
,storage.py/River
orwaste.py/Waste
nodes. Spill counts towardsenvironmental_flow
. - Evaporation/precipitation onto surface area currently ignored.
- Currently, if a reservoir satisfies a pull from a downstream
node, it does not count towards
environmental_flow
. - If
decays
are provided to model water quality transformations, seecore.py/DecayObj
.
Input data and parameter requirements
- Tank
capacity
,area
, anddatum
. Units: cubic metres, squared metres, metres environmental_flow
Units: cubic metres/timestep- Optional dictionary of decays with pollutants as keys and decay parameters (a constant and a temperature sensitivity exponent) as values. Units: -
Source code in wsimod/nodes/storage.py
995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 |
|
apply_overrides(overrides=Dict[str, Any])
Override parameters.
Enables a user to override any of the following parameters: environmental_flow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides
|
Dict[str, Any]
|
Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. |
Dict[str, Any]
|
Source code in wsimod/nodes/storage.py
1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 |
|
end_timestep_()
Udpate state varibles.
Source code in wsimod/nodes/storage.py
1130 1131 1132 1133 |
|
push_check_river_reservoir(vqip=None)
A push check to receive water, assumes spill may occur and checks downstream capacity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP that can be used to limit the volume in the return value (only volume key is used). Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
excess |
dict
|
A VQIP amount of water that cannot be received |
Source code in wsimod/nodes/storage.py
1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 |
|
push_set_river_reservoir(vqip)
Receive water.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP amount to be received |
required |
Returns:
Name | Type | Description |
---|---|---|
reply |
dict
|
A VQIP amount that was not successfully received |
Source code in wsimod/nodes/storage.py
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 |
|
satisfy_environmental()
Satisfy environmental flow downstream.
Source code in wsimod/nodes/storage.py
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 |
|
Storage
Bases: Node
Source code in wsimod/nodes/storage.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
__init__(name, capacity=0, area=0, datum=0, decays=None, initial_storage=0, **kwargs)
A Node wrapper for a Tank or DecayTank.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
node name capacity (float, optional): Tank capacity (see |
required |
nodes.py/Tank).
|
Defaults to 0. area (float
|
Tank area (see |
required |
nodes.py/Tank).
|
Defaults to 0. datum (float
|
Tank datum (see |
required |
nodes.py/Tank).
|
Defaults to 0. decays (dict
|
Tank decays if |
required |
or
|
dict
|
Initial storage (see nodes.py/Tank). Defaults to 0. |
required |
Functions intended to call in orchestration
distribute (optional, depends on subclass)
Source code in wsimod/nodes/storage.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
apply_overrides(overrides=Dict[str, Any])
Override parameters.
Enables a user to override any of the following parameters: capacity, area, datum, decays.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides
|
Dict[str, Any]
|
Dict describing which parameters should be overridden (keys) and new values (values). Defaults to {}. |
Dict[str, Any]
|
Source code in wsimod/nodes/storage.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
distribute()
Optional function that discharges all tank storage with push_distributed.
Source code in wsimod/nodes/storage.py
120 121 122 123 124 125 126 127 |
|
end_timestep()
Update tank states.
Source code in wsimod/nodes/storage.py
134 135 136 |
|
get_percent()
Function that returns the volume in the storage tank expressed as a percent of capacity.
Source code in wsimod/nodes/storage.py
129 130 131 132 |
|
push_set_storage(vqip)
A node wrapper for the tank push_storage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vqip
|
dict
|
A VQIP amount to push to the tank |
required |
Returns:
Name | Type | Description |
---|---|---|
reply |
dict
|
A VQIP amount that was not successfully pushed |
Source code in wsimod/nodes/storage.py
106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
reinit()
Call tank reinit.
Source code in wsimod/nodes/storage.py
138 139 140 141 142 143 |
|