Step 3a - Adding volumetric heating

In Step 3, we added the time-derivative term to the heat equation, and showed how including it allows for the solution of transient thermal problems. Some thermal problems also involve a volumetric heat source, which could arise due to a number of phenomena, including exothermic chemical reactions, nuclear fission, and resistive heating.

#
# Single block thermal input with time derivative and volumetric heat source terms
# https://mooseframework.inl.gov/modules/heat_transfer/tutorials/introduction/therm_step03.html
#

[Mesh<<<{"href": "../../../../syntax/Mesh/index.html"}>>>]
  [generated]
    type = GeneratedMeshGenerator<<<{"description": "Create a line, square, or cube mesh with uniformly spaced or biased elements.", "href": "../../../../source/meshgenerators/GeneratedMeshGenerator.html"}>>>
    dim<<<{"description": "The dimension of the mesh to be generated"}>>> = 2
    nx<<<{"description": "Number of elements in the X direction"}>>> = 10
    ny<<<{"description": "Number of elements in the Y direction"}>>> = 10
    xmax<<<{"description": "Upper X Coordinate of the generated mesh"}>>> = 2
    ymax<<<{"description": "Upper Y Coordinate of the generated mesh"}>>> = 1
  []
[]

[Variables<<<{"href": "../../../../syntax/Variables/index.html"}>>>]
  [T]
    initial_condition<<<{"description": "Specifies a constant initial condition for this variable"}>>> = 300.0
  []
[]

