Skip to content

question about minimum volume for new segments - performance implications #813

Open
@samhatchett

Description

@samhatchett

When the quality engine is looking at node outflows, the following logic is used in determining if new segments are produced.

In short, the volume of a new segment must be greater than 0.0 and its quality value has to be outside of Ctol - otherwise no new segment is produced.

EPANET/src/qualroute.c

Lines 341 to 357 in fbd005d

v = fabs(LINKFLOW(k)) * tstep;
if (v == 0.0) return;
// Release flow and mass into upstream end of the link
// ... case where link has a last (most upstream) segment
seg = qual->LastSeg[k];
if (seg)
{
// ... if node quality close to segment quality then mix
// the nodal outflow volume with the segment's volume
if (fabs(seg->c - c) < qual->Ctol)
{
seg->c = (seg->c*seg->v + c*v) / (seg->v + v);
seg->v += v;
}

This approach has some pretty severe performance impacts on large networks, run for long times, that have dead-end pipes. After a while, even with large tolerance values, the number of segments skyrockets because the volume of these new segments, while greater than 0.0, is still vanishingly small.

I'm wondering about the introduction of a "volume tolerance" term here to skip new segment creation when the volume of the new segment would be negligible in the eyes of the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions