#### 2.1.17.3. Solution Plots

All analysis results can be visualized as solution plots in ACP-Post. Solution plots are attached to individual solutions.

- Common Plot Settings
- Visualization Mismatch
- Deformation Plot
- Strain Plot
- Stress Plot
- Failure Mode Plot
- Temperature Plot
- Progressive Damage Plot
- User-Defined Plot

##### 2.1.17.3.1. Common Plot Settings

Plot settings are largely similar for all plot types. Each plot can be configured through the Plot Properties dialog. The Plot Properties dialog has two tabs, General and Legend. The General tab is where the results component and geometry scope are defined. It possible to configure a plot to display only a particular section of a component. The Legend tab controls the format of the plot legend. Specific to solution plots is the selection of the solution set of interest.

The General Tab has the following properties:

- Name: Name of the plot.

- Data Scope: Determines what scope is used in the plot. Element sets, OSS, Modeling Plies & Sampling Points can be selected in the data scope. The data scope of a sampling point covers all plies that are intersected by the sampling point.

- Ply-wise: Activates a ply-wise plot display. Thickness and angle plot are only shown if a ply is selected. Angle plots are automatically set to ply-wise. The plies can be selected from the modeling groups, sampling points or solid model analysis plies.

- Show on Solids: Shows plot data on solid elements and for solid elements only.

- Component: offers the selection of components (for example, usum, s12, and IRF) available for the chosen plot.

- Display Solution: Choose the solution set for which the plot result is to be computed.

- Show on Section Cuts: Shows the ply angle on section cuts in the same color scale (angle plot only).

- Ply Offsets: Visualize the results of a ply-wise plot on the selected plies at their true or scaled offset from the reference surface (angle plot only).

The Legend tab allows you to control titles, labels, and legend ranges:

- The legend is formatted automatically by default but can be customized to suit.

- Limits can be set be set to be min/max limits.

- Limits can be set as thresholds on the penultimate labels on the contour plot scale.

- Values above limits can be colored in non-rainbow scale colors (grey and pink).

##### 2.1.17.3.2. Visualization Mismatch

Failure plots show the critical values for all defined failure criteria (modes) and integration points. The strain and stress plot illustrates the values at the element center (interpolation). Therefore the absolute strain and stress peaks are not displayed in the plots and the elements have a constant value. This can cause graphical inconsistency between the strain/stress and failure plot.

##### 2.1.17.3.3. Deformation Plot

- ux: Translation in X direction.

- uy: Translation in Y direction.

- uz: Translation in Z direction.

- rotx: Rotation around the X axis.

- roty: Rotation around the Y axis.

- rotz: Rotation around the Z axis.

##### 2.1.17.3.4. Strain Plot

Strains can be displayed ply-wise or for an entire laminate. Strain results can be plotted for the following component directions:

- 1: Material 1 direction.

- 2: Material 2 direction.

- 3: Out-of-plane normal direction.

- 12: In-plane shear.

- 13: Out-of-plane shear terms.

- 23: Out-of-plane shear terms.

- I: 1st principal direction.

- II: 2nd principal direction.

- III: 3rd principal direction.

##### 2.1.17.3.5. Stress Plot

There is an option to compute interlaminar normal stresses for shell elements. Stress results can be plotted for the following stress component directions:

- 1: Material 1 direction.

- 2: Material 2 direction.

- 3: Out-of-plane normal direction.

- 12: In-plane shear.

- 13: Out-of-plane shear terms.

- 23: Out-of-plane shear terms.

- I: 1st principal direction.

- II: 2nd principal direction.

- III: 3rd principal direction.

##### 2.1.17.3.6. Failure Mode Plot

Failure plots can be used to display the safety factor for first ply failure of a pre-defined failure criteria definition. There are three kinds of safety factors that can be displayed in a failure contour plot. Text labels can be activated to show the critical failure mode and in what layer it occurs. In the case of an envelope solution, the critical load case can also be shown. The toolbar button switches the display of activated element text labels on and off. For information on failure definitions see Postprocessing.

Available safety factor components:

- Inverse Reserve Factors (IRF)

- Margins of Safety (MoS/MS)

- Reserve Factors (RF)

The failure plot properties have the following additional options:

- Failure Criteria Definition: Drop-down menu for selecting the desired failure criteria definition.

- Show Critical Failure Mode: Show the critical failure mode as an element text label.

- Show Critical Layer: Show the layer index of the critical failure mode as an element text label.

