Skip to content
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

BMI for a Water System Reservoir Model #217

Open
pdmich opened this issue Sep 21, 2023 · 1 comment
Open

BMI for a Water System Reservoir Model #217

pdmich opened this issue Sep 21, 2023 · 1 comment

Comments

@pdmich
Copy link

pdmich commented Sep 21, 2023

First of all, we're new to BMI, so please excuse the ignorance. We're working on a bmi adapter for water systems model (MODSIM). These models traditionally consist of "nodes" which can be reservoirs, inflow points, water system demands (etc.), and then "links" which connect the nodes together and define the flow paths in the system. Looking though the documentation and examples, I'm not quite sure how to fit in some of the BMI logic into this model. For example, the "get_value" or "set_value" logic seems to only have parameters for variable name and an array. If you had a variable "reservoir_storage", but your model had 20 reservoir nodes, are there ways to specify which specific reservoir you want to interact with based on some id other than the variable? Using the current non-bmi version of the model, you can do this, and it is pretty useful. Maybe you would need to use some the "grid" logic in bmi for this? Or do you have to just use the array indices? I noticed in the MODFLOW implementation, they added an additional function "get_value_address" which seems to use some other logic to do this, but that doesn't seem to be part of the standard library. Any help or examples on how we should tackle this would be much appreciated, thanks!

@mdpiper
Copy link
Member

mdpiper commented Nov 3, 2023

👋 @pdmich! I agree with what you've described. The key, which you've hit on, is that the BMI doesn't preclude helper functions. For your "reservoir_storage" example variable, you would get/set values on it by indexing, optionally using a helper function to translate between identifiers from the model and array indices in the BMI for the model.

Does this make sense? Please let me know what you think. (I'll try to be better about responding in a timely fashion.)

Tagging @mcflugen in case I missed anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants