### 14.3.2. Example: Feedback to Control Inlet Temperature

In this example a feedback loop is used to control the outlet temperature by varying the temperature at an inlet. To illustrate the example consider the geometry shown below:

Figure 14.1: Temperature Feedback Loop

Fluid from a main and a side inlet enter at temperatures of 275 K and 375 K respectively. The temperature of the fluid entering from the third inlet depends on the outlet temperature. When the outlet temperature is greater than 325 K, the fluid from the third inlet is set to 275 K. When the outlet temperature is less than 325 K, the fluid from the third inlet is set to 375 K. In addition an expression is used to set the dynamic viscosity to be a linear function of temperature.

The LIBRARY section of the .ccl (CFX Command Language) file appears as follows. Note that the “\” character indicates a line continuation in CCL.

    LIBRARY:
       MATERIAL: Water at STP Modified
          Option = Pure Substance
          PROPERTIES:
             Option = General Fluid
             Density = 9.999E2 [kg m^-3]
             Dynamic Viscosity = VisT
             Specific Heat Capacity = 4.21E3 [J kg^-1 K^-1]
             Thermal Conductivity = 5.69E-1 [W m^-1 K^-1]
          END # PROPERTIES
       END # MATERIAL Water at STP Modified
       CEL:
          EXPRESSIONS:
             Tupper = 375.0 [ K ]  # Upper temp.
             Tlower = 275.0 [ K ]  # Lower temp.
             Visupper = 0.000545 [ N s m^-2 ]  # Vis. at Tupper
             Vislower = 0.0018 [ N s m^-2 ]  # Vis. at Tlower
             VisT = Vislower+(Visupper-Vislower)*(T-Tlower)/ \
                (Tupper-Tlower)
             # Vis.-Temp. relationship
             Tm=(Tupper+Tlower)/2
             Tout=areaAve(Water at STP Modified.T)@outlet
             Tcontrol=Tlower*step((Tout-Tm)/1[K]) \
                +Tupper*step((Tm-Tout)/1[K])
          END # EXPRESSIONS
       END # CEL
    END # LIBRARY

The first four expressions, `Tupper`, `Tlower`, `Visupper` and `Vislower` are simply constant values to define temperature and viscosity values. The expression `VisT` produces a linear function for the dynamic viscosity taking a value of `Visupper` at `Tupper` and a value of `Vislower` at `Tlower`. The expression `Tm` sets the desired value of the outlet temperature. In this case it is set to a mean value of the two inlet temperatures.

`Tout` calculates the outlet temperature using the `areaAve` function.

Finally the expression `Tcontrol` is used to set the temperature of the third inlet. Two step functions are used so that the temperature is equal to `Tlower` when `Tout-Tm` is positive (that is, the outlet temperature is greater than `Tm`), and is equal to `Tupper` when `Tout-Tm` is positive.

Release 18.2 - © ANSYS, Inc. All rights reserved.