library(pipenostics)
# It is possible to run without specification of argument values:
m325tracebw()
# Consider isomorphic representation of District Heating Network graph:
DHN <- pipenostics::m325testbench
# * Adapt units:
DHN$d <- 1e3*DHN$d # convert [m] to [mm]
# * Adapt node identifiers for ordering representation simplification:
DHN[["sender"]] <- sprintf("N%02i", DHN[["sender"]])
DHN[["acceptor"]] <- sprintf("N%02i", DHN[["acceptor"]])
# * Provided actual values of specific heat loss power (say, field measurements) for each
# pipe in DHN, [kcal/m/h]:
actual_loss <- c(
# acceptor:
96.236, # 1
96.288, # 2
70.584, # 3
116.045, # 4
70.734, # 5
96.211, # 6
78.400, # 7
116.016, # 8
28.115, # 9
24.918, # 10
116.679, # 11
0.000, # 12, may be unmeasured!
153.134, # 13
96.733, # 14
96.600, # 15
116.667, # 16
24.960, # 17
115.923, # 18
28.166, # 19
96.123, # 20
77.824, # 21
115.946, # 22
70.690, # 23
96.184, # 24
96.236, # 25
70.540 # 26
)
# * Remove inappropriate attributes of the graph:
DHN.1 <- DHN[, setdiff(colnames(DHN), c("year", "insulation", "laying", "beta", "exp5k"))]
# * Trace thermal-hydraulic regime for DHN:
tracebw_report <- do.call("tracebw", c(as.list(DHN.1), list(loss = actual_loss)))
# * If the actual values of specific heat loss power presented above are close
# to those in Minenergo-325, then the results of regime tracing match the
# normative procedure:
m325_report <- do.call("m325tracebw", DHN)
stopifnot(
all.equal(tracebw_report$temperature, m325_report$temperature, tolerance = 1e-4),
all.equal(tracebw_report$pressure , m325_report$pressure , tolerance = 1e-4),
all.equal(tracebw_report$flow_rate , m325_report$flow_rate , tolerance = 1e-4)
)
Run the code above in your browser using DataLab