-
Notifications
You must be signed in to change notification settings - Fork 55
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
EN_setLinkValue #42
Comments
@sandcastler yes, pretty much so. Except that a pipe's diameter also affects its resistance coefficient and minor loss factor which are used in the hydraulic solver to compute head loss as a function of flow. So for this particular property the code would look as follows:
|
Thanks @LRossman for the quick respsonse; SO I'm testing this out, It actually gives an error in the error list "expression must be modifiable lvalue". So my solution is to create 'setDiameter' and other function for each in the appropriate location. So for diameter, since its a link specific property (valves/pipes/ect..) I added
and then in the switch case
I assume this is how all properties would need to be set, correct? EDIT: it seems this is appropriate for Length and Diameter thus far. Don't get an lvalue error for roughness. But with the change in roughness, like diameter, I assume setlossfactor and setResistance will need to be recalculated. Edit 2: I don't see a |
I should have mentioned that I've already added most of the missing API functions (including
|
Thanks. I see what my mistake was orginally. Like I mentioned, ramping into understanding syntax and this project is a great one (In my Opinion) to get started. I'm familiar with 2.0 toolkit so I have a good understanding of what things should do. Thanks again! |
OK @LRossman ; So you've created Actrually, it looks to be just a ratio, based off diameter to adjust the existing lossfactor... |
@sandcastler here's what the
with the same function also appearing in I will push my updated version to the |
Yep, that is what I have for the lossFactor as well. Thanks for the update. |
I'm reviewing the code and am 'new' at C++ (though I feel pretty good in VBA/ModL). I noticed that API to set system parameters (EN_setLinkValuie, EN_setControl, EN_setOption, EN_setTimeParam, EN_XXXX, ect...) is not currently developed. If I were to develop some of these, if I understand correctly, I'd want to add to datamanager.cpp; for example, to setLinkValue, I'd take getLinkValue and essentially reverse the method so that the value is set, and not retrieved. so the function would have the same format but essentially switch value and the link parameter variable?
int DataManager::setLinkValue(int index, int param, double value, Network* nw)
and for the switch case:
{
case EN_DIAMETER:
link->diameter * nw->ucf(Units::DIAMETER)=value ;
break;
is it that simple or am I'm missing something.?
The text was updated successfully, but these errors were encountered: