This tcl script shows how to generate CONVG cards for OptiStruct with a variable value of convection along Z axis:
Run the script through File -> Load -> Script