A design approach for determining the optimal flow pattern in a landscape lake is proposed based on FLUENT simulation, multiple objective optimization, and parallel computing. This paper formulates the design into a multi-objective optimization problem, with lake circulation effects and operation cost as two objectives, and solves the optimization problem with non-dominated sorting genetic algorithm II. The lake flow pattern is modelled in FLUENT. The parallelization aims at multiple FLUENT instance runs, which is different from the FLUENT internal parallel solver. This approach: (1) proposes lake flow pattern metrics, i.e. weighted average water flow velocity, water volume percentage of low flow velocity, and variance of flow velocity, (2) defines user defined functions for boundary setting, objective and constraints calculation, and (3) parallels the execution of multiple FLUENT instances runs to significantly reduce the optimization wall-clock time. The proposed approach is demonstrated through a case study for Meijiang Lake in Tianjin, China.
INTRODUCTION
An urban landscape lake is an important component of an urban ecosystem, and there is increasing interest in maintaining and improving landscape lake water quality. The most prevalent lake water quality problem is eutrophication (Jensen & Andersen 1992; Carpenter et al. 1999; Arhonditsis & Brett 2005). Different from natural lakes, landscape lakes are enclosed water bodies and are almost not affected by exogenous pollution. Although forced by the wind-induced current, landscape lakes are mostly stagnant. Nutrients in the lake sediments are the predominant key eutrophication factors. Improving the hydrodynamic circulation pattern of the lake water can increase the dissolved oxygen content, which inhibits the release of phosphorus (P) and nitrogen (N) from the sediments (Wu et al. 2014; Müller et al. 2016). Improving circulation of the lake water using circulation channels and pumping systems is an effective technique for preventing eutrophication and has been successfully used in landscape lakes (Yin et al. 2007; Kang 2012). For an enclosed lake, the dissolved oxygen concentration of lake water can be increased through the circulation channel by creating a series of hydraulic drops. More oxygen is introduced into the lake through the aeration of the water in the circulation channels. This technique is costly especially for a large lake as the operation fee of circulation pumps is proportional to the total pump flow. A good flow pattern design should simultaneously optimize the circulation effects and operation costs.
Computational fluid dynamics (CFD) models utilize numerical methods to solve problems that involve fluid flows; they have been widely and successfully employed in lake hydrodynamic and water quality simulation (Phares et al. 2009; Gresch et al. 2011; Yang et al. 2011). An accurate and efficient lake hydrodynamic and/or water quality model based on CFD simulation is essential to control lake eutrophication. FLUENT is a state-of-the-art CFD program for modelling fluid flow and heat transfer within complex geometries. FLUENT provides complete mesh flexibility, including the ability to solve flow problems with unstructured meshes that can represent complex geometries (FLUENT 6.3 Getting Started Guide 2006), and is accordingly utilized herein for lake hydrodynamic simulation. To customize a FLUENT run, user defined functions (UDFs) can be defined. UDFs are widely utilized: for example, Chacon et al. (2007) adopted improved UDFs in a new methodology for the design and optimization of a low NOx-CO burner. Le & Zhou (2008) used UDFs to implement a general model of proton exchange membrane fuel. Ma et al. (2010) added UDFs to a compressible sub-model in the CFD model to predict the flow ripple of an axial piston pump. Herein UDFs are developed for use in optimization.
A multiple objective optimization problem is formulated to determine the optimal flow pattern design. The first objective is to get good circulation effects by increasing the overall flow velocity in the lake. Kang (2012) designed a local circulation system on the northwest of Meijiang Lake to investigate the impact of the hydrodynamic pattern on the improvement in lake water quality. The local circulation test showed that both phosphorus and ammonia nitrogen concentrations were reduced with increasing lake flow velocity. Therefore the average lake flow velocity is selected as the objective to represent good lake circulation effects. The second objective is to decrease the circulation costs, which are represented by total pump flow. The decision variables are inlet inflow velocities, and the two objectives are to maximize the lake average flow velocity and to minimize total pump flow by controlling the inflow through each lake inlet. Constraints are also formulated for the optimization problem. The non-dominated sorting genetic algorithm II (NSGA-II) is a multi-objective evolutionary algorithm based on the optimum concept of the Pareto front (Deb et al. 2002). This algorithm provides optimal solutions at the Pareto front, and does not require weighting the different objective functions to obtain a simple objective. For CFD modelling, it has been successfully applied in shape optimization of a micromixer (Hossain et al. 2011), aerodynamic optimization of turbomachinery (Wang et al. 2011), optimization of a radiant hydronic panel (Tye-Gingras & Gosselin 2012), and optimization of gas cyclone separator performance (Elsayed & Lacor 2012) and geometry (Elsayed & Lacor 2013).
FLUENT simulation is very computational intensive, and often requires long runtimes. To address this issue, FLUENT is equipped with a built-in parallel solver which enables partitioning the model domain mesh into multiple groups and allocates each group to a computational unit (either multi-core or super computer). This partition method can significantly speed up a single FLUENT instance run, and is required when the available memory limit is an issue. To parallel multiple FLUENT instances runs for NSGA-II, this paper proposes a parallelization scheme for multiple FLUENT runs in a multi-core computer; however, the scheme can be easily extended to super computers.
The proposed approach is demonstrated by a case study for Meijiang Lake located in Tianjin, China, and generates promising optimized designs.
METHODS
Study area
Surroundings (a) and inlet and outlet locations (b) of Meijiang Lake.
Objectives
As Meijiang Lake is a shallow lake with a large surface and small depth, a 2D simulation was conducted in this study. Good circulation effects and low operation costs are two objectives of this landscape lake flow pattern design. This study focuses on the design for the inlet locations and inflow velocity. Accordingly a multiple objective optimization problem is formulated. The decision variables are trial inlet locations and flow velocity at each trial inlet. Two objectives are formulated to achieve maximum average flow velocity with minimum total pump flow. In this case study, Meijiang Lake was divided into a large amount of triangular unstructured meshes with different cell areas. Using the arithmetic average lake flow velocity to evaluate the entire lake flow regime will overestimate the average velocity. Therefore the weighted average of the velocity based on the cell volume is defined as objective f1. The total pump flow f2 is calculated as the summation of flow rates at the open inlets.
The weighted average lake flow velocity f1 is calculated with Equation (1), and is to be maximized.
Constraints
Four constraints are proposed, consisting of: (I) layout of inlets according to lake surrounding conditions, (II) total pump flow and inlet flow velocity, (III) lake water volume percentage below prescribed low flow velocity, and (IV) lake flow velocity variance. Constraints I and II can be obtained based on lake geometry and no FLUENT runs are needed, while III and IV can only be quantified with outputs from a successful FLUENT run. FLUENT simulation is time consuming; hence it is essential to limit the number of FLUENT runs to save clock time. Constraints I and II represent inlet layout and operational requirements, and FLUENT simulation is not performed for simulations that violated either constraint, and the objective f1 is set to infinity.
where Q, Qmax, Qmin are total, maximum, and minimum pump flow (m3/s), respectively; vkmin is the lowest flow velocity (m/s) at the inlet i.
Constraints III and IV are presented to assure that the flow velocity distribution in the lake is as even as possible. Generally, water is regarded as stagnant when its flow velocity is under a certain limit, which is likely to cause water quality issues in the lake. Based on the flow velocity distribution histogram, constraint III is defined by Equation (6):
Parallel computing in NSGA-II
Four folders are created for each core, with each containing four files: velocity.txt, mj.jou, mj.cas, and result.txt. The velocity.txt file includes the flow velocities of the number of inlets, which is updated according to each individual within the current NSGA-II population. The file is input to a FLUENT instance, and is read in by a customized UDF; the mj.jou consists of a sequence of FLUENT operation commands; the mj.cas compiles two UDFs that are developed to calculate the lake average flow velocity, lake flow velocity variance and lake water volume under a specified flow velocity, and to write these values into the result.txt; the result.txt is subsequently parsed to set the objective f1 and the constraints III and IV.
The individuals in the first generation of NSGA-II are randomly generated, and each individual contains the inlet flow velocities for the number of trial inlets. Each one is examined against the constraints I and II. The objective f1 is set to infinity for the individual violating either constraint I or II, and no FLUENT simulation will be run. The individuals that satisfy both constraints I and II are scattered to each of the four cores for FLUENT parallel simulation. While launching each FLUENT run, a transcript file is generated through switch/file/start-transcript outputfile.trn to contain all model warning and error messages, and the number of iterations to achieve specified convergence criteria. After each FLUENT run, the transcript file is parsed by the program to ensure the model is numerically stable and its outputs are reliable. Subsequently, the ranks and crowding distances of the individuals in the current population are calculated, and the genetic operations of crossover and mutation are performed on the population individuals.
For an NSGA-II run, the numbers of FLUENT runs and generation are applied as a terminal condition. The individuals in the final population are stored in the file solution.txt, and read as the initial population for the next NSGA-II run in the case that optimization is required to be resumed.
Case study
The volume of the Meijiang Lake ranges from 731,500 m3 (during dry season) to 1,463,000 m3 (during wet season). The lake retention time for the circulation system is designed to be 20 to 40 days, and the pump operation time is specified at 8 h. Thus Qmax is calculated as 1,463,000 m3/(20 days × 8 h), which is 2.54 m3/s; and Qmin is calculated as 731,500 m3/(40 days × 8 h), which is 0.635 m3/s. The vkmin is computed when the inlets are open for the Qmin, which is 0.0178 m/s.
Kang (2012) built a FLUENT model, and calibrated it to monitored lake flow velocities. The relative error between simulated and measured flow velocities was smaller than 10%, which proved the feasibility of the FLUENT model. The same mesh and model setup was also adopted in this case study. To construct the FLUENT mesh for the lake, the original lake boundary drawing of DWG format is saved as a SAT format file with AutoCAD, and then the SAT file is imported into the Gambit package for mesh generation. A 2D mesh is generated for FLUENT simulation. The mesh near the inlets and outlets is denser and gradually becomes coarser by moving into the centre of the lake, for the purpose of accurately capturing the flow regime near inlet and outlet boundaries and achieving numerical stability. The lake is divided into 146,556 triangular unstructured meshes and 74,059 nodes, with cell areas ranging from 0.2452 m2 to 5.3368 m2. A mesh file (mj.msh) is generated by FLUENT after a check operation.
For the FLUENT simulation, the state of each inlet (on or off) is controlled by the NSGA-II individual. An inlet is on if its flow velocity from the corresponding element of an individual of the NSGA-II population is above the minimum inlet flow velocity 0.0178 m/s, and off for a value below 0.0178 m/s.
Two UDFs, DEFINE_PROFINE and DEFINE_EXECUTE_AT_END, are implemented to calculate cell statistics, switch inlet states (on/off), assign flow velocities for inlets with state on, and write cell statistics into result.txt file. Subsequently the mesh file and the two UDFs are compiled to generate the CASE file (mj.case).
For a complete FLUENT simulation, a journal file (mj.jou) is created listing the sequential FLUENT commands: operate FLUENT, read in CASE file, initialize CASE file, set iteration number, and exit FLUENT without prompt. Herein for every FLUENT run, the convergence criterion is set as 0.001 (scaled residual). The iteration number was set to 1,500, which was shown to be sufficient for all FLUENT models for different inlet configurations to converge below the specified criterion.
The parallel NSGA-II parameters are summarized in Table 1.
NSGA-II parallel computing parameter values
Optimization parameters . | Value . |
---|---|
Number of cores | 4 |
Number of decision variables (the number of inlets) | 17 |
Number of objectives | 2 |
Population size of every generation | 200 |
Evolutionary generation | 50 |
Number of individuals distributed to every core | 25 (100/4) |
Maximum simulation number of FLUENT simulation in NSGA-II | 500 |
Simulation binary cross distribution index | 20 |
Polynomial variation distribution index | 20 |
Optimization parameters . | Value . |
---|---|
Number of cores | 4 |
Number of decision variables (the number of inlets) | 17 |
Number of objectives | 2 |
Population size of every generation | 200 |
Evolutionary generation | 50 |
Number of individuals distributed to every core | 25 (100/4) |
Maximum simulation number of FLUENT simulation in NSGA-II | 500 |
Simulation binary cross distribution index | 20 |
Polynomial variation distribution index | 20 |
RESULTS AND DISCUSSION
Eight NSGA-II runs are performed. Each run uses the previous run's final population as its initial population, with the exception of the first run, which applies a randomly generated population. Such a configuration allows each run of the NSGA-II to restart from a better initial population than a randomly generated one.
The parallel computing in NSGA-II significantly decreases wall-clock time. For example, a total number of 4,000 FLUENT instances are run. With serial computing, the wall-clock time would be 4,000 × 9 min (600 h), while the parallel computing with a four-core computer drops the runtime to around 150 h.
To validate the effectiveness of the proposed optimization procedure, two scenarios, namely optimized scenarios I and II (selected from solutions 1 and 8, respectively), are compared. The design total pump flow for both scenarios is the same, 1.57 m3/s.
Flow velocity (m/s) distributions for optimized scenarios I (a) and II (b).
CONCLUSIONS
The urban landscape lake water flow pattern design is formulated as a multiple objective optimization problem with inlet velocity as the decision variable, the minimization of total pump flow and the maximization of average lake flow velocity as the two objectives, and four constraints: (I) layout of trial inlets; (II) total pump flow/inlet flow velocity; (III) water volume with low flow velocity; and (IV) velocity uniformity.
A 2D FLUENT model is utilized to simulate the flow pattern in the lake. UDFs are implemented to (1) set inlet state (on/off) and inflow velocity based on the optimization individual, and (2) calculate the lake average flow velocity and the constraints III and IV.
The parallel runs of FLUENT simulations in NSGA-II scatter and gather data to and from multiple cores. This parallel scheme further expands the FLUENT internal parallel solver (which parallels a single FLUENT simulation by partitioning the mesh to different units, and each unit simulates for the scattered mesh data). The computational speedup of the proposed parallel scheme will depend on the number of cores available.
The landscape flow pattern design approach successfully generates a series of optimized flow pattern schemes, i.e. Pareto front between total pump flow and lake average flow velocity. The Pareto front provides a base for decision making on the total pump flow to achieve desired lake average flow rate.
ACKNOWLEDGEMENTS
This research was supported by the Major Science and Technology Program for Water Pollution Control and Treatment (No. 2014ZX07203-009-002) and Major Science and Technology Program for Water Pollution Control and Treatment (No. 2008ZX07314-004-002).