comsol part a cbe 565 polymer rheologyfmorriso/cm4650/2012comsolpartacbe565.pdfpart 1: start comsol...

15
1Oct12 F. A. Morrison COMSOL Part A CBE 565 Polymer Rheology Due: Friday 12 October 2012, 5pm in my mailbox Equad A220 This is an individual assignment; you may work together to learn Comsol; please prepare your reports individually. Problem statement: Using both Comsol and an analytical calculation, calculate the steady state velocity field and stress field for pressuredriven flow of water (an incompressible, Newtonian fluid) through parallel plates. The plates are long and wide and separated by a narrow gap. The flow is driven by a constant axial pressure gradient. Address the following issues in your solution: 1. Quantitatively compare your numerical solution for the velocity profile across the gap to the analytical calculation of the same quantity. Note that you must use the same, constant pressure gradient in both solutions to have a valid comparison. 2. Discuss which region of the numerical calculation domain suggested below, if any, actually reflects the flow in the problem statement. Modify the suggested numerical calculation to address any problems you identify. 3. Compare the total vector force on the walls with an appropriate analytical calculation of the same quantity. 4. For this flow determine the range of Reynolds number you are able to explore with Comsol. What limits the Re obtainable? 5. Submit your results in a memo report format (memo header; intro, methods, results, discussion, conclusions). This may be as short as you can make it while addressing all the objectives above. Numerical Calculation Template These instructions detail a way to calculate the velocity field in the flow between two long, wide plates. Because the flow field only varies in one direction, we use a 2D calculation, assuming the result would be the same in any 2D cross section along the flow direction (no edge effects). In the stepbystep discussion below, we also demonstrate how to make different types of plots from the results. These plots and the data in the plots are useful to address all our objectives.

Upload: others

Post on 15-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

COMSOL Part A CBE 565 Polymer Rheology  Due:  Friday 12 October 2012, 5pm in my mailbox Equad A220  This is an individual assignment; you may work together to learn Comsol; please prepare your reports individually.  

Problem statement:  Using both Comsol and an analytical calculation, calculate 

the steady state velocity field and stress field for pressure‐driven flow of water (an incompressible, Newtonian fluid) through parallel plates.  The plates are long and wide and separated by a narrow gap.  The flow is driven by a constant axial pressure gradient.  Address the following issues in your solution:  

1. Quantitatively compare your numerical solution for the velocity profile across the gap to the analytical calculation of the same quantity.   Note that you must use the same, constant pressure gradient in both solutions to have a valid comparison. 

2. Discuss which region of the numerical calculation domain suggested below, if any, actually reflects the flow in the problem statement.  Modify the suggested numerical calculation to address any problems you identify.   

3. Compare the total vector force on the walls with an appropriate analytical calculation of the same quantity. 

4. For this flow determine the range of Reynolds number you are able to explore with Comsol.  What limits the Re obtainable? 

5. Submit your results in a memo report format (memo header; intro, methods, results, discussion, conclusions).  This may be as short as you can make it while addressing all the objectives above.  

 

Numerical Calculation Template 

These instructions detail a way to calculate the velocity field in the flow between two long, wide plates.  Because the flow field only varies in one direction, we use a 2D calculation, assuming the result would be the same in any 2D cross section along the flow direction (no edge effects).    In the step‐by‐step discussion below, we also demonstrate how to make different types of plots from the results.  These plots and the data in the plots are useful to address all our objectives.     

Page 2: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

The basic numerical strategy is this:  

1. Choose the physics (choose 2D flow, choose water, etc.) 2. Draw the flow domain (2D representation of a slit of appropriate width). 3. Specify boundary conditions. 4. Design a finite‐element mesh on which to do the numerical calculations (see 

en.wikipedia.org/wiki/Finite_element_method for more on the finite element method).  Good mesh design ensures an accurate calculation.  The mesh should be more refined (have smaller divisions) in areas where properties change most rapidly.  At a minimum, there should be 8‐10 elements across the flow domain. 

5. Run the simulation (this produces a “Study”). 6. Use and evaluate the simulation results by calculating and plotting the quantities of 

interest. 7. Perform calculations that allow you to address your objectives in a report. 

 

 Step‐by‐Step Instructions Part 1:  Start Comsol and Select Problem Type 

We are doing a steady laminar 2D flow through a slit.  We begin by making these choices in 

Comsol. 

Start‐up 

1. Start COMSOL Multiphysics 4.3 (Classkit License).  

The program opens up in the Model Wizard 

2. Select 2D from the Select Space Dimension list. 

3. Click the blue arrow   for next page. 4. In the Add Physics tab select (double click or expand by clicking the triangle sign in front of your 

choice) Fluid Flow, Single‐Phase Flow.  Right click on Laminar Flow and choose Add Selected.  

