### 4.2.4. User Defined Wall Functions

A user-defined wall function transfer coefficient may be applied to any wall boundary condition. This is accomplished by adding the following CCL data to the wall boundary condition, in the `HEAT TRANSFER` block or `ADDITIONAL VARIABLES` block, as appropriate:

    TURBULENT WALL FUNCTIONS:
       Option = User Defined
       Wall Function Transfer Coefficient = [expression goes here]
    END

Note that the parameter `Wall Function Transfer Coefficient` must be a normalized value having dimensions of [L T^-1] (that is, the units of kinematic diffusivity divided by length). The definition of the two different types of wall function transfer coefficient and their normalized values are presented next, followed by examples of CCL implementations.

#### 4.2.4.1. Heat Flux

    heat flux = C* (Vertex Temperature - Wall Temperature)

where `C` represents the wall heat flux transfer coefficient before normalization.

The `Wall Function Transfer Coefficient` parameter is then calculated as:

    Wall Function Transfer Coefficient = C / (density * Cp)

#### 4.2.4.2. Additional Variable Flux

    additional variable flux = C * (Vertex AV - Wall AV)

where `C` represents the wall scalar flux transfer coefficient before normalization.

The `Wall Function Transfer Coefficient` parameter is then calculated as:

    Wall Function Transfer Coefficient = C / density

#### 4.2.4.3. Example of User-Defined Wall Function for Heat Flux

In the following example, a user-defined wall function, in the form of a wall function transfer coefficient for heat flux, is defined and applied to a wall boundary condition.

    LIBRARY :
       CEL:
          EXPRESSIONS:
             sn = 1.E-20
             prandtl = viscosity * Cp / cond
             pryplus = prandtl * yplus
             beta1 = (3.85 * prandtl^(1./3.) - 1.3) ^ 2
             gamma = 0.01 * prandtl * yplus ^ 3 / \
             (1./(yplus*prandtl^3+sn) + 5.0)
             tplussub = pryplus
             tpluslog = max(2.12*loge(pryplus+sn)+beta1,0.)
             tplus = tplussub*exp(-gamma) + tpluslog*exp(-1./(gamma+sn))
             twftfc1 = ustar / (tplus + sn)
          END
       END
    END
    FLOW
       DOMAIN: flatplate
          BOUNDARY : Wall
             Boundary Type = WALL
             Coord Frame = Coord 0
             BOUNDARY CONDITIONS :
                MASS AND MOMENTUM :
                   Option = No Slip Wall
                END
                WALL ROUGHNESS :
                   Option = Rough Wall
                   Roughness Height = 0.019 [in]
                END
                HEAT TRANSFER :
                   Option = Fixed Temperature
                   Fixed Temperature = 100[C]
                   TURBULENT WALL FUNCTIONS:
                      Option = User Defined
                      Wall Function Transfer Coefficient = twftfc1
                   END
                END
             END
          END
       END
    END

#### 4.2.4.4. Example of User-Defined Wall Function for an Additional Variable

The CCL implementation of a user-defined wall function for an Additional Variable is similar to that shown in the example for heat flux. The CCL block in the boundary condition is (using a specified quantity as an example):

    FLOW
       DOMAIN: flatplate
          BOUNDARY : Wall
             BOUNDARY CONDITIONS :
                ADDITIONAL VARIABLE: my_av
                   Wall Function Transfer Coefficient = 10 [m s^-1]
                END
             END
          END
       END
    END

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