## 2 Methodology  
WDNs have been widely studied, specifically in recent times due to their complex infrastructure [12]. Their design can be formulated as a least-cost optimization with a selection of pipe sizes as the decision parameters [8]. The cost of a WDN is related to the pipe parameters, which include lengths and diameters. Therefore, the cost optimization model of a WDN can be defined as follows [4]:  
\[C=\sum_{i=1}^{N}C(D_{i})\times L_{i}|i=1,\ldots,N \tag{1}\]  
where \(C\) is the overall cost of the WDN, and \(C(D_{i})\) is the cost of pipe \(i\) with the corresponding diameter \(D_{i}\) and length \(L_{i}\). \(N\) is the number of pipes in a proposed WDN. The difference between the inlet node water flow rate (\(W_{I}\)) and outlet node water flow rate (\(W_{O}\)) is equal to the node demand (\(De\)) [4]:  
\[\sum W_{I}-\sum W_{O}=De \tag{2}\]  
By considering the measurements obtained from water meters, the nodal demand can also be expressed as follows:  
\[D_{a,t}=M_{a,t}\times D_{b,t} \tag{3}\]  
where \(D_{a,t}\) is the demand at the node \(a\) and time \(t\), \(M_{a,t}\) is the demand multiplier, and \(D_{b,t}\) is the base demand [19]. The multiplier takes into account any government policies regarding the investments on a larger macroeconomic scale. Figure 1 shows the average hourly profile of residential consumers regarding the water demand according to the multiplier estimates [19]. Figure 2 demonstrates the average daily water consumption profile in the case of different cities in the United States together with the multiplier estimates according to the statistics obtained from the American Water Works Association (AWWA) [20]. The head losses in pipelines can be estimated according to the Hazen-Williams equation [19]:  
\[\Delta H=\frac{10.67P_{L}}{P_{RC}^{1.852}\times D^{4.8704}}\times W_{I}^{1.852} \tag{4}\]  
where \(\Delta H\) is head losses (meters of water column), \(P_{L}\) is the pipe length (meters), \(D\) is the diameter (meters), \(W_{I}\) is the flow rate in the pipe (m\({}^{3}\)/s), and \(P_{RC}\) is the pipeline roughness coefficient, which is dimensionless [20]. In this study, according to the previous results, the \(P_{RC}\) is assumed to be 130 [4]. Figure 1: A demand profile of the residential water consumption. Figure 2: A sample of the hourly water consumption profile. In addition, based on one-dimensional (1D) hydraulic models, a methodology for CFD-based pipeline network optimization in water distribution systems is developed to approximate the complex behavior of fluid flow in pipes. Equation (4), a widely adopted approach, is used to compute frictional head losses along each pipe segment. The Hazen-Williams equation is an empirical formula, which is particularly useful in design practices because it offers a balance between accuracy and computational simplicity when analyzing water distribution networks [20]. It solves the complex physics of turbulent flow into a form that is computationally efficient for design purposes. In optimizing a network, candidate pipe diameters are evaluated by calculating the associated friction losses and then comparing these results against performance criteria such as minimum acceptable head loss and construction cost. The optimization is typically performed by sweeping through a range of potential diameters and selecting the design that meets hydraulic constraints while minimizing cost. This deterministic approach has been validated in numerous studies on network optimization, where engineers use these methods to achieve efficient and cost-effective designs [4]. The Reynolds number for each candidate diameter can be calculated according to the following equation:  
\[Re=\frac{\rho\times V\times L}{\mu}=\frac{V\times L}{\
u} \tag{5}\]  
where \(\rho\) is density, \(V\) is velocity, \(L\) is length, \(\mu\) is bulk viscosity, and \(\
u\) is kinematic viscosity. The flow regime is determined by comparing \(Re\) with standard thresholds (Re < 2000: Laminar; 2000 \(\leq\) Re < 4000: Transitional; Re \(\geq\) 4000: Turbulent) [21].