You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Computational Fluid Dynamics

Flocculation Tank Simulation

Overview

The FLUENT analysis software used in the Fall 2008 and Spring 2009 semesters was changed over the summer of 2009. FLUENT was integrated into the ANSYS software package. This changed the procedure for constructing CFD simulations. The Gambit interface for building meshes was removed and mesh construction is now handled in Workbench. The sketching of geometries is handled in a SolidWorks style environment and the sketches are transferred into a meshing tool. Analysis of fluid flow is a still handled by the classic FLUENT solver.

The shift from Gambit to ANSYS for geometry sketching rendered the geometries and automated mesh generating journal files in Gambit, from Fall 2008 and Spring 2009, incompatible with ANSYS, unless the files were converted with a MATLAB code. New 2D sketches of AguaClara baffle systems were created in ANSYS. Creation of lines from sketches and the line projection command are essential for creating systems of baffles in the new version of Fluent. For turbulent flow in FLUENT, the mesh must be refined enough for the solution of the simulation to stay out of the mixed boundary layer regime of turbulent y+ = 5 to 30. The turbulent y+ in the solution can be below 5 or above 30 if the cells at the walls of the mesh are made small enough to solve the turbulent boundary layer gradients near the wall. This is achieved with the biasing tool in the mesh creation interface. The mesh can be biased to have smaller cells near the wall than at the center of the pipe for example.

Unknown macro: {center}

Unable to render embedded object: File (mesh biasing.png) not found.

Biasing of mesh near the wall

The investigation began with setting up simulations from Fall 2008 in the new FLUENT interface. We ran these cases to verify the new version of FLUENT. The most extensive investigation was in periodic boundary conditions. This tool in the FLUENT solver iterates the simulation until convergence with the requirement that inlet and outlet values are the same. This tool is capable of performing this analysis strictly for symmetric geometries. A two turn baffle model was used for the periodic analysis. Periodic solution allows the user to initialize the flow at the inlet with the mass flow rate (kg/s) or pressure drop/length traveled (Pa/m). Cases of 5, 10, and 15 baffles were modeled and simulated to compare with the converged periodic solution. The user defined functions (UDFs) were used to explore how to analysis the performance parameters in the said cases.

Goals

The goals of the CFD work are fairly straightforward in scope. To properly form flocs, there needs to be an appropriate level of turbulent energy dissipation to enhance turbulent mixing. The levels throughout the flow need to be at a certain value to ensure that flocs are large enough that they will settle out in the sedimentation tank, while preventing any pre-sedimentation settling at the end of the flocculator or in the channels between the two sections. The rates also need to be such that turbulent eddies are strong enough to pull settled flocs off the bottom of the flocculator if they do end up settling. In order to ensure all these requirements, a full description of the flow through the length of the flocculator would be ideal, but the simulation time and processing power puts a limit on this ability. Thus, we look to model a certain number of baffles that will provide a reasonable description of the flow through the entire system. Work in previous years has been limited to simulations of five or less baffle turns meaning that analysis of the flow after significant development has not been examined. This was a primary goal for the fall of 2009. It was originally thought that a high level of turbulent energy dissipation at the beginning of the flocculator would lead to initial floc growth near the entrance with a tapering of levels to a much lower value near the end to prevent floc breakup. However, it was speculated that this particular distribution was leading to early settling of flocs before they ever entered the sedimentation tank. A more even dissipation of energy would ideally help break up flocs that become too large, but not be so high as to break up all reasonably sized particles. This scenario motivates the goal of modeling more of the flocculator and leads to two possible directions. One method involved increasing the number of baffles to greater than five and observe the outcome to see if after a certain number, the flow variables become steady between each turn. The other involved using a periodic condition where the fully developed case far from the entrance would be modeled using only one turn. The advantage of this method is less time to obtain a solution because the mesh has far fewer cells than a substantial number of baffles.

FLUENT Updates

Recently ANSYS acquired FLUENT and integrated it with the more user-friendly Workbench software. While this makes new projects much easier to set up when compared to the previous Gambit interface, it required a good deal of work to adapt previous work to the new system. Workbench is not a new tool itself, and ANSYS has used it for a number of years for its structural finite element solver. It allows the user to step through the process of geometry creation and meshing, setting up the physics, solving the problem, and postprocessing the results. Work began immediately on reproducing results from past years with the goal of ensuring the new system did not fundamentally change any of the results that had previously been obtained. It was clear early on that, while better than building geometry and meshes in GAMBIT, the new system left something to be desired. Certain common sense tasks that someone would likely want to perform in any CAD style program required nonintuitive methods. For example, when creating a baffle turn in the flocculator, our 2D model was best served by having an infinitely thin wall where the fluid would flow in opposite directions on different sides. The software help documentation was useless for providing an answer, and only after consulting technical support did we find that lines had to be drawn, created as separate bodies, and then projected onto the surface through which fluid would flow. Another such issue occurred while creating the near-wall mesh. In order to properly resolve the viscous sublayer (i.e. y+ values less than 5), cell size growth had to occur from an initial cell size (0.0003m) to the size used for meshing the flow's core that is "far" from the wall. This is implemented using a bias factor that governs the change in size of each cell when moving away from the wall. Unfortunately, there is no simple user input where first cell size, number of divisions, and total length are specified and the bias factor is simply computed from this information (Gambit actually had this ability which indicates ANSYS took this a step backwards in my opinion). Also the documentation doesn't provide this algorithm leaving it to the user to either figure it out independently or simply guess until the correct size is obtained.

Verification and Validation

Perhaps one of the most important aspects of any numerical approximation is ensuring the accuracy of solutions. The danger of using any computational software comes from the user becoming content with the output without taking any time to look over the results and determine if they actually make any sense. The verification process involves looking at a number of sources of error introduced by the computational formulation and attempting to mitigate their effects on the overall solution. These errors take the form of discretization error (based on mesh size), iterative error (based on the value of the residual), and error based on the treatment of special circumstances in the flow (such as near the wall). The work involved in minimizing this error is extensive, and even then, there is no guarantee that results will be worth anything. Even if the user can manipulate the setup to solve the "equations right", there is still the issue of whether the user is solving the "right equations." Thus a separate validation process must be implemented.

Grid Convergence

Before discussing grid convergence, the following diagram will help clarify what is meant by baffle space # and baffle #:

Unknown macro: {center}

Now that certain terms have been defined, the discussion turns to grid (aka mesh) size which is a common source of error for computational problems. The finite volume method used in FLUENT requires that the flow domain be divided up into areas (2D) or volumes (3D) and the resulting equations be solved for each cell. Since each cell is a finite portion of the domain, there is a truncation error associated with solving the discrete equations. Decreasing cell size will help reduce this error because the discretization will asymptotically approach a point which is the same as the continuum formulation. The tradeoff comes from the computational cost associated with smaller and therefore more cells. The approach to minimizing grid error thus involves systematically decreasing the grid size by dividing the cell length and width in half and looking at the results for an otherwise constant setup.

There are essentially two methods for determining grid convergence once simulation data has been obtained. The first test is a simple qualitative look at contour plots to determine if there are any visually obvious differences between the two grid densities. There is no real point in doing any quantitative comparisons if pressure and velocity contours are clearly different. Grid refinement should be carried out to the point that visual inspection can no longer tell the difference between contour patterns. Once this has been achieved, actual data must be examined. For the following grid analysis, three levels of refinement are considered. The mesh properties are given in the following table. It should be noted that the portion of the mesh used to resolve the boundary layer does not change with different meshes.

Symbol

Cell Dimension (Cells are Square)

Number of Cells in Mesh

0.008 m

65,888

∆/2

0.004 m

169,600

∆/4

0.002 m

499,712

Before looking at derived parameters such as collision potential, it is important to examine variables common among all flows. Pressure coefficient is one such parameter, and it is defined as:

FLUENT allows the pressure coefficient to be plotted, but the user must be careful to set the correct reference values. In this case, p0 = 0 (gauge pressure), ρ = 1000 kg/m3, and V = 0.1 m/s. Figure 1 shows the pressure coefficient at a height of 0.5 m (half the flocculator height) across all the baffle spaces for the three mesh densities. A couple of interesting trends can be observed. First, doubling the mesh density (i.e. halving the cell dimension) suggests asymptotic convergence since the difference going from ∆ to ∆/2 is larger than that from ∆/2 to ∆/4. Also, as the flow progresses through the baffles, the difference between the pressure coefficient for each mesh density gets smaller. To further investigate these phenomena, an average pressure coefficient was calculated for each baffle space for all three meshes, and this is plotted in figure 2. The average values were used to determine percent differences between Cp for each baffle space with the results appearing in figure 3. This helps confirm the observations mentioned above. As the plot shows, refinement from ∆ to ∆/2 has percent differences ranging from 2% to 2.5% for each baffle space while going from ∆/2 to ∆/4 keeps the percent difference below 1%. The percent difference also decreases as the flow goes through each baffle and drops off considerably in the last few spaces. While it is interesting that Cp far from the entrance seems to have decreasing dependence on the cell size, the most important result is probably the fact that the most refined mesh has is consistently less than 1% different than the previous refinement. Since the error introduced by the turbulence model usually introduces an error of about 5-10%, it is not necessary to pursue any further increase in mesh density. Thus the ∆/4 grid will be the standard used for all further flocculator investigations.

Unknown macro: {center}

