Skip to main content

Module simulations

Module simulations 

Source
Expand description

Simulation management (FEA, CFD, …).

A simulation is an item of type simulation with the usual lifecycle, revisions, check-out/check-in and change orders. Its files are the model, the solver deck, selected results, the report and pictures. On top of that a simulation revision has

  • basis links – the item revisions it was computed with and, optionally, the exact file version (role geometry, mesh, material, load case or other). They belong to the simulation revision like BOM lines: changed only while it is checked out, copied by Revise and frozen at release;
  • result values – key numbers such as the maximum stress or the pressure drop with unit, optional limits (pass/fail), load case and solver. They are entered in the UI, imported from a CSV/Excel table or written by a solver script through the REST API, and can be compared between two revisions.

A simulation is out of date when a newer revision of a basis item was released, the basis revision became obsolete or the simulated file has a newer version. Releasing or obsoleting a basis also flags the simulation for a check through the change propagation (impacts, relation simulation); acknowledging that check means “still valid, because …”.

Structs§

AttentionSimulation
A simulation whose latest revision has failed result values or is out of date.
BasedSimulation
A simulation based on a revision of an item (the other side of a basis link), shown on the part or assembly.
BasisPrefill
What the new-simulation form takes over from a basis revision.
CompareSummary
Counts of a comparison.
ImportSummary
What an import of result values did.
NewBasis
NewItemFor
The input of create_with_basis.
ResultDiff
One result value in either revision.
ResultInput
A result value as entered or imported.
ResultSummary
How many values passed and failed.
SimulationBasis
A revision (and file version) a simulation revision is based on.
SimulationResult
A key result value of a simulation revision.

Constants§

GALLERY_MAX_BYTES
Largest picture shown on the simulation page (the browser loads each one).
GALLERY_MAX_IMAGES
Pictures shown on the simulation page at most.
MAX_ATTENTION_SCAN
At most this many simulations are checked for the dashboard card.
MAX_RESULTS
At most this many result values per simulation revision.

Functions§

add_basis
Adds a basis link to a simulation revision checked out by the actor.
add_result
Adds a result value to a simulation revision checked out by the actor.
based_on_item
Simulations whose latest revision is based on a revision of the item. Only simulations the actor may see; the second value counts the others.
bases
The basis links of a simulation revision the actor may read; bases the actor may not see are placeholders.
compare
Compares the result values of two revisions of the same simulation.
compare_results
Matches the values of two revisions by name and load case (pure).
compare_summary
create_with_basis
Creates a simulation item together with its first files and its basis link – the one-step counterpart of items::create_with_files followed by add_basis.
default_description
The description a new simulation gets from its basis.
default_name
The name a new simulation gets from its basis: Simulation – <name> (cut to the 200 characters of an item name).
get_basis
get_result
import_results
Writes a set of result values in one transaction: values with the same name and load case are updated, new ones appended. With replace, the values that are not in the set are removed (the set becomes the result table – what a solver script wants).
is_gallery_image
Whether a file of a simulation revision is shown as a picture in the gallery: PNG, JPEG or WebP (by file name) of at most GALLERY_MAX_BYTES. Rendered result pictures are the cheap way to show a CFD or FEA result – nothing is parsed, the browser draws the file.
needing_attention
Simulations the actor may read whose latest revision (not obsolete) has a value outside its limits or an out-of-date basis, the first limit by number, how many there are in total, and whether the scan cap was hit (the total is then a lower bound).
out_of_date_reason
What makes a basis out of date, from its stored facts (pure, see the module docs). None means the simulation still matches the basis.
parse_results_table
Reads result values from a CSV/TSV or spreadsheet table with the header name,value,unit,limit_low,limit_high,load_case (further columns: solver, solver_version, note; German names and min/max work too). Rows without a name are skipped; a value that is not a number is an error naming the row.
pick_basis_file
Picks the file of the basis revision whose current version a new simulation pins: the STEP export if there is one (the neutral geometry), else the first file of a known CAD/mesh format. files are (filename, format id); none fits → None (the revision alone is linked).
prefill_from_basis
The values the form New simulation based on … is prefilled with. A basis the actor may not read answers like a missing one (404), so the caller can fall back to the plain form without echoing anything.
remove_basis
Removes a basis link from a simulation revision checked out by the actor.
remove_result
Removes a result value from a simulation revision checked out by the actor.
resolve_basis
A basis revision the actor may read, by item number and revision code (empty or latest = the latest revision). Hidden = 404.
results
The result values of a revision the actor may read, in their order.
summarize
to_csv
The result values as CSV, in the import layout.
update_result
Changes a result value of a simulation revision checked out by the actor.