Skip to content

Add a common calculation interface (strategy pattern) for ISO, AGMA and FEM #16

Open

Description

@efirvida

What do you need

A common calculation interface where each calculation method is an interchangeable strategy: ISO 6336, AGMA 2001/2101 and the CalculiX FEM model. One entry point would take a Transmission and a strategy and return results in a shared shape, so a study can switch method without rewriting the calling code.

Today each method has its own functions and result types:

  • iso6336.calculate_pitting(pair) / calculate_bending(pair)
  • agma2101.calculate_pitting(pair) / calculate_bending(pair)
  • fem.solve_contact(...), fem.solve_bending(...), fem.post.contact_sweep(...)

Comparing methods, for example in the optimization case study (original vs. ISO-optimum vs. AGMA-optimum, each rated by both standards and by FEM), needs method-specific glue each time.

Requested scope:

  • A small strategy protocol (for example evaluate(transmission) -> result) implemented by an ISO strategy, an AGMA strategy and a FEM strategy.
  • A single method to run any of them, returning a common result view (contact stress or pressure, root stress, and safety factors where the method defines them) while keeping the method-specific result reachable.
  • No change to the existing public functions, result types or behavior. The new interface is an additive layer over them.
  • Methods stay honest about what they cannot provide. For example, FEM returns stresses without safety factors, and AGMA safety factors stay unavailable without qualified material stress numbers. Missing quantities must be explicit, not filled in or converted.

Standard, edition and clause

No new formulas. The strategies wrap the existing ISO 6336-2:2019 / ISO 6336-3:2019 and AGMA 2001-D04 / 2101-C95 implementations, and the existing CalculiX model. FEM output (nominal loading, 2D plane strain, frictionless) is not equivalent to factored rating stresses, and the interface must not present it as such.

How could it be validated

  • For ISO and AGMA, the strategy results equal the existing calculate_pitting / calculate_bending results exactly for the README pair.
  • For FEM, the strategy results equal the existing solve_contact / contact_sweep results for the same inputs (CalculiX test skipped when ccx is not installed, as today).
  • Existing public API tests pass unchanged.
  • A worked example evaluates one transmission with all three strategies through the single method and reports what each one provides and what it does not.
  • Unavailable quantities are reported as explicitly unavailable, with a test per method.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions