FEMLAB Exercise 1 for ChE366 Problem statement Consider a spherical particle of radius r s moving with constant velocity U in an infinitely long cylinder of radius R that contains a Newtonian fluid. Let η and ρ denote the viscosity and density of the fluid respectively. The center of the sphere always lies on the axis of the cylinder. Compute the velocity and pressure fields by using FEMLAB for the following parameters: r s = 0.2 mm, U = 1 mm/s, and η = 10 cp and ρ = 1 g/cm 3 for R values (in mm) of 2, 1, 0.6, 0.4, 0.3 and 0.25. Compare the results obtained for different values of κ r s /R. Show that for κ >>1, friction coefficient ζ F/(6πηUr s ), where F denotes the drag force, approaches 1. Construct a plot of ζ vs. κ. Key Steps Step 1: Defining the geometry (Simulating an infinitely long cylinder ) In practice, we need to consider a finite cylinder with length L >> r s such that the end effects do not influence our final answer. This requires a trial and error procedure as given below. 1. Choose a length L >>r s, say L = 10 r s. 2. Solve the problem and check whether the solution (e.g. velocity and pressure) changes appreciably at the ends of the cylinder. 3. If the solution changes appreciably at the cylinder ends, increase L by 10 percent and go back to step 2. If not, you have succeeded in simulating an infinite cylinder. 1 Prepared by Kartik Arora based on guidance from Prof. R. Sureshkumar Privileged material. The use may be subject to software licensing agreements. Do not circulate or modify without written permission from Sureshkumar. 1
You would require boundary conditions at the cylinder ends. These boundary conditions can be assigned in the form of pressure, i.e., maintaining the same pressure at the two ends of the cylinder: see the attached handout and figure 1 in this document. Step 2: Changing the frame of reference (Simulating a translating sphere) It is not possible to solve a problem with moving boundaries in FEMLAB. Therefore, it makes sense to solve the problem in a new of frame of reference in which the sphere is stationary and the cylindrical wall moves with a constant velocity U. Step 3: Exploiting symmetries to reduce problem size Cylindrical symmetry can be used to reduce the problem geometry to an axisymmetric one, see figure 4 of the attached handout and figure below. p = p a Line of symmetry r s No slip z r L u z = U u r = 0 p = p a Figure 1: Schematic of the flow geometry along with the boundary conditions R Step 4: Non-dimensionalization of the Navier-Stokes equations The fluid motion inside the cylinder can be described by Navier-Stokes equations which in its dimensional form can be written as follows: 2
u ρ + u u = p + η t 2 r r u + ρg + F. (1) In the above equation, u is the velocity vector, p is the hydrodynamic pressure, g r is the acceleration due to gravity, and F r is the external force applied per unit volume on the fluid. For this problem, we neglect gravity and assume no external force, i.e. F r = 0. The equation is solved along with the incompressibility constraint (i.e., conservation of mass or the continuity equation) on the velocity vector, which is, u = 0. (2) Equations (1) and (2) can be non-dimensionalized by using quantities, r s, U, r s and U the scales for length, velocity, time and pressure respectively. Let u, t and p denote the dimensionless velocity vector, time and pressure respectively. Then equation (1) can be written in the dimensionless form as (verify this): ρu r s 2 u ηu ηu + u u = p + t r r 2 s 2 s 2 u. Note that in the above equation, the gradient and the Laplacian operators are in dimensionless forms. Dividing equation (3) by ηu 2, we obtain r s ρur s η u + u u = p + 2 u. t The quantity ρur s appearing as the coefficient of the left hand side term, is referred to as the η Reynolds number and is denoted by Re, which simplifies equation (4) as, u 2 Re + u u = p + u. t (5) Recall that Re represents the ratio of inertial to viscous forces in the flow. Equation (5) looks similar to equation (1), except that it is in dimensionless form, the coefficient of the Laplacian of u is 1 instead of η, and the coefficient of the convection term in the l.h.s. is Re instead of ρ. Note that we have ignored the gravitational and the external force terms in equation (1). ηu (3) (4) r s as 3
FEMLAB only allows equations to be written in dimensional form. However, by cleverly renaming the variables, a non-dimensional equation (e.g. Eq. 5) can be represented in FEMLAB. Specifically, this can be achieved in our example if we assign Re to ρ, keep η as 1, and define the geometry in non-dimensional coordinates. Note that in non-dimensional coordinates, the radius of the sphere will always be 1, length of the cylinder will be L/r s and radius of the cylinder will be R/r s. The dimensionless geometry and the dimensionless boundary conditions are shown in figure 2 below. Note that the non-dimensional form allows us to determine the flow regime, e.g. Re << 1 implies creeping flow. Step 5: Calculating Drag The drag on the sphere can be calculated by integrating the z-component of the force along the surface of the sphere. You can compute this quantity by using the boundary integration tool in FEMLAB (see attached handout). p = 0 Line of symmetry 1 No slip z r L/r s u z = 1 u r = 0 p = 0 Figure 2: Schematic of the dimensionless flow geometry with the boundary conditions (dimensionless coordinates). R/r s 4
Notice that when R/r s >> 1, the particle will not feel the presence of the cylinder wall. In this case, the drag on the sphere can be compared with the Stokes law valid in the limit Re 0. According to Stokes law, the force on a spherical particle moving with a velocity U in an infinite medium, is given by, F = 6πr s Uη. (6) This force can be expressed in its dimensionless form as, F = 6π. (7) You can compare the force evaluated using FEMLAB to the equation (7). You can also study the influence of R/r s and Re on the force (drag). Theoretically, when Re << 1 and R/r s >> 1, the drag on the particle has to be equal to 6π. 5
Attachment: Handout on the use of FEMLAB FEMLAB utilizes the Finite Element Method in the MATLAB interface to solve physical and mathematical problems. It has a user-friendly interface that allows to prescribe process geometry and built-in models for processes from the library of chemical/mechanical/electrical processes. You can also create and customize applications in FEMLAB. The steps involved in solving a problem in FEMLAB. 1. Choose the physics: The moment you open the FEMLAB software, it will ask you to choose a process from its built-in library. Take some time to browse through the library; see what all processes you can identify. You also need to choose the dimensionality of the problem, i.e., whether it is 1-dimensional, 2-dimensional, 3-dimensional, 1-d axisymmetric, or 2-d axisymmetric. You can always go back and change the physics of the problem, but changing the dimensionality will not be easy. In some cases you might have to start over the whole problem. For our example, choose 2-d axisymmetric geometry + Incompressible Navier-Stokes equation as shown in figure 1. Figure 1. Choosing the physics (process). Note that in the Space dimension field, it shows Axial symmetry (2D). 6
2. Specify the details of the process geometry: Once you have chosen the physics, depending on the dimensionality, FEMLAB will bring up a 1-d, 2-d, or 3-d interface as shown in figure 2. At this point you are required to define the geometry, i.e., the domain of the process. There are various preset geometries in FEMLAB that you can use to draw the domain, or you can draw an arbitrary shape by using the 2 nd and 3 rd degree brazier curve object in menu Draw Draw Objects. Also, the toolbar on the left has all the short-cut keys to these objects. Figure 2. The axisymmetric interface. Note that the vertical and horizontal axes represent the z and the r directions respectively. For our example, draw a rectangle with its vertices at (0, -20), (0, 20), (20, 20), (20, -20), and a circle with its center at (0,0) and radius of 1 2. After drawing these objects, select them by keeping the shift key pressed and clicking the objects individually. Once the objects are selected, press the difference button on the left panel/toolbar (one that has two intersecting circles with the non-intersected region of one of the circles colored) as shown in figure 3. This should result in the desired axisymmetric geometry for our problem, as shown in figure 4. 2 You can view and change the properties of an object by double clicking it. 7
Figure 3. Taking the difference of two objects to construct the geometry. Figure 4. Desired Geometry: Rotating along the vertical axis gives the 3-D geometry for sphere in a cylindrical vessel. 3. Assign the parameters of the problem: The Navier-Stokes equation, in its dimensional form, contains two parameters, η and ρ, denoting the viscosity and the density of the fluid respectively. However, we will only work with non-dimensional quantities, as explained in the 8
problem definition. In this case, η will always be 1 and ρ will represent the Reynolds number, as FEMLAB doesn t allow equations in their non-dimensional forms. Refer to the attached document (pgs 2-3) for details. The parameter, µ and ρ, can be assigned by opening menu physics Subdomain Setting As a test problem run the following case, enter 0 in the field for ρ, and 1 in the field for η, as shown in figure 5. Figure 5. Assigning the parameters. 4. Specify the boundary conditions: Once you are sure that you have assigned the right values to all the parameters, it is time to specify the boundary conditions. It is important to note that N-S equation is a second order PDE; hence it requires either the flux (derivative) specification, or the variable(s) specification all around the boundary. The boundary conditions can be specified by opening menu physics Boundary Settings 9
For our geometry, FEMLAB divides the boundary into 7 different segments, which consist of 5 lines (black) and two quarter-circles (red), as shown in figure 6. You can change the conditions on each of the boundary segments by highlighting its number on the left side, i.e., Boundary selection field. For segments 1 and 3, in the boundary condition field, choose slip/symmetry. For segments 2 and 4, in the boundary condition field, choose normal flow/pressure and let p 0 = 0. For segment 5, in the boundary condition field, choose inflow/outflow velocity and set z-velocity to 1 and r-velocity to 0. For segments 6 and 7, choose the no slip field as shown in figure 6. Figure 6. Boundary segments: There are seven different segments; condition on each one of them can be specified individually. 5. Construct a mesh: Finite element method divides the domain into a finite number of elements, which can in principle have arbitrary shapes. However, in most of the problems, it is convenient to have them as polygons, i.e., triangles, rectangles, pentagons etc. FEMLAB employs only triangular elements. You can draw the mesh (a mesh consists of several elements) by choosing the following option menu Mesh Initialize mesh. 10
After initializing the mesh, the FEMLAB will draw all the elements as shown in figure 7. You can further refine the mesh in the whole domain or you can focus on a desired region, and refine that part only. Do not refine the mesh unnecessarily because your system can run out of memory. Besides, it takes more time for finer meshes. However, you will need to ensure that your results are mesh-independent or mesh-converged. Figure 7. Mesh generation. If N is the number of nodes and there are 3 dependent variables (u, v, and p), then FEMLAB calculates the number of degree of freedom as 3N. 6. Solving the problem: First go to menu Solver Parameter, and make sure that in the General tab, your solver is set as Stationary nonlinear. Do not change any other fields at this point. Congratulations! You have completed the problem definition; go ahead and choose menu solve Solve Problem. For the initialized mesh, this should take 2-5 seconds to run on CELL computers, unless you are running some other programs in background. 11
7. Understanding and presenting the solution: By default, FEMLAB will display the surface plot (color-coded) of the absolute velocity. You can plot streamlines and vector plots of the flow, or you can plot contour plots of individual velocities (u r or u z ), by going to menu Post processing Plot Parameters as shown in figure 8. Figure 8. Displaying the solution. The figure illustrates the surface plot (color-coded) of the absolute velocity. You can also plot the solution (variables or derived quantities) along one of domain s boundaries by going to menu Post processing Domain Plot Parameters: Tab = Line/Extrusion, and selecting the desired boundary and variable. Or you can draw a line plot by clicking on the lineplot short cut in the left toolbar, as shown in figure 9. 12
Short-cut for line plots Figure 9. Constructing the line plot of the absolute velocity. 8. Calculating the drag on the sphere: The total drag, or in other words the force exerted by the fluid, on the sphere will be in the positive z-direction. The net force in the z-direction can be evaluated by performing a boundary integral of Total force per area, z-component, on the sphere s perimeter, i.e., segments 6 and 7. You can do this by going to menu Post Processing Boundary Integration. The two segments should be selected simultaneously in order to calculate the integral. 13
Remember to check this box Result for the surface integral Figure 10. Calculating the drag on the sphere. For our problem, remember to check the box below the expression fields in the Boundary Integration window, that reads Compute surface integral (for axisymmetric modes), as shown in figure 10. The results appear only after clicking the OK button, which shows up in the log generated below the figure. Compare the drag with equation (7) of the handout FEMLAB Exercise for ChE366. 14