- Show Critical Load Case: Show the solution index of the critical failure mode as an element text label (Envelope Solution only).

- Threshold for Text Visualization: Set the threshold so that element labels are only shown for as of a certain IRF, RF or MoS level.

Note: The critical layer index counts from the reference surface upwards and starts at layer 1. The sandwich failure criteria top and bottom sheet wrinkling are evaluated for a sandwich structure as a whole and cannot to be linked to specific layer. The layer index shows 0 in this case. The critical load case index starts at 0. In the Envelope Solution, the solution in position n is plotted with number n - 1.

Figure : Scene with Failure Mode Plot Activated

##### 2.1.17.3.7. Temperature Plot

The temperature plot can display a temperature field results on solid elements if temperature data is available in the results file.

##### 2.1.17.3.8. Progressive Damage Plot

This plot object can display progressive damage results. The overall damage status can be displayed indicating whether no damage, some damage, or complete damage has occurred. The damage variables give an indication of how much the stiffness has reduced for fiber and matrix in tension or compression. The damage variable scale goes from 0 (no damage, 0% stiffness reduction) to the maximum stiffness reduction specified. The highest reduction possible is 1 (complete damage, 100% stiffness reduction).

Note that a failure analysis for this analysis type should be done with care and may not make sense for damaged elements.

See Damage Results in the Mechanical User's Guide for more information on each result component.

The following components can be plotted:

- Damage Status:

  - 0 = undamaged

  - 1 = damaged

  - 2 = completely damaged

- Fiber Tensile Damage Variable (FT)

- Fiber Compressive Damage Variable (FC)

- Matrix Tensile Damage Variable (MT)

- Matrix Compressive Damage Variable (MC)

- Shear Damage Variable (S)

##### 2.1.17.3.9. User-Defined Plot

This plot object can be used to plot a scalar data set provided as a Python list or `numpy.ndarray` , as well as associated custom text labels provided as a list of strings. Once the plot has been loaded, you can query active element indices, labels, and respective element centroid coordinates through the plot user interface properties based on the data scope. User-defined plots can be created as a lay-up plot or a solution plot. The plot is defined using the Python interface. The code can be placed in the script field of the plot object. This ensures the plot is refreshed following model updates. Alternatively, the plot definition can be executed through the Python shell. For more information about the Python interface, see The ACP Python Scripting User Interface.

Caution: The `model.update()` command must not be executed in the user-defined script field as it leads to an infinite update loop. Because of this limitation, changes to objects preceding the user-defined script object cannot be handled within the script field, as a `model.update()` would be required.

Figure : Script Field in the User-Defined Plot Properties

###### Python User Interface Properties

`user_element_indices`

  Retrieve a `numpy.ndarray` with the active element indices in the relevant order.

`user_element_labels`

  Retrieve a `numpy.ndarray` with the active element labels in the relevant order.

`user_element_centroids`

  Retrieve a `numpy.ndarray` with the active element centroid coordinates in the relevant order.

`user_data`

  Retrieve or provide the user data, which must obey the order of the `user_element_indices` or `user_element_labels`, respectively.

`user_script_enabled`

  Boolean that controls if a custom script is run on update.

`user_script`

  The body of the script to be executed on update if `user_script_enabled` = True.

`user_text`

  Access to the user-defined text of the plot. Empty strings can be inserted when no labels are to be shown for certain elements.

###### Example Scripts

All examples are based on the class40.wbpz Workbench example provided with the installation.

- This project contains a material called E_Glass_shear_dependent.

- This material is contained within cell B5 (ACP).

The sample code below shows how you can plot the effective Young's modulus as a function of draping simulation.

Example 2.1: Plot Material Property Distribution

The following commands must be deployed from within the UI of cell B5:

    # get active model
    model = db.active_model
    # get angle plot
    ap = model.layup_plots['Angle.1']
    # set the angle plot to display the draped shear angle
    ap.component =  'shear'
    # set the plot data scope to modeling ply 'outer_skin_1' which uses a draping simulation
    scope = model.modeling_groups['hull'].plies['outer_skin_1']
    ap.data_scope = scope
    # update the model
    model.update()

    # create a user defined lay-up plot
    up = model.layup_plots.create_user_defined_plot(name = 'myplot')
    # apply the same scope as before
    up.data_scope = scope
    # enable the script field
    up.user_script_enabled = True
    up.show_user_text = True

