Material laws
MaterialLaws is the part of MeanFieldHomogenization that deals with one material point: a constitutive law, linear or not, that may remember its history, and that may couple several fields. With it you can
write a law in a few lines of mathematics, either as the equations of its integration over a time step or as two potentials;
test it along any loading path, a tensile test, a creep test, a cycle, an undrained compression, before using it anywhere else;
plug it into a finite-element computation, exactly where a homogenized material plugs in today;
homogenize a composite of nonlinear phases into a law of the same kind.
The consistent tangent, the coupling blocks between fields and the derivatives with respect to the parameters are computed for you, by automatic differentiation: you never write a derivative by hand.
Four pieces that do not depend on each other
| piece | the question it answers | what you write |
|---|---|---|
| the law | what is the material? | a ResidualLaw or a PotentialLaw: plain functions and a NamedTuple of parameters |
| the local algorithm | how is one step integrated? | nothing: LocalNewton is the default |
| the loading | along which path is the point driven? | a LoadingPath, each component driven by its gradient or by its flux |
| the coupling | where is the law evaluated? | point_response for one point, material_response in an element loop |
Any law runs with any algorithm, along any path, in any caller. Changing one piece never means touching another.
A first calculation
A steel bar pulled in tension, with von Mises plasticity and linear isotropic hardening. The law has five parameters; the path drives the axial strain
using MeanFieldHomogenization
law = J2Plasticity(; E = 200e3, ν = 0.3, σ₀ = 250.0, H = 2e3) # MPa
path = LoadingPath(range(0, 1; length = 51); ε11 = t -> 5e-3 * t)
r = point_response(law, path)
r[:σ11][end], r[:p][end] # axial stress (MPa) and cumulated plastic strain(257.4257425742574, 0.003712871287128713)r[:σ11] is the axial stress at every time of the path, r[:p] the cumulated plastic strain, an internal variable of the law. The lateral stresses r[:σ22] and r[:σ33] are zero, as the path asked: the driver found the lateral strains that make them vanish.
Three kinds of laws, one tool
| kind | what changes | example shipped |
|---|---|---|
| a law of the strain alone | nothing is remembered | LinearElasticity, PowerLawElasticity |
| a law with internal variables and their evolution | the state carries the history: plastic strain, viscous strain, damage | J2Plasticity, NortonViscoplasticity, MaxwellViscoelasticity |
| a law of coupled primal fields | several gradients and their conjugate fluxes, with every coupling block of the tangent | BiotPoroelasticity (strain and pore pressure) |
The three are written the same way. A coupled law only lists its fields: gradients = (ε = 6, p = 1) and flux_names = (σ = 6, φ = 1) for poroelasticity; a thermo-hydro-mechanical law would add the temperature and the entropy in the same manner.
Reading order
Each law and each homogenized model has one page, which states the theory and runs it: the blocks of a page, in order, form a script of scripts/material_laws/ that runs on its own.
| page | |
|---|---|
| Common ground | |
| Integrating a law over a step | the incremental problem, the consistent tangent by the implicit-function theorem, the potential route, exact derivatives |
| Manual | |
| Writing a law | the residual route, the potential route, internal variables, coupled fields |
| The laws shipped | the six laws, their equations, parameters and behavior along typical paths |
| Driving a point | loading paths, mixed control, reading the response |
| Plugging a law into a computation | the Gauss-point contract, the flat interface for speed, differentiating with respect to parameters |
| Laws | |
| Elastoplastic bar under cycles | J2 plasticity against the closed form, isotropic and kinematic hardening |
| A damage law written from scratch | a law of your own, with a threshold and an evolving internal variable |
| Drained and undrained poroelasticity | a coupled law, the same sample in two tests |
| Homogenized laws | |
| Secant methods | the linear comparison composite, the classical and the modified secant methods; two power-law phases against the Voigt bound |
| Uniform fields: Voigt–Taylor and Reuss–Sachs | every phase at the macroscopic strain or at the macroscopic stress, for any phase laws; a steel and an alloy |
| Polycrystals | grains of single crystals under the Taylor model; the Taylor factor of a random FCC aggregate |
| The incremental tangent approach | phases with a history linearized by their tangents at each step, isotropic projection; a particle-reinforced alloy |
| The affine formulation | phases replaced by their tangents and prestresses at their average strains, Levin's theorem, exact for laminates; against the secant estimates |
| Damage by the growth of microcracks | crack densities as internal variables, Griffith's resistance, stability and viscous regularization |
| Nonlinear poroelasticity of a cracked rock | cracks closing under the Terzaghi effective stress, stress-dependent stiffness and Biot tensor |
| The strength of a porous plastic solid | the rigid–plastic limit of the secant method, a strength domain from a phase law, normality |
| Strength of a frictional matrix | a Drucker–Prager matrix with a non-associated flow rule, limit states around pores or rigid inclusions |
Small strain
The laws are written in infinitesimal strain. The kinematics is a trait of the law (kinematics), so that finite strain can be added later without changing the laws written today.