# MENG 421 Assignment 5

## Temperature and flux in a 2D plate

```

```

MENG 421 -- Class assignments -- 1 2 3 4 5 6 8 9 10 11 12

Lecture notes -- Milestones, 1, 2, Tables, NGEN, Plane42, Plane55, Plane82,
Element 1, Elements 1-7, Element 1-49, Heat2d64.a,

In Assignment 3 you created a bracket with the Ansys element Shell93, an 8-node structural shell. You used the 2D, 4-node Ansys element Plane42 for Assignment 4 to create an axisymmetric cylinder and then apply a mechanical load. For today's lesson, you will use a similar element, Ansys Plane55 with a thermal load. This element is a 2D, 4-node thermal solid. However, we will only use three nodes per element. You can use Plane55 in axisymmetric mode to create rods and pipes like you did with Plane42 for Assignment 4. Today you will program Ansys to find the temperature distribution in the plate subject to a temperature gradient on one edge of a 7x7 plate. The other three edges are insulated. If we let Ansys create the finite elements automatically, we get quadrilaterals like this Instead will define the elements with the NGEN and EGEN commands to learn more about them.

The left figure above shows a meshed plate with 64 nodes and 98 triangular elements. For the Ansys code that you will start with today, the left and bottom edges are thermally insulated while there is a temperature gradient on the top and right edges. The temperature is 50 F at the upper-left and lower right corners and increases linearly to 400 degrees at the upper-right corner. The Ansys code is found in the file heat2d64.a. Look at the MP command. We have been using MP,EX to define the elastic modulus. Now we use MP,KXX to define the thermal conductivity. Look at the D command we have been using to constrain movement in mechanical systems. For this problem we use it to set the temperature. For example

D, 8,TEMP, 50

sets the temperature of node 8 to 50 degrees. Today you will change the Ansys code to insulate the top, left, and bottom edges and define a temperature gradient on the left edge.

The lesson is in two parts. First you will use a short file Heat2da.a to create just the 2D array in stages by adding keyboard commands. Then you will change to the complete file Heat2d64.a to solve the problem. You did a similar thing in Assignment 4. For both files, you will make changes with editor before running Ansys. Append the output data from the complete second file to the end of the Ansys file. Print the Ansys source file and the two graphics showing the elements and the temperatures.

1. Copying and editing the two Ansys files.
• Copy the two files: heat2da.a and heat2d64.a from class files page as you have done before.
• Make a copy of heat2d64.a and name the copy Heat2as8.a
• In the right pane of Explorer, right-drag Heat2d64.a to a blank area and release the mouse button.
• Pick Copy from the menu.
• Right-click the copy and pick Rename.
• Give the new copy the name Heat2as8.a
• Edit heat2da.a putting your name and date on the /TITLE line.
Notice that the next to last line is
`    E, 9,1,10`
which defines the first triangular element in the preprocessor section.
• Open a second editor with Heat2as8.a
• Go back to the first editor and drag through the TITLE line to highlight it
• Type Ctrl-C to copy the line
• Click to remove the highlight
• Move to the second editor and drag through the TITLE line to highlight it
• Type Ctrl-V to paste the new TITLE line.
• Click to remove the highlight
• Don't close the editor for heat2d64.a, the complete problem, since you will put the Ansys results at the end.

2. Running the shorter heat2da.a with Ansys
In this section you will run the short file with Ansys in batch mode to create the first element. Then you will type two Ansys EGEN commands and an E command to create more elements.
• Start Ansys.
• Click the Ansys File menu at the upper left and pick Read Input from.
• The Read File dialog box should show C:\WINDOWS\Temp since that is where you set the workspace previously.
(If another location is shown instead, Ansys is not set correctly. Then reset Ansys to C:\WINDOWS\Temp as you learned in Assignment 2.)
But, of course, your Ansys files are not stored in C:\WINDOWS\Temp.
• Steer Ansys to the location to your files at U:\win\Ansys.
• Drop down the Drive list and pick U
• Double-click the win folder
• Double-click the Ansys folder
• Highlight your Heat2da.a file by left clicking.
• Click OK to start running the short program
• Your figure should look like this showing the first element (9, 1, 10).
• Check for the above node numbers.
• Check that your name, the date, and the title appear on the figure.
• Create a row of elements by typing the element generation command shown below
• Find the command line at the upper-left side with the heading
`   Pick a menu item or enter ANSYS Command below`
• Click in the box just below this line and type the following
`   EGEN,7,1,-1`
As you know, this command creates seven total elements using the previous element (-1) as a pattern and increments the node numbers by 1.
• Press Enter to complete the command.
• Your figure should look like this showing a row of seven elements.
• Create an array of elements by typing a second EGEN command
• Click the command line box again and type the following
`   EGEN,7,8,-7`
This command copies the previous seven elements to create eight rows of elements and increments the node numbers by 7.
• Press Enter to complete the command.
• Reduce the size of the figure.
• In the Utility Menu click PlotCtrls and pick Pan, Zoom, Rotate (right). Click to see full tool.
• Move to the middle part of the menu, shown on the right and click the small dot to reduce the size of the Figure.
• Don't change the orientation with the Iso or Obliq buttons since you are using a 2D element.
• Close the Pan-Zoom tool.
• Your figure should look like this showing an array of upper-left elements. You have now created half the needed elements.
• Capture this image, edit it as usual, and print it.
• You are now finished with this file
• Click the File menu and pick Clear & Start New so you can run the next batch file

