dinaharchery
Computer
- Jul 13, 2010
- 2
Hello,
I am trying to build a C++ program that uses the Finite Element Method to compute the heat conduction/transfer of a set of 3-node triangular elements (2-D) at different time. I am using the explicit forward difference (Euler) and I believe I have everything properly put together except for two sections - initial node temperatures, and boundary corrections at the end of each time-step.
Can anyone explain to me the proper way to initialize the nodes, and how to "correct" boundary nodes at the end of each time step? Currently I initialize all nodes to zero and the boundary "corrections" are done by setting the heat-rate vector to the predefined set of boundary temperatures (arbitrarily set to 2.0).
The algorithm I am using follows:
(1) Form LOCAL 'c' (capacity matrix) and 'k' (stiffness)
(2) Initialize nodal temperatures at time 0
(3) Select time step
(4) Assemble GLOBAL 'C' matrix and GLOBAL 'K' (stiffness)
- At EACH Time Step -
(1) Form ELEMENT heat-rate vector 'r'
(2) Assemble EFFECTIVE heat-rate vector 'R'
(3) Solve for nodal temperatures
(4) Correct nodal temperatures for boundary conditions
I hope someone out there will be kind enough to help me. Thanks in advance.
I am trying to build a C++ program that uses the Finite Element Method to compute the heat conduction/transfer of a set of 3-node triangular elements (2-D) at different time. I am using the explicit forward difference (Euler) and I believe I have everything properly put together except for two sections - initial node temperatures, and boundary corrections at the end of each time-step.
Can anyone explain to me the proper way to initialize the nodes, and how to "correct" boundary nodes at the end of each time step? Currently I initialize all nodes to zero and the boundary "corrections" are done by setting the heat-rate vector to the predefined set of boundary temperatures (arbitrarily set to 2.0).
The algorithm I am using follows:
(1) Form LOCAL 'c' (capacity matrix) and 'k' (stiffness)
(2) Initialize nodal temperatures at time 0
(3) Select time step
(4) Assemble GLOBAL 'C' matrix and GLOBAL 'K' (stiffness)
- At EACH Time Step -
(1) Form ELEMENT heat-rate vector 'r'
(2) Assemble EFFECTIVE heat-rate vector 'R'
(3) Solve for nodal temperatures
(4) Correct nodal temperatures for boundary conditions
I hope someone out there will be kind enough to help me. Thanks in advance.