/*
************************************************************************
            Global Variables for EPANET Program                           
                                                                   
VERSION:    2.00                                              
DATE:       5/8/00
            6/24/02
            2/14/08    (2.00.12)
AUTHOR:     L. Rossman                                        
            US EPA - NRMRL
                                                                    
************************************************************************
*/
//该文件定义了EPANET程序中的全局变量。文件的组织形式是根据变量的类型。每个变量都有一个简单的说明。
EXTERN FILE     *InFile,               /* Input file pointer           */
                *OutFile,              /* Output file pointer          */
                *RptFile,              /* Report file pointer          */
                *HydFile,              /* Hydraulics file pointer      */
                *TmpOutFile;           /* Temporary file handle        */
EXTERN long     HydOffset,             /* Hydraulics file byte offset  */
                OutOffset1,            /* 1st output file byte offset  */
                OutOffset2;            /* 2nd output file byte offset  */
EXTERN char     Msg[MAXMSG+1],         /* Text of output message       */
                InpFname[MAXFNAME+1],  /* Input file name              */
                Rpt1Fname[MAXFNAME+1], /* Primary report file name     */
                Rpt2Fname[MAXFNAME+1], /* Secondary report file name   */
                HydFname[MAXFNAME+1],  /* Hydraulics file name         */
                OutFname[MAXFNAME+1],  /* Binary output file name      */
                MapFname[MAXFNAME+1],  /* Map file name                */
                TmpFname[MAXFNAME+1],  /* Temporary file name          */      //(2.00.12 - LR)
                TmpDir[MAXFNAME+1],    /* Temporary directory name     */      //(2.00.12 - LR)
                Title[MAXTITLE][MAXMSG+1], /* Problem title            */
                ChemName[MAXID+1],     /* Name of chemical             */
                ChemUnits[MAXID+1],    /* Units of chemical            */
                DefPatID[MAXID+1],     /* Default demand pattern ID    */

/*** Updated 6/24/02 ***/
                Atime[13],             /* Clock time (hrs:min:sec)     */

Outflag,               /* Output file flag             */      //(2.00.12 - LR)
                Hydflag,               /* Hydraulics flag              */
                Qualflag,              /* Water quality flag           */
                Reactflag,             /* Reaction indicator           */      //(2.00.12 - LR)
                Unitsflag,             /* Unit system flag             */
                Flowflag,              /* Flow units flag              */
                Pressflag,             /* Pressure units flag          */
                Formflag,              /* Hydraulic formula flag       */
                Rptflag,               /* Report flag                  */
                Summaryflag,           /* Report summary flag          */
                Messageflag,           /* Error/warning message flag   */
                Statflag,              /* Status report flag           */
                Energyflag,            /* Energy report flag           */
                Nodeflag,              /* Node report flag             */
                Linkflag,              /* Link report flag             */
                Tstatflag,             /* Time statistics flag         */
                Warnflag,              /* Warning flag                 */
                Openflag,              /* Input processed flag         */
                OpenHflag,             /* Hydraul. system opened flag  */
                SaveHflag,             /* Hydraul. results saved flag  */
                OpenQflag,             /* Quality system opened flag   */
                SaveQflag,             /* Quality results saved flag   */
                Saveflag;              /* General purpose save flag    */
EXTERN int      MaxNodes,              /* Node count from input file   */
                MaxLinks,              /* Link count from input file   */
                MaxJuncs,              /* Junction count               */
                MaxPipes,              /* Pipe count                   */
                MaxTanks,              /* Tank count                   */
                MaxPumps,              /* Pump count                   */
                MaxValves,             /* Valve count                  */
                MaxControls,           /* Control count                */
                MaxRules,              /* Rule count                   */
                MaxPats,               /* Pattern count                */
                MaxCurves,             /* Curve count                  */
                Nnodes,                /* Number of network nodes      */
                Ntanks,                /* Number of tanks              */
                Njuncs,                /* Number of junction nodes     */
                Nlinks,                /* Number of network links      */
                Npipes,                /* Number of pipes              */
                Npumps,                /* Number of pumps              */
                Nvalves,               /* Number of valves             */
                Ncontrols,             /* Number of simple controls    */
                Nrules,                /* Number of control rules      */
                Npats,                 /* Number of time patterns      */
                Ncurves,               /* Number of data curves        */
                Nperiods,              /* Number of reporting periods  */
                Ncoeffs,               /* Number of non-0 matrix coeffs*/
                DefPat,                /* Default demand pattern       */
                Epat,                  /* Energy cost time pattern     */
                MaxIter,               /* Max. hydraulic trials        */
                ExtraIter,             /* Extra hydraulic trials       */
                TraceNode,             /* Source node for flow tracing */
                PageSize,              /* Lines/page in output report  */
                CheckFreq,             /* Hydraulics solver parameter  */
                MaxCheck;              /* Hydraulics solver parameter  */
