# TA4: Centerline Temperature of a Heat Generating Wire (Under Revision)

## 1. PROBLEM DESCRIPTION

A bare steel wire is generating heat with a given rate. Radius and length of the wire is given. The convection coefficient and ambient temperature of the air around the wire are known. We will calculate the centerline and the surface temperature of the wire when it comes to steady-state. Also, the heat dissipation rate of the wire will be determined.

Properties and BC Value

Material Properties

Geometric Properties

k = 0.0036111 Btu/s-ft-°F

L = 1 ft

Ta = 70°F

h = 0.0013889 Btu/s-ft2-°F

r = 0.03125 ft

Q = 30.92 Btu/s-ft3

## 2. MODEL SETUP AND SOLUTION

The following sections describe the setup and solution steps for this tutorial:

2.1. Preparation

2.2. General Settings

2.3. Geometry/Mesh

2.4. Material

2.5. Boundary Conditions

2.6. Solution

2.7. Processing

2.8. Post-Processing

### 2.1. Preparation

To run this tutorial;

2. After login, Click Personel Projects>>New Project button on the screen and then we will create a project page and name the project.

(Let’s name of Analysis “TempDistWire1”)

1. You can see the project page in Personal Projects.

2. Our Screen is a blank python page without any script. We will be doing a tutorial by using Simularge’s Library.

1. We import our libraries from the Simularge Libraries to our empty Python page that we almost will use in each tutorial.

1from TwinAPI.SimulationTools import Solver
2from TwinAPI.SimulationTools import Mesher


Material Properties is one of the most significant factor that affects the result. Therefore, we should define it easily to the problem. I will explain below how to use and write Material Library elaborately. Furtherless, the libraries that has to be imported for this problem is given below.

1from TwinAPI.MaterialLibrary import MaterialManager
2from TwinAPI.MaterialLibrary.Units import units


### 2.2. General Settings

After the necessary libraries are imported into the analysis, analysis is defined.

1. Define name of Analysis as “TempDistWire1”

1TempDistWire1= Solver.Analysis(Verbose=True)

1. Calculix is used on solid mechanics problems in TwinAPI. Hence, we are defining Calculix to run this analysis.

1TempDistWire1.SetSolver("Calculix")


Analysis is defined successfully into TwinAPI System.

### 2.3. Geometry/Mesh

There are two different options to define geometry on TwinAPI System. You can create the geometry on TwinAPI by using Mesher Library that belongs to Simularge’s libraries or you can import your own CAD geometry.

 1    r=0.03125
2    LengthX=r
3    LengthY=1
4    NodeX=11
5    NodeY=5
6    TypeX="uniform"
7    directionX=""
8    TypeY=TypeX
9    directionY=directionX
10    box1=Mesher.Quad2D(LengthX, NodeX, TypeX, directionX, LengthY, NodeY, TypeY, directionY)


With the script given above, you can create your geometry and mesh.

LengthX= Length of X Direction

NodeX= Node Number of X Direction

directionX= Aspect

TypeX= Mesh type of X direction.

All of given above is valid for Y and Z direction.

We create a rectangular geometry which name is “quad1” from given inputs. We will model the wire as a cylinder and solve the problem as an axisymmetrical problem. Therefore we defined a rectangular geometry. Length of the short edge of the rectangle is equal to radius of the wire.

Note

We told you that you can also create this geometry by importing 3D CAD file apart from using MESHER. Code should be written like this;

1 Box1=Mesher.MeshFromCad('Box.step',20000,1,1e4,SurfaceExtract=True)


If we are not sure how the created geometry is and want to see the geometry before starting analysis;

Click Preview Button

### 2.4. Material

Before we start, there are lots of parameters which affect the result of the problem. We are going to explain which parameters are required for this problem and some parameter instances will be given.

If your material is isotropic that means material properties are identical in all directions. However properties of an anisotropic material depend on the direction. Only thermal conductivitiy of the material will affect the temperature distribution and heat dissipation rate in this problem.

We call the Material class in the Material Manager library and name the material as “TwinAPI”. At the same time, we give the information that the material behaves as a metal by typing “metal”.

Conductivity is defined in the x-direction and the unit of conductivity ,Btu/s-ft-°F, is converted to Btu/hr-ft-°F by multiplying conductivity by 3600.

1 material = MaterialManager.Material("TwinAPI","metal")
2
3
4 material.SetThermalData("conductivityX",3600*0.00316111 ,units["btu/hrftf"])


We also defined specific heat and density of the wire.

1 material.SetGeneralData("density", 493.18089, units["lb/ft3"])
2
3 material.SetThermalData("specificHeat", 0.395, units["btu/lbf"])


After defining the material into our system, we should combine geometry defined above and material using Addpart. Here we also define the problem as and axisymmetric problem.

1TempDistWire1.AddPart(box1,material,Type="Axisymmetric")
2
3TempDistWire1.Assemble()


### 2.5. Boundary Conditions

After adding material and geometry to the analysis, we are ready to set the boundary conditions.

1. First of all, we need to call a method to create a step. Name of the step is determined as “Step1”.

1Step1=Solver.CreateStep("new")

1. We need to choose whether this step is computed depending on time or not. Since our problem is steady-state, the code below should be used.

