gearbox.fem.calculix#

Finite-element analysis of gears with CalculiX.

The meshes come from gearbox.fem.mesh. Units are mm, N and MPa. CalculiX is an external program: install it with conda install -c conda-forge calculix and either put ccx on the PATH, set the GEARBOX_CCX environment variable or pass its location explicitly.

CONTACT_SETTINGS = ToothMeshSettings(root_size=0.2, fillet_size=0.05, flank_size=0.015, tooth_elements=16, rim_elements=None, surface_growth=1.2, variant='fillet_block', fillet_angle=30.0, cross_angle=30.0, width_elements=None, order=1, bore_diameter=None)#

flank elements fine enough for the Hertzian band.

Type:

Default mesh of solve_contact()

class BendingResult[source]#

Bases: object

Result of solve_bending().

max_principal_stress#

Largest first principal stress at the fillet nodes of the loaded tooth [MPa]; this is the tensile root stress.

Type:

float

max_von_mises_stress#

Largest von Mises stress at the same nodes [MPa].

Type:

float

max_displacement#

Largest nodal displacement magnitude [mm].

Type:

float

applied_force#

Normal force applied to the flank [N] (per unit width in 2D).

Type:

float

reaction_torque#

Moment of the reactions at the bore about the gear axis [N*mm] (per unit width in 2D).

Type:

float

applied_torque#

Ft * r_pitch, the torque the load stands for (per unit width in 2D); it must equal reaction_torque. The reaction force itself is not a good check for helical gears: the pressure vectors turn with the helix, so their sum is smaller than the applied force.

Type:

float

load_radius#

Mean radius of the loaded flank patch [mm].

Type:

float

load_faces#

Number of boundary faces of the loaded patch.

Type:

int

mesh#

The mesh that was solved.

Type:

GearMesh

files#

Paths of the files written (deck, frd, dat, log).

Type:

dict[str, Path]

stresses#

Nodal stress components of the solution, {node: (sxx, syy, szz, sxy, syz, szx)}.

Type:

dict[int, tuple[float, …]]

__init__(max_principal_stress, max_von_mises_stress, max_displacement, applied_force, reaction_torque, applied_torque, load_radius, load_faces, mesh, files=<factory>, stresses=<factory>)#
class ContactResult[source]#

Bases: object

Result of solve_contact().

The stress and pressure summaries are scaled from the torque reached by the last CalculiX run to the requested torque: stresses in proportion to the torque, the contact pressure in proportion to its square root (Hertz). The two torques differ by at most tolerance.

max_contact_pressure#

Largest contact pressure on the flanks [MPa]; the Hertzian pressure sigma_H of the meshing teeth.

Type:

float

contact_radius#

Radius of the pinion point with that pressure [mm].

Type:

float

contact_nodes#

Number of pinion flank nodes in contact.

Type:

int

max_root_stress_pinion#

Largest first principal stress at the fillet nodes of the pinion [MPa].

Type:

float

max_root_stress_wheel#

Same for the wheel [MPa].

Type:

float

max_von_mises_stress#

Largest von Mises stress of the model [MPa].

Type:

float

applied_torque#

Pinion torque reached by the last run [N*mm] (per unit width in 2D).

Type:

float

requested_torque#

Ft * d1 / 2 (divided by the face width in 2D).

Type:

float

bore_rotation#

Rigid rotation of the pinion bore that gives that torque [rad].

Type:

float

mesh_position#

Rotation of the pinion from the symmetric mesh position, the pinion_rotation of mesh_pair() [deg].

Type:

float

runs#

CalculiX runs needed to reach the torque.

Type:

int

mesh#

The mesh that was solved.

Type:

GearMesh

files#

Paths of the files of the last run (mesh, deck, frd, dat, log).

Type:

dict[str, Path]

stresses#

Nodal stress components of the last run (at applied_torque, not scaled), {node: (sxx, syy, szz, sxy, syz, szx)}.

Type:

dict[int, tuple[float, …]]

contact_pressure#

Contact pressure of the last run at the pinion flank nodes (not scaled), {node: pressure}.

Type:

dict[int, float]

displacements#

Nodal displacements of the last run (not scaled), {node: (ux, uy, uz)}. The contact happens in the displaced position: the pinion turns by bore_rotation, tens of micrometres at the flank.

Type:

dict[int, ndarray]

__init__(max_contact_pressure, contact_radius, contact_nodes, max_root_stress_pinion, max_root_stress_wheel, max_von_mises_stress, applied_torque, requested_torque, bore_rotation, mesh_position, runs, mesh, files=<factory>, stresses=<factory>, contact_pressure=<factory>, displacements=<factory>)#
class ElasticMaterial[source]#

Bases: object

Linear elastic isotropic material.

youngs_modulus#

Young’s modulus [MPa].

Type:

float

poisson_ratio#

Poisson’s ratio.

Type:

float

__init__(youngs_modulus=206000.0, poisson_ratio=0.3)#
find_ccx(path=None)[source]#

Locate the CalculiX executable.

An explicit path is used as given; otherwise the GEARBOX_CCX environment variable and then the PATH are searched.

Raises:

FileNotFoundError – If CalculiX cannot be found.

Return type:

Path

solve_bending(subject, output_dir, tangential_force=None, model_name='bending', dimension=Dimension.THREE_D, settings=None, teeth=3, side='ccw', load_radius=None, load_height=None, material=None, member='pinion', ccx=None)[source]#

