Using ACT, how can I define a variable pressure with Independent Variable set to X in a specific coo

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 712
First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
edited June 2023 in Structures

Using ACT, how can I define a variable pressure with Independent Variable set to X in a specific coordinate system?

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 712
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
    Answer ✓

    The following code can be adapted:

        analysis=ExtAPI.DataModel.Project.Model.Analyses[0] # refer to analysis
        my_press=analysis.AddPressure() # add pressure
        my_press.Magnitude.Inputs[0].DiscreteValues=[Quantity('1[s]'),Quantity('20[s]')]  # force definition to be set to tabular data
        my_press.Magnitude.Output.DiscreteValues=[Quantity('10[MPa]'),Quantity('20[MPa]')] # define pressure values
        my_press.IndependentVariable=LoadVariableVariationType.XValue # define X as independent variable
        my_press.XYZFunctionCoordinateSystem=ExtAPI.DataModel.GetObjectsByName("Coordinate System")[0] # select coordinate system called "Coordinate System" in which X is defined
        my_press.Magnitude.Inputs[0].DiscreteValues=[Quantity('1[mm]'),Quantity('20[mm]')]  # define pressure values