.. _conditions-initialtemperature:

*******************
Initial Temperature
*******************

.. code-block:: sierrainput

   BEGIN INITIAL TEMPERATURE
     #
     # block set commands
     INCLUDE ALL BLOCKS
     BLOCK = <string list>block_names
     ASSEMBLY = <string list>assembly_names
     REMOVE BLOCK = <string list>block_names
     ELEMENT = <int_list>elem_ids       
  
     NODE SET|NODESET = <string list>nodeset_names
     REMOVE NODE SET = <string list>nodeset_names
     NODE = <int_list>node_ids
     #
     # specification command
     MAGNITUDE = <real>initial_temperature_value
     #
     # user subroutine commands
     NODE SET SUBROUTINE = <string>subroutine_name
     SUBROUTINE DEBUGGING OFF | SUBROUTINE DEBUGGING ON
     SUBROUTINE REAL PARAMETER: <string>param_name
       = <real>param_value
     SUBROUTINE INTEGER PARAMETER: <string>param_name
       = <integer>param_value
     SUBROUTINE STRING PARAMETER: <string>param_name
     #
     # external database commands
     READ VARIABLE = <string>var_name
     COPY VARIABLE = <string>var_name [FROM MODEL <string>model_name]
       MAP_BY_PROXIMITY|MAP_BY_ID(MAP_BY_PROXIMITY)
     TIME = <real>time|FIRST|LAST
   END [INITIAL TEMPERATURE]

The ``INITIAL TEMPERATURE`` command block initializes a temperature field on the prescribed mesh entities. The temperature field is set on a nodal field ``temperature`` and interpolated to the integration points of an element field ``temperature``.

The temperature field may evolve later through interaction with material models that support temperature evolution features such as adiabatic heating. In this case, only the element temperature field is changed and will become out-of-sync with the nodal temperature field.

The simplest example for initializing temperature is as follows:

.. code-block:: sierrainput

   begin initial temperature
       include all blocks
       magnitude = 294.0
   end

The initial temperature block may appear multiple times. In the case where temperature has already been prescribed on one node (e.g. two merged blocks with different temperatures), the last initial temperature specification wins.

A ``PRESCRIBED TEMPERATURE`` command block may exist within the same scope as an ``INITIAL TEMPERATURE`` command block. It is possible that the prescribed temperature at the initial analysis time conflicts with what is specified in the ``INITIAL TEMPERATURE`` block. In this case, the ``PRESCRIBED TEMPERATURE`` block wins and will subsequently provide a temperature at every time step.

Block Set Commands
==================

The ``block set commands`` portion of the ``INITIAL TEMPERATURE`` command block defines a set of nodes associated with the prescribed temperature field and can include some combination of the following command lines:

.. code-block:: sierrainput

   BLOCK = <string list>block_names
   ASSEMBLY = <string list>assembly_names
   INCLUDE ALL BLOCKS
   REMOVE BLOCK = <string list>block_names
   ELEMENT = <int_list>elem_ids       
   NODE SET|NODESET = <string list>nodeset_names
   REMOVE NODE SET = <string list>nodeset_names
   NODE = <int_list>node_ids

These command lines, taken collectively, constitute a set of Boolean operators for constructing a set of nodes derived from some combination of element blocks. See :numref:`conditions-general-entity` for more information about the use of these command lines for creating a set of nodes used by the boundary condition. There must be at least one ``BLOCK``, ``INCLUDE ALL BLOCKS``, ``ELEMENT``, ``ASSEMBLY``, ``NODE SET|NODESET``, or ``NODE`` command line in the command block. Assemblies may contain blocks, nodesets, or assemblies of these.

Specification Commands
======================

The ``MAGNITUDE`` command may be used to specify a constant temperature for the selected mesh entities.

The initial temperature field may also vary over space by using either the user subroutine commands, or the external mesh database commands. For example, the exodus results database of a SIERRA/TF analysis may be used to initialize a Sierra/SM analysis. The usage details for this follow directly from the description in :numref:`conditions-prescribetemperature`.