Click the blue arrow   for next page. 5. In the Select Study Type tab, select Stationary at the Present Studies Module. 

6. Click the checkered flag  to finish. 7. In the Model Builder window, click on Laminar Flow.  In the Laminar Flow tab, under Physical 

Model, Compressibility, choose Incompressible Flow.  Under Equation verify the equations in use are appropriate to the problem. 

 

 

Page 3: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

Part 2:  Set up the Flow Geometry and Physics Settings 

Our geometry is the gap between two long plates.  We draw this as a vertical rectangle of the 

chosen gap width (0.02 m) with a long, arbitrary length.  We choose the length to be 0.100 m. 

Geometry Setting 

8. In the Model Builder window, click on Model 1, Geometry 1.   9. To bring up the Rectangle/square dialog select the Draw Rectangle icon from the menu bar and 

drag any sized rectangle in the Graphics Window.   

  

 10. To enter the exact dimensions for your desired rectangle, go to the Model Builder window and 

click the triangle sign at Geometry 1 to expand the menu, and select Rectangle 1 (r1). Enter the dimensions and positions shown below.  

  

11. To enter these new dimensions, click on the Build Selected icon .   To zoom the Graphics 

view to full extent, click on the Zoom Extents icon   in the Graphics window.  

Page 4: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

 Physics Settings 

Our fluid is water.  We choose water from the Material Browser. 

12. From the Model Builder menu Right‐click on Materials and select Open Material Browser. 13. Click the triangle sign at the Liquids and Gases, then Liquids, then select Water.  14. Right click on Water and select Add Material to Model. 

   

Part 3:  Boundary Conditions and Mesh Generation 

The boundary conditions we use in these instructions are no‐slip at long walls, uniform flow 

into the slit at a specified average velocity, and gauge pressure zero at exit. 

Boundary conditions 

‐Inlet 

15. Right click Laminar Flow (spf) from the Model Builder and select Inlet. 16. In the Graphics Window, select the bottom boundary by clicking on it, and under Boundary 

Selection, choose .  

Page 5: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

  

17. In the Inlet tab under Boundary Condition select Velocity, and then under Velocity, select the Velocity Field radio button.  Enter the number 0 for Vx and 0.0175 for Vy (units are set to m/s).  

  

‐Outlet 

18. Right click Laminar Flow (spf) from the Model Builder and select Outlet. 

19. Select the top boundary and click on .  

  

20. Set Boundary Condition to Pressure, no viscous stress and set the pressure to 0 (Default).  

Page 6: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

  

‐Wall 

21. Under Laminar Flow (spf), click on Wall 1. In the wall window the two as yet not specified boundary segments, 1 and 4, will already be selected (both side walls). In Boundary Condition select No Slip (Default).  

  

 

Mesh Generation 

We now create the mesh for our calculation.  We use the Free Triangular mesh generator of the 

software. 

22. Right click on Mesh 1 from The Model Builder menu and select Free Triangular.  23. In Model builder select Size under Mesh 1 and in the Size window under Predefined, select 

Extra Fine.  

  

Page 7: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

24. In the Model Builder, right click on Free Triangular 1, and select Build Selected to build the mesh.  

  

 

 

Part 3:  Solve 

We are now ready to calculate the velocity and pressure fields for the problem. 

25. In Model Builder, right click on Study 1 and select Compute. After a few seconds the color graph of the velocity field will appear. 

  

Part 4:  Generate Plots and Visualize the Solution 

We have calculated the two‐dimensional velocity and pressure fields for the flow; now we need 

to interpret and display the results.  We create an arrow graph (the vectors representing the 

velocity field), and we create a plot of the centerline pressure as a function of distance down 

the length of the slit.  We also create a series of plots of the cross‐sectional velocity distribution 

at various positions down the axis of the flow.  These plots will allow us to assess which parts of 

the flow domain actually represent the flow we intend. 

Page 8: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

Arrow Surface 

26. Right click on Results and select 2D Plot Group.   27. Right click on 2D Plot Group 3 and select Arrow Surface.  

 

  

28. Under Arrow Positioning select 15 points in x grid points and 15 points in y grid points. 

   

29. In the Arrow Surface tab, click on Plot to draw the arrow plot . Note that the uniform flow at the inlet gradually transforms to a parabolic profile at the exit. 

 Velocity Profile Generation 

We plot data cross‐sections by creating “cut lines.” We want to choose a set of cut lines across the flow 

at different positions downstream. First, we disable the current plot. 

30. In the Model Builder, right click on Arrow Surface 1 and select Disable to clear the plot view. 31. Under Results right click on Data Sets and select Cut Line 2D. 

 

Page 9: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

  

