morphogen.dynamics.model

The model of an explicit dynamic simulation of a morphology: the unit system of its inputs (UnitSystem), the materials of its phases (ExplicitMaterial), its loading (ExplicitLoading), its mesh (explicit_mesh()) and the stable time step of that mesh (critical_time_step()), from which the cost of a run is known before it starts.

OpenRadioss has no unit system of its own: the values are given in a consistent system, which the Starter input names (/BEGIN) so that the solver knows it, e.g. Mg, mm and s: stresses in MPa, densities in Mg/mm³ (7.85e-9 for a steel), velocities in mm/s, forces in N and energies in mJ. UnitSystem.from_si() converts values given in SI units (a density of 7850 kg/m³, a speed of 10 m/s) into the system.

morphogen.dynamics.model.MASS_UNITS = {'Mg': 1000.0, 'g': 0.001, 'kg': 1.0, 'mg': 1e-06, 'ug': 1e-09}

The units of mass, length and time that the Starter of Radioss names (/BEGIN), by their value in kg, m and s

morphogen.dynamics.model.LOADINGS = ('compression', 'tension', 'shear', 'impact')

The kinds of loading of ExplicitLoading

class morphogen.dynamics.model.UnitSystem(mass: str = 'Mg', length: str = 'mm', time: str = 's')[source]

Bases: object

A consistent system of units of mass, length and time, named as Radioss names them (MASS_UNITS, LENGTH_UNITS, TIME_UNITS): every value of the inputs is given in it, stresses in mass / (length time²), densities in mass / length³, velocities in length / time.

classmethod parse(value) → UnitSystem[source]

A system from three names ("Mg mm s", ("kg", "mm", "ms")) or itself.

property names: tuple[str, str, str]
si(quantity: str) → float[source]

The value in SI units of the unit of quantity in this system: mass, length, time, density, stress, velocity, force, energy or strain_rate.

from_si(value, quantity: str)[source]

value given in SI units, in this system (a number or an array).

to_si(value, quantity: str)[source]

value given in this system, in SI units (a number or an array).

unit(quantity: str) → str[source]

The name of the unit of quantity (e.g. "MPa"; "Mg/mm³").

describe() → str[source]

The system and its derived units, in words.

class morphogen.dynamics.model.JohnsonCook(a: float, b: float = 0.0, n: float = 1.0, c: float = 0.0, rate: float = 1.0, max_stress: float | None = None)[source]

Bases: object

The yield stress of Johnson and Cook, (a + b p^n) (1 + c ln(ṗ / ṗ0)) (p the plastic strain), Radioss’s LAW2 without its terms of temperature: a the yield stress, b and n the hardening, c the sensitivity to the strain rate above the reference rate rate (ṗ0, in 1 / time), max_stress a cap of the yield stress (none by default).

yield_stress(strain, rate: float = 0.0) → ndarray[source]

The yield stress at the plastic strains strain and the strain rate.

classmethod from_config(spec) → JohnsonCook[source]

{a, b, n, c, rate, max_stress} (aliases A, B, C, reference_rate).

morphogen.dynamics.model.NORTON_RATES = (0.0, 0.0001, 0.001, 0.01, 0.1, 1.0, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0)

The strain rates (in 1 / time) of the yield curves of a viscoplastic material (Norton’s overstress tabulated at each, LAW36 interpolating between them)

morphogen.dynamics.model.CURVE_STRAINS = (0.0, 0.00125, 0.005, 0.01125, 0.02, 0.03125, 0.045, 0.06125, 0.08, 0.10125, 0.125, 0.15125, 0.18, 0.21125, 0.245, 0.28125, 0.32, 0.36125, 0.405, 0.45125, 0.5, 0.55125, 0.605, 0.66125, 0.72, 0.78125, 0.845, 0.91125, 0.98, 1.05125, 1.125, 1.20125, 1.28, 1.36125, 1.445, 1.53125, 1.62, 1.71125, 1.805, 1.90125, 2.0)

The plastic strains of the tabulated yield curves (denser near 0, where the saturating terms bend)

class morphogen.dynamics.model.ExplicitMaterial(young: float, poisson: float, density: float, plasticity: object | None = None, johnson_cook: JohnsonCook | None = None, failure_strain: float | None = None)[source]

Bases: object

The material of a phase in an explicit dynamic simulation: isotropic elasticity (young, poisson) and its density (mass / length³), elastic (Radioss’s LAW1), or elastoplastic: von Mises with the isotropic hardening of morphoGen’s Plasticity (the yield stress R0, the linear hardening H, the terms Q (1 - exp(-b p)); Norton’s viscosity K ṗ^(1/n) as yield curves at several strain rates, NORTON_RATES), tabulated in LAW36, or the law of Johnson and Cook (JohnsonCook, LAW2). failure_strain: the plastic strain at which an element fails and is deleted (none by default).

property law: str

LAW1, LAW2 or LAW36.

Type:

The law of Radioss that it is written as

property wave_speed: float

The speed of the longitudinal (dilatational) waves, sqrt(M / ρ), M the P-wave modulus.

yield_curve(strains=None, rate: float = 0.0) → ndarray[source]

The yield stress at the plastic strains strains (by default CURVE_STRAINS) and the plastic strain rate rate (its plastic law).

rates() → tuple[float, ...][source]

The strain rates of its tabulated yield curves: several for a viscoplastic material, one (0) otherwise.

to_config() → dict[source]
classmethod from_config(spec, *, density: float | None = None) → ExplicitMaterial | None[source]

A material from its configuration: the keys of morphoGen’s materials (from_config(): young and poisson or bulk and shear, density, plasticity), johnson_cook (JohnsonCook.from_config()) and failure_strain; "void" (or a void material) gives None. density: the density of a material that gives none. Its thermal properties are not used.

morphogen.dynamics.model.explicit_materials(spec, *, density: float | None = None) → dict[int, ExplicitMaterial | None][source]

The material of each phase (None for the voids) from a mapping phase -> material (ExplicitMaterial.from_config(); the phases may be strings).

class morphogen.dynamics.model.ExplicitLoading(kind: str = 'compression', axis: int = 2, strain: float = 0.2, strain_rate: float = 100.0, shear_axis: int | None = None, velocity: float = 0.0, duration: float | None = None, ramp: float = 0.05, lateral: str = 'fixed', contact: bool = True, friction: float = 0.0)[source]

Bases: object

The loading of a morphology in an explicit dynamic simulation.

  • compression and tension: the lower face normal to axis held along it, the upper face driven along it at the nominal strain rate strain_rate (in 1 / time) up to the nominal strain;

  • shear: the lower face held, the upper face driven along shear_axis (by default the next axis) at the rate strain_rate up to the engineering shear strain, held along the other axes;

  • impact: the morphology thrown at velocity (length / time) along -axis against a fixed rigid wall at its lower face, for duration (by default the time to travel strain times its length at that velocity).

The driven velocities grow smoothly from 0 over the share ramp of the duration, which tempers the first waves. lateral: fixed (the loaded faces held across the axis, as by bonded platens) or free (they slide freely across it, a node of the lower face held against drifting); contact: the self contact of the outer surface of the solid (folding struts, cells closing; Radioss’s TYPE24) with the friction coefficient.

property driven: int

The axis along which the upper face is driven.

speed(lengths) → float[source]

The speed of the upper face once the ramp is over (that of the impact).

sign() → float[source]

The direction of the motion along driven: -1 for a compression and an impact (toward the lower face), +1 otherwise.

end_time(lengths) → float[source]

The duration of the simulation: the nominal strain reached at the rate after the ramp (whose smooth step travels half as far as at full speed).

velocity_function(end_time: float, points: int = 11) → ndarray[source]

The velocity of the upper face over time, a share of speed(): the smooth step 3 s² - 2 s³ (s = t / t_ramp) over the ramp, then 1 (to ten times the end, so that the solver never extrapolates); rows (t, share).

displacement(times, lengths) → ndarray[source]

The displacement of the upper face along driven at times (signed; the impact: the distance travelled at the initial velocity).

to_config() → dict[source]
classmethod from_config(spec) → ExplicitLoading[source]

A loading from its configuration (the fields, axes as x, y, z).

morphogen.dynamics.model.explicit_mesh(micro, materials: dict, *, mesh: str = 'voxels', resolution: int = 24, element_size: float | None = None, order: int = 1)[source]

The mesh of a morphology for an explicit simulation, of its phases that are not voids (materials: phase -> ExplicitMaterial or None): "voxels", 8-node hexahedra of its voxel image of resolution voxels along its longest edge (morphogen.mesh.voxel.voxel_mesh()), or "conforming", tetrahedra of order 1 or 2 conforming to its level set, element_size the largest (morphogen.mesh.conforming_mesh(); 1/12 of the longest edge by default).

morphogen.dynamics.model.element_lengths(mesh) → ndarray[source]

The characteristic length of each element of a mesh: the smallest edge of the voxels of a voxel mesh; the smallest altitude (3 V / the largest face) of the tetrahedra, halved for the quadratic ones (whose nodes lie twice as close).

morphogen.dynamics.model.critical_time_step(mesh, materials: dict, *, scale: float = 0.9) → float[source]

The stable time step of an explicit integration of a mesh, about: scale times the smallest time of a longitudinal wave across an element (its characteristic length, element_lengths(), over the wave speed of its material). Radioss computes its own, a little smaller with its bulk viscosity.