# 4.14. Output Reference

Output is divided into two major categories:

- Results Output contains binary format simulation results in a form suitable for visualization. While the Results output usually corresponds to the entire model, it can also be applied to portions of the model.

- Heartbeat Output is generally written to a text file and provides a convenient means of monitoring intermediate simulation results as well as outputting post-processed variables.

This section describes how to use these two output functionalities. A detailed list of all possible commands can be found in the command reference.

## 4.14.1. Results Output

The results output block allows you to print simulation data to an output database. This database can then be visualized/postprocessed (e.g. in ParaView), used in subsequent simulations, etc. This data includes internal fields such as the DOF solved in each active equation, as well as post-processed nodal and global fields.

A list of the quantities available for output is printed to the log immediately after the mesh is read. This list can be previewed by running fuego with the `--check-input` option which will verify the input syntax, read the mesh, print the variables available for output, and then exit.

    Fuego Region "fuego_region" has the following fields available for output:
      GLOBAL Variables:
        * AREA_X_surface_1
        * AREA_Y_surface_1
        * AREA_Z_surface_1
        * mass_flow_rate_surface_1
        * TOTAL_AREA_surface_1
      NODE_RANK Fields:
        * continuity_residual
        * control_volume
        * density
        * density_derivative
        * dpdx
        * dpdy
        * dpdz
        * gas_volume_fraction
        * grad_q
        * mass_diffusivity
        * mass_fraction
        * model_coordinates
        * molecular_weight
        * pressure
        * pressure_gradient
        * turbulent_dissipation
        * turbulent_kinetic_energy
        * turbulent_production_ke
        * turbulent_viscosity
        * u_star
        * u_tmp
        * v_tmp
        * velocity
        * viscosity
        * w_tmp
        * x_velocity
        * y_velocity
        * ysolve
        * z_velocity
      FACE_RANK Fields:
        * density_bip
        * eff_wall_yp_bnd
        * mass_flux_bip
        * pressure_bip
        * viscous_force_bip
        * wall_area_bip
        * wall_temperature_bip
        * wall_yp_bip
      ELEMENT_RANK Fields:
        * CFL
        * mass_flux
        * num_wall_faces_on_scv
        * subcontrol_volume

The available quantities are split by their entity rank. When specifying a field for output, the associated rank should be used. A quantity is added to the output database using a line of the form

    <entity> variables = <internal name> [as <output name>]

where the `entity` is the rank specified in the output list, and the `internal name` can optionally be overridden in the output database by specifying an `output name` e.g.

    # Scope: Sierra > Procedure > Fuego Region
    begin results output myOutput
      # name of the output database
      Database name = results.e

      # Frequency information
      at step 0 increment = 1

      #Quantities to print
      nodal variables = someMissingField
      nodal variables = density as rho
      element variables = volume_change_ratio
      global variables = avg_temperature
    end

Note

It is worth noting that since the ExodusII format has no concept of vector/tensor quantities, Paraview deduces vectors by looking for the same variable with `X`, `Y`, and `Z` (for 3D problems) appended. For example if `Ux`, `Uy`, and `Uz` are all present in an output database, ParaView will group them into a vector called `U`.

Similarly if a field called `displacement` is found, it will be recognized by ParaView as the nodal displacements and the mesh will automatically be warped by the field.

Fuego will handle naming of vector/tensor quantities that are requested for output, but it is worth keeping these facts in mind when specifying your own output names.

Note

It is not fatal to request an output quantity that does not exist. Instead, a warning is printed to the log stating that output is skipped since the field cannot be found. If a certain quantity is missing from your output, this can be a good first thing to check for.

    ******************************************************************************
    **  Warning:
    **  In region 'myRegion' Results Output block 'myOutput', Nodal variable
    **  'someMissingField' was not found and will not be output
    ******************************************************************************

## 4.14.2. Heartbeat Output

Unlike Results Output, heartbeats are used to view scalar data such as reduced quantities and running metrics. They can be useful to track progress of simulations, as well as for collecting reduced data for postprocessing.

Available output quantities include:

- Mass flow rate on inflow and open boundaries

- Force, heat flux, and yplus on walls

- Any postprocessed scalar

The complete list of commands available in the heartbeat block can be found in the command summary.

As was stated above, the list of the available globals will be printed to the log

    Fuego Region "myRegion" has the following fields available for output:
      GLOBAL Variables:
        * AREA_X_surface_1
        * AREA_Y_surface_1
        * AREA_Z_surface_1
        * mass_flow_rate_surface_1
        * TOTAL_AREA_surface_1
      NODE_RANK Fields:
        * ...
      EDGE_RANK Fields:
        * ...
      ELEMENT_RANK Fields:
        * ...

