update_mechanical_shock_props#

Analysis.update_mechanical_shock_props(project: str, mechanical_shock_properties: list[dict[str, bool | float | int | str]]) int#

Update properties for a mechanical shock analysis.

Available Since: 2024R1

Parameters:
  • project (str) – Name of the Sherlock project.

  • mechanical_shock_properties (list[dict[str, bool | float | int | str]]) –

    Mechanical shock properties for a CCA consisting of these properties:

    • cca_name: str

      Name of the CCA.

    • model_source: ModelSource, optional

      Model source. The default is None.

    • shock_result_countint

      Number of mechanical shock result layers to generate.

    • critical_shock_strain: float

      Critical shock strain. The default is None.

    • critical_shock_strain_units: str

      Critical shock strain units. The default is None. Options are "strain", "ε", and "µε".

    • part_validation_enabled: bool

      Whether to enable part validation. The default is None.

    • require_material_assignment_enabled: bool

      Whether to require material assignment. The default is None.

    • force_model_rebuild: str

      How to handle rebuilding of the model. The default is None. Options are "FORCE" and "AUTO".

    • natural_freq_min: int

      Minimum frequency. The default is None.

    • natural_freq_min_units: str

      Minimum frequency units. The default is None. Options are "HZ", "KHZ", "MHZ", and "GHZ".

    • natural_freq_max: int

      Maximum frequency. The default is None.

    • natural_freq_max_units: str

      Maximum frequency units. The default is None. Options are "HZ", "KHZ", "MHZ", and "GHZ".

    • analysis_temp: float

      Temperature. The default is None.

    • analysis_temp_units: str

      Temperature units. The default is None. Options are "C", "F", and "K".

Returns:

Status code of the response. 0 for success.

Return type:

int

Examples

>>> from ansys.sherlock.core.launcher import launch_sherlock
>>> sherlock = launch_sherlock()
>>> sherlock.project.import_odb_archive(
    "ODB++ Tutorial.tgz",
    True,
    True,
    True,
    True,
    project="Test",
    cca_name="Card",
)
>>> sherlock.analysis.update_mechanical_shock_props(
    "Test",
    [{
        "cca_name": "Card",
        "model_source": ModelSource.GENERATED,
        "shock_result_count": 2,
        "critical_shock_strain": 10,
        "critical_shock_strain_units": "strain",
        "part_validation_enabled": True,
        "require_material_assignment_enabled": False,
        "force_model_rebuild": "AUTO",
        "natural_freq_min": 10,
        "natural_freq_min_units": "Hz",
        "natural_freq_max": 100,
        "natural_freq_max_units": "KHz",
        "analysis_temp": 20,
        "analysis_temp_units": "F",
    },
    ]
)