morphogen.dynamics¶
Explicit dynamics with OpenRadioss: crushing, tension, shear and impacts of a morphology at the rates of crashes, shocks and drops.
morphoGen writes the inputs of the explicit finite element solver OpenRadioss for the
mesh of a morphology (its voxels or a conforming mesh of its level set), the materials of
its phases and a loading (morphogen.io.radioss), runs them (run_openradioss(),
an installation found or installed by install_openradioss()) and reads the results
back (read_explicit_run()): the nominal stress-strain curves of its faces, its
energies and its fields over time. explicit_test() does it all.
>>> from morphogen import dynamics
>>> test = dynamics.explicit_test(micro, {0: "void", 1: {"young": 70e3, "poisson": 0.3,
... "density": 2.7e-9, "plasticity": {"yield": 200, "hardening": 500}}},
... {"kind": "compression", "strain": 0.5, "strain_rate": 500}, "crush")
>>> dynamics.summary(test.result)["plateau stress (20-40 %)"]
Public names¶
ExplicitFrame— An animation of a run on the mesh of the run: its time, the displacement and reaction force of each node (None when the animation has none), the fields of the elements and their status (1 active, 0 deleted).ExplicitLoading— The loading of a morphology in an explicit dynamic simulation.ExplicitMaterial— The material of a phase in an explicit dynamic simulation: isotropic elasticity (young,poisson) and itsdensity(mass / length³), elastic (Radioss’s LAW1), or elastoplastic: von Mises with the isotropic hardening of morphoGen’sPlasticity(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).ExplicitResult— The results of a run (see the module): itsmanifest, itsmesh(nodes, elements, phases and loaded faces), itscurves(time, displacement, strain, forces and nominal stresses of the upper and lower faces), itsenergies(time -> internal, kinetic… when the time history gives them), itsframesand thesourceof its forces.JohnsonCook— 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:athe yield stress,bandnthe hardening,cthe sensitivity to the strain rate above the reference raterate(ṗ0, in 1 / time),max_stressa cap of the yield stress (none by default).OpenRadioss— An installation of OpenRadioss: its folder (root), the Starter, the Engine (and its MPI version), the converters of its outputs when it has them, the suffix of the names of its executables (linux64_gf,win64…) and the release installed (wheninstall_openradioss()installed it).RadiossRun— A run of OpenRadioss in itsdirectory: its animations converted to legacy VTK files (frames, in their order), its time history converted to CSV (history, None withoutth_to_csv), its listings and the time it took (s).UnitSystem— 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.convert_outputs— Convert the outputs of a run: each animation to a legacy VTK file (anim_to_vtk,<name>A001.vtk…) and the time history to CSV (th_to_csv); the outputs already converted are kept. A converter missing from the installation is skipped with a warning of the run.critical_time_step— The stable time step of an explicit integration of a mesh, about:scaletimes 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.default_home— The folder whereinstall_openradioss()installs OpenRadioss by default.element_lengths— 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).explicit_materials— The material of each phase (None for the voids) from a mapping phase -> material (ExplicitMaterial.from_config(); the phases may be strings).explicit_mesh— The mesh of a morphology for an explicit simulation, of its phases that are not voids (materials: phase ->ExplicitMaterialor None):"voxels", 8-node hexahedra of its voxel image ofresolutionvoxels along its longest edge (morphogen.mesh.voxel.voxel_mesh()), or"conforming", tetrahedra oforder1 or 2 conforming to its level set,element_sizethe largest (morphogen.mesh.conforming_mesh(); 1/12 of the longest edge by default).find_openradioss— The installation of OpenRadioss atpath(its folder, itsexecfolder or its Starter), else the first found in the places of the module; raises FileNotFoundError, saying how to install it, when there is none.has_openradioss— Whether an installation of OpenRadioss is found.install_openradioss— Download the releasetagof OpenRadioss (the latest by default) for this system from GitHub and unpack it intotarget(~/morphogen/openradiossby default), which replaces an earlier installation there; returns the installation. Releases are published for Linux (x86-64, ARM) and Windows; elsewhere OpenRadioss is built from its sources.progress(fraction, message)follows the download.read_explicit_run— The results of a run of OpenRadioss indirectory(see the module), from its manifest and mesh (morphogen.io.write_radioss()), its animations converted to VTK and its time history converted to CSV (morphogen.dynamics.convert_outputs()).release_asset— The archive of a release (release_info()) for this system and machine.release_info— The releasetagof OpenRadioss on GitHub (the latest by default): its name, tag and archives (assets: name, size, URL).run_openradioss— Run the inputs written indirectory(morphogen.io.write_radioss()): the Starter, then the Engine withthreadsOpenMP threads (all the cores by default) or onmpiprocesses (mpiexecand the Engine built with MPI), then the conversion of the animations and of the time history (convert).summary— The values that sum a run up, in the units of the run: the final and peak nominal stresses and strains, the energy absorbed per unit volume of the box (the integral of the nominal stress over the nominal strain) and per unit mass, the mean gap between the stresses of the two faces over the second half of the run (the equilibrium of a quasi-static test: small when the waves have settled), the plateau stress (the mean between 20 and 40 % strain, after Ashby) and the densification strain (where the energy efficiency, the absorbed energy over the stress, peaks: Avalle et al., 2001) of a crushing; for an impact, the peak force on the wall and the kinetic energies; the energies at the end when the time history gives them; the size of the run.write_frames— Write each animation of a run as<prefix>_0001.vtu… infolder: the elements still active (the bricks split in six tetrahedra), their phase and fields, the displacement of the nodes, the box (morphoGen’s 3D views draw the last one).write_tables— The curves and energies of a run ascurves.csvandenergies.csv.
- class morphogen.dynamics.ExplicitTest(inputs: object, run: RadiossRun | None = None, result: ExplicitResult | None = None)[source]¶
An explicit dynamic test of
explicit_test(): its inputs (RadiossInputs), its run (None when not run) and its results read back (None when not run).
- morphogen.dynamics.explicit_test(micro, materials, loading, directory, *, mesh: str = 'voxels', resolution: int = 24, element_size: float | None = None, order: int = 1, units=None, density: float | None = None, name: str | None = None, frames: int = 50, history: int = 1000, time_step: float | None = None, length_scale: float = 1.0, run: bool = True, threads: int | None = None, mpi: int | None = None, installation=None, progress=None, phase_names: dict | None = None) ExplicitTest[source]¶
An explicit dynamic test of a morphology in
directory: its mesh (explicit_mesh():mesh"voxels"ofresolutionvoxels along its longest edge, or"conforming"tetrahedra ofelement_sizeandorder), the inputs of OpenRadioss (morphogen.io.write_radioss():materialsa mapping phase -> material,explicit_materials(),densitythat of the materials that give none;loadinganExplicitLoadingor its configuration; every value in theunits, aUnitSystem, Mg mm s by default, the lengths of the morphology timeslength_scale), then, withrun, their run (run_openradioss()) and their results (read_explicit_run()).progress(fraction, message)follows the run.