Pressure (hwx.inspire)#

class Pressure(features, location=None, direction=None, magnitude=None, **kwds)#

Bases: BoundaryCondition

A pressure is a distributed force that acts perpendicular to every point along the face.

Pressures typically arise from gases or liquids pressing on a face and can act in either the inward or outward direction on a solid. To apply a distributed force to a face that acts in a single uniform direction across the entire face, use a force instead of a pressure.

Attribute Table#

Name

Type

interpolationData

property

inward

Bool

magnitude

Double

type

Enum

Example

from hwx import inspire

model = inspire.newModel()
block = model.createSolidBlock()
# apply pressure on a face feature
face = block.features[21]
pressureOnFace = inspire.Pressure(face, direction=face.normal, loadCase='current')
with inspire.usingUnits("MKS"):
  pressureOnFace.magnitude = 10.0

print("Some pressure values:")
print("Location:", pressureOnFace.location)
print("Direction:", pressureOnFace.direction)
print("Magnitude:", pressureOnFace.GetMagnitude())

# modify some pressure attributes
pressureOnFace.direction = -face.normal
with inspire.usingUnits("MKS"):
  pressureOnFace.magnitude = 50
pressureOnFace.location = [0.0, -0.5, 0.25]
inspire.fitView()

print("")
print("Pressure values after modification:")
print("Location:", pressureOnFace.location)
print("Direction:", pressureOnFace.direction)
print("Magnitude:", pressureOnFace.GetMagnitude())
property type#

The type of the pressure.

You can apply a non-uniform distributed pressure (Interpolated) using the interpolationData property.

property inward#

Returns True if pressure acts in the inward direction on the solid, False if it acts in outward direction.

property magnitude#

The magnitude of the pressure, specified in terms of force per unit area.

property interpolationData#

A list of named tuples containing the position (Point(x, y, z)) and the magnitude of the pressure in it, used to apply a non-uniform distributed pressure. To set you can pass nested iterables where the inner flattened has four elements. For example, valid inputs are [(math.Point(0, 0, 0), 100)] or [((0, 0, 0), 100)] or [(0, 0, 0, 100)].