Wiki Markup |
---|
<!-- /* Font Definitions */ @font-face {font-family:Wingdings; panose-1:5 0 0 0 0 0 0 0 0 0; mso-font-charset:2; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:0 268435456 0 0 -2147483648 0;} @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:1627421319 -2147483648 8 0 66047 0;} @font-face {font-family:Verdana; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:536871559 0 0 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} h1 {mso-style-next:Normal; margin-top:12.0pt; margin-right:0in; margin-bottom:3.0pt; margin-left:0in; mso-pagination:widow-orphan; page-break-after:avoid; mso-outline-level:1; font-size:16.0pt; font-family:Arial; mso-font-kerning:16.0pt; font-weight:bold;} h2 {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:2; font-size:18.0pt; font-family:"Times New Roman"; font-weight:bold;} h4 {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:4; font-size:12.0pt; font-family:"Times New Roman"; font-weight:bold;} h5 {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:5; font-size:10.0pt; font-family:"Times New Roman"; font-weight:bold;} h6 {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:6; font-size:7.5pt; font-family:"Times New Roman"; font-weight:bold;} p.MsoCommentText, li.MsoCommentText, div.MsoCommentText {mso-style-noshow:yes; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} span.MsoCommentReference {mso-style-noshow:yes; mso-ansi-font-size:8.0pt; mso-bidi-font-size:8.0pt;} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} p {mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} pre {margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt; font-size:10.0pt; font-family:"Courier New"; mso-fareast-font-family:"Times New Roman";} p.MsoCommentSubject, li.MsoCommentSubject, div.MsoCommentSubject {mso-style-noshow:yes; mso-style-parent:"Comment Text"; mso-style-next:"Comment Text"; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; font-weight:bold;} p.MsoAcetate, li.MsoAcetate, div.MsoAcetate {mso-style-noshow:yes; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:8.0pt; font-family:Tahoma; mso-fareast-font-family:"Times New Roman";} p.Default, li.Default, div.Default {mso-style-name:Default; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; mso-layout-grid-align:none; text-autospace:none; font-size:12.0pt; font-family:Verdana; mso-fareast-font-family:"Times New Roman"; mso-bidi-font-family:Verdana; color:black;} ins {mso-style-type:export-only; text-decoration:none;} span.msoDel {mso-style-type:export-only; mso-style-name:""; text-decoration:line-through; color:red;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:1022559722; mso-list-template-ids:763265730;} @list l0:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level2 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:"Courier New"; mso-bidi-font-family:"Times New Roman";} @list l1 {mso-list-id:1302274148; mso-list-template-ids:-93549060;} @list l1:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} @list l2 {mso-list-id:1448550990; mso-list-template-ids:2105318412;} @list l2:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} @list l3 {mso-list-id:1923563562; mso-list-template-ids:-1219047982;} @list l3:level1 {mso-level-number-format:bullet; mso-level-text:; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Symbol;} @list l4 {mso-list-id:1941793530; mso-list-template-ids:1878977714;} @list l4:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} ol {margin-bottom:0in;} ul {margin-bottom:0in;} --> CFD Analysis of a Flocculation Tank and Design Recommendations *By:* * * *Yong Sheng Khoo* * * *Jesse Prager* \\ *Abstract* A flocculation tank +converts a suspension of colloidal+ +particles+ +into a suspension of mm size flocs through a{+}{+}n extended+ +series of collisions+ +between particles.+ +A hydraulic flocculation tank relies on energy dissipation from flow expansions to generate{+}{+}the+ +particle collisions.+ Little information is available about the fluid behavior within +hydraulic+ floccula{+}tors+. The flow is turbulent and involves separation, reattachment and high shear. By analyzing the flocculation tank using the k-ε realizable model in FLUENT, the fluid behavior has been characterized, and various geometrical configurations have been simulated. The results of our experiment will be +used by{+}AguaClara's design team which produces designs for hydraulic water treatment plants installed in Honduras. The fluid behavior has been analyzed by examining the uniformity of the energy dissipation rate (ε) within the flocculation tank, and by determining performance parameters which relate to the formation and break up of flocs. The uniformity of ε, indicates that there is +uniform+ mixing throughout the entire flocculation tank. The uniformity of the +energy dissipation rate+ is gauged by +color ramp+ plots of ε, and a +probability distribution function,+ pdf+,+ quantifying the distribution of flocculation area within ε ranges. Performance parameters are derived using dimensional analysis, and relate ε to the relative +particle velocities+ within the viscous and non-viscous sub-regions. The performance parameters are ε raised to various powers multiplied by the residence time, and are found by summing the time-averaged cell values using FLUENT +user defined function,+ UDF+,+ scripts. The result of the research indicates that the optimal flocculation tank design in terms of uniformity occurs at a flocculation tank height to baffle spacing ratio of 3, and clearance height to baffle spacing ratio of 1. The optimal flocculation tank design in terms of the performance parameters occurs at a flocculation tank height to baffle spacing ratio of 2, and clearance height to baffle ratio of 1. The flocculation tank analyzed at Re=10,000 is somewhat sensitive to Reynolds number, while the flocculation tank performance is not sensitive to the turbulent boundary inlet condition. Overall the design of the flocculation tank produced reasonable results which match expected results of hydraulic flocculation tanks found in literature. The results of the report suggest that +a height to baffle spacing ratio of 3 creates+ intersecting energy dissipation regions{+}that+ produce the greatest formation of flocs per +reactor volume+. \\ *I. Introduction* In order to better understand the behavior of the fluid in the flocculation tank, the CFD simulation team has modeled the tank using FLUENT. This approach allows the analysis of different geometries, flows and boundary conditions without the difficulty of setting each of these cases up in an experimental lab. The results produced by the simulation enables examining detailed profiles of velocity, turbulence energy dissipation, turbulent kinetic energy, and any derived parameter in terms of these variables. This semester our main goals have been to optimize the flocculation tank design, and understand how the region of turbulent energy production and dissipation over each baffle interact. Research of the flocculation tank using these advanced tools improves the performance of the flocculation tank, and can lead to smaller more cost effective designs. h2. h2. II. Procedures h2. II.1 Geometry of Flocculation Tank There are a few important parameters of flocculation tank that will affect the flow properties in the flocculation tank. The important parameters are number of baffles (N), baffle spacing (bs), flocculation tank height (fh), and baffle clearance height (ch). To make sure that the flow properties are not affected by the inlet and outlet boundary conditions, we want N to be large. However, large N will contribute to long computational time. +Five baffles were used+ to balanced both factor{+}s+. Knowing the general geometry of the flocculation tank, we can now focus our analysis on the +mesh+ geometry. h2. h2. II.2 Gambit and FLUENT h2. II.2.1 Automation of Mesh Creation +F{+}locculation tank{+}s+ with different geometric properties were evaluated. +J{+}ournal script{+}ing was used to+ automating the mesh creation process. In general, every time we use Gambit for creating mesh, it logs every single action that we do into a journal file. This journal file is very useful as it enables the user to troubleshoot the code if problems arise. By changing the appropriate geometry parameters of the journal files into variables, we are able to create mesh with different geometries by changing the value of the variables. \\ Refer to Appendix A-1 for script files for the automation mesh creation of flocculation tank with 5 baffles turning. Figure II.1. Flocculation tank geometry parameters Using the scriptprovided, users can investigate the necessary geometry by changing the parameter of baffle spacing, clearance height and flocculation tank height as illustrated in figure II.1. +After adjusting+ parameter{+}s+, run the script in Gambit +to create a new+ mesh +that+ is ready for implementation in FLUENT. Similarly, a script in FLUENT can process a completed mesh, and automatically set up the solver, initial conditions, fluid properties, convergence criteria, and save the convergence solution data file to be analyzed later. Please refer to Appendix A-2 for the script. h2. Modifying the Journal File Following is the sample of the heading of the journal file that was added to declare the value of different parameters. /clearance height $ch = 0.1 /flocculator height $fh = 0.5 /create baffle spacing $bs1 = 0.1 /create x-coordinate $w0 = 0 $b1 = $w0+$bs1 /create y-coordinate $y1 = $ch $y2 = $fh-$ch Note that '/' means commenting on the code. Note also that the parameters are initialized to ch = 0.1, fh = 0.5, bs = 0.1. Note also that a '$' is added in front of those parameters to denote them as variables in Gambit. Note also Gambit recognize mathematical operators. By relating different coordinates of the flocculation tank to the declared parameters, we can generate meshes with different geometry by just changing the heading of the journal file. Look at the Appendix A-1 for the complete script. \\ h2. II.2.2 Setting up Problem in FLUENT With mesh created, we can now use FLUENT to set up the problem using the following steps: # Import generated mesh file # Define turbulence model #* Different turbulence model are appropriate for different flow properties #* K-ε realizable model is chosen for the flow in flocculation tank (further discussed in later section) # Define materials (liquid water for our case) # Define operating conditions (use default operating pressure) # Define boundary conditions (Details below) # Set control solution #* Select second order discretization method instead of first order method # Initialize the problem with the inlet properties # Set Residual to 1e-05 #* The residual is a measure of how well the current solution satisfies the discrete form of each governing equation # Solve the problem by iterating h2. Defining Boundary Conditions \\ *Figure II.2. Boundary conditions of flocculation tank{*}Figure II.2 shows the boundary conditions of the flocculation tank. The top part of the flocculation is open, so a symmetry boundary conditions is employed. The inlet boundary condition is set to inlet velocity of 0.1 m/s, and the outlet is set to pressure outlet. \\ *Table II.1. Boundary conditions* | *Boundary* \\ | *Boundary Conditions* \\ | | Top | Symmetry | | Wall | Wall | | Inlet | Velocity Inlet (0.1m/s) | | Outlet | Pressure Outlet | h2. h2. II.3 Validation of Turbulence Models h4. Turbulence Modeling Resolution Problem Computational Fluid Dynamics works by iteratively changing the values of the variables to +reduce+ the residuals, or errors of the governing equation{+}s+. The governing equations in our model +are+ conservation of mass and conservation of momentum as shown below in Eq. 1 and Eq. 2: *Equation 1. Conservation of Mass* *Equation 2. Conservation of Momentum* The conservation of Momentum equation can be simplified to Reynolds Averaged Navier Stokes Equation (for x,y directions) in Eq. 3 by estimating velocity and pressure in terms of mean value (u) and fluctuation (u') and averaging all terms as shown below: *Equation 3. Reynolds Averaged Navier Stokes Equation* With the conservation of mass equation, and conservation of momentum equations in the x and y direction, there are three governing equations. However with the introduction of the velocity fluctuation variable (u',v'), as shown above there are four variables (u,v,u'v',p). Thus, the problem becomes unsolvable unless additional equations are formulated to relate the variables. This is the *Turbulence Modeling Resolution Problem*. The k-epsilon model overcomes this problem by relating the product of the velocity fluctuation terms to gradients of the mean velocity. The ν_t represents a variable which can be related to the turbulent kinetic energy (k) and the energy dissipation rate (ε). The turbulent kinetic energy (k) and energy dissipate rate (ε) are governed by the following equations. Thus, these definitions of k and ε enable the system to be fully resolvable with 6 variables (u,v,p,v_t,k,ε) and 6 equations. The k-ε model is one approach to create a resolvable problem and many other methods have been formulated. Certain models solve particular types of problem{+}s+ +better;+ therefore it is necessary to gauge the performance of the turbulence models using +experimental results from a similar flow geometry+. h4. Comparing Turbulence Models Using Back-step Example To +evaluate+ the turbulence model{+}s+, a flow over back-step was compared with the literature experimental data. Figure II.3 shows the flow of Re = 48000 over the channel. In the middle of the channel, the flow separate{+}s+ due to the small step size of height h. The flow reattaches at about 7 times the step height further downstream. This flow property is similar to the 180 degree bend in the flocculation tank where we have flow separation and reattachment downstream (Figure II.4). \\ \\ *Figure II.3. Flow over backstep in a open channel (Re = 48000, Reattachment length = 7h)* *Figure II.4. Flow over 180 degree turn in flocculation tank* The back step flow was analyzed using K-ε, K-ω SST, K-ε realizable, K-ε RNG, RSM turbulence models. The reattachment points of all the turbulence models was determined so that the reattachment ratio could be compared with the experimental data. Plotting the derivative du/dy, the change in direction of velocity in x direction with respect to y at the wall, the reattachment point is easily identified. At the wall, separated flow will give a negative du/dy, while +reattached+ flow has a +positive{+}du/dy value. Figure II.5 shows the derivative of du/dy vs x direction for different turbulence models. *Figure II.5. dU/dy for Different Turbulence Models (h=.038 m, back step at .305 m)* *Table II.2. Reattachment ratio with different turbulence models* | *Turbulence Model* \\ | *K-e* | *K-W SST* \\ | *K-e realizable* \\ | *RSM* \\ | | Reattachment Ratio \\ | 0.195/0.038 = 5.13*h | 0.242/0.038 = 6.37*h | 0.235/0.038 = 6.18*h | 0.2/0.038 = 5.26*h | From table II.2, the K-ε model under-predicts the reattachment length, as known by most literature. K-ω SST and K-ε realizable gives the most accurate representation of the back step flow with reattachment length of 6.37*h and 6.18*h. However, from literature reviews, K-ε realizable is more proven for a variety of types of flows. Thus K-ε realizable has been chosen as the model for flow in the flocculation tank. Below in Figure II.6, the stream contours (of the averaged velocity) with Re=48,000 for the k-ε realizable model case closely approximate the experimental results. \\ *Figure II.6. Flow over backstep using K-e realizable model* h2. II.4 UDF Following the converged solution in FLUENT, data needs to be extracted from the cells. This is accomplished by using a User Defined Function (UDF). UDFs sum relevant parameters based on the corresponding values of variables in the cell. The shell of the UDF used to determine relevant parameters in the program is structured as follows: Declaration of DEFINE macro: defines when the function is called DEFINE_ON_DEMAND(on_demand2_calc) Variable declarations: defines structure, variables, and parameters Domain \*d; double pos_x; int density=1000; Thread \*t; double pos_y; double visc=1e-6; cell_t c; double sum=0; Node \*nod; Loops over cells thread_loop_c(t,d) { begin_c_loop(c,t) { Meat of the Code: May makes reference to Mesh values of C_D(c,t) turb kin energy dissipation NODE_X(nod) node x-position } } Print Results to Screen: uses _printf_ to display results The UDF used for this semester are available on the wiki, and follow the above format. h2. h2. II.5 Analyzing Results h2. II.5.1 Based on Performance Parameters Given the converged solution, how does one determine compare performance of +flocculator geometr{+}{+}ies+? The optimality is based on the mechanism of the formation of floc particles, as well as the break up of flocs. The formation of flocs is directly related to the relative velocity of the particles in the flocculator. In the viscous sub-range, the relative velocity of the particles is proportional to the velocity gradient (*G*). The velocity gradient in the viscous subregion is√ε/ν, and the relative velocity is proportional to *ε{*}{*}{^}1/2{^}*. This behavior only occurs in the first stage of flocculation, while the majority of the flocculation is done in larger length scales, above the Kolmogorov length scale. Here the relative velocity is proportional to the *ε{*}{*}{^}1/3{^}*. The floc break-up is directly related to the shear stress applied by the fluid on the floc particle. For all length scales, this is proportional to the turbulent energy dissipation rate (ε) times the coefficient of drag. Also, important to both the break up, and formation of flocs is the residence time (θ). Multiplying the residence time +by+ each of the above parameters creates performance parameters for formation of flocs, Gθ, ε{^}1/2{^}θ, and ε{^}1/3{^}θ, and break up of flocs, εθ. These quantities can be determined for the entire flocculator by summing up the value of each cell normalized by the volume flow rate. This is accomplished by using the UDFs, as defined above. The formulation of the summed quantity is solved for using the Gθ quantity below. By a similar process, the performance parameters of the other quantities equals 1/Q*Σ(G, ε{^}1/2^, ε{^}1/3^)*(cell_area). *Figure II.7. Performance Parameter Formulation* h2. II.5.2 Based on Uniformity of Flocculation Tank Energy Dissipation From above discussion, it is known that energy dissipation rate play{+}s+ a big role in determining the performance of the flocculation tank. At the beginning of the flocculation, floc collision +occurs in the{+}viscous +subrange+. The performance parameter at the beginning is a function of ε{^}1/2^. For the rest of the flocculation, flocs collision is due to ε{^}1/3^. Since energy dissipation rate plays an important role in particle collision, determining the uniformity of the energy dissipation rate is a sensible method for examining performance. +Dimensional analysis relates ε to K,V,+ π\-+cell and baffle spacing, as follows:+ + ε = KV{+}{+}{^}3{^}+ +/(2*π-cell*b{+}s+)+{+}Thus, ε*b{+}s+/V{+}{^}3^ +represents a dimensionless quantity where K is the minor loss coefficient (the drop in the pressure coefficient per baffle), b{+}s +is the baffle spacing, and V is the average velocity flowing through the channel when the baffle spacing is b.+ Plotting d{+}imensionless+ energy dissipation enables the comparison of cases with different geometric conditions and inlet velocities+.+ As presented, the relevant geometry parameters to examine in a flocculation tank are baffle spacing (bs), flocculation tank height (fh), and clearance height (ch). By fixing the (bs), and exploring different ratios of fh/bs, and ch/bs, we can determine the optimal normalized design of the flocculation tank. The optimization method starts with an initial geometry. From the initial geometry, varying ratios of ch/bs, and fh/bs are examined. If changes in geometry resulted in a more uniform energy dissipation rate than the initial geometry, the new geometry is called the incumbent. This process investigates the entire geometric space. At the end of the investigation, the final incumbent will be chosen as the optimal solution. \\ *{+}Figure II.+{*}8+. Nondimensionalized energy dissipation rate (fh+/bs +=4+, ch/bs=1, +bs = 0.1,+ V += 0.1)+ +Figure II.+8 +shows an example of nondimensionalized contour of energy dissipation rate. Note that for above example, the nondimensionalized epsilon differs by a factor of 100 compared to the epsilon.+ Figure{+}s+ II.9 and II.10 show the comparison of the energy dissipation plot with and without adding the range. As can be seen, setting the appropriate range of energy dissipation rate enables us to better visualize the contour of energy dissipation rate. Using this visual method, we can evaluate the uniformity of the energy dissipation rate. A less subjective and powerful way of determining the uniformity of energy dissipation rate is to use +a+ UDF to collect the individual cell data and plot out the energy dissipation distribution of the flocculation tank. To plot the distribution, separate ranges of the energy dissipation rate into different bins. The area with different energy dissipation rate is then captured into the appropriate bins for analysis. Plotting the energy dissipation rate against fractional area will give us the distribution that we are interested. *Figure II.9. Energy Dissipation Rate without ranging{*}{*}Figure II.10. Energy Dissipation Rate with ranging*\\ *III. Results & Discussion* h2. Result 3.1: Uniform Energy Dissipation Rate Approach in Determining Optimal Geometry The optimal geometry is determined by evaluating the uniformity of energy dissipation rate of different ratios of flocculation tank height (fh) to baffle spacing (bs), and different ratios of clearance height (ch) to baffle spacing. Since energy dissipation rate is the core parameter that influence{+}s+ particle collision, it is reasonable to assume that a uniform energy dissipation rate profile will give a better performing flocculation tank. *Figure III.1. Turbulent Dissipation Rate (fh/bs = 2, ch/bs = 1, bs = .1, V=.1) * *Getting Started with an Initial Geometry* From first semester, we concluded that clearance height should be no smaller than the baffle spacing. We would also like to start our investigation of the geometric space by having the most overlapping energy dissipation region. Employing the two constraints, we come up with the initial fh/bs of 2. Figure III.1 shows the contour of turbulent dissipation rate with such geometry. We see that the energy dissipation rate is fairly uniform. Since this is our starting geometry, there is no other geometry to compare with. So this will be the new incumbent. *Baffle Spacing Investigation* From initial geometry in figure III.1, we see that there is large blue region in the inner turn. By reducing the baffle spacing we hope to reduce the non-active region. *Figure III.2. Turbulent Dissipation Rate (fh/bs = 2.86, bs = 0.07, ch/bs = 1.43) * Changing dimensionless ratio to fh/bs = 2.86 and ch/bs = 1.43 does not give the desired effect. Since the uniformity decreases, this is not the right parameter to change. Note that the validity of this section is not clear because we are changing multiple non-dimensional parameters at a time such as Re, fh/bs and ch/bs. *Clearance Height Investigation* Another geometric space that we can investigate is the clearance height. Though it was recommended from previous semester that clearance height of one baffle spacing is optimal for the design for one baffle turn, it would be interesting if we observe different results for multiple baffles turning. \\ h6. *Figure III.3. Turbulent Dissipation Rate (fh/bs = 2, bs = 0.1, ch/bs = 0.7) * Figure III.3 shows the result with dimensionless ratio of ch/bs = 0.7. Changing clearance height parameter also did not give desirable result. Decrease in clearance height create a constriction of the flow and we have very high energy dissipation rate in that region. The result observed is the same as of last semester's result of one baffle turning. Changing clearance height geometric space will not give us a better result. \\ *Flocculation Tank Height Investigation* Having investigated two of the three parameters, we are left with final parameter, which is the flocculation tank height. fh/bs of 2 might be providing too much overlapping region. Reducing overlapping of the tail of the energy dissipation region might give a more uniform distribution. *Figure III.4. Turbulent Dissipation Rate (fh/bs = 3, bs = 0.1, ch/bs = 1) * Figure III.4 shows the longer flocculation tank height of 3*bs. This geometry +gives+ us a more uniform energy dissipation rate than the previous incumbent (Figure 1). This geometry configuration will be the new incumbent. Since changing this geometric space give desirable result, further investigation into this parameter is needed. *Figure III.5. Turbulent Dissipation Rate (fh/bs = 4, bs = 0.1, ch/bs = 1) * Comparing figure III.4 and III.5, we see that flocculation tank height of 4*bs does not give a more uniform energy dissipation rate. Therefore, flocculation tank height of 3*bs is still the incumbent. *Adding of Slots Investigation* Notice that there is a region of low energy dissipation rate right before the turning. Another interesting geometric space that might be worth investigating is to add a small slot at the baffle so that water can flow directly through the baffles. The hope is that this method will reduce the stagnant region. *Figure III.6. Turbulent Dissipation Rate (fh/bs = 4, bs = 0.1, ch/bs = 1, slot = 0.1bs) * From figure III.6, we see that adding small slots at the bottom of baffles does not give us the desired result. The small slot causes the water to flow directly through them and the +small slot has a small energy dissipation zone and hence a high energy dissipation rate+. \\ After considering all possible geometric space, we concluded that the optimal geometry for flocculation tank is fh/bs = 3, ch/bs = 1 as seen in figure III.4. h2. Result 3.2: Complementary Solution to Analysis of Energy Dissipation Distribution From section 3.1, we concluded the uniformity of energy dissipation rate using visual investigation. This section presents the results using a statistical method to complement the result from previous section. *Figure III.7. Contour of Energy Dissipation Rate (fh/bs=3)* Figure III.7 shows the contour of the energy dissipation rate. Visually, we can judge the uniformity of the energy dissipation rate for the given geometry. A less subjective way of characterizing the uniformity of the energy dissipation rate is to use +a{+}UDF to analyze and plot out the distribution of the energy dissipation rate. Appendix B-1 shows the UDF script. *Figure III.8. Distribution of Energy Dissipation Rate (fh/bs=3) with "hump"* Figure III.8 shows the distribution of the energy dissipation. Note that there is a hump in the distribution. The peak of the hump is around energy dissipation rate of 0.006 m2/s3. There might be relationship between the hump and the uniformity of the energy dissipation rate. Smaller range of energy dissipation rate was set to investigate this relationship. *Figure III.9. Contour of Energy Dissipation Rate (fh/bs=3) with* TighterRange From figure III.9, setting a tighter range of energy dissipation rate, we see that the contour is dominated by the blue and green region which is from the range of 0.005 to 0.01 m2/s3. This explains the appearance of +the local maximum+ in figure 2. To further investigate +this phenomenon+, another flocculation geometry with flocculation tank height of 4*bs is plotted. *Figure III.10. Distribution of Energy Dissipation Rate (fh/bs=4) with "hump"* *Figure III.11. Contour of Energy Dissipation Rate (h/b=4)* Figure III.10 shows the distribution of energy dissipation rate for flocculation tank height of 4*bs. We also see a visible hump. Figure III.11 shows the uniformity of energy dissipation rate with flocculation tank height of 4*bs. Since hump appears both in the flocculation tank with uniform energy dissipation rate, we concluded that hump in the distribution of energy dissipation rate provided by UDF will be a good indication of uniformity. \\ *Figure III.12. Distribution of Energy Dissipation Rate (fh/bs=10)* For flocculation tank height of 10*bs, we see that there is no visible hump. From previous analysis, this indicates that the energy dissipation rate in the flocculation tank is not uniform. \\ *Figure III.13. Contour of Energy Dissipation Rate (fh/bs=10) * Figure III.13 clearly shows the non-uniformity in energy dissipation rate for such geometry. h2. Result 3.3 - Performance Parameter Approach in Determining Optimal Geometry To determine the optimal geometry, performance parameters, εθ, ε^(1/2)θ, ε^(1/3)θ, K, and Gθ, +were+ calculated for each baffle for fh/bs of 2, 3, 5, and 10. These performance parameters are extracted from the results of the converged solutions for the geometries listed above using the UDFshown in Appendix B-2. \\ *Table III.1 Summarized Data of Performance Parameters* \*Note that eps_1/2 values for fh/bs of 3,5 and 10 are normalized by the flow (x100). \\ h4. Performance Based Analysis From the data, observations about the values of the performance parameters can be made: * The Gθ/m^2 value decreases with increasing flocculation tank height indicating that the most efficient flocculation occurs at a h/w ratio of 2. This type of trend would be exhibited for εθ, ε^(1/2)θ, and ε^(1/3)θ if they were normalized by area. * Similarly, larger pressured drops, K for both observed and calculated are exhibited for flocculation tank with smaller heights. This reflects how energy dissipation regions intersect with each other. (K{~}observed~ is based on observation from FLUENT. K{~}calculated~ is calculated from ) * Large flocculation tank heights have a more uniform performance over all baffles, and reach a converged baffle solution more quickly than the smaller flocculation tank heights. h4. Pi Cell Analysis The +size of the+ region of high energy dissipation behind a baffle can be estimat{+}e{+}d by +P{+}{~}cell{~}value (the length of the region in terms of baffle s{+}pacing+). Interestingly with larger flocculation tank heights the +P{+}{+}{~}cell{~}{+}values bolded in the charts above continue to increase. From observations of the energy dissipation regions in tall (fh/bs > 5) flocculation tanks, the energy dissipation regions do not interact with the separation region at the subsequent region. Thus, it seems reasonable to +expect+ a maximum +P{+}{+}{~}cell{~}{+}value +at high+ f{+}h/b{+}s values. However, in the formulation of this quantity, the energy dissipation from the entire baffle is summed (including energy dissipation from the walls), and thus the increasing f{+}h/b{+}s +ratio+ results in increasing +P{+}{+}{~}cell{~}{+}values. \\ *Figure III.14. pi-cell values as a function of the height* h2. Discussion 3.1 Sensitivity to Reynolds Number A sensitivity analysis of Reynolds number for the flocculation height tank height of .3 with a symmetry boundary condition has been completed. The performance of the flocculator was examined at Re=1,000 (corresponding to a velocity inlet of .01 m/s), Re=10,000 (velocity inlet of .1 m/s), and Re=100,000 (velocity inlet of 1 m/s). Note that by checking the effect of Reynolds number, we are effectively also checking our results to scale to other physical dimensions such as the baffle spacing. We can either change the Reynolds number by changing inlet velocity or changing the baffle spacing. h4. Velocity Profiles The velocity profiles for varying Reynolds numbers are presented below. With increasing inlet velocities, the uniformity of the flow decreases. This can be seen by how the ratio of the maximum velocity over the inlet velocity increases, as well by the color contour velocity profiles. *Figure III.15. Velocity inlet = .01 m/s (Re=1,000)* *Figure III.16. Velocity inlet = .1 m/s (Re=10,000)*{*}Figure III.17. Velocity inlet = 1 m/s (Re=100,000)*For the case when the Reynolds number is 1,000, the flow is in the laminar region, and the fluid behaves similarly across different baffles. The velocity profile, which has a maximum magnitude of only twice the inlet value, reveals that the recirculation region is smaller, and the fluid does not impinge on the baffle following it. The Re=100,000 case +has higher relative velocities than the Re = 10,000 case. This suggests+ +that+ +the jet leaving the vena contracta expand{+}{+}s slower+ +as the Reynolds number increases.+ After each turn the fluid impinges upon the baffle following it. The flow over the first baffle channels the fluid creating an extremely high velocity region at the edge of the second baffle. Following this baffle there is an extremely high region of velocity +where the+ fluid +impinges{+}against the third baffle. h4. Normalized Energy Dissipation Profiles The normalized energy dissipation for varying Reynolds Numbers is presented below. With increasing Reynolds numbers, the energy dissipation profile reveals a greater amount of energy dissipation in areas where the fluid impinges on the following baffle. \\ *Figure III.18. Normalized Epsilon Values for Velocity inlet = .01 m/s (Re=1,000)* *Figure III.19. Normalized Epsilon Values for Velocity inlet = . 1 m/s (Re=10,000)* *Figure III.20. Normalized Epsilon Values for Velocity inlet = 1 m/s (Re=100,000)* The normalized energy dissipation profile in Figure 4 for Re=1,000 reveals that the fluid only dissipates energy due to the no slip conditions on the wall. Otherwise, the energy dissipation is quite boring, and there is little energy dissipation induced in the main portion of the flow of the fluid, even after the baffles. In the higher Reynolds values the normalized dissipation values increase, and higher spikes occur where the fluids impinges upon the next baffle. There is a slight difference in the profiles of the Re=10,000 and 100,000 cases. The Re=100,000 flow does not make use of the space of the flocculation tank as efficiently as the Re=10,000 flow, and the dissipation regions are more pinched. This is reflected by the higher angle of separation at the baffle, and less uniformity. h4. Performance Parameters for Re=100,000 Below is the performance parameters for the tank with Re=100,000 for baffles 1-6. *Figure III.21. Performance Parameters for Re = 100,000* The performance parameters reflects that the higher energy dissipation results in a flocculation tank design with a higher pi-cell value and a higher Gθ value. However, clearly the spike in energy dissipation will cause flocs to break up, and not all of the flocculation tank is being effectively used. Overall, the sensitivity analysis has shown that the Reynolds number does impact the normalized epsilon value. However, a small adjustment in flow rate will not result in drastic changes in performance of the flocculation tank. h2. Discussion 3.2 Investigation of Turbulence Boundary Condition The effect of turbulence boundary condition has been examined by varying the inlet condition. The following three plots of energy dissipation illustrate the result. \\ *Figure III.22. Turbulent intensity 10% Turbulent length scale 0.004 (BL thickness * 0.4) * *Figure III.23. Turbulent intensity 1% Turbulent length scale 0.04* \\ *Figure III.24. Turbulent Intensity 20% Turbulent length scale 0.0004 * Comparing figure III.22, III.23 and III.24, large changes of turbulence boundary conditions do not significantly affect the solution. Final boundary condition is the Turbulent intensity of 10% and turbulent length scale of 0.004, which is approximately +0+.4*boundary layer thickness. h2. Discussion 3.3 Validation of Results It is important to confirm that the results generated by FLUENT are comparable to values from literature. For flocculators without recirculating solids, the recommended Gθ is between 20,000-150,000 (Schulz, C. R. and D. A. Okun. Surface Water Treatment for Communities in Developing Countries, John Wiley & Sons. 1984). The results from FLUENT normalized by the flocculation area are shown below in Table III.2: \\ *TABLE III.2. Gθ normalized by area for different geometries*| *Case Geometry (fh-height,bs-width,N-baffles)* \\ | *Gθ_Flocculator/m^2* \\ | | bs=.1, fh=1, N=1, Clearance height=.15 \\ | 4,300 | | bs=.1, fh=.3, N=5, sym bc \\ | 8,870 | | bs=.1, fh=.2, N=5 \\ | 10,600 | Dividing the recommended Gθ value by the normalized values, estimates the area required by the flocculation tank. This corresponds to 2-15 m^2 of flocculator area based on the weighted Gθ-values calculated. The area of flocculators currently used in practice in Honduras is within this range. Thus, the calculated Gθ-values seem sensible. Another check of the accuracy of the results can be seen by comparing the dissipation rate of the flocculation tanks to values recommended by Schulz and Okun of .4-10 mW/kg. The energy dissipation plotted in this region for the fh/bs=3 case results in the plot shown below: *Figure III.25. Energy Dissipation Rate in the range of .4-10 mW/kg for fh/bs=3, Re=10,000* The regions in white are outside of this region, indicating that energy dissipation values above and below this recommended region exist in the flocculation tank. Note that after the first baffle, very little of the fluid is below the recommended energy, and the white regions are high turbulent kinetic energy dissipation areas. *IV. Conclusion* K-ε realizable turbulence model is suitable for modeling the flow in the flocculation tank. Result{+}s+ of the modeling +are+ insensitive to the turbulence boundary condition used. Result{+}s+ of the modeling +are{+}sensitive to the Reynolds number. Two design approaches can be utilize to find the optimal geometry for flocculation tank. The first approach is to analyze the uniformity of energy dissipation rate contour. The second approach is to analyze the performance parameters such as εθ, ε ^1/2{^}θ, ε{^}1/3{^}θ, and Gθ. Using +the+ first approach, it is concluded that for a flow of Re = 10,000, the optimal geometry is fh/bs = 3, bs = 0.1m, ch/bs = 1. Using the second approach, it is concluded that for a flow of Re = 10,000, the optimal geometry is fh/bs = 2, bs = 0.1m, ch/bs = 0.1m. Both approaches suggest that smaller flocculation tank height with intersecting energy dissipation regions will produce a better performing flocculation tank. \\ *Appendix A-1: Gambit Automation Script* / Journal File for GAMBIT 2.4.6, Database 2.4.4, ntx86 SP2007051421 / Identifier "Clean Script" / File opened for write Wed Oct 08 09:16:13 2008. undo begingroup /clearance height $ch = 0.1 /flocculator height $fh = 0.5 /create baffle spacing $bs1 = 0.1 $bs2 = 0.1 $bs3 = 0.1 $bs4 = 0.1 $bs5 = 0.1 $bs6 = 0.1 /create x-coordinate $w0 = 0 $b1 = $w0+$bs1 $b2 = $b1+$bs2 $b3 = $b2+$bs3 $b4 = $b3+$bs4 $b5 = $b4+$bs5 $w6 = $b5+$bs6 /create y-coordinate $y1 = $ch $y2 = $fh-$ch coordinate modify "c_sys.1" xyplane xaxis add 0 AND 0.1 reset snap lines coordinate modify "c_sys.1" xyplane yaxis add 0 AND 0.1 reset snap lines window modify coordinates "c_sys.1" xyplane grid undo endgroup undo begingroup coordinate modify "c_sys.1" xyplane xaxis add 0 AND 0.1 reset snap lines coordinate modify "c_sys.1" xyplane yaxis reset snap lines window modify coordinates "c_sys.1" xyplane grid undo endgroup undo begingroup coordinate modify "c_sys.1" xyplane xaxis add 0 AND 0.1 AND 0.2 AND 0.3 AND \ 0.4 AND 0.5 AND 0.6 reset snap lines coordinate modify "c_sys.1" xyplane yaxis reset snap lines window modify coordinates "c_sys.1" xyplane grid undo endgroup undo begingroup coordinate modify "c_sys.1" xyplane xaxis add 0 AND 0.1 AND 0.2 AND 0.3 AND \ 0.4 AND 0.5 AND 0.6 reset snap lines coordinate modify "c_sys.1" xyplane yaxis add 0 AND 0.1 AND 0.2 AND 0.3 reset \ snap lines window modify coordinates "c_sys.1" xyplane grid undo endgroup vertex create coordinates 0 0 0 vertex create coordinates 0 $y1 0 vertex create coordinates 0 $y2 0 vertex create coordinates 0 $fh 0 vertex create coordinates $b1 0 0 vertex create coordinates $b1 $y1 0 vertex create coordinates $b1 $y2 0 vertex create coordinates $b1 $fh 0 vertex create coordinates $b2 0 0 vertex create coordinates $b2 $y1 0 vertex create coordinates $b2 $y2 0 vertex create coordinates $b2 $fh 0 vertex create coordinates $b3 0 0 vertex create coordinates $b3 $y1 0 vertex create coordinates $b3 $y2 0 vertex create coordinates $b3 $fh 0 vertex create coordinates $b4 0 0 vertex create coordinates $b4 $y1 0 vertex create coordinates $b4 $y2 0 vertex create coordinates $b4 $fh 0 vertex create coordinates $b5 0 0 vertex create coordinates $b5 $y1 0 vertex create coordinates $b5 $y2 0 vertex create coordinates $b5 $fh 0 vertex create coordinates $w6 0 0 vertex create coordinates $w6 $y1 0 vertex create coordinates $w6 $y2 0 vertex create coordinates $w6 $fh 0 edge create straight "vertex.1" "vertex.2" "vertex.3" "vertex.4" edge create straight "vertex.5" "vertex.6" "vertex.7" "vertex.8" edge create straight "vertex.9" "vertex.10" "vertex.11" "vertex.12" edge create straight "vertex.13" "vertex.14" "vertex.15" "vertex.16" edge create straight "vertex.17" "vertex.18" "vertex.19" "vertex.20" edge create straight "vertex.21" "vertex.22" "vertex.23" "vertex.24" edge create straight "vertex.25" "vertex.26" "vertex.27" "vertex.28" edge create straight "vertex.4" "vertex.8" "vertex.12" "vertex.16" \ "vertex.20" "vertex.24" "vertex.28" edge create straight "vertex.3" "vertex.7" "vertex.11" "vertex.15" \ "vertex.19" "vertex.23" "vertex.27" edge create straight "vertex.2" "vertex.6" "vertex.10" "vertex.14" \ "vertex.18" "vertex.22" "vertex.26" edge create straight "vertex.1" "vertex.5" "vertex.9" "vertex.13" "vertex.17" \ "vertex.21" "vertex.25" /ERROR occurred in the next command\! face create wireframe "edge.1" "edge.2" "edge.3" "edge.4" "edge.5" "edge.6" \ "edge.7" "edge.8" "edge.9" "edge.10" "edge.11" "edge.12" "edge.13" \ "edge.14" "edge.15" "edge.16" "edge.17" "edge.18" "edge.19" "edge.20" \ "edge.21" "edge.22" "edge.23" "edge.24" "edge.25" "edge.26" "edge.27" \ "edge.28" "edge.29" "edge.30" "edge.31" "edge.32" "edge.33" "edge.34" \ "edge.35" "edge.36" "edge.37" "edge.38" "edge.39" "edge.40" "edge.41" \ "edge.42" "edge.43" "edge.44" "edge.45" real face create wireframe "edge.3" "edge.22" "edge.6" "edge.28" real face create wireframe "edge.2" "edge.5" "edge.34" "edge.28" real face create wireframe "edge.1" "edge.34" "edge.4" "edge.40" real undo begingroup coordinate modify "c_sys.1" xyplane xaxis add 0 AND 0.1 AND 0.2 AND 0.3 AND \ 0.4 AND 0.5 AND 0.6 reset snap lines coordinate modify "c_sys.1" xyplane yaxis add 0 AND 0.1 AND 0.2 AND 0.3 reset \ snap lines window modify coordinates "c_sys.1" xyplane nogrid undo endgroup face create wireframe "edge.23" "edge.9" "edge.29" "edge.6" real face create wireframe "edge.29" "edge.8" "edge.35" "edge.5" real face create wireframe "edge.35" "edge.7" "edge.41" "edge.4" real face create wireframe "edge.24" "edge.12" "edge.30" "edge.9" real face create wireframe "edge.30" "edge.11" "edge.36" "edge.8" real face create wireframe "edge.36" "edge.10" "edge.42" "edge.7" real face create wireframe "edge.25" "edge.15" "edge.31" "edge.12" real face create wireframe "edge.31" "edge.14" "edge.37" "edge.11" real face create wireframe "edge.37" "edge.13" "edge.43" "edge.10" real face create wireframe "edge.26" "edge.18" "edge.32" "edge.15" real face create wireframe "edge.32" "edge.17" "edge.38" "edge.14" real face create wireframe "edge.38" "edge.16" "edge.44" "edge.13" real face create wireframe "edge.27" "edge.21" "edge.33" "edge.18" real face create wireframe "edge.33" "edge.20" "edge.39" "edge.17" real face create wireframe "edge.39" "edge.19" "edge.45" "edge.16" real undo begingroup blayer create first 0.001 growth 1.4 total 0.00436 rows 3 transition 1 \ trows 0 uniform blayer attach "b_layer.1" face "face.2" "face.1" "face.3" "face.1" "face.1" \ "face.4" "face.2" "face.5" "face.3" "face.6" "face.3" "face.4" "face.4" \ "face.7" "face.5" "face.8" "face.6" "face.9" "face.6" "face.7" "face.7" \ "face.10" "face.8" "face.11" "face.9" "face.12" "face.9" "face.10" \ "face.10" "face.13" "face.11" "face.14" "face.12" "face.15" "face.12" \ "face.13" "face.13" "face.16" "face.14" "face.17" "face.15" "face.18" \ "face.15" "face.16" "face.16" "face.17" "face.18" "face.18" edge "edge.2" \ "edge.3" "edge.1" "edge.22" "edge.6" "edge.6" "edge.5" "edge.5" "edge.4" \ "edge.4" "edge.40" "edge.23" "edge.9" "edge.9" "edge.8" "edge.8" "edge.7" \ "edge.7" "edge.41" "edge.24" "edge.12" "edge.12" "edge.11" "edge.11" \ "edge.10" "edge.10" "edge.42" "edge.25" "edge.15" "edge.15" "edge.14" \ "edge.14" "edge.13" "edge.13" "edge.43" "edge.26" "edge.18" "edge.18" \ "edge.17" "edge.17" "edge.16" "edge.16" "edge.44" "edge.27" "edge.21" \ "edge.20" "edge.19" "edge.45" add undo endgroup undo begingroup edge picklink "edge.45" "edge.44" "edge.43" "edge.42" "edge.41" "edge.40" \ "edge.39" "edge.38" "edge.37" "edge.36" "edge.35" "edge.34" "edge.33" \ "edge.32" "edge.31" "edge.30" "edge.29" "edge.28" "edge.27" "edge.26" \ "edge.25" "edge.24" "edge.23" "edge.22" "edge.21" "edge.20" "edge.19" \ "edge.18" "edge.17" "edge.16" "edge.15" "edge.14" "edge.13" "edge.12" \ "edge.11" "edge.10" "edge.9" "edge.8" "edge.7" "edge.6" "edge.5" "edge.4" \ "edge.3" "edge.2" "edge.1" edge mesh "edge.1" "edge.2" "edge.3" "edge.4" "edge.5" "edge.6" "edge.7" \ "edge.8" "edge.9" "edge.10" "edge.11" "edge.12" "edge.13" "edge.14" \ "edge.15" "edge.16" "edge.17" "edge.18" "edge.19" "edge.20" "edge.21" \ "edge.22" "edge.23" "edge.24" "edge.25" "edge.26" "edge.27" "edge.28" \ "edge.29" "edge.30" "edge.31" "edge.32" "edge.33" "edge.34" "edge.35" \ "edge.36" "edge.37" "edge.38" "edge.39" "edge.40" "edge.41" "edge.42" \ "edge.43" "edge.44" "edge.45" successive ratio1 1 size 0.002 undo endgroup face mesh "face.1" "face.2" "face.3" "face.4" "face.5" "face.6" "face.7" \ "face.8" "face.9" "face.10" "face.11" "face.12" "face.13" "face.14" \ "face.15" "face.16" "face.17" "face.18" map size 1 / File opened for append Wed Oct 08 11:58:25 2008. physics create "w0" btype "WALL" edge "edge.1" "edge.2" "edge.3" physics create "b1" btype "WALL" edge "edge.5" "edge.4" physics create "b2" btype "WALL" edge "edge.9" "edge.8" physics create "b3" btype "WALL" edge "edge.10" "edge.11" physics create "b4" btype "WALL" edge "edge.15" "edge.14" physics create "b5" btype "WALL" edge "edge.17" "edge.16" physics create "w6" btype "WALL" edge "edge.21" "edge.20" "edge.19" physics create "top" btype "WALL" edge "edge.22" "edge.23" "edge.24" \ "edge.25" "edge.26" "edge.27" physics create "bottom" btype "WALL" edge "edge.41" "edge.42" "edge.43" \ "edge.44" physics create "Inlet" btype "VELOCITY_INLET" edge "edge.40" physics create "Outlet" btype "PRESSURE_OUTLET" edge "edge.45" *Appendix A-2: Fluent Automation Script* rc backstep_7800.cas y define/models/viscous ke-realizable yes define models viscous near-wall-treatment enhanced-wall-treatment no define/materials change-create air water yes boussinesq 998.2 no no yes constant 0.001003 no no no no no n n n n n yes define/operating-conditions operating-pressure 101325 //set bcs //initialize solve/set/equations flow yes solve/set/equations temperature no solve/set/equations ke yes solve/monitors/residual convergence-criteria 0.000001 0.000001 0.000001 0.000001 0.000001 solve/iterate file/write-case "runkereal.cas" define/models/viscous ke-realizable solve iterate 1000 wcd "runkereal.cas" *{_}exit{_}* *Appendix B-1: UDF for Analyzing Distribution of Energy Dissipation Rate* /********************************************************************** UDF to Look at the distribution of the energy dissipation rate ***********************************************************************/ #include "udf.h" DEFINE_ON_DEMAND(on_demand_calc) { Domain *d; real velocity; Thread *t; cell_t c; Node *nod; int n; double pos_x; double pos_y; double xvel; double yvel; double xprev=0; double yprev=0; double MeshArea=0; double cell_area=0; //bin analysis double checkmax = 0; // check max energy dissipation int binlength = 20; int binsize = 20; double bin[20]={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int i = 0; int j = 0; int nondimensionE = 1; // should be 100 if normalize double area[20]={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; double start = 0.001; double end = 0.01; d = Get_Domain(1); /* Get the domain using Fluent utility */ /* Loop over all cell threads in the domain */ thread_loop_c(t,d) { begin_c_loop(c,t) { double delta_x = 0; double delta_y = 0; int run_number = 0; for (n=0; n < cell_type_nnodes[(int)C_TYPE(c,t)]; n++) { nod = C_NODE(c, t, n); pos_x=NODE_X(nod); pos_y=NODE_Y(nod); if(run_number>0) { if(delta_x<fabs(pos_x-xprev)) delta_x= fabs(pos_x-xprev); if(delta_y < fabs(pos_y-yprev)) delta_y = fabs(pos_y-yprev); } run_number = run_number +1; xprev = pos_x; yprev = pos_y; } MeshArea = MeshArea+delta_x*delta_y; } end_c_loop(c,t) printf("\nMeshArea = %g\n", MeshArea); /* Loop over all cells */ begin_c_loop(c,t) { double delta_x = 0; double delta_y = 0; int run_number = 0; for (n=0; n < cell_type_nnodes[(int)C_TYPE(c,t)]; n++) { nod = C_NODE(c, t, n); pos_x=NODE_X(nod); pos_y=NODE_Y(nod); if(run_number>0) { if(delta_x<fabs(pos_x-xprev)) delta_x= fabs(pos_x-xprev); if(delta_y < fabs(pos_y-yprev)) delta_y = fabs(pos_y-yprev); } run_number = run_number +1; xprev = pos_x; yprev = pos_y; } } end_c_loop(c,t) checkmax = end - start; printf("\nmax e = %g\n\n", checkmax); for (i = 0; i<=binsize-1; i++) { bin[i] = start + checkmax/binlength*i; } //chaterizing bins by looping through bins for (i=0; i<=binsize-1; i++) { //printf("\n bin = %g\n", bin[i]); begin_c_loop(c, t) { if(bin[i]<C_D(c,t) && C_D(c,t)<bin[i+1] ) { double delta_x = 0; double delta_y = 0; int run_number = 0; for (n=0; n < cell_type_nnodes[(int)C_TYPE(c,t)]; n++) { nod = C_NODE(c, t, n); pos_x=NODE_X(nod); pos_y=NODE_Y(nod); if(run_number>0) { if(delta_x<fabs(pos_x-xprev)) delta_x= fabs(pos_x-xprev); if(delta_y < fabs(pos_y-yprev)) delta_y = fabs(pos_y-yprev); } run_number = run_number +1; xprev = pos_x; yprev = pos_y; area[i] = delta_x*delta_y+area[i]; } } } end_c_loop(c,t) area[i]=area[i]/2/MeshArea; //if (i<=19) //{printf("\n area = %g\n", area[i]);} } printf("bin\n"); for (j=0; j<=binsize-1; j++) {printf(" %g\n", bin[j]);} printf("\n area\n"); for (j=0; j<=binsize-1; j++) {printf(" %g\n", area[j]);} } } Appendix B-2: UDF for Extracting Performance Parameters #include "udf.h" DEFINE_ON_DEMAND(on_demand2_calc) { Domain *d; real velocity; Thread *t; cell_t c; Node *nod; int n; int j; int density=1000; double flow=.01; double fh=1; double bl_thick=.01; double visc=1e-6; double pos_x; double pos_y; double xvel; double yvel; double xprev=0; double yprev=0; double MeshArea=0; double cell_area=0; double magvel=0; double flowtot=0; double baffle[7] = {0, .1, .2, .3, .4, .5, .6}; double Monroe_sum1[6]={0, 0, 0, 0, 0, 0}; double Monroe_sum2[6]={0, 0, 0, 0, 0, 0}; double Monroe_sum3[6]={0, 0, 0, 0, 0, 0}; double Manroe[6] = {0, 0, 0, 0, 0, 0}; double display2 =0; double display1 =0; int counter=0; int q=0; d = Get_Domain(1); /* Get the domain using Fluent utility */ /* Loop over all cell threads in the domain */ for (q = 0; q <=5; q++) { thread_loop_c(t,d) { begin_c_loop(c,t) { double delta_x = 0; double xpos_ave = 0; double delta_y = 0; double ypos_ave =0; int run_number = 0; for (n=0; n < cell_type_nnodes[(int)C_TYPE(c,t)]; n++) { nod = C_NODE(c, t, n); pos_x=NODE_X(nod); pos_y=NODE_Y(nod); if(run_number>0) { if(delta_x<fabs(pos_x-xprev)) delta_x= fabs(pos_x-xprev); xpos_ave=pos_x*.5+xprev*.5; if(delta_y < fabs(pos_y-yprev)) delta_y = fabs(pos_y-yprev); ypos_ave=pos_y*.5+yprev*.5; } run_number = run_number +1; xprev = pos_x; yprev = pos_y; } if(xpos_ave>(baffle[q]+bl_thick) & xpos_ave<(baffle[q+1]-bl_thick) & ypos_ave>bl_thick & ypos_ave<(fh-bl_thick)) { Manroe[q]=Manroe[q]+delta_x*delta_y; Monroe_sum1[q] = Monroe_sum1[q] + pow(C_D(c,t),.333)*delta_x*delta_y; Monroe_sum2[q] = Monroe_sum2[q] + pow(C_D(c,t),0.5)*delta_x*delta_y; Monroe_sum3[q] = Monroe_sum3[q] + C_D(c,t)*delta_x*delta_y; } } end_c_loop(c,t); } } printf("Eps_onethird_pheta %g\n"); for (q=0; q<=5; q++) {printf("%g\n",Monroe_sum1[q]/flow);} printf("Eps_onehalf_pheta = %g\n"); for (q=0; q<=5; q++) {printf("%g\n",Monroe_sum2[q]/flow);} printf("Eps_one_pheta = %g\n"); for (q=0; q<=5; q++) printf("%g\n",Monroe_sum3[q]/flow); for (q=0; q<=5; q++) printf("Area = %g\n", Manroe[q]); } |
Page History
Overview
Content Tools