1Step1.Time("SteadyState",[0,0.5,0.1])


If the problem was transient, type of the problem and time for the analysis would be written in a similar manner to the code given below.

1Step1.Time("Transient",[0,10,0.1])

1. Types of boundary conditions required for this problem are initial temperature, convection and heat generation. The ambient temperature, h (Heat Transfer Coefficient) value and Q (heat generation rate) are required for the problem and defined before the boundary conditions. Unit of h and Q is converted to Btu/hr-ft-°F by multiplying them by 3600.

 1AmbientTemperature = 70
2
3h=3600*0.0013889
4
5Q=3600*30.92
6
8
10


### 2.6. Solution

After defining our boundary conditions, we need to combine our defined domain and the steps containing boundary conditions.To complete this task;

1TempDistWire1.Build([Step1])


Now,Problem is ready to be solved.

1TempDistWire1.Solve()


Let’s review what we have done.

### 2.7. Processing

1. Click Run Button and gears rotate on the right side while problem is being solved.

### 2.8. Post-Processing

1. After problem solved;

We can see the result;

Click Result Button

1. If we want to see the detailed result of the problem;

Output tab shows us the results that we desire to see. First, the centerline and the surface temperature is computed by giving their locations. Then, heat dissipation rate is calculated as heat convection between the surface of the wire and air. Formula is given below. Unit of heat dissipation rate is converted to Btu/s by dividing it by 3600 to be able compare our result with the target result.

$q = Area \times h \times (Surface Temperature - Ambient Temperature)$
 1TempCent=TempDistWire1.Result(Variable="Temperature", Loc=[0,0,0],Print=False)
2
3TempSurf=TempDistWire1.Result(Variable="Temperature", Loc=[LengthX,0,0],Print=False)
4
5print("Centerline Temperature:", TempCent, "F")
6
7print("Surface Temperature:", TempSurf, "F")
8
9q=2*3.14*r*LengthY*h*(TempSurf-AmbientTemp)/3600
10
11print("Heat dissipation rate:", q, "btu/s")


Log tab tells us respectively what happened in analysis.

Error tab shows us if there is an error in script, it tells us what the error is and where it is.

Files tab can upload the files imported from Upload command and check them from Files.

Graph tab shows us analysis result viewed graphically. (It will be shown in other examples.)

## 3. SUMMARY

In this tutorial, we learned how to set up and solve a problem involving heat generating wire and natural convection. We also learned how to perform postprocessing in an engineering manner.

With table given below shows that comparasion of Ansys Mechanical Result and TwinAPI result.

Comparasion

SOLID MODEL

Target

ANSYS

SIMULARGE-TwinAPI

Ratio: SIMULARGE/Target

Ratio: SIMULARGE/ANSYS

TempCent, °F

419.9

419.94

419.899

1.00

1.00

TempSurf, °F

417.9

417.85

417.794

1.00

1.00

q, Btu/s

-0.094861

-0.094861

-0.094847

1.00

1.00

## 4. SOURCE CODE

 1from TwinAPI.SimulationTools import Solver
2from TwinAPI.SimulationTools import Mesher
3from TwinAPI.MaterialLibrary import MaterialManager
4from TwinAPI.MaterialLibrary.Units import units
5
6TempDistWire1=Solver.Analysis(Verbose=True)
7TempDistWire1.SetSolver("Calculix")
8
9r=0.03125
10LengthX=r
11LengthY=1
12NodeX=11
13NodeY=5
14TypeX="uniform"
15directionX=""
16TypeY=TypeX
17directionY=directionX
18box1=Mesher.Quad2D(LengthX, NodeX, TypeX, directionX, LengthY, NodeY, TypeY, directionY)
19
20material = MaterialManager.Material("TwinAPI","metal")
21material.SetThermalData("conductivityX",3600*0.00316111 ,units["btu/hrftf"])
22material.SetGeneralData("density", 493.18089, units["lb/ft3"])
23material.SetThermalData("specificHeat", 0.395, units["btu/lbf"])
24
26
27TempDistWire1.Assemble()
28Step1=Solver.CreateStep("new")
30
31AmbientTemp=70
32h=3600*0.0013889
33Q=3600*30.92
34
38
39TempDistWire1.Build([Step1])
40TempDistWire1.Solve()
41
42TempCent=TempDistWire1.Result(Variable="Temperature", Loc=[0,0,0],Print=False)
43TempSurf=TempDistWire1.Result(Variable="Temperature", Loc=[LengthX,0,0],Print=False)
44
45print("Centerline Temperature:", TempCent, "F")
46print("Surface Temperature:", TempSurf, "F")
47q=2*3.14*r*LengthY*h*(TempSurf-AmbientTemp)/3600
48print("Heat dissipation rate:", q, "btu/s")


Keywords: Heat Transfer,Heat Generation,Convection,Temperature,Heat Transfer Coefficient

Problem Reference: W. M. Rohsenow, H. Y. Choi, Heat, Mass and Momentum Transfer, 2nd Printing, Prentice-Hall, Inc., Englewood Cliffs, NJ, 1963, pg. 106, ex. 6.5.

Author: Ilknur Akica