Prescribing Constant Temperature in Fluid Cells

In modeling some applications, such as air conditioning units, it may be desirable to impose the temperature distribution within a range of fluid cells. This section describes a procedure that uses the discretized form of the energy equation to fix a target temperature that you specify.

The steps are as follows:

  1. Create a cell set containing the cells for which the temperature is to be fixed.
    This cell set has a corresponding field function with a default name. Here, the field function is CellSetVar_1.
  2. Create a field function, GREAT, that contains a number sufficiently large to mask the contribution from the usual energy fluxes in the designated cells, but not too high to cause a floating point exception.
    For example, you could use 1000 times the maximum local value of (mCp)/V or k L / V , where m is the mass flow rate into the cell, Cp is the specific heat, V is the cell volume, k is the thermal conductivity, and L is some characteristic cell length. In this example, GREAT is set to 1e20.


  3. Create a field function for the user-defined temperature field.

    Here, for example, T_target is set to:

    293 + 40 *$$Centroid[1] * (1 - $$Centroid[1])



  4. Using these three field functions, it is possible to define a further field function for the Volumetric Heat Source, Q, that applies to cells in the cell set:

    ($CellSetVar_1) ? $GREAT*($T_target - $Temperature) : 0

  5. The differential of this field function with respect to temperature is also required as a field function.

    Here, it is defined as dQdT, with the formula:

    ($CellSetVar_1) ? -$GREAT : 0



Having created the necessary field functions, the final step is to apply them to the relevant region values:

  1. Set the Volumetric Heat Source of the region to the field function Q:



  2. Set the Energy Source Temperature Derivative to the field function dQdT: