George Ellwood CCLRC Using Tables in ANSYS ANSYS reads in tables of values as tab delimited txt files. In most examples ANSYS wants a coordinate and then a value at that coordinate. An example is shown in figure 1.1a & b, this is for a 2D table with primary variable x and secondary variable y. Figure 1.1a Example of a 2D table opened in Notepad Figure1.1b Explanation The primary variable, x in this case, is highlighted in the black box. The secondary variable, y in this case, is highlighted in the red box. At the point x=2, y=3 the value is 80. For a 3D table ANSYS needs more information, it requires the x-y plane information at different off sets of z. As shown in figure1.2. Figure 1.2: 3D table George Ellwood CCLRC Figure 1.3a & b shows how this looks when opened in notepad. Figure 1.3a: 3D table opened in Notepad Figure 1.3b Explanation The primary variable is highlighted in the black box. The secondary variable in the red box. The third variable in the green box. Creating Tables from Excel Large tables can be created simply by using excel. Data manipulation can be performed here and then the final table can be transferred back into ANSYS. For this example a 3D table will be created. The table comprises values at positions in the x-y plane at two different positions of z. These are shown in table 2.1. Table 2.1: Values at different coordinates Z=0 Z=1 y y 0 1 2 0 1 2 0 5 10 15 0 50 55 60 x x 1 20 25 30 1 65 70 75 2 35 40 45 2 80 85 90 George Ellwood CCLRC Figure 2.1 shows how table needs to be represented in excel in order for the file to be readable for ANSYS. Figure 2.1:Excel representation of table A break down of what this means is shown in figure 2.2. The first variable, x in this case, is shown in blue. The second variable, y, is shown in red, these form the x-y coordinates, the grid shows the values at these positions. The z coordinate is shown in brown. This is in the top left hand corner. For multiple values of z this grid is repeated but the z value is changed, as shown in figure 2.1. The values of the x, y and z are free to change between planes. The formatting must be that shown in figure 2.1 or there may be problems interpreting the file in ANSYS. Figure 2.2: Explanation of table spacing George Ellwood CCLRC Once the table has been created in excel it needs to be saved as a .txt file. These are tab delimited text files. It should be saved in the working directory that ANSYS will be using. In this example it has been saved as tabletest.txt. Excel may give a few warnings when saving but just click ok to carry on. The text file can be opened in a text editor such as notepad. This is shown in figure 2.3. Figure 2.3: tabletest.txt viewed from notepad In the macro or the command window on ANSYS type the following commands. *DIM,Txyz,table,3,3,2,x,y,z *TREAD,Txyz,tabletest,txt,, The first line tells ANSYS to create a table array called Txyz that is 3 x 3 x 2. With the first variable x, second variable y and third variable z. The second line tells ANSYS to read the values from tabletest into the Txyz table. You can check that the table has been created correctly by going to Parameters>Array Parameters>Define/Edit Choose the table you want to look and click edit. This will then display the table and you can confirm it has been created correctly.