3d_transient.i 1.87 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
# This test solves a 1D transient heat equation
# The error is caclulated by comparing to the analytical solution
# The problem setup and analytical solution are taken from "Advanced Engineering
# Mathematics, 10th edition" by Erwin Kreyszig.
# http://www.amazon.com/Advanced-Engineering-Mathematics-Erwin-Kreyszig/dp/0470458364
# It is Example 1 in section 12.6 on page 561

[Mesh]
  file = 3D.exo
[]

[Variables]
  [./T]
  [../]
[]

[ICs]
  [./T_IC]
    type = FunctionIC
    variable = T
    function = '100*sin(3.14159*x/80)*sin(3.14159*y/80)'
  [../]
[]

[Kernels]
  [./HeatDiff]
    type = HeatConduction
    variable = T
  [../]
  [./HeatTdot]
    type = HeatConductionTimeDerivative
    variable = T
  [../]
[]

# [BCs]
#   [./top]
#     type = DirichletBC
#     variable = T
#     boundary = top
#     value = 0
#   [../]
#   [./bottom]
#     type = DirichletBC
#     variable = T
#     boundary = bottom
#     value = 100
#   [../]
# []

# [Materials]
#   [./k]
#     type = GenericConstantMaterial
#     prop_names = 'thermal_conductivity'
#     prop_values = '0.95' #copper in cal/(cm sec C)
#     block = 0
#   [../]
#   [./cp]
#     type = GenericConstantMaterial
#     prop_names = 'specific_heat'
#     prop_values = '0.092' #copper in cal/(g C)
#     block = 0
#   [../]
#   [./rho]
#     type = GenericConstantMaterial
#     prop_names = 'density'
#     prop_values = '8.92' #copper in g/(cm^3)
#     block = 0
#   [../]
# []

[Postprocessors]
  [./error]
    type = NodalL2Error
    function = '100*sin(3.14159*x/80)*exp(-0.95/(0.092*8.92)*3.14159^2/80^2*t)' #T(x,t) = 100sin(pix/L)exp(-rho/(cp k) pi^2/L^2 t)
    variable = T
  [../]
[]

[Executioner]
  type = Transient
  scheme = bdf2
  nl_rel_tol = 1e-12
  l_tol = 1e-6
  dt = 2
  end_time = 100
  petsc_options_iname = '-pc_type -pc_hypre_type'
  petsc_options_value = 'hypre boomeramg'
[]

[Outputs]
  exodus = true
  print_perf_log = true
[]