07 Udf Clarifier
07 Udf Clarifier
07 Udf Clarifier
Introduction
The purpose of this tutorial is to include a user-dened scalar equation (sediment concentration) in the calculation process. With the help of the user-dened functions (UDFs), a Boussinesq-like approximation is considered. The buoyancy eects due to density gradients are accounted for by a gravity source term in the vertical (axial) momentum equation. The damping eect of stratication on turbulence is introduced by means of source terms in the transport equations of turbulence kinetic energy (k) and its rate of dissipation (e). A rheology function is also considered to account for the increased viscosity of highly concentrated sludge mixtures. This tutorial demonstrates how to do the following: Dene an unsteady case with appropriate settings. Compile and link a compiled UDF. Set up qualitative and quantitative convergence monitors. Conduct alphanumeric and graphic postprocessing.
Prerequisites
This tutorial is written with the assumption that you have completed Tutorial 1 from ANSYS FLUENT 12.0 Tutorial Guide, and that you are familiar with the ANSYS FLUENT navigation pane and menu structure. Some steps in the setup and solution procedure will not be shown explicitly. Some knowledge of UDF structure, compilation and linking is desired. If you have not used UDFs, ANSYS FLUENT 12.0 UDF Manual will provide you with the necessary experience.
Problem Description
The problem considered is a circular, center-feed secondary clarier with inclined bottom and central sludge withdrawal. The central inlet includes two baes: a vertical inlet bafe that forces the inow to enter the tank at a relatively low position; and a horizontal deection plate that prevents short circuiting from the inlet to the sludge withdrawal. Axisymmetry is assumed, and the ow and settling processes are modelled in a radial section on a two-dimensional grid [1]. 1
(b) Select Up Vector from the Camera drop-down list. (c) Set X, Y, Z to -1, 0, 0.
(d) Click Apply and close the Camera Parameters dialog box. (e) Click Apply and close the Views dialog box.
Step 2: General Settings 1. Check the mesh. General Check ANSYS FLUENT will perform various checks on the mesh and will report the progress in the console. Make sure the reported minimum volume is a positive number. 2. Dene the solver settings. General (a) Enable Transient. (b) Select Axisymmetric from the 2D Space list. Step 3: Models 1. Enable the k - turbulence model. Models Viscous Edit...
2. Select k - (2 eqn) from the Model list. 3. Retain the default selection of Standard Wall Functions from the Near-Wall Treatment list. Based on Reynolds number calculation at the inlet, the ow is expected to be turbulent, so an appropriate turbulence model is required.
4. Click OK to close the Viscous Model dialog box. Step 4: Compile the UDF Compile the user-dened function. Dene User-Dened Functions Compiled...
1. Click the Add... button in the Source Files section. 2. Select the clarifier.c le and click OK in the Select File dialog box. 3. Enter sedimentation in the Library Name text entry box 4. Click Build to compile the UDF code. ANSYS FLUENT displays a Warning dialog box asking you to make sure that UDF source les are in the folder that contains the case and data les. Click OK in the Warning dialog box. All related les following the compilation will be stored in the sedimentation folder. 5. Click Load so that all the macros are available in the graphical user interface. For more details regarding the resolved system of equations, refer to Appendix 2: Compiling the UDF. Step 5: User-Dened Scalars Besides the continuity, momentum, and turbulence transport equation, a new passive scalar equation is dened to determine local particle concentration (6). Although the standard GUI does not allow the direct activation of the concentration equation, you can introduce the computation of a general transport equation, whose terms are adapted to yield the nal sediment concentration equation. 1. Enable the user dened scalar. Dene User-Dened Scalars... 4
(a) Increase the Number of User-Dened Scalars to 1. (b) Select setting ux::sedimentation from the Flux Function drop-down list. (c) Retain the selection of default from the Unsteady Function drop-down list. (d) Click OK to close the User-Dened Scalars dialog box. ANSYS FLUENT displays an Information dialog box informing that available material properties or methods have changed. Click OK in the Information dialog box. Step 6: User-Dened Memory A user-dened memory (UDM) is a customized variable dened within the UDF code. UDMs can store any expression combining ow variables and user constants. They are easily accessed and can be used for postprocessing (contours, vectors, XY plots, etc.). In this tutorial, ve UDMs have been dened to store quantities as shown in the following table: UDM 0 1 2 3 4 Description Settling Velocity UDS Diusion Coecient Gravity Source Term Turbulence Kinetic Rate Source Term Turbulence Dissipation Rate Source Term
1. Increase the Number of User-Dened Memory Locations to 5. 2. Click OK to close the User-Dened Memory dialog box. Step 7: Materials Materials Create/Edit... The Create/Edit Materials dialog box for air opens. 1. Select user-dened from the UDS Diusivity drop-down list. 2. Select turbulent di::sedimentation and click OK to close the User-Dened Functions dialog box. 3. Click Change/Create. 4. Import the water-liquid material from the ANSYS FLUENT Materials Database. 5. Enter 1000 kg/m3 for Density. 6. Select user-dened from the Viscosity drop-down list and select viscosity::sedimentation in the User-dened Functions dialog box. 7. Select user-dened from the UDS Diusivity drop-down list and select turbulent di::sedimentation in the User-Dened Functions dialog box.
8. Click Change/Create and close the Materials dialog box. Step 8: Cell Zone Conditions Cell Zone Conditions uid Edit...
1. Select water-liquid from the Material Name drop-down list. 2. Enable Source Terms. 3. Click on the Source Terms tab. (a) Click the Edit... button next to Axial Momentum to open the Axial momentum (n/m3 ) sources dialog box. i. Set the Number of Axial Momentum (n/m3 ) sources to 1. ii. Select udf X mom src::sedimentation from the drop-down list. iii. Click OK to close the Axial momentum (n/m3 ) sources dialog box. 4. Similarly, enable the UDF source term udf turb k source::sedimentation for Turbulent Kinetic Energy. 5. Also enable udf turb e source::sedimentation for Turbulent Dissipation Rate. 6. Click OK to close the Fluid dialog box.
Step 9: Boundary Conditions 1. Set boundary conditions for inlet. Boundary Conditions inlet Edit...
(a) Enter 0.019 m/s for Velocity Magnitude. (b) Select Intensity and Hydraulic Diameter from the Specication Method in the Turbulence group box. (c) Enter 5% and 5.6 m for Turbulent Intensity and Hydraulic Diameter, respectively. (d) Click the UDS tab and select Specied Value from the User Scalar 0 drop-down list. (e) Enter 3.2 for User Scalar 0.
(f) Click OK to close the Velocity Inlet dialog box. 2. Set boundary conditions for outlet top. Boundary Conditions outlet top Edit...
(a) Enter -0.04 m/s for Velocity Magnitude. (b) Select Intensity and Hydraulic Diameter from the Specication Method in the Turbulence group box. (c) Enter 5% and 0.02 m for Turbulent Intensity and Hydraulic Diameter, respectively. (d) Retain the default parameters in the UDS tab.
(e) Click OK to close the Velocity Inlet dialog box. 3. Set boundary conditions for outlet bottom. Boundary Conditions outlet bottom Edit...
(a) Select Intensity and Hydraulic Diameter from the Specication Method in the Turbulence group box. (b) Enter 5% and 3.2 m for Backow Turbulent Intensity and Backow Hydraulic Diameter, respectively. (c) Retain the default parameters in the UDS tab and click OK to close the Pressure Outlet dialog box. 4. Retain the default settings for other zones. Step 10: Solution 1. Dene the solution control parameters. Solution Methods (a) Select Green-Gauss Cell Based from the Gradient drop-down list. (b) Select PRESTO! from the Pressure drop-down list. (c) Select QUICK for all the other parameters. (d) Select Second Order Implicit from the Transient Formulation drop-down list.
(a) Ensure that Plot is enabled in the Options group box. (b) Click OK to close the Residual Monitors dialog box. 3. Dene a surface monitor. Monitors (Surface Monitors) Create...
10
(a) Enable Print to Console, Plot, and Write. (b) Select Flow Time from the X Axis drop-down list. (c) Select Time Step from Get Data Every drop-down list. (d) Select Flow Rate from the Report Type drop-down list . (e) Select User Dened Scalars... and Scalar-0 from the Field Variable drop-down lists. (f) Select outlet bottom from the Surfaces selection list. (g) Click OK to close the Surface Monitor dialog box. 4. Initialize the solution. Solution Initialization (a) Select all-zones from the Compute From drop-down list. (b) Click Initialize. 5. Write the case and data les (clarifier-t=0.cas.gz and clarifier-t=0.dat.gz). File Write Case & Data... 6. Run the calculations. Run Calculations (a) Enter 10 for Time Step Size and 7300 for Number of Time Steps. (b) Click Calculate. The hydraulic residence time (hrt = ratio of volume to owrate) of the sedimentation tank is approximately 7300 seconds. It is assumed that the steady-state solution is achieved for 10 times the hrt (conservative estimation). The size of the time step size is a compromise between numerical stability and computational time. A time step of 10 seconds is chosen which yields a total number of 7300 time steps to reach a steady-state solution. The outcome of the simulation is the steady-state clarier behavior and intermediate time-dependent information will be neglected. Depending on computer resources, the simulation may take several hours to complete. 7. Write the case and data les (clarifier-steady.cas.gz and clarifier-steady.cas.gz). File Write Case & Data... Step 11: Postprocessing 1. Display contours of particle concentration, User Scalar 0 (Figure 2). Graphics and Animations Contours Set Up...
2. Display velocity vectors colored by velocity magnitude (Figure 3). Graphics and Animations Vectors Set Up...
11
12
(a) Increase Scale to 5 to improve vector viewing. (b) Click Display and close the Vectors dialog box. 3. Display contours of settling velocity, User Memory 0 (Figure 4).
(a) Select Mesh... and Y-Coordinate from the Surface of Constant drop-down lists. (b) Enter 4 for Iso-Values and y=4 for New Surface Name. 13
(c) Click Create and close the Iso-Surface dialog box. 5. Create two custom eld functions. Dene Custom-Field Functions...
(a) Click the - button on the keypad in the dialog box. (b) Select Mesh... and X-Coordinate from the Field Functions drop-down lists. (c) Click the Select button and enter x-in in the New Function Name text entry box. (d) Click Dene. (e) Similarly, create the second custom eld function, mgl-1.
(f) Close the Custom Field Function Calculator dialog box. 6. Create an XY plot to display concentration proles at a radial position (Figure 5). Plots XY Plot Set Up...
14
7. Modify the number format. Display Colormap... Changing the number format (type and precision) eases results interpretation for a non-technical audience.
15
(a) Select general from the Type drop-down list. (b) Enter 4 for Precision. (c) Click Apply and close the Colormap dialog box. 8. Display concentration contours in mg/l units (custom eld function and mgl-1).
16
Appendix 1: Parameters
The loading conditions for this reference case can be found on the publication in [1]. For simplicity, some key parameters are summarized in the following table: Parameter Ui n Ci n R p w c US0 RH RP CMIN USMAX Description Inow Velocity Inow Particle Concentration Recycle Ratio Dry Particle Density Clear Water Density Schmidt Number Reference Settling Velocity Floc Settling Parameter Colloidal Settling Parameter Nonsettleable Concentration Maximum Settling Velocity Value 0.019 m/s 3.2 kg/m3 0.86 1450 kg/m3 1000 kg/m3 0.7 0.005 m/s 0.7 m3 /kg 5 m3 /kg 0.01 kg/m3 0.002 m/s
gC (p w ) w (2)
where,
gC (p w ) : w
2t
Vy y2 (3) 17
k Vx k (Vy k ) + + = t x y x
t k
k 1 t + y + x y y k
k + G k + Gb y (4)
where,
p w t C p w g c x
Vx (Vy ) + + = t x y x
1 t + y + x y y
C (Vx + Vs )C (Vy C ) t C 1 t C + + = + y t x y x c x y y c y
(6)
1 y y
t C y : c y
References
[1]Computing Shear Flow and Sludge Blanket in Secondary Clariers Djamel Lakehal, Peter Krebs, Johan Krijgsman, Wolfgang Rodi
18