How To: Units, Geometry, & Materials

Units

The default Unit System is MKS or MeterKilogramSecond. We allow the following customizations:

  • Specify custom unit for geometry through the Scenario unit (default MKS)

  • Specify custom unit for loads (default MKS)

  • Specify custom unit for materials (default MKS)

Unit System Keywords

Mass

Force

Stress

Length

Temperature

Energy

MeterKilogramSecond

kg

N

Pa

m

K

J

CentimeterGramSecond

g

dyne

dyne/cm²

cm

K

dyne·cm

MillimeterMegagramSecond

Mg

N

MPa

mm

K

mJ

FootPoundSecond

slug

lbf

lbf/ft²

ft

Ra

lbf·ft

InchPoundSecond

lbf s²/in (slinch)

lbf

psi

in

Ra

lbf·in

Geometry

Geometry is specified through a Model object

  • MeshModel from surface mesh can be defined in two ways.

    • filename to define mesh from a file (STL, PLY)

      • instance_id a unique name

      mesh_geometry = MeshModel(filename="beam.stl")
      mesh_geometry.instance_id = "beam"
      
    • Constructing mesh face-by-face

      # define an empty mesh
      mesh_geometry = MeshModel()
      mesh_geometry.instance_id = "fixed_boundary"
      
      # add vertices to the mesh and get the vertex id as output
      v0 = mesh_geometry.addVertex([0.0, 0.0, 0.0])
      v1 = mesh_geometry.addVertex([1.0, 0.0, 0.0])
      v2 = mesh_geometry.addVertex([0.0, 1.0, 0.0])
      
      # add faces defined by the vertex id
      mesh_geometry.addFacet(v0, v1, v2)
      
    • Mesh refinement (usually used for finer interpolation of results during visualization). Uses MeshModel.refine with refinement_level as an input which is the largest allowed triangle edge as a ratio of the bounding box diagonal.

      # mesh geometry created above is further refined
      mesh_geometry.refine(refinement_level=0.02)
      
  • VDB Model

    • Using a .vdb file

      vdb_geometry= VDBModel("box.vdb")
      
    • In memory using a VDB object

      import pyopenvdb as vdb
      
      # create a vdb double grid object
      cube = vdb.DoubleGrid()
      cube.fill(min=(100, 100, 100), max=(199, 199, 199), value=1.0)
      
      # create an Intact Model from VDB object
      vdb_geometry = pyintact.VDBModel(cube)
      
      # create a tesselation of the vdb to get a MeshModel and its list of vertices for sampling
      mesh = vdb_geometry.tesselate() # mesh is a MeshModel()
      num_vertices = mesh.vertexCount()
      print(num_vertices)
      

Materials

Structural

  • IsotropicMaterialDescriptor to create an Isotropic material. (Unit is MeterKilogramSecond)

    • density is the material density

    • youngs_modulus is the elastic modulus

    • poisson_ratio is the Poisson ratio

    steel_structural = IsotropicMaterialDescriptor()
    
    # Set the density to 7845 kg/m^3, modulus to 200 GPa and poison ratio to 0.29
    steel_structural.density = 7845
    steel_structural.youngs_modulus = 200e9
    steel_structural.poisson_ratio = 0.29
    
  • OrthotropicMaterialDescriptor to create an Orthotropic material. Orthotropic materials are often used to represent composites and wood, where the material properties along one axis are significantly different from the properties along the other axes. (Unit is MeterKilogramSecond)

    • density is the material density

    • Ex is the elastic modulus in the material’s x-direction

    • Ey is the elastic modulus in the material’s y-direction

    • Ez is the elastic modulus in the material’s z-direction

    • Gxy is the shear modulus in the xy plane

    • Gxz is the shear modulus in the xz plane

    • Gyz is the shear modulus in the yz plane

    • vxy is the poisson ratio in the xy plane

    • vxz is the poisson ratio in the xx plane

    • vyz is the poisson ratio in the yz plane

    • transform is the optional material transform to arbitrarily rotate the axes along which the material properties are defined. Specified as a list of 9 floating point numbers corresponding to a 3x3 matrix. Note the first 3 floating point numbers corresponds to the first row.

    # Create an orthotropic material (Red Pine)
    material = OrthotropicMaterialDescriptor()
    material.density = 460.0             # kg/m³
    material.Ex = 11.2e9                 # Pa
    material.Ey = 492.8e6                # Pa
    material.Ez = 985.6e6                # Pa
    material.Gxy = 907.2e6               # Pa
    material.Gxz = 1.08e9                # Pa
    material.Gyz = 123.2e6               # Pa
    material.vxy = 0.315
    material.vxz = 0.347
    material.vyz = 0.308
    material.transform = [1.0, 0.0, 0.0,
                        0.0, 1.0, 0.0,
                        0.0, 0.0, 1.0] # optional in this case
    

Thermal

  • ThermalMaterialDescriptor to create a thermal material. (Default unit is MeterKilogramSecond)

    • density is the material density

    • conductivity is the conductivity of the material

    • specific_heat is the specific heat of the material

    thermal_material = ThermalMaterialDescriptor()
    
    # Set the density, conductivity, and specific heat of the material
    thermal_material.density = 2700.0 # kg/m^3
    thermal_material.conductivity = 170  # W/(m·K)
    thermal_material.specific_heat = 500  # J/(kg·K)
    
    # Optionally set the coefficient of thermal expansion when using
    # the thermal material in a thermo linear elasticity scenario.
    thermal_material.expansion_coefficient = 23.0e-6
    

Component and Assembly

  • A Component is created as a MaterialDomain and takes three inputs

    • A Model object (MeshModel or VDBModel specifically)

    • A material name

    • A ScenarioDescriptor object (see Simulation Setup)

    bar1_structural = MaterialDomain(mesh_geometry, "Steel", structural_scenario)
    bar2_structural = MaterialDomain(vdb_geometry, "Steel", structural_scenario)
    
  • Assembly is a list of components that are bonded together

    structural_assembly = [bar1_structural, bar2_structural]