EXTERN double   Ucf[MAXVAR],           /* Unit conversion factors      */
                Ctol,                  /* Water quality tolerance      */
                Htol,                  /* Hydraulic head tolerance     */
                Qtol,                  /* Flow rate tolerance          */
                RQtol,                 /* Flow resistance tolerance    */
                Hexp,                  /* Exponent in headloss formula */
                Qexp,                  /* Exponent in orifice formula  */
                Dmult,                 /* Demand multiplier            */
                Hacc,                  /* Hydraulics solution accuracy */
                DampLimit,             /* Solution damping threshold   */      //(2.00.12 - LR)
                BulkOrder,             /* Bulk flow reaction order     */
                WallOrder,             /* Pipe wall reaction order     */
                TankOrder,             /* Tank reaction order          */
                Kbulk,                 /* Global bulk reaction coeff.  */
                Kwall,                 /* Global wall reaction coeff.  */
                Climit,                /* Limiting potential quality   */
                Rfactor,               /* Roughness-reaction factor    */
                Diffus,                /* Diffusivity (sq ft/sec)      */
                Viscos,                /* Kin. viscosity (sq ft/sec)   */
                SpGrav,                /* Specific gravity             */
                Ecost,                 /* Base energy cost per kwh     */
                Dcost,                 /* Energy demand charge/kw/day  */
                Epump,                 /* Global pump efficiency       */
                Emax,                  /* Peak energy usage            */
                Dsystem,               /* Total system demand          */
                Wbulk,                 /* Avg. bulk reaction rate      */
                Wwall,                 /* Avg. wall reaction rate      */
                Wtank,                 /* Avg. tank reaction rate      */
                Wsource;               /* Avg. mass inflow             */
EXTERN long     Tstart,                /* Starting time of day (sec)   */
                Hstep,                 /* Nominal hyd. time step (sec) */
                Qstep,                 /* Quality time step (sec)      */
                Pstep,                 /* Time pattern time step (sec) */
                Pstart,                /* Starting pattern time (sec)  */
                Rstep,                 /* Reporting time step (sec)    */
                Rstart,                /* Time when reporting starts   */
                Rtime,                 /* Next reporting time          */
                Htime,                 /* Current hyd. time (sec)      */
                Qtime,                 /* Current quality time (sec)   */
                Hydstep,               /* Actual hydraulic time step   */
                Rulestep,              /* Rule evaluation time step    */
                Dur;                   /* Duration of simulation (sec) */
EXTERN SField   Field[MAXVAR];         /* Output reporting fields      */

/* Array pointers not allocated and freed in same routine */
EXTERN char     *S,                    /* Link status                  */
                *OldStat;              /* Previous link/tank status    */
EXTERN double   *D,                    /* Node actual demand           */
                *C,                    /* Node actual quality          */
                *E,                    /* Emitter flows                */
                *K,                    /* Link settings                */
                *Q,                    /* Link flows                   */
                *R,                    /* Pipe reaction rate           */
                *X;                    /* General purpose array        */
EXTERN double   *H;                    /* Node heads                   */
EXTERN STmplist *Patlist;              /* Temporary time pattern list  */
EXTERN STmplist *Curvelist;            /* Temporary list of curves     */
EXTERN Spattern *Pattern;              /* Time patterns                */
EXTERN Scurve   *Curve;                /* Curve data                   */
EXTERN Snode    *Node;                 /* Node data                    */
EXTERN Slink    *Link;                 /* Link data                    */
EXTERN Stank    *Tank;                 /* Tank data                    */
EXTERN Spump    *Pump;                 /* Pump data                    */
EXTERN Svalve   *Valve;                /* Valve data                   */
EXTERN Scontrol *Control;              /* Control data                 */
EXTERN HTtable  *Nht, *Lht;            /* Hash tables for ID labels    */
EXTERN Padjlist *Adjlist;              /* Node adjacency lists         */

/*
** NOTE: Hydraulic analysis of the pipe network at a given point in time
**       is done by repeatedly solving a linearized version of the
**       equations for conservation of flow & energy:
**
**           A*H = F
**
**       where H = vector of heads (unknowns) at each node,
**             F = vector of right-hand side coeffs.
**             A = square matrix of coeffs.
**       and both A and F are updated at each iteration until there is
**       negligible change in pipe flows.
**
**       Each row (or column) of A corresponds to a junction in the pipe
**       network. Each link (pipe, pump or valve) in the network has a
**       non-zero entry in the row-column of A that corresponds to its
**       end points. This results in A being symmetric and very sparse.
**       The following arrays are used to efficiently manage this sparsity:
*/

EXTERN double   *Aii,        /* Diagonal coeffs. of A               */
                *Aij,        /* Non-zero, off-diagonal coeffs. of A */
                *F;          /* Right hand side coeffs.             */