32. In Cut Line 2D select x1=0, x2=0.02, y1=0 and y2=0.  This is a line across the inlet of the flow. This is the first cross section. Now we create additional cross sections.  

  

 33. In Cut Line 2D, check Additional parallel lines and under Distances click on the icon to the right 

to bring up the range menu. Enter Start=0, Stop=0.1 and Step=0.005 and click on Replace.  

Page 10: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

   

34. Click on Plot icon to see the 21 parallel lines along which velocity will be reported. 35. To select which data to plot in Model Builder, right click on Results and select 1D Plot Group.  36. Right click on 1D Plot Group 4 and select Line Graph.  37. In Line Graph 1 go to the dialog window under Data and under Data set select Cut Line 2D 1 

from the drop down menu.  

   

38. In Y‐Axis Data. Click on the Replace Expression icon on the right   and select Laminar Flow, Velocity field, Velocity field y component (v). 

 

Page 11: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

   

39. In X‐Axis Data select Arc length (Default). 

40. Then select Plot . 41. To Rename the Line Graph 1, with the right button of your mouse select Rename and then give 

the new name: Velocity Field. 

  

42. To Rename the Cut Line 2D 1, with the right button of your mouse select Rename  and then give the new name: Cut Line 2D Velocity Field. 

 

  

 Pressure Profile Generation 

Now we want to create a plot of the variation for pressure down the centerline of the flow (from point 

0.01, 0 to point 0.01, 0.1). 

43. In Results, 1D Plot Group 4, Velocity Field right click and select Disable. 44. Right click on Data Sets and select Cut Line 2D. 

 

Page 12: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

  

45. In the Cut Line 2D window under Line Data enter x1=0.01, x2=0.01, y1=0 and y2=0.1.  

  

46. Click on Plot to see the line along which pressure will be reported. 47. Right click on 1D Plot Group 4 and select Line Graph.  48.  In the Line graph window under Data, Data set, select Cut Line 2D 2 from the drop down menu. 

 

   

49. In Y‐Axis Data. Click on Replace Expression icon and select Laminar Flow, Pressure (p).  

Page 13: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

   

50. In Data, X‐Axis Data select Arc length (Default). 

51. Select Plot .  This is the pressure profile down the center of the tube. 52. To Rename the Line Graph 2 with the right button of your mouse select Rename and then give 

the new name: Pressure profile.  

   

53. To Rename the Cut Line 2D 2 with the right button of your mouse select Rename  and then give the new name: Cut Line 2D Pressure profile. 

 

   

 

Page 14: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

Part 5:  Calculate Properties of Interest 

To calculate the force on a surface or volume rate of flow we perform integrations.  Note that since we are in 2D flow, what would have been an area integration becomes a line integration.  Note that “total stress” is our Π , “viscous stress” is our  , and pressure is our pressure.  The sign convention for stress in 

Comsol matches the mechanics convention:  Π . 

  

54. In Model Builder go to Results, Derived Values.  Right click on Derived Values and chose Integration, Line Integration 

55. To select the quantity to be integrated you may manually select boundaries from the Graphics 

window and add them by clicking on .  Alternatively you may create the data to be used with a cut line. 

56. If integrating along a boundary, select the Expression to integrate by clicking on the Replace 

Expression icon    and choosing from the drop down menu. 57. To make the calculation, click on Evaluate in the Line Integration tab.  The numerical result 

appears below the Graphics window under the Results tab.  

Part 6:  To Export Data 

To make subsequent data calculations in Excel or in another program, we export the data to a 

text file that can be imported to the program of interest. First we do pressure; then we do the 

set of velocity sections. 

58. Choose 1D Plot Group 4 and the Export Data icon    will appear in the main toolbar at the 

very top of the screen. Note that Pressure profile is in black text and Velocity Field is greyed out. 

59. Select the Export Data icon and choose appropriate settings (Filename, spreadsheet) and click 

save. 

 

60. Click on Export within the Plot tab to export the chosen data. A message will appear in the 

Messages tab below the graph confirming the export. 

Page 15: COMSOL Part A CBE 565 Polymer Rheologyfmorriso/cm4650/2012ComsolPartACBE565.pdfPart 1: Start Comsol and Select Problem Type We are doing a steady laminar 2D flow through a slit. We

1‐Oct‐12 F. A. Morrison 

 

You must export each 1D Plot Group separately (Velocity, Pressure). Under 1D Plot Group 4 right 

click on Pressure Field and choose Disable. Now right click on Velocity Field and click on Enable. 

Export as before. 

Part 7:  Import Data in Excel (optional) 

61. In Excel go to Data, From Text. Select your .txt file and Import.  (Your data are delimited with 

spaces). 

Part 8:  Write the Report 

62. Be sure to address all objectives in your report.