Create a Convection Load

Goal

The following script creates a convection load on the first Named Selection listed in the Named Selections folder in the Outline using example values and Units.

Code

    try:
        named_sel = Model.NamedSelections.Children[0]
    except:
        ExtAPI.Log.WriteWarning("Named Selection not found")

    convection = Model.Analyses[0].AddConvection()
    if named_sel != None:
        convection.Location = named_sel

    convection.AmbientTemperature.Inputs[0].DiscreteValues = [Quantity("0 [s]"), Quantity("1 [s]")]  # Set the time values
    convection.AmbientTemperature.Output.DiscreteValues = [Quantity('760  [C]'), Quantity('800  [C]')] # Set the Ambient Temperature values
    convection.FilmCoefficient.Inputs[0].DiscreteValues = [Quantity("0 [s]"), Quantity("1 [s]")]  # Set the time values
    convection.FilmCoefficient.Output.DiscreteValues = [Quantity("100 [W m^-1 m^-1 K^-1]"), Quantity("150  [W m^-1 m^-1 K^-1]")] #Set the HTC values