EXTERN double   *P,          /* Inverse headloss derivatives        */
                *Y;          /* Flow correction factors             */
EXTERN int      *Order,      /* Node-to-row of A                    */
                *Row,        /* Row-to-node of A                    */
                *Ndx;        /* Index of link's coeff. in Aij       */
/*
** The following arrays store the positions of the non-zero coeffs.   
** of the lower triangular portion of A whose values are stored in Aij:
*/
EXTERN int      *XLNZ,       /* Start position of each column in NZSUB  */
                *NZSUB,      /* Row index of each coeff. in each column */
                *LNZ;        /* Position of each coeff. in Aij array    */

EPANET头文件解读系列9——VARS.H的更多相关文章

  1. EPANET头文件解读系列7——MEMPOOL.H

    //EPANET应用程序使用了大量的节点与管段数据,而且每个对象数据又有不同时段的数据,这些数据占用了大量内存,而mempool.h就是一个简单快速的内存分配相关的头文件/***  mempool.h ...

  2. EPANET头文件解读系列6——HASH.H

    该文件是EPANET中HASH.C的头文件,下面列出了该文件的源码以及我的中文注释 /* HASH.H**** Header file for Hash Table module HASH.C***/ ...

  3. EPANET头文件解读系列4——EPANET2.H

    该头文件的功能与系列3中的TOOLKIT.H类似,而且内容也几乎一致,所以也就不再详细介绍.

  4. EPANET头文件解读系列3——TOOLKIT.H

    /******************************************************************** TOOLKIT.H - Prototypes for EPA ...

  5. EPANET头文件解读系列2——ENUMSTXT.H

    在前一系统中介绍了text.h,回顾下,该文件包含了EPANET中所有字符串常量的定义,而ENUMSTXT.H文件则是以text.h中定义的字符串常量为基础,来对这些字符串常量进行合理的分组,形成字符 ...

  6. EPANET头文件解读系列5——TYPES.H

    /************************************************************************                            ...

  7. EPANET头文件解读系列1——TEXT.H

    定义在TEXT.H文件中的字符常量都以小写开头,然后紧跟一个下划线,再接着就全是大写字母 /***************************************************** ...

  8. EPANET头文件解读系列8——FUNCS.H

    /***************************************************************************                         ...

  9. 头文件带和不带.h的区别

    所有C++标准库的头文件都是没有.h结尾的.这么做是为了区分,C标准库的头文件和C++标准库的头文件.比如最具代表性的: #include <string.h> // C 标准库头文件,包 ...

随机推荐

  1. 实现多项式的JAVA类

                                   p = coef[i] + (x * p);               }                           Poly ...

  2. python matplotlib

    背景: 1)数据可视化 目前还处于python入门阶段,主要想通过numpy.matplotlib进行数据可视化. 安装: 操作系统:windows7 1)python2.7 安装numpy.matp ...

  3. Adobe Illustrator里使用fontawesome矢量图标

     简单教程:1.安装FontAwesome.otf字体2.打开http://fontawesome.io/cheatsheet/3.选中图标图片,ctrl+c4.粘贴到AI中5.选中粘贴的内容,修改字 ...

  4. likwid工具尝鲜

    likwid: like I knew what I am doing. 是一系列工具的集合,用于针对多线程程序的指标分析,方便程序员进行性能调优工作.可以深入到控制cpu等硬件的频率. 主要包括以下 ...

  5. Windows调试学习笔记:(二)WinDBG调试.NET程序示例

    好不容易把环境打好了,一定要试试牛刀.我创建了一个极其简单的程序(如下).让我们期待会有好的结果吧,阿门! using System; using System.Collections.Generic ...

  6. 学习之路三十六:SQL知识总结 - [游标||字符串分割]

    好久没有写文章了,今天把前不久项目用到的SQL知识总结一下. 一丶字符串分割 SQL内置函数中是没有Split分割函数的,所以需要自己去实现,不多说,上代码: )) RETURNS @result T ...

  7. 读Java 804 - Quick refresher

    Upcast永远是成功的,但Downcast不是,记得做instanceof判断 仅抛不同异常,而返回值相同的重载是不可以的 static import只会import静态类 static metho ...

  8. 单线程vs多线程

    a.多线程可以说是实现异步的一种方式: b.共同点:多线程和异步操作两者都可以达到避免调用线程阻塞的目的,从而提高软件的可响应性: c.线程消费CPU资源.  异步消费硬件资源: 1.多线程和异步操作 ...

  9. python 安装加环境变量

    pip install sth --global-option="build_ext" --global-option="-I/usr/local/include&quo ...

  10. 从逆向的角度去理解C++虚函数表

    很久没有写过文章了,自己一直是做C/C++开发的,我一直认为,作为一个C/C++程序员,如果能够好好学一下汇编和逆向分析,那么对于我们去理解C/C++将会有很大的帮助,因为程序中所有的奥秘都藏在汇编中 ...