3. Running the longer Heat2as8.a with Ansys
In this section you will edit and run Heat2as8.a with Ansys. This will create the all the elements and calculate the temperatures and flux.
• Edit the Heat2as8.a file again
• Check that your name and date are on the Ansys TITLE line as usual.
• Look at the temperature constraints in the Solution section.
• Remove the temperature constraints from the top nodes (57-63).
Check the enlarged left figure above to see the appropriate node numbers. Removing the constraints makes the upper edge thermally insulated like the left and lower edges.
• Look at the end of your program for the temperature and heat flux data. You will append similar data to the end of your program.
• Drag through these values and press Del to delete them.
• Be sure you have cleared Ansys in the previous section.
• Highlight your Heat2as8.a file by left clicking.
• Click OK to start running your program. The temperature map will appear in the Graphics window.
• Click Close when the calculations are done.
• Check that your name, date, and title appear on the figure.
If not, edit the file to, put your name and date on the /TITLE line of the Ansys source program, and save the file. Run Ansys again by first clicking File and then Clear & Start New.
• Reduce the figure size to fit the graphics screen
• In the Utility Menu click PlotCtrls and pick Pan, Zoom, Rotate. Click to see full tool.
• Move to the middle part of the menu and pick the smaller dot to zoom out so all of the figure shows.
• Your figure should look like this.
• Animate the figure with: PlotCtrls | Animate | Deformed Results | DOF solution | OK
• To see a 620KB animation of the temperature:
• Microsoft Internet Explorer opens Media Player with full controls.

4. Append temperature and heat data
• Look in your Ansys directory for the file named Temp.txt which has the temperature and heat flux results.
• Edit this file with Notepad.
• Notice that the temperatures are given in two parts, nodes 1-39 and nodes 40-64. This is followed by heat flux for nodes 8-64.
• Drag through the temperatures and heat flux to make one block.
• Type Ctrl-C to copy all the data.
• Click to remove the highlighting.
• Go to the bottom of your Ansys file and paste the temperature and heat data by typing Ctrl-V.
• Remove the extraneous information between the temperatures and heat.
• Compare the data you have at the end of Heat2as8.a to that at the end of the original heat2d64.a.

5. First printout
Look at the elements again by clicking the Plot menu and picking Elements.
Capture, edit, and print this figure continuing the elements. If not printing in color, change to grayscale, and negative.

6. To see the thermal flux, pull down the Plot menu and pick Results, Contour Plot, Nodal Solution, DOF solution, Def shape only, Apply. This shows the temperature fields without the elements.

7. Second printout
To see the temperature and the elements together. click the Plot menu and pick Results, Contour Plot, Nodal Solution, DOF solution, Temperature and Def + undeformed, OK
Capture this figure, edit and print it. If not printing in color, change to negative and grayscale.

8. Try other combinations such as Results, Contour Plot, Elem Solution, Flux & Gradient, Def + undeformed, Thermal grad TGSUM to see the flux.

9. Assignment
Create a cover sheet that includes a discussion of the two types of 2D elements you have used so far. Also discuss batch mode vs. adding keyboard commands. Attach the two graphic screens you captured and turn in the package as specified at the lab.

10. Before logging out check the size of your saved files.

Epilogue: In this lesson you began Ansys with batch mode to create one element. Then you gave two EGEN commands from the keyboard to create more elements. You altered another batch file to create a temperature gradient in a two-dimensional plate. Ansys then calculated the temperature throughout the plate. In Assignment 9 and 10 you will not use batch mode at all. You will create a two-dimensional plate and apply constraints and a load by using menus. Then Ansys can find the deflections and stresses. This is a very power feature of Ansys, but because there are so many features, it is easy to get lost.

MENG 421 -- Ansys -- Lectures -- Class assignments -- 1 2 3 4 5 6 8 9 10 11 12
Files: Ansys, Matlab, Bash