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
Scenariounit (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
MeshModelfrom surface mesh can be defined in two ways.filenameto define mesh from a file (STL, PLY)instance_ida 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.refinewithrefinement_levelas 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
.vdbfilevdb_geometry= VDBModel("box.vdb")
In memory using a
VDBobjectimport 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
IsotropicMaterialDescriptorto create an Isotropic material. (Unit isMeterKilogramSecond)densityis the material densityyoungs_modulusis the elastic moduluspoisson_ratiois 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
OrthotropicMaterialDescriptorto 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 isMeterKilogramSecond)densityis the material densityExis the elastic modulus in the material’s x-directionEyis the elastic modulus in the material’s y-directionEzis the elastic modulus in the material’s z-directionGxyis the shear modulus in the xy planeGxzis the shear modulus in the xz planeGyzis the shear modulus in the yz planevxyis the poisson ratio in the xy planevxzis the poisson ratio in the xx planevyzis the poisson ratio in the yz planetransformis 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
ThermalMaterialDescriptorto create a thermal material. (Default unit isMeterKilogramSecond)densityis the material densityconductivityis the conductivity of the materialspecific_heatis 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
MaterialDomainand takes three inputsA
Modelobject (MeshModelorVDBModelspecifically)A material name
A
ScenarioDescriptorobject (see Simulation Setup)
bar1_structural = MaterialDomain(mesh_geometry, "Steel", structural_scenario) bar2_structural = MaterialDomain(vdb_geometry, "Steel", structural_scenario)
Assembly is a
listof components that are bonded togetherstructural_assembly = [bar1_structural, bar2_structural]