Figure 1

Unknown macro: {center}

Figure 2

Unknown macro: {center}

Figure 3

Iterative Convergence

Iterative convergence is the method used to deal with the nonlinearity of the governing Navier-Stokes equations. Basically the procedure involves beginning with a guess value, then solving the discrete governing equations and comparing that solution to the guess value and finding that difference. The solution then becomes the guess value for the next iteration. When the difference between the guess value and the solution falls below a specified value convergence is reached. The error associated with this procedure is based on the residual level. Not only does the iterative process reduce linearization error, it also reduces the error associated with a more efficient (and thus faster) matrix inversion process that is common among CFD codes. The following is a standard residual plot for the five variables of the k-epsilon realizable model:

Unknown macro: {center}

The validation aspect comes from comparison of CFD results to those obtained through experiment. This will be explored in the final draft since we only obtained accurate results today.

Periodic Case

The periodic simulation was a proposed method of determining flow characteristics far downstream of the inlet. Instead of creating geometry for a large number of baffles and looking at the solution near the end of that case, only one baffle would need to be created with the boundary conditions providing the necessary information to the solver. The time it takes to create and mesh a multi-baffle flocculator can be extensive, so clearly being able to examine this case using only one turn would save a significant amount of work. Time would also be saved during the solution step of the procedure. For each iteration, FLUENT solves the discrete governing equations in each cell of the mesh. The more baffles a particular case has, the more cells are required to obtain an accurate solution. A large number of cells can significantly slow the time each iteration takes, even with the powerful processors available in the Swanson lab. While a one baffle turn might take about a second per iteration, ten baffles might take ten seconds per iteration, and since it takes thousands of iterations to reach the desired residual level, these simulations could end up taking more than a day to compute. For the above mentioned reasons, a periodic baffle is desirable, and much effort was placed on implementing this case.

According to the FLUENT user guide, the following are conditions and limitations on its periodic solver:

  • Flow must be incompressible
  • The geometry must be translationally periodic
  • No extra mass sources/sinks
  • No reacting flow
  • No multiphase flow

The periodic baffle case meets all these criteria, so a solution should be obtainable.

Boundary conditions for the periodic case can only come in two forms. Either a prescribed mass flow rate or pressure gradient. The mass flow rate was attempted first, and a value of 6 kg/s was used corresponding to some of the lower flow rate plants (it should have been 10 kg/s for this particular case but it didn't matter since no solution could be found). After several attempts with different under-relaxation factors and thousands of iterations, the general pattern was a slow and steady convergence of the two components of momentum and the two turbulent parameters contrasted by a sharp divergence in continuity. In other words, the solver was not finding a solution. A shift to specifying a pressure gradient of 15 Pa/m did little to improve this situation. The five variable residuals would all approach residual levels of 10^-4 then begin to fluctuate as the solver dealt with instabilities in values between iterations. Ultimately it was determined that the flow had to be periodic along the axis of translation which is not explicitly stated in the guide, but it now appears this method will not work.

More Baffles

The motivation for more baffles came from the inability of the periodic solution to converge. To advance the project, it was essential to find the flow solution after enough baffles to achieve time independent conditions. While the simulations would take much longer, the decision was made to proceed with more baffles and look at the relative change in flow variables before and after successive turns. The solution took ~3000 iterations (6+ hours) to converge, but the process was worth the time since the results seem to indicate that after only about 5 to 10 baffles, the solution becomes steady.

Unknown macro: {center}

Contours of Velocity (m/s) over 15 Baffles (H/S = 10)

Looking at turblent energy dissipation also revealed the same sort of constant values after 5 or so baffles.

Unknown macro: {center}

Contours of Turbulent Energy Dissipation (m^2/s^3) over 15 Baffles

Conclusion

Multiple trials were tested to attain a periodic solution. The mass flow rate input was calculated to be 10 kg/s, based on a density of 1000 kg/m^3, an area of 0.1 m X 1 m, and a velocity of 0.1 m/s. Professor Weber-Shirk estimated a pressure drop of 30 Pa over two baffle turns, which was used in the pressure drop initial condition for periodic solution. The Fluent solver solution controls were adjusted to allow the periodic simulation to converge. The behavior of the converged periodic solutions could not be validated. The mass flow rate initialized periodic solution had a very large pressure drop over the baffle turns. The pressure drop periodic boundary conditions yielded little if no pressure difference between the outlet and the inlet. To this point the periodic solution for the AguaClara baffles does not work. The 10 and 15 turn baffle solutions show stability of energy dissipation rate after multiple turns, perhaps showing promise for analyzing the performance parameters for optimal baffle geometries far down stream. The UDFs are being adapted to analyze the current cases.

Post-Midterm Analysis

Flocculator Design Case

  • No labels