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

Unexpected simulation error for Tank with volume curve and CanOverflow #64

Open
pajarrige opened this issue Jan 18, 2024 · 1 comment
Open

Comments

@pajarrige
Copy link

When a model contains one or more tank with a volume curve AND CanOverflow attribute, it cannot be simulated from GUI:

  • simulation is OK with the toolkit.
  • opening the model with Epanet is OK.
  • when running the analysis you get "Error 206: undefined curve -16s in [TANKS] section:" error.
    See the .inp file attached
    Tank_vol_curve+overflow.inp.txt
@pajarrige pajarrige changed the title Unexpected simulation error with Tank with volume curve and CanOverflow Unexpected simulation error for Tank with volume curve and CanOverflow Jan 18, 2024
@lbutler
Copy link

lbutler commented Apr 18, 2024

This bug is caused by Line 402 the following section of code:

if SameText(Data[TANK_OVERFLOW_INDEX], 'Yes') then
begin
if Length(Trim(Data[TANK_VCURVE_INDEX])) = 0
then s := s + '* '#9
else s := s + Format('-16s'#9, [Data[TANK_VCURVE_INDEX]]);
s := s + 'Yes'#9';' + Data[COMMENT_INDEX];
end
else s := s + Format('%-16s'#9';%s', [Data[TANK_VCURVE_INDEX],
Data[COMMENT_INDEX]]);
Writeln(F, s);

The Format function is missing the % character and the line should be rewritten like so:

else s := s + Format('%-16s'#9, [Data[TANK_VCURVE_INDEX]]);

I tested this over at the OWA EPANET GUI and was able to fix the bug.

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