This preview shows page 1. Sign up to view the full content.
Unformatted text preview: BE104 Lab 1 The purpose of this lab is to model flow through a pipe. This is a problem that should be familiar to most of you; in fact, it is readily solvable analytically. During this lab you should focus on learning the following lessons: • Geometry – how to create shapes in COMSOL. • Symmetry – how to take advantage of symmetries to simplify problems. • Incompressible Navier
Stokes – the standard physics for modeling simple flow through a system in COMSOL. • Boundary conditions – how to assign BCs to surfaces (like inlets, outlets, and walls). • Physical properties – how to assign constants to volumes (in this case, the fluid). Modeling incompressible steady
state flow through a pipe using COMSOL: (1) Open COMSOL. The Model Navigator window will open. (2) Select Space Dimension > 3D. (3) In the Model Navigator window, select New > Application Modes COMSOL Multiphysics > Fluid Dynamics > Incompressible Navier
Stokes > Steady
state analysis and press OK. (4) You’ll see a 3D space in which you can begin drawing. Press the Cylinder Button , and use the following values to create a 1 m long cylinder with a 10 cm radius pointing in the x
direction. When you’re finished, click OK. (5) If you’d like to resize your pipe to fit the screen, press the Zoom Extents button. The other zoom buttons can be found next to this one. (6) Go to Options > Constants and enter the following, then click OK. Rho and eta are the density and viscosity of water, respectively, and vin will be your inlet flow velocity. All values are in SI units. (7) Go to Physics > Subdomain Settings and enter the following, then click OK. COMSOL calls volumes “subdomains”, and this volume is filled with fluid, so we’ve got to assign a density and viscosity. (8) Go to Physics > Boundary Settings. We have three different boundary conditions we need to include at the 6 surfaces generated by COMSOL: • No Slip (at the walls of the pipe) • Inflow/Outflow Velocity (at the inlet, u0 = vin or –vin, depending on which direction the flow should go to be heading into the pipe – this will depend on the coordinate system and which side you choose to be your inlet) • Pressure, no viscous forces (at the outlet, p0 = 0) I suggest having the inlet at the surface centered at the origin (x = 0, y = 0, z = 0). If you’re not sure which surface is which, click on the number and it will be highlighted in the picture. Once you’ve finished, press OK. Press the Initialize Mesh button, then the Refine Mesh button once. It is possible in COMSOL to refine the mesh more (9) sophisticatedly than this, but let’s start with a simple, brute
force method. (10) Press the Solve button. This will use the default solver. (11) Go to Post
Processing > Plot Parameters. Click on the Slice tab and enter the values shown below, then click OK. You’re telling COMSOL to plot one slice in the z
direction – the velocity field plot should cut the cylinder in two parts along the center axis. (12) You may want to press the button to get a good view of your solution. Once you can see the velocity profile, save a screenshot of your solution by choosing File > Export > Image and the following values. Once entered, click Export, and choose JPG. (13) We have thus far approached the problem rather inelegantly, and we’ve paid for it in computing time for this relatively quick flow (if you don’t believe me, calculate the Reynold’s number). Let’s see if we can come up with a better way to state the problem. To do this, keep in mind that our cylinder is symmetric around its center axis. The red dashed line is the center axis of our pipe. I’ve made two imaginary “cuts” in the pipe (the blue plane and the green plane). If I were to look at the flow profile in those planes alone for our system, they would be the same – flow in the pipe ought to be symmetric (as we’ve described it). In fact, if I were to take the flow profile in either plane and rotate it around the axis of symmetry, it would be the always be the same. This is true for shapes other than cylinders as well – whenever there’s symmetry, there’s simplification. This is a simple but powerful observation – it means I don’t have to solve for the entire system. If I solve for one of those imaginary (2D) cuts, I have effectively solved the entire (3D) system! Luckily, COMSOL makes it quite easy to do this. Go to File > New. (14) Select Space Dimension > Axial Symmetry – 2D. (15) In the Model Navigator window, select New > Application Modes > Fluid Dynamics > Incompressible Navier
Stokes > Steady
state analysis and press OK. (16) The red dashed line is your axis of symmetry. Since your pipe is symmetric along the center axis, that means that the red line corresponds to the center axis of the pipe. Click the Rectangle/Square the screen. (17) Double
click on the rectangle you’ve created and enter the following, then press OK. This will resize the rectangle to exactly match one of those imaginary “cuts” discussed previously. button and draw a rectangle anywhere on (18) Go to Options > Constants and click the Import Variables from File button. Open the Lab01.txt file you saved previously, then click OK. (19) Go to Physics > Subdomain Settings and enter rho and eta as before. (20) Go to Physics > Boundary Settings. We now have four different boundary conditions we need to set on the 4 sides of our rectangle: • Axial Symmetry (at the side of the rectangle that lines up with the axis of symmetry – the red dotted line) (21) Press the Initialize Mesh button, then the Refine Mesh button twice. For far less computational power (and time) we’re getting a better solution using symmetry. (22) Press the Solve button. Note that there is an entry region where the flow has not yet developed the parabolic flow profile you would expect. • No Slip (at the wall of the pipe – since the red dotted line is the center of the pipe, the wall is the part of the rectangle parallel to but not on top of the red dotted line) • Inlet Velocity (at the inlet, v0 = vin) • Pressure, no viscous forces (at the outlet, p0 = 0) Again, I suggest having the inlet at the surface centered at the origin (r = 0, z = 0). If you’re not sure which surface is which, click on the number and it will be highlighted in the picture. Once you’ve finished, press OK. (23) Save a screenshot of your solution by choosing File > Export > Image and the same values as before. Once entered, click Export, choose JPG. Compare this to your 3D solution. ...
View Full
Document
 Spring '10
 Various

Click to edit the document details