Bending of a tooth loaded on its flank, with the bore fixed.

Given a Transmission, the tooth of its pinion (or of its wheel, see member) carries the nominal tangential force of the transmission at the outer point of single pair contact, where ISO 6336-3 loads it: the point D of the line of action for the pinion, B for the wheel (see gearbox.fem.post.LineOfAction). Given a bare Gear, there is no mesh to take these from: the force is required and the band ends at the tooth tip unless load_radius says otherwise.

A sector of teeth consecutive teeth is meshed and the middle tooth is loaded by a uniform pressure normal to the flank, on the faces overlapping a band of height load_height that ends at load_radius (so at least one ring of faces is loaded). The normal force is Ft / (cos(alpha_t) * cos(beta_b)) in 3D and Ft / (b * cos(alpha_t)) per unit width in 2D (plane strain), the force that gives the nominal tangential force Ft at the reference circle. The helical contact line is not modelled: the band is a circle of constant radius across the face width.

Parameters:
  • subject (Transmission | Gear) – A transmission, or a single gear (never modified).

  • output_dir (str | Path) – Folder for the mesh, the deck and the results, created if missing.

  • tangential_force (float | None) – Nominal tangential force Ft over the face width [N]; the nominal_tangential_force of a transmission by default, required for a gear.

  • model_name (str) – Base name of the files; spaces are replaced by underscores.

  • dimension (Dimension | str | int) – "3D" (hexahedra) or "2D" (plane strain, quadrilaterals).

  • settings (ToothMeshSettings | None) – Mesh settings, ToothMeshSettings defaults if omitted.

  • teeth (int) – Teeth in the sector, 3 or more recommended.

  • side (str) – "ccw" or "cw", the flank of the middle tooth that is loaded.

  • load_radius (float | None) – Radius where the loaded band ends [mm]. By default the band is centred on the outer point of single pair contact for a transmission and ends at the tip for a gear.

  • load_height (float | None) – Radial height of the loaded band [mm]; 0.1 modules for a transmission, 0.15 for a gear by default.

  • material (ElasticMaterial | None) – Elastic properties, steel by default.

  • member (str) – "pinion" or "wheel", the gear of a transmission that is analysed.

  • ccx (str | Path | None) – Location of the CalculiX executable, see find_ccx().

Returns:

A BendingResult.

Raises:
Return type:

BendingResult

solve_contact(transmission, output_dir, tangential_force=None, model_name='contact', dimension=Dimension.TWO_D, settings=None, teeth=(3, 4), pinion_rotation=None, materials=None, contact_stiffness=100.0, tolerance=0.05, initial_rotation=None, ccx=None)[source]#

Contact between the teeth of a gear pair loaded by a torque.

The pair is meshed with mesh_pair(), by default in the position where the flanks touch at the pitch point (pinion_rotation=None). The bore of the wheel is fixed and the bore of the pinion is turned rigidly counter-clockwise, so the pinion drives on the flank that leads in that direction. CalculiX solves the frictionless contact with a penalty (surface-to-surface, linear pressure-overclosure). The rotation is adjusted, one CalculiX run at a time, until the reaction torque of the pinion is within tolerance of Ft * d1 / 2; one or two runs are usually needed. The results are then scaled to that torque, see ContactResult.

With the default mesh and penalty, the contact pressure of a spur pair at the pitch point agrees with Hertz’ theory within 1 % (tests/test_fem_calculix.py); a coarser flank mesh or a softer penalty widen the contact band and change the peak by 10 % or more.

Parameters:
  • transmission (Transmission | Sequence[Gear]) – A transmission, or a (pinion, wheel) sequence of gears.

  • output_dir (str | Path) – Folder for the mesh, the deck and the results, created if missing.

  • tangential_force (float | None) – Nominal tangential force Ft at the reference circle of the pinion [N]; Transmission.nominal_tangential_force by default.

  • model_name (str) – Base name of the files; spaces are replaced by underscores.

  • dimension (Dimension | str | int) – "2D" (plane strain, per unit of the smaller face width) or "3D".

  • settings (ToothMeshSettings | Sequence[ToothMeshSettings] | None) – Mesh settings, one for both gears or a (pinion, wheel) pair; CONTACT_SETTINGS by default. The flank elements must be several times smaller than the Hertzian contact width.

  • teeth (tuple[int, int]) – Teeth meshed on the (pinion, wheel). The default puts two teeth of each gear on either side of the contact; a loaded tooth at the end of a sector is too weak.

  • pinion_rotation (float | None) – Mesh position, see mesh_pair() [deg]; None puts the contact at the pitch point.

  • materials (ElasticMaterial | Sequence[ElasticMaterial] | None) – Elastic properties, one for both gears or a (pinion, wheel) pair; the elastic_modulus and poissons_ratio of the gear materials by default.

  • contact_stiffness (float) – Penalty stiffness of the contact, in Young’s moduli per mm.

  • tolerance (float) – Largest relative difference between the reached and the requested torque.

  • initial_rotation (float | None) – First guess of the rotation of the pinion bore [rad], for instance the bore_rotation of a result at a nearby mesh position; estimated from a typical mesh stiffness if omitted.

  • ccx (str | Path | None) – Location of the CalculiX executable, see find_ccx().

Returns:

A ContactResult.

Raises:
Return type:

ContactResult