EPANET Programmer’s Toolkit

I have mentioned the EPANET toolkit several times before but didn’t post any information about it yet. The following info is from the toolkit readme file:

EPANET is a program that analyzes the hydraulic and water quality behavior of water distribution systems. The EPANET Programmer’s Toolkit is a dynamic link library (DLL) of functions that allows developers to customize EPANET’s computational engine for their own specific needs. The functions can be incorporated into 32-bit Windows applications written in C/C++, Delphi Pascal, Visual Basic, or any other language that can call functions within a Windows DLL. The Toolkit DLL file is named EPANET2.DLL and is distributed with EPANET. The Toolkit comes with several different header files, function definition files, and .lib files that simplify the task of interfacing it with C/C++, Delphi, and Visual Basic code.

The freeware FireFlow utility was written using the EPANET toolkit.

For more information and download see EPANET web page.







16 Responses to 'EPANET Programmer’s Toolkit'

  1. lekshmibhavana - October 25th, 2005 at 1:54 pm

    sir

    i want to optimise the water distribution system of our campus using ant colony optimisation.
    i am with a set of equations associated with ant colony optimisation and, can you help me to develope a code to link with that of the epanet tool kit.

  2. lekshmibhavana - October 25th, 2005 at 1:56 pm

    can it be open the epanet tool kit with that of windows xp.

  3. Elad - October 26th, 2005 at 10:09 am

    lekshmibhavana,

    1) The toolkit can be used in Windows XP.
    2) What exactly do you need regarding the Ant Colony optimization?

    Elad

  4. lekshmibhavana - November 17th, 2005 at 12:26 pm

    sir
    my project is the optimisation of water distribution system using Ant colony optimisation . Ants secreting a substance called pheromone during there way from nest to the food source. By means of these pheromone successive ants realise the shortest path and thus they can optimise their path . Like wise with the available diameters we can optimise water distribution system by keeping the minimum pressure head and other constraints.

    I came to know that we can develope a programme on Epanet tool kit and can be linked. Can i downloaded that epanet tool kit for that purpose and can you give me further advices about that
    yours sincerely

    LEKSHMI

  5. Elad - November 17th, 2005 at 12:53 pm

    lekshmibhavana,

    The EPANet Toolkit can be dwonloaded from here:
    http://www.epa.gov/ORD/NRMRL/wswrd/EN2toolkit.zip

    Elad

  6. lekshmibhavana - December 14th, 2005 at 12:37 pm

    Sir

    What should be the procedure adopted for writing a programme in c or c++ using toolkit.
    I DOWNLOADED THE EPANET TOOLKIT .
    Now i am with a water distribution network. From my learnings i came to know that first
    1. The network should be drawn in EPANET
    2. Enter the pipe lengths, water demands at all the nodes, elevations at all the nodes etc
    3. Write programme in Epanet.dll by calling required outputs from the Epanet
    4. Run the programme.

    Now i am with a possible 11 diameters and their associated costs. Where i input the cost?
    Can it be through the programme or anywhere else?

    i expect all the help from you

    I have a great expectation about my project

    THANKING YOU

    yOURS FAITHFULLY

    LEKSHMIBHAVANA

  7. Manuel - March 1st, 2006 at 8:04 pm

    I have a similar problem that LEKSHMIBHAVANA’s problem,
    I desire implementing heuristic algorithms with the EPANET’s input/output, but I don’t know how make this.

    Thanks and… sorry for my english

    Manuel

  8. Elad Salomons - March 1st, 2006 at 10:14 pm

    Manuel,

    If you ask a specific question I can try and help :)

  9. tongirri - March 8th, 2006 at 5:45 am

    i need example code because i writecode not work
    my file in c:\EN\
    in folder EN have file
    epanet2.dll
    epanet2vc.lib
    epanet2.h
    int1.inp
    test.c

    this is test.c code

    #include
    #include “epanet2.h”
    void main()
    {
    int errcode;

    errcode = ENopen(”int1.inp”,”int1.rpt”,”");
    if (errcode>0)
    {
    printf(”cann’t run ENopen”);
    ENclose();
    return;
    }

    ENsolveH();
    ENsolveQ();
    ENreport();
    ENclose();
    }

    please sent example code to my e-mail

    tongirri@hotmail.com

  10. Elad Salomons - March 8th, 2006 at 7:06 am

    tongirri,

    What error do you get?

    Please see this example:
    http://www.water-simulation.com/wsp/bb/viewtopic.php?id=238

  11. tongirri - March 8th, 2006 at 10:53 am

    in my code
    i write code follow programmer’s toolkit in page “opening and closeing the toolkit” and “ENsolveH”

    after buid
    VC show

    ——————–Configuration: test - Win32 Debug——————–
    Compiling…
    test.c
    Linking…
    test.obj : error LNK2001: unresolved external symbol _ENreport@0
    test.obj : error LNK2001: unresolved external symbol _ENsolveQ@0
    test.obj : error LNK2001: unresolved external symbol _ENsolveH@0
    test.obj : error LNK2001: unresolved external symbol _ENclose@0
    test.obj : error LNK2001: unresolved external symbol _ENopen@12
    Debug/test.exe : fatal error LNK1120: 5 unresolved externals
    Error executing link.exe.

    test1.exe - 6 error(s), 0 warning(s)

    ————————————————-
    i see example2-c in programmer’s toolkit
    how i will call function “HydrantRating ()” in main program

    void main()
    {
    .
    .
    .
    HydrantRating (?,?,?,?);
    .
    .
    .
    }

    Thanks you

  12. Cynthia - June 7th, 2006 at 11:04 pm

    Hi!
    I have the same problem as tongirri, I keep on getting the error LINK for unresolved external symbol. I’m using VS.NET 2003 with C++ as a programming language, I’m including the epanet2.h, I read in another forum that I have to use the epanetvc.lib instead of the header file.

    Can someone please help me????

    Thanks

  13. Marco - October 5th, 2006 at 11:47 am

    Hi Cynthia and Tongirri!
    I hope that these advices will help you, I met the same problem and spent a week to find the solution!!!
    These are the step I followed using Microsoft Visual C++:
    - include epanet2.h in your source file (.cpp);
    - compile the program;
    - link the library epanetvc.lib in this way:
    on the menu bar select
    project —> add to project —> files…
    To be sure that the library has been linked, control in the workspace, in “fileview” if there is the file epanetvc.lib.
    - Now you can build the program and then execute it!!

    If you’ll meet other problems write, I’m here!!

    Bye

  14. Moisés - October 31st, 2006 at 3:54 am

    I am open and build the epanet2 source code in Delphi7, it’s work fine, however a save file in a project of my epanet don’t open in others versions of epanet (english and portuguese). Only when i use caracters “ç á é í ó ú” in descrition of pump. I think that code page language or delphi are different of mine. I don’t know that do for fix this.

  15. Priya - November 8th, 2006 at 7:03 pm

    dear sir
    my project is determining the water quality of the distribution system. especially determining the concentration at each node. i have some set of equations to find the concentration. i have drawn the network and gave all the mandated inputs. i have run the analysis also. in my analysis i am getting concentration level at the initial node(reservoir and the first node) for the others i am getting 0Mg/l. i couldnt trouble shoot the problem. i dont know how to write c code also. whether to write in c editor or any editor inside the tool kit. when i import the network an input file is created. how to take input from this file and link with c code? plz sir help me for my futher work. i have great expectations for my project. expecting for your reply
    thanks and regards
    P.Priya

  16. Luke - June 12th, 2007 at 8:27 pm

    I’m designing a geothermal community ground loop system. It’s a closed loop where I am just supplying heat pumps with water for their heat exchangers to cycle. My question is should I represent a home with a “node” or a “pump”?


Leave a Reply