A quantity is added to the output heartbeat using a line of the form

    variable = <entity> <internal name> [as <output name>]

Note that similar to results output, the `internal name` can be overridden by specifying `as <output name>`

    # Scope: Sierra > Procedure > Fuego Region
    Begin Heartbeat myHb
      # name of the output stream
      Stream name = results.csv

      #Formatting of file
      Timestamp Format = ""
      Precision        = 8   # precision of output
      Format           = csv # delimeter
      Labels           = Off # qnty=123 format
      Legend           = On  # header row of labels

      # Frequency information
      at step 0 increment = 1

      #Quantities to print
      variable = global mass_flow_rate_surface_1 as mdot1
      variable = global TOTAL_AREA_SURFACE_1
      ...
    End

It is also possible to select a single value from a field by specifying the closest point

    variable = <entity> <internal name> nearest location <X> <Y> <Z> as <output name>

or a specified ID

    variable = <entity> <internal name> at <entity> <ID> as <output name>

For example:

    # Scope: Sierra > Procedure > Fuego Region
    Begin Heartbeat myHb
      ...
      Variable = Node density nearest location 0.0 0.0 0.0 as rhoOrigin
      Variable = Node density at node 123 as rho123
      variable = element CFL at element 1 as cfl1
      ...
    End

Note

Similar to results output, it is not fatal to request heartbeat of a global that does not exist. Instead, a warning is printed

    ***********************************************************************************
    **  Warning:
    **  In Heartbeat Output block 'THE_HEARTBEAT':
    **  Global variable 'someMissingGlobal' does not exist and will not be output
    ***********************************************************************************

The format of the heartbeat output is flexible, and is controlled by the parameters Precision, Format, Labels, and Legend.

If no specific format is required, the following parameters

    # Scope: Sierra > Procedure > Fuego Region
    Begin Heartbeat myHb
      ...
      Timestamp Format = ""
      Precision        = 8   # precision of output
      Format           = csv # delimeter
      Labels           = Off # qnty=123 format
      Legend           = On  # header row of labels
    End

produce a csv file that is human-readable and can be read easily across applications

              time, avg_temperature, max_temperature
    0.00000000e+00,  3.50000000e+02,  4.00000000e+02
    1.00000000e-01,  3.60000000e+02,  4.10000000e+02
    2.00000000e-01,  3.70000000e+02,  4.20000000e+02
    ...

## 4.14.3. Output Scheduling

For both results and heartbeat output, the frequency of output is controlled by specifying either the time or step frequency using the following lines respectively

    # Scope: Sierra > Procedure > Fuego Region
    Begin Heartbeat myHb
      at time 0.0 increment = 0.1
      # or
      at step 0 increment = 1
    End

Note that multiple of these lines can be specified to define a more complex output schedule e.g.

    # Scope: Sierra > Procedure > Fuego Region
    Begin Heartbeat myHb # or results output myOutput
      at time 0.0    increment = 100.0
      at time 300.0  increment = 300.0
      at time 1800.0 increment = 500.0
    End

Additional times/steps can also be included using by specifying the respective command lines

    # Scope: Sierra > Procedure > Fuego Region
    Begin Heartbeat myHb # or results output myOutput
      Additional Steps = 1 2 3
      # or
      Additional Times = 0.1 0.2 0.3
    End

By default, the time closest to the requested print interval is written. It is sometimes desired, however, to output exactly at a given print interval. In this case, `Timestep adjustment interval = <N>` can be set, which allows the time step manager to modify the next `N` steps to attempt to exactly hit the desired output.

    # Scope: Sierra > Procedure > Fuego Region
    Begin Heartbeat myHb # or results output myOutput
      ...
      Timestep adjustment interval = 4
    End

Finally, note that if a certain output pattern is desired to be used in multiple places, it can be defined as an output scheduler

and given as input to the output block(s) in place of the arguments above. Note that the scheduler must be placed at Sierra scope:

    Begin Sierra Job
      # Scope: Sierra!
      begin Output Scheduler mySched
        at time 0.0    increment = 100.0
        at time 300.0  increment = 300.0
        at time 1800.0 increment = 500.0
        ...
      end

      ...
      Begin Procedure theProcedure
          ...

          Begin Fuego Region Fuego_Region
            ...

            # Scope: Sierra > Procedure > Fuego Region
            Begin Heartbeat myHb
              Use Output Scheduler mySched
              ...
            End

            Begin results output myOutput
              Use Output Scheduler mySched
              ...
            End
          End

        End Procedure theProcedure
    End Sierra Job

Note

In the case of steady solutions, Fuego output will contain two “time” steps: an initialization output plane, and the steady solution output. Care must be taken to use the appropriate time if these results are used in subsequent analysis (e.g. to provide the initial condition from file for a transient problem).