Using FDM and Numerical Analysis To Calculate Temperature and Strength
Using FDM and Numerical Analysis To Calculate Temperature and Strength
I/ PROBLEM 1.................................................................................................................................................. 2
A) BASE THEORY ......................................................................................................................................... 2
B) MATLAB CODE ........................................................................................................................................ 3
II/ PROBLEM 2 ................................................................................................................................................ 6
A) NUMERICAL METHOD SOLUTION ....................................................................................................... 6
1/ Displacement of elements .............................................................................................................12
2/ Stress of elements ...........................................................................................................................12
B) ANSYS APDL SOLUTION ......................................................................................................................14
III/ REFERENCES...........................................................................................................................................19
1
I/ PROBLEM 1
A) BASE THEORY
We have the thickness of the plate: L = 6 cm = 0.06 m.
L 0.06
There are 3 nodes, therefore the distance between 2 consecutive nodes is: = = 0.03 (m).
3−1 2
*Additional code attached using finite element method to display steady-state temperature colormap
of Uranium plate.
*There will be 1 displayed result and 4 figures generated by the MATLAB code: The temperature to
thickness plot; The mesh figure,
Results and Figures 1- 5:
2
B) MATLAB CODE
% with finite difference method:
3
syms T1 T2;
% Equation for node 1:
eqn1 = (T0 - 2*T1 + T2)/(deltaX^2) + g/k == 0;
% Equation for node 2:
eqn2 = h*(Tenv - T2) + k*(T1 - T2)/deltaX + g*deltaX/2 == 0;
% Solve the two equations:
S = solve(eqn1, eqn2);
% Display results:
fprintf("Temperature at node 1 is %s degrees Celsius. \n",
string(double(S.T1)));
fprintf("Temperature at node 2 is %s degrees Celsius. \n",
string(double(S.T2)));
% Plot results:
y = [T0,S.T1,S.T2];
x = [0, 0.03, 0.06];
figure;
hold on;
plot(x,y, 'r-', 'LineWidth', 3);
plot (x, y, 'r^', 'MarkerSize', 10);
xlabel ('Thickness of plate (Meters)');
ylabel ('Temperature (Celsius Degree)');
grid on;
title('Temperature to Thickness of Uranium plate plot');
% Create geometry
width = 0.06;
height = 0.06;
gdm = [3 4 0 width width 0 0 0 height height]';
g = decsg (gdm, 'S1', ('S1')');
geometryFromEdges(tmodel,g);
figure;
4
pdegplot(tmodel,"EdgeLabels","on");
axis([-0.01 0.07 -0.01 0.07]);
title("Geometry With Edge Labels Displayed");
msh = generateMesh(tmodel,"Hmax",hmax);
figure;
pdeplot(tmodel);
axis equal;
xlabel("X-coordinate, meters");
ylabel("Y-coordinate, meters");
title("Meshed geometry");
xlabel("X-coordinate, (meters)")
axis equal;
title ("Steady-State Temperature of Uranium (Celcius)");
5
II/ PROBLEM 2
A) NUMERICAL METHOD SOLUTION
Figure 7: Bridge model with named elements (in white) and nodes (in yellow)
Topo Table:
Elements Initial point Terminal point Length l m
x y x y
1 (1-2) 0 0 1.8 3.118 3.6 0.5 0.8661
2 (1-3) 0 0 3.6 0 3.6 1 0
3 (2-3) 1.8 3.118 3.6 0 3.6 0.5 -0.8661
4 (2-4) 1.8 3.118 5.4 3.118 3.6 1 0
5 (3-4) 3.6 0 5.4 3.118 3.6 0.5 0.8661
6 (3-5) 3.6 0 7.2 0 3.6 1 0
7 (4-5) 5.4 3.118 7.2 0 3.6 0.5 -0.8661
8 (4-6) 5.4 3.118 9 3.118 3.6 1 0
9 (5-6) 7.2 0 9 3.118 3.6 0.5 0.8661
10 (5-7) 7.2 0 10.8 0 3.6 1 0
11 (6-7) 9 3.118 10.8 0 3.6 0.5 -0.8661
6
11 Element stiffness matrix:
With a 2D bar element, we have its global stiffness matrix described as:
l2 lm −l2 −lm
EA lm m 2
−lm −m2 ]
[k] = [ 2
L −l −lm l2 lm
−lm −m2 lm m2
Element 1, 5, 9: θ = 60°; l = 0.5; m = 0.8661
0.25 0.43305 −0.25 −0.43305
250 ∗ 109 ∗ 3500 ∗ 10−6 0.43305 0.7501 −0.43305 −0.7501
[k1,5,9 ] = [ ]
3.6 −0.25 −0.43305 0.25 0.43305
−0.43305 −0.7501 0.43305 0.7501
Element 2, 4, 6, 8, 10: θ = 0°; l = 1; m = 0
1 0 −1 0
250 ∗ 109 ∗ 3500 ∗ 10−6 0 0 0 0
[k 2,4,6,8,10 ] = [ ]
3.6 −1 0 1 0
0 0 0 0
Element 3, 7, 11: θ = -60°; l = 0.5; m = -0.8661
0.25 −0.8661 −0.25 0.8661
250 ∗ 109 ∗ 3500 ∗ 10−6 −0.8661 0.7501 0.8661 −0.7501
[k 3,7,11 ] = [ ]
3.6 −0.25 0.8661 0.25 −0.8661
0.8661 −0.7501 −0.8661 0.7501
7
8
9
Boundary conditions (BC):
u1 = v1 = v7 = 0;
F2x = F2y = F3x = F4x = F4y = F5x = F6x = F6y = F7x = 0 (N);
F1x = R1x;
F1y = R1y − 280 kN;
F3y = −210 kN;
F5y = −280 kN;
F7y = R7y − 360 kN;
10
11
1/ Displacement of elements
Using matrixcalc.org we can solve for the displacement matrix as follows:
u2 0.00238636
v2 −0.00271085
u3 0.00057735
v3 −0.00508839
u4 0.00123167
v4 = −0.00559946 (m)
u5 0.00178977
v5 −0.00541058
u6 −0.00003848
v6 −0.00288861
[u7 ] [ 0.00242485 ]
This result matches our team ANSYS APDL’s simulation result.
Movable support R displaces approximately 0.00242485 meters or about 2.42485 millimeters along
the positive x axis only.
2/ Stress of elements
We have the stress in a 2D element from node i to node j written as:
𝑢𝑖
𝐸 𝑣𝑖
𝜎= [−𝑙 −𝑚 𝑙 𝑚] {𝑢 }
𝐿 𝑗
𝑣𝑗
Therefore (result with larger value than 1000 will be separated by commas (,) and decimal numbers will
be separated by points (.)),
For element 1 (node 1-2):
0
240 ∗ 109 0
σ1 = [−0.5 −0.8661 0.5 0.8661] { } ≈ −76,979,145.67 (Pa)
3.6 0.00238636
−0.00271085
For element 2 (node 1-3):
0
240 ∗ 109 0
σ2 = [−1 −0 1 0] { } ≈ 38,490,000 (Pa)
3.6 0.00057735
−0.00508839
For element 3 (node 2-3):
0.00238636
240 ∗ 109 −0.00271085
σ3 = [−0.5 0.8661 0.5 −0.8661] { } ≈ −76979145.67 (Pa)
3.6 0.00057735
−0.00508839
For element 4 (node 2-4):
0.00238636
240 ∗ 109 −0.00271085
σ4 = [−1 −0 1 0] { } ≈ −76,979,333.33 (Pa)
3.6 0.00123167
−0.00559946
12
For element 5 (node 3-4):
0.00057735
240 ∗ 109
σ5 = [−0.5 −0.8661 0.5 0.8661] {−0.00508839} ≈ −7,698,515.133 (Pa)
3.6 0.00123167
−0.00559946
For element 6 (node 3-5):
0.00057735
240 ∗ 109 −0.00508839
σ6 = [−1 −0 1 0] { } ≈ 80,828,000 (Pa)
3.6 0.00178977
−0.00541058
For element 7 (node 4-5):
0.00123167
240 ∗ 109
σ7 = [−0.5 0.8661 0.5 −0.8661] {−0.00559946} ≈ 7,697,402.133 (Pa)
3.6 0.00178977
−0.00541058
For element 8 (node 4-6)
0.00123167
240 ∗ 109 −0.00559946
σ8 = [−1 −0 1 0] { } ≈ −84,676,666.67 (Pa)
3.6 −0.00003848
−0.00288861
For element 9 (node 5-6):
0.00178977
240 ∗ 109 −0.00541058
σ9 = [−0.5 −0.8661 0.5 0.8661] { } ≈ 84,676,881.13 (Pa)
3.6 −0.00003848
−0.00288861
For element 10 (node 5-7):
0.00178977
240 ∗ 109 −0.00541058
σ10 = [−1 −0 1 0] { } ≈ 42,338,666.67 (Pa)
3.6 0.00242485
0
For element 11 (node 6-7):
−0.00003848
240 ∗ 109
σ11 = [−0.5 0.8661 0.5 −0.8661] {−0.00288861} ≈ −84,677,341.3 (Pa)
3.6 0.00242485
0
These stresses solution relatively match our team’s ANSYS APDL’s simulation results.
13
B) ANSYS APDL SOLUTION
This part of the report will be presented step by step with figures and their captions, important results
are Bold:
14
Figure 10. Define material and Young module.
15
Figure 12. Define nodes' coordinates.
16
Figure 14. Set up constraints for node 1 and 7.
17
Figure 16. Plot displacements of bars
18
Figure 19. von Mises stresses results (or total stresses that appear on axial direction of each bar, read
the result by nodes to nodes since the elements are numbered by the software and therefore are not
synchronized with our report).
III/ REFERENCES
1. Dr. Le Thanh Long’s lecture slides
2. https://www.mathworks.com/
3. https://www.ansys.com/
19