*sphgenerate_new

Generates SPH elements with various options.

Syntax

*sphgenerate_new entity_type mark_id string_array number_of_strings

Type

HyperMesh Tcl Modify

Description

Generates SPH particles within bounded, semi-watertight (some small gaps less than pitch size allowed), regions. The relative placement of these particles is specified using the pitch distance and the fill method parameters. The region(s) can be specified using elements, elements belonging to components, and either geometric surfaces or solids. The amount and direction of fill can also be specified. The mass of each resulting particle is calculated using either an input density or the total mass of the filled space. Full SPH functionality is available for RADIOSS, LS-DYNA and PAM-CRASH user profiles. Execution is supported in other profiles, without the creation of solver data.

Inputs

entity_type
The type of entity that defines the volumes. Valid values are elements, comps (elements only), surfs or solids.
mark_id
The ID of the mark containing the input entities. Valid values are 1 and 2.
string_array
The ID of the string array that contains the array of meshing parameters. The string array is created using the *createstringarray command. This should always be set to 1.
String names must be followed by a : (e.g. Config:). Valid strings and values are:
Config
Indicates how the particles are located relative to each other. Valid values are:
  • 0 – Simple cubic
  • 1 – Face centered cubic
ElemToComps
Specifies the organization of the SPH components. Valid values are:
  • 0 – Create elements in current component
  • 1 – Create elements in new component
  • 2 – Create elements in new component per cavity
MassType
Indicates how the mass of each resulting particle is calculated. Valid values are:
  • 0 – Using the specified density of the material in conjunction with the occupied volume and the number of created particles.
  • 1 – By dividing the specified total mass by the number of created particles.
MassDensity
If MassType is 0, this is the density of the material.
If MassType is 1, this is the total mass of the particles.
PartialFill
An option to fill the volume partially. This string contains six values in a fixed sequence as "is_partial_fill is_percent_or_depth fillpercent_or_depth filldir_x filldir_y filldir_z".
is_partial_fill
  • 0 - Fill volume fully
  • 1 - Fill volume partially.
is_percent_or_depth
  • 0 - Fill by percentage of volume. Used when is_partial_fill is 1.
  • 1 - Fill by depth of volume. Used when is_partial_fill is 1.
fillpercent_or_depth
The percentage value when is_percent_or_depth is 0, or the depth level when is_percent_or_depth is 1.
filldir_x
Fill direction vector x component.
filldir_y
Fill direction vector y component.
filldir_z
Fill direction vector z component.
PitchSize
The numerical value of the pinch distance.
Reference
Specifies an optional reference used to align the SPH grid. This string contains five values in a fixed sequence as use_ref_origin ref_origin_x ref_origin_y ref_origin_z ref_system_id.
use_ref_origin
  • 0 – Do not align to a reference.
  • 1 – Align the grid to the specified reference.
ref_origin_x
The x-coordinate of the reference origin.
ref_origin_y
The y-coordinate of the reference origin.
ref_origin_z
The z-coordinate of the reference origin.
ref_system_id
The ID of the reference coordinate system.
VolumeType
Specifies the volume(s) to be considered for meshing. This string contains four values in a fixed sequence as volume_type nth_largest_index enclosed_vol_node_mark exclude_vol_node_mark.
volume_type
  • 0 – All volumes are considered.
  • 1 – Nth largest volume only considered as given by nth_largest_index.
  • 2 – Enclosed volumes are considered which contains nodes by enclosed_vol_node_mark.
  • 3 – Exclude volumes from meshing which contain nodes specified by exclude_vol_node_mark.
nth_largest_index
The volume index to be meshed (starting with 1). Volumes are sorted based on descending order of volume. Used when volume_type is 1.
enclosed_vol_node_mark
The ID of the mark containing nodes within enclosed volumes to consider. Valid values are 1 and 2. Used when volume_type is 2.
exclude_vol_node_mark
The ID of the mark containing nodes within volumes to exclude. Valid values are 1 and 2. Used when volume_type is 3.
WallClearance
The wall clearance distance for which particles will not be created.
WallOffset
The wall offset distance for which particles will be created.
number_of_strings
Integer indicating the size (number of strings) in the string array created using *createstringarray. This must equal the number of columns in the table.

Example

To generate SPH elements for all components and all volumes, using a pitch size of 1, partial filling with a depth of 50 along the y direction with a reference location of (35.0, 11.0, -5.0) , a wall clearance of 0.1 and a wall offset of 30:

*createmark components 1 all
*createstringarray 10 "PitchSize: 1" "Config: 0" "MassType: 0" "MassDensity: 1" "PartialFill: 1 1 50 0 1 0" "Reference: 1 35.0 11.0 -5.0 0" "VolumeType: 0 0 0 0" "WallClearance: 0.1" "WallOffset: 30" "ElemToComps: 1"
*sphgenerate_new components 1 1 10

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

14.0.110

2017 Execution in all user profiles now supported, without the creation of solver data.