The following code must be placed within the Script field of UserDefinedPlot object myplot:

    # get active model, angle plot and data scope
    model = db.active_model
    ap = model.layup_plots['Angle.1']
    scope = model.modeling_groups['hull'].plies['outer_skin_1']
    # get a list of the shear angles of the selected modeling ply
    shear_angles = ap.get_data(visible = ap.data_scope, selected = scope)
    # get the shear dependent material
    mat = model.material_data.materials['E-Glas_shear-dependant']
    moduli = []

    # loop thru list of shear angles and determine the corresponding
    # elastic modulus in 1 direction
    for i in shear_angles[0]:
        moduli.append(round(mat['engineering_constants'].query('E1', {'Shear Angle' : i}),3))

    # set the plot to display the list of moduli
    plot.user_data = moduli
    # set the user text to display the corresponding shear value as string, rounded to 2 digits
    import functools
    plot.user_text = map(str, map(functools.partial(round, ndigits = 2), shear_angles[-1]))
    # add formatting to the plot
    plot.color_table.use_defaults = False
    plot.color_table.description = 'E_1 [MPa] with shear angle labels'

This script should result in the following plot:

The sample code below shows how you can plot the margin against the combined interlaminar shear stresses :

Example 2.2: Plot Combined Shear Stress Values

The following commands must be deployed from within the UI of cell E5:

    # get active model
    model = db.active_model
    # set data scope to element set
    scope = model.element_sets['HULL_BELWL']

    # create a stress plot for out-of-plane shear stress s13
    sp = model.solutions['Solution 1'].plots.create_stress_plot()
    sp.data_scope = scope
    sp.component = 's13'

    # create a second stress plot for out-of-plane shear stress s23
    sp1 = model.solutions['Solution 1'].plots.create_stress_plot()
    sp1.data_scope = scope
    sp1.component = 's23'
    # update the model, to make stress data available
    model.update()

    # create user defined solution plot
    up = model.solutions['Solution 1'].plots.create_user_defined_plot(name = 'myplot.1')
    # apply the same data scope as before
    up.data_scope = scope
    up.user_script_enabled = True

The following code must be placed within the script field of the UserDefinedPlot object myplot:

    # import numpy extentsion for mathematical operations
    import numpy
    # get active model, set data scope as before and select core layer
    model = db.active_model
    scope = model.element_sets['HULL_BELWL']
    ply = model.modeling_groups['hull'].plies['core_bwl'].production_plies['ProductionPly.9'].analysis_plies['P1L1__core_bwl']

    # retrieve references to stress plots created before
    sp = model.solutions['Solution 1'].plots['Stress.1']
    sp1 = model.solutions['Solution 1'].plots['Stress.2']

    # get list of s13 and s23 stresses
    s13 = sp.get_data(visible = sp.data_scope, selected = ply)[0]
    s23 = sp1.get_data(visible = sp1.data_scope, selected = ply)[0]

    # take the sqrt of the sum of squares
    combined = numpy.sqrt(numpy.power(s13,2) + numpy.power(s23,2))
    # define a stress limit
    slimit = 1.1

    # calculate the inverse reserve factors (irfs)
    irf = combined / slimit

    # set the plot to display the list of irfs
    plot.user_data = irf
    # add formatting to the plot
    plot.color_table.use_defaults = False
    plot.color_table.description = 'irf_plot'

This script should result in the following plot:

User-defined plots can also show results on solid elements. The sample code below shows how to execute mesh selections and mesh queries for solids.

Example 2.3: Mesh Selections and Queries on a Solid Model

The following commands must be deployed from within the UI of cell B5:

    # get active model
    model = db.active_model
    # set data scope to element set 'BULKHEAD_ALL'
    scope = model.element_sets['BULKHEAD_ALL']

    # create a user defined lay-up plot and apply the data scope set before
    up = model.layup_plots.create_user_defined_plot(name = 'myplot.2')
    up.data_scope = scope
    # enable the script field
    up.user_script_enabled = True
    # activate the solid model display option
    up.show_on_solids = True

The following code must be placed within the script field of the UserDefinedPlot object myplot.2:

    # get active model
    model = db.active_model
    # select all elements attached to 'SolidModel.1'
    model.select_elements('sel0', attached_to=model.solid_models['SolidModel.1'])
    # retrieve the element type numbers for the selected elements using a mesh query
    data = model.mesh_query(selection='sel0', name='etypes', position='centroid')
    # set the plot to display the element type number on the solid elements
    plot.user_data = data.astype(float)

This script should result in the following plot. The prism and brick elements are highlighted separately:

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