Configuring Samcef

After installing the Samcef program, you must set the following environment variables for compatibility with Workbench:

SAMTECH_LICENSE_FILE

The path to your license server or license file. See the Samcef documentation for more information.

SAM_EXE

The path to the Samcef executable folder. In a standard installation, this is the Exec folder in the base directory of the Samcef install. For instance, if Samcef is installed at C:\Samcef, the path to the executable folder is C:\Samcef\Exec

SAM_WORK

The path to a temporary folder for a local run of Samcef. See the Samcef documentation for more information.

The Samcef Result Storage Configuration File

The exact results stored by the Samcef solver can be controlled using an XML configuration file. This file uses Samcef SAI codes to define which results to write to the results file. Results are classified by result type and category. The configuration file is located at ANSYS_INSTALL_DIR\v242\aisol\WBAddins\SamcefAddin\SamcefArchiveSettings.xml.

The configuration file is read when Mechanical is launched. If changes are made to the file while Mechanical is running, Mechanical must be restarted to reflect the changes.

The XML root element in this file is <SamcefArchiveSettings>. The child nodes of this root element represent analysis types. The only valid child node is <Analysis>, and this child node has the following attribute:

name (type string)

The analysis type:

  • default

  • modal

  • non_linear

  • harmonic

  • thermal

The <Analysis> node can have a child node of <Output>, which has the following attribute:

type (type string)

The option type, used to order SAI codes in the solver input file:

  • nodal

  • elemental

The <Output> node has child nodes of <Codes> which have the following attributes:

value (type string)

List of Samcef SAI codes separated by spaces. Usually a list of integers, positive or negative.

category (type string)

Optional, used for options enable or disabled by the user.

  • stress

  • strain

  • thermal_flux

  • contact

When a solve is executed and the solver input file is created, Mechanical finds the correct <Analysis> node in the configuration file to determine the SAI codes to write to the input file. This check is performed by finding the analysis type and whether the analysis is linear or nonlinear. The following table describes the mapping:

Workbench Analysis TypeOption<Analysis> Node Used
Static Structural (Samcef)Lineardefault
Nonlinearnon_linear
Transient Structural (Samcef)Lineardefault
Nonlinearnon_linear
Modal (Samcef)Linearmodal
Nonlinearnon_linear
Harmonic Response (Samcef)-harmonic
Eigenvalue Buckling (Samcef)-No SAI code written
Steady-State Thermal (Samcef)-thermal
Transient Thermal (Samcef)-thermal

The Samcef Postprocessing Configuration File

In order to postprocess all results from the Samcef solver in the Workbench interface, an XML file is used to map the results between Samcef and Workbench. The XML file defines all of the Workbench result codes with associated data, and lists the corresponding Samcef codes. The configuration file is located at ANSYS_INSTALL_DIR\v242\aisol\WBAddins\SamcefAddin\SamcefResultCodes.xml.

The configuration file is read when Mechanical starts postprocessing Samcef data. If changes are made to the file while Mechanical is running, Mechanical must be restarted to reflect the changes.

The following is an example result as expressed in the XML configuration:

<Result result_name="U" result_id="101" data_type="nodal" out_unit="length" style="vector"
   num_comp="5" comp_labels="XYZLABELS" description="Deformations(XYZs)">
      <Codes>
           <Code name="Code 163" />
      </Codes>
</Result>

The listing provides the following information:

  • The Workbench code "U" identified by Mechanical by the ID 101 is a nodal result and is interpreted as a length.

  • The result is represented in the vector style, has 5 components and is part of the XYZLABELS group.

  • The result corresponds to Samcef result code, "Code 163".

The XML Result object can have the following attributes:

result_name (type string)

The Workbench name of the result. Standard Mechanical names are reserved.

result_id (type integer)

The Workbench ID of the result. Standard Mechanical IDs are reserved; you should start numbering solver-specific results at 100000. You should not choose a number larger than 1000000 because those numbers are internally reserved.

data_type (type string enumerate)

The result type:

  • nodal

  • elem_nodal

  • elemental

out_unit (type string enumerate)

The unit type of the result. If this value is defined_per_component, the subtag <UnitsPerComponent> must be defined.

The <UnitsPerComponent> node contains individual <Component> nodes with the attributes name and out_unit. The name attribute corresponds to the component name, and the out_unit attribute has the same requirements as this attribute.

