Merge pull request #877 from OpenWaterAnalytics/EN_setpipedata_bug_fix
Fixes bug in EN_setpipedata
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
Authors: see AUTHORS
|
Authors: see AUTHORS
|
||||||
Copyright: see AUTHORS
|
Copyright: see AUTHORS
|
||||||
License: see LICENSE
|
License: see LICENSE
|
||||||
Last Updated: 04/23/2025
|
Last Updated: 09/03/2025
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -4340,11 +4340,11 @@ int DLLEXPORT EN_setpipedata(EN_Project p, int index, double length,
|
|||||||
Link[index].Diam = diameter;
|
Link[index].Diam = diameter;
|
||||||
Link[index].Kc = rough;
|
Link[index].Kc = rough;
|
||||||
if (p->hydraul.Formflag == DW) Link[index].Kc /= (1000.0 * Ucf[ELEV]);
|
if (p->hydraul.Formflag == DW) Link[index].Kc /= (1000.0 * Ucf[ELEV]);
|
||||||
|
Link[index].Km = 0.02517 * mloss / SQR(Link[index].Diam) / SQR(Link[index].Diam);
|
||||||
|
|
||||||
// Update minor loss factor & pipe flow resistance
|
// Update pipe flow resistance
|
||||||
if (p->hydraul.OpenHflag)
|
if (p->hydraul.OpenHflag)
|
||||||
{
|
{
|
||||||
Link[index].Km = 0.02517 * mloss / SQR(Link[index].Diam) / SQR(Link[index].Diam);
|
|
||||||
resistcoeff(p, index);
|
resistcoeff(p, index);
|
||||||
}
|
}
|
||||||
else Link[index].InitSetting = Link[index].Kc;
|
else Link[index].InitSetting = Link[index].Kc;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
Authors: see AUTHORS
|
Authors: see AUTHORS
|
||||||
Copyright: see AUTHORS
|
Copyright: see AUTHORS
|
||||||
License: see LICENSE
|
License: see LICENSE
|
||||||
Last Updated: 04/19/2025
|
Last Updated: 09/03/2025
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ typedef int INT4;
|
|||||||
Various constants
|
Various constants
|
||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
*/
|
*/
|
||||||
#define CODEVERSION 20301
|
#define CODEVERSION 20302
|
||||||
#define MAGICNUMBER 516114521
|
#define MAGICNUMBER 516114521
|
||||||
#define ENGINE_VERSION 201 // Used for binary hydraulics file
|
#define ENGINE_VERSION 201 // Used for binary hydraulics file
|
||||||
#define EOFMARK 0x1A // Use 0x04 for UNIX systems
|
#define EOFMARK 0x1A // Use 0x04 for UNIX systems
|
||||||
|
|||||||
Reference in New Issue
Block a user