Description
Coding Assignment 2 Solve the steady state problem of heat conduction
PDE −∇ · j = f
Constitutive relation j = −κ∇u
Neumann b.c. −j · nˆ = h on ∂Ωj
Dirichlet b.c. u = g on ∂Ωu
with the following boundary conditions using the specified meshes and linear basis functions. Use ¯κ = 385 watt.m−1K−1, where κij = ¯κδij. Assume j = 0 watt.m−2 on all edges/surfaces where no temperature/flux conditions are specified.
1. (2D Quadrilateral Mesh): (x ∈ [0,0.03], y ∈ [0,0.08], use a 15 x 40 element mesh.) u(x) = 300(1 + c0x) K along y = 0 m (bottom nodeset) and u(x) = 310(1 + cˆ0x2) K along y = 0.08 m
(top nodeset) where .
2. (3D Hexahedral Mesh): (x ∈ [0,0.04], y ∈ [0,0.08], z ∈ [0,0.02], use a 8 x 16 x 4 element mesh) u(y,z) = 300(1 + c0(y + z)) K along x = 0 m (left nodeset) and u(y,z) = 310(1 + c0(y + z)) K along x = 0.04 m (right nodeset)
where .
Coding Instructions: You will receive the following files:
• main2a.cc (the source file for the 2D problem)
• FEM2a.h (the template header file for the 2D problem)
• main2b.cc (the source file for the 3D problem)
• FEM2b.h (the template header file for the 3D problem)
• writeSolutions.h
• CMakeLists.txt
You will also receive the .vtk solution files for a 5 x 13 mesh (2D problem) and a 4 x 8 x 2 mesh (3D problem) to help you debug your code. As before, most of your coding will be done in FEM2a.h and FEM2b.h. Do not modify any function names or the names of any class data structure. The only parts of main2a.cc and main2b.cc that should be modified are the function inputs that define the number of elements in the mesh. Your FEM2a.h and FEM2b.h files must run with the given main2a.cc and main2b.cc files, respectively. Nothing should be changed in writeSolutions.h or CMakeLists.txt.
Submission Instructions: You should submit (through the Coursera website) a .zip file (name it CA2.zip) containing your FEM2a.h and FEM2b.h files and the .h5 solution files. You will have a total of two .h5 solution files (one from the 2D problema and one from the 3D problem). Each .h5 file will contain the solution vector. Do not submit any files other than those listed here.
1




Reviews
There are no reviews yet.