# 6.7.1. Applying complex BCs

The best way to do this is to define a surface material. A surface material lets you use user expressions, string functions, or any of the other generic expression types to define things like convection coefficient or reference temperature. An example showing how to include a complex convection boundary condition is shown below.

    # Define the material
    begin aria material cht_material
        heat transfer coefficient = scalar_string_function f = "10 + 5*x"
        user expression = user_function user_tag=Tref_scaling name=Tref_table X=time
        bc reference temperature = scalar_string_function f = "Tref_scaling + 10*x"
    end

    # Apply the material to the relevant sideset(s)
    Begin finite element model mymesh
        #...
        Use material cht_material for surface_1
    End

    # Apply the generalized nat conv BC on the relevant sideset(s), this
    # will apply Flux = h*(T - Tref) using the h and Tref you defined in your material
    BC Flux for Energy on surface_1 = Generalized_Nat_Conv

If your convective BC only uses string functions for and , they can also be supplied in-line instead of with a surface material.

    BC Flux for Energy on surface_1 = Generalized_Nat_Conv \$
        h = "10 + 5*x"                                     \$
        T_ref = "300 + 50*sin(t) + 10*x"