[Kernels<<<{"href": "../../../../syntax/Kernels/index.html"}>>>]
  [heat_conduction]
    type = HeatConduction<<<{"description": "Diffusive heat conduction term $-\\nabla\\cdot(k\\nabla T)$ of the thermal energy conservation equation", "href": "../../../../source/kernels/HeatConduction.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
  []
  [time_derivative]
    type = HeatConductionTimeDerivative<<<{"description": "Time derivative term $\\rho c_p \\frac{\\partial T}{\\partial t}$ of the thermal energy conservation equation.", "href": "../../../../source/kernels/HeatConductionTimeDerivative.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
  []
  [heat_source]
    type = HeatSource<<<{"description": "Demonstrates the multiple ways that scalar values can be introduced into kernels, e.g. (controllable) constants, functions, and postprocessors. Implements the weak form $(\\psi_i, -f)$.", "href": "../../../../source/kernels/HeatSource.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
    value<<<{"description": "Value of heat source. Multiplied by function if present."}>>> = 1e4
  []
[]

[Materials<<<{"href": "../../../../syntax/Materials/index.html"}>>>]
  [thermal]
    type = HeatConductionMaterial<<<{"description": "General-purpose material model for heat conduction", "href": "../../../../source/materials/HeatConductionMaterial.html"}>>>
    thermal_conductivity<<<{"description": "The thermal conductivity value"}>>> = 45.0
    specific_heat<<<{"description": "The specific heat value"}>>> = 0.5
  []
  [density]
    type = GenericConstantMaterial<<<{"description": "Declares material properties based on names and values prescribed by input parameters.", "href": "../../../../source/materials/GenericConstantMaterial.html"}>>>
    prop_names<<<{"description": "The names of the properties this material will have"}>>> = 'density'
    prop_values<<<{"description": "The values associated with the named properties"}>>> = 8000.0
  []
[]

[BCs<<<{"href": "../../../../syntax/BCs/index.html"}>>>]
  [t_left]
    type = DirichletBC<<<{"description": "Imposes the essential boundary condition $u=g$, where $g$ is a constant, controllable value.", "href": "../../../../source/bcs/DirichletBC.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
    value<<<{"description": "Value of the BC"}>>> = 300
    boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = 'left'
  []
  [t_right]
    type = FunctionDirichletBC<<<{"description": "Imposes the essential boundary condition $u=g(t,\\vec{x})$, where $g$ is a (possibly) time and space-dependent MOOSE Function.", "href": "../../../../source/bcs/FunctionDirichletBC.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
    function<<<{"description": "The forcing function."}>>> = '300+5*t'
    boundary<<<{"description": "The list of boundary IDs from the mesh where this object applies"}>>> = 'right'
  []
[]

[Executioner<<<{"href": "../../../../syntax/Executioner/index.html"}>>>]
  type = Transient
  end_time = 5
  dt = 1
[]

[VectorPostprocessors<<<{"href": "../../../../syntax/VectorPostprocessors/index.html"}>>>]
  [t_sampler]
    type = LineValueSampler<<<{"description": "Samples variable(s) along a specified line", "href": "../../../../source/vectorpostprocessors/LineValueSampler.html"}>>>
    variable<<<{"description": "The names of the variables that this VectorPostprocessor operates on"}>>> = T
    start_point<<<{"description": "The beginning of the line"}>>> = '0 0.5 0'
    end_point<<<{"description": "The ending of the line"}>>> = '2 0.5 0'
    num_points<<<{"description": "The number of points to sample along the line"}>>> = 20
    sort_by<<<{"description": "What to sort the samples by"}>>> = x
  []
[]

[Outputs<<<{"href": "../../../../syntax/Outputs/index.html"}>>>]
  exodus<<<{"description": "Output the results using the default settings for Exodus output."}>>> = true
  [csv]
    type = CSV<<<{"description": "Output for postprocessors, vector postprocessors, and scalar variables using comma seperated values (CSV).", "href": "../../../../source/outputs/CSV.html"}>>>
    file_base<<<{"description": "The desired solution output name without an extension. If not provided, MOOSE sets it with Outputs/file_base when available. Otherwise, MOOSE uses input file name and this object name for a master input or uses master file_base, the subapp name and this object name for a subapp input to set it."}>>> = therm_step03a_out
    execute_on<<<{"description": "The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html."}>>> = final
  []
[]
(moose/modules/heat_transfer/tutorials/introduction/therm_step03a.i)

Input file

Kernels

The only change necessary to include a volumetric heating term to this problem is to add an additional block under Kernels for the volumetric heat source, which is provided by the HeatSource kernel. The prescribed value here is a constant heat source prescribed as a heat source per unit volume. Options exist for prescribing this using a function, which provides the flexibility to model a wide variety of problems.

It may seem unusual that this is prescribed using a Kernel because this is similar in nature to a boundary condition. However, volume integrals are prescribed as Kernels in MOOSE, regardless of whether they are source terms or terms that depend on a derivative of the solution.

[Kernels<<<{"href": "../../../../syntax/Kernels/index.html"}>>>]
  [heat_conduction]
    type = HeatConduction<<<{"description": "Diffusive heat conduction term $-\\nabla\\cdot(k\\nabla T)$ of the thermal energy conservation equation", "href": "../../../../source/kernels/HeatConduction.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
  []
  [time_derivative]
    type = HeatConductionTimeDerivative<<<{"description": "Time derivative term $\\rho c_p \\frac{\\partial T}{\\partial t}$ of the thermal energy conservation equation.", "href": "../../../../source/kernels/HeatConductionTimeDerivative.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
  []
  [heat_source]
    type = HeatSource<<<{"description": "Demonstrates the multiple ways that scalar values can be introduced into kernels, e.g. (controllable) constants, functions, and postprocessors. Implements the weak form $(\\psi_i, -f)$.", "href": "../../../../source/kernels/HeatSource.html"}>>>
    variable<<<{"description": "The name of the variable that this residual object operates on"}>>> = T
    value<<<{"description": "Value of heat source. Multiplied by function if present."}>>> = 1e4
  []
[]
(moose/modules/heat_transfer/tutorials/introduction/therm_step03a.i)

Questions

Before running the model, consider how the solution should change with the addition of volumetric heating.

Click here for the answer.

Now go ahead and run the input and visualize the result to see if it matches the behavior you would expect.

Exploring parameters

Try changing the magnitude of the volumetric heating and see how that affects the solution.