<UnitsPerComponent>
     <Component name="XXX" out_unit="XXX" />
     <Component out_unit="XXX" />
</UnitsPerComponent>
  • no_units

  • acceleration

  • angle

  • angular_velocity

  • area

  • capacitance

  • charge

  • charge_density

  • conductivity

  • current

  • current_density

  • density

  • displacement

  • electric_conductivity

  • electric_field

  • electric_flux_density

  • electric_resistivity

  • energy

  • film_coeff

  • force

  • force_intensity

  • frequency

  • heat_flux

  • heat_generation

  • heat_rate

  • inductance

  • inverse_stress

  • length

  • magnetic_field_intensity

  • magnetic_flux

  • magnetic_flux_density

  • mass

  • moment

  • moment_inertia

  • permeability

  • permittivity

  • poisson

  • power

  • pressure

  • relative_permeability

  • relative_permittivity

  • section_modulus

  • specific_heat

  • specific_weight

  • shear_strain

  • stiffness

  • strain

  • stress

  • strength

  • thermal_expansion

  • temperature

  • time

  • velocity

  • voltage

  • volume

  • gasket_stiffness

  • moment_inertia_mass

  • psd_acceleration

  • psd_acceleration_grav

  • psd_displacement

  • psd_velocity

  • rotational_damping

  • rotational_stiffness

  • translational_damping

  • angular_acceleration

  • seedbeck_coefficient

  • decay_constant

  • fracture_energy

  • shock_velocity

  • energy_density_mass

  • electric_conductance_per_unit_area

  • psd_stress

  • psd_strain

  • psd_force

  • psd_moment

  • psd_pressure

  • force_per_angular_unit

  • impulse

  • impulse_per_angular_unit

  • temperature_difference

  • material_impedance

  • rs_acceleration

  • rs_acceleration_grav

  • rs_displacement

  • rs_velocity

  • warping_factor

  • thermal_conductance

  • inverse_length

  • inverse_angle

  • thermal_capacitance

  • normalized_value

  • mass_flow_rate

  • unitless

  • stress_intensity_factor

  • sqrt_length

  • energy_per_volume

  • thermal_gradient

style (type string enumerate)

The style of the value:

  • scalar

  • vector

  • tensor

  • tensor_strain

  • euler_angles

  • coordinate

  • shear_moment_diagram

num_comp (type integer)

Number of components, between 1 and the length of comp_labels.

comp_labels (type string enumerate)

The component labels:

  • XYZLABELS

  • STRESSLABELS

  • CONTACTLABELS

  • BEAMLABELS

  • GASKETLABELS

  • NLLABELS

  • MISCLABELS

  • SENGLABELS

  • SPRINGLABELS

  • BEAM188LABELS

  • RADIOSITYLABELS

  • EULERLABELS

  • BEAMRXLABELS

  • THERMALMASSLABELS

  • SHELLMBPLABELS

  • SLASHPNUMLABELS

  • CINTLABELS

  • PRIN_S_LABELS

  • PDMG_LABELS

  • PFC_LABELS

  • CDM_LABELS

  • CONTDEBONDLABELS

  • BEARINGLABELS

  • BLANKLABELS

description (type string)

Free text.

Once the <Result> node is defined, the <Codes> node with the individual <Code> child nodes are defined. The <Codes> node can have the following attributes:

hasShell (type string)

If present and value = true, the layer attribute should be defined.

layer (type integer)

Only necessary if hasShell is set to true.

  • 1 - bottom

  • 2 - middle

  • 3 - top


Note:  It is possible to have a <Codes> node without any child <Code> nodes. It can be used to define a result with layers but no associated codes for those layers, for example TEMP_UPSHELL.


The <Code> child nodes can have the following attributes:

name (type string)

Value of the Samcef solver code, generally of the form "Code XXX" or "Sdb XXX".

module (type string)

Optional, if set, defines the code only for a specific Samcef module. Possible values are:

  • ba - bacon

  • me - mechano

  • as - asef

  • st - stabi

  • dy - dynam

  • mt - mechano/thermal

  • re - repdyn

Limitations
  • If the XML of the configuration file is missing or not well-formed, no results are available.

  • If a result has invalid syntax (missing XML components, invalid attributes), it is not available.

  • Mechanical must be restarted if any changes are made to the result configuration file during operation.