# 如何在使用epanet仿真计算管壁的热交换

2023年07月12日 阅读 31 次

If the temperature of the pipe wall (i.e., the surrounding rock) can be considered a constant, then the existing EPANET program and interface can be used by making the following change to the wallrate() function at the bottom of the quality.c module: replace the code segment underneath the "if (WallOrder == 0.0)" with the following:

```
if (WallOrder == 0.0)
{
return kf * 4.0/d * (Climit - c)
}

```
`Then re-compile the epanet2.dll library. When you run EPANET, set theWall Reaction Order to 0, Global Bulk reaction coefficient to 0, theGlobal Wall coefficient to any non-zero value, the LimitingConcentration to the constant pipe wall temperature, and the RelativeDiffusivity to the thermal diffusivity of water (in sq ft /day) dividedby 0.00112.`

These changes express the rate of temperature change in the bulk water as the product of a heat transfer coefficient (kf, computed internally by EPANET), the area per unit volume of the pipe (4/d), and the difference between the wall and water temperatures (Climit - C). If the heat transfer mechanism is more complicated than this then it might be better to follow Steve's suggestion to use the MSX toolkit.

We noticed that in epanet22, the quality.c had splitted into 3 files.
Now we need to make the above adjustment in qualreact.c, line 431:

```
if (qual-&gt;WallOrder == 0.0)             // 0-order reaction */
{
kf = SGN(kw) * c * kf;              //* Mass transfer rate (mass/ft2/sec)
kw = kw * SQR(pr-&gt;Ucf&#91;ELEV]);       // Reaction rate (mass/ft2/sec)
if (fabs(kf) &lt; fabs(kw)) kw = kf;   // Reaction mass transfer limited
return (kw * 4.0 / d * (qual-&gt;Climit -c));              // Reaction rate (mass/ft3/sec)
}

```