Materials
Overview
Geometry and a mesh tell a simulation where a body is and how it is cut up into elements. A material tells the simulation what the body is made of — how stiff it is, how dense, how well it conducts heat, and how strong it is before it fails.
A material in Rasmah is a single object that bundles every physical property a solver might need. Instead of passing bare numbers — a Young's modulus here, a density there, a conductivity somewhere else — you pass one material, and every physics routine reads the property it needs from it. That one change keeps the whole $\text{CAD} \to \text{mesh} \to \text{simulation}$ pipeline consistent: one source of truth for the physics, one place to record where the numbers came from, and one place to attach temperature dependence or uncertainty.
This chapter explains the material model, the built-in library, how to read and customize materials, and how to build anisotropic, composite, and fluid materials.
What a material describes
Linear elasticity
The simplest material model is linear elasticity. For a bar pulled in one direction, Hooke's law says the stress $\sigma$ is proportional to the strain $\varepsilon$:
\[\sigma = E \varepsilon ,\]
where $E$ is Young's modulus (in Pa). A stiffer material has a larger $E$: for the same stretch it stores more stress, so it resists the load more.
When you pull a material it also gets thinner sideways. The ratio of the sideways contraction to the axial stretch is Poisson's ratio:
\[\nu = -\frac{\varepsilon_{\text{transverse}}}{\varepsilon_{\text{axial}}} .\]
Most metals sit around $\nu \approx 0.3$; rubber approaches $\nu \to 0.5$ (nearly incompressible). These two numbers, $E$ and $\nu$, are enough to derive the other isotropic elastic constants:
\[G = \frac{E}{2(1+\nu)} , \qquad K = \frac{E}{3(1-2\nu)} ,\]
where $G$ is the shear modulus (resistance to shearing) and $K$ the bulk modulus (resistance to uniform squeezing).
The full set of properties
Real simulation is multiphysics, so a material carries far more than $E$ and $\nu$. It also carries the mass density $\rho$, the thermal conductivity $k$, the specific heat $c$, the thermal expansion $\alpha$, strength limits (yield $\sigma_y$, ultimate $\sigma_u$), fracture toughness, and — for the electromagnetic, acoustic, and optical physics — electrical conductivity, permittivity, permeability, refractive index, and more. Every property is an SI value; a property that does not apply is stored as $0.0$ or $Inf$ (for example $Inf$ for the refractive index of an opaque metal), and one that is simply undocumented is missing.
The isotropic solid is the Material type:
Rasmah.Materials.Material — Type
MaterialAn isotropic linear-elastic solid material carrying a full set of scalar multiphysics properties (elastic, thermal, strength, fracture, piezoelectric, magnetic, thermoelectric, dielectric, optical). All properties are SI units; Inf denotes "not defined" and missing an undocumented value.
Fields
name::String,grade::String,source::String: identification and provenance.youngs_modulus::Float64: Young's modulus (Pa).poisson_ratio::Float64: Poisson's ratio.density::Float64: mass density (kg/m³).thermal_conductivity::Float64: thermal conductivity (W/(m·K)).thermal_expansion::Float64: thermal expansion (1/K).specific_heat::Float64: specific heat (J/(kg·K)).yield_strength::Float64,ultimate_strength::Float64: strength (Pa).elongation::Float64: elongation at break (fraction).hardening_modulus::Float64: hardening modulus (Pa).fatigue_strength::Float64: fatigue strength (Pa; 0 = no endurance limit).fracture_toughness::Float64: fracture toughness (Pa·√m).hardness::Union{Float64,Missing}: Vickers hardness (HV;missingif N/A).latent_heat_fusion::Float64: latent heat of fusion (J/kg).piezoelectric_d33::Float64,piezoelectric_d31::Float64,piezoelectric_d15::Float64: piezoelectric charge coefficients (m/V = C/N).saturation_magnetization::Float64: saturation magnetization (A/m).magnetostriction::Float64: saturation magnetostriction.pyroelectric_coefficient::Float64: pyroelectric coefficient (C/(m²·K)).seebeck_coefficient::Float64: Seebeck coefficient (V/K).dielectric_loss_tangent::Float64: dielectric loss tangent.electrical_conductivity::Float64: electrical conductivity (S/m).relative_permeability::Float64: relative permeability.emissivity::Float64: emissivity (0..1).relative_permittivity::Float64: relative permittivity (Inf= conductor).melting_point::Float64: melting point (K;Inf= decomposes).refractive_index::Float64: refractive index (Inf= opaque).curie_temperature::Float64: Curie temperature (K;Inf= non-ferromagnetic).loss_factor::Float64: loss factor (damping).relative_uncertainty::Union{Float64,Missing}: coefficient of variation (missingif undocumented).temperature_data::Dict{Symbol,TempSeries}: optional temperature-dependent property tables.texture::Texture: surface appearance.
Every material also carries a Texture — a color plus a roughness, metallic, and opacity — used when the material is rendered:
Rasmah.Materials.Texture — Type
TextureSurface appearance for rendering: an sRGB base color plus a compact PBR-style description.
Fields
color::NTuple{3,Float64}: 0..1 RGB triplet.roughness::Float64: 0 = mirror, 1 = matte.metallic::Float64: 0 = dielectric, 1 = metal.opacity::Float64: 0 = transparent, 1 = opaque.
The common supertype of every material (solid, anisotropic, composite, fluid) is AbstractMaterial:
Rasmah.Materials.AbstractMaterial — Type
AbstractMaterialCommon supertype of all material types: an isotropic Material, an AnisotropicMaterial, or a CompositeMaterial/Laminate (homogenized to concrete properties on demand).
The built-in library
Rasmah ships with a library of standard engineering materials — metals, polymers, ceramics, and a few special materials — compiled from permissively licensed handbooks. You look them up by name rather than typing in their constants yourself:
Rasmah.Materials.material — Function
material(name; grade="", kwargs...) -> MaterialLook up a built-in material by name (case-insensitive, slug-normalized). With a grade keyword, selects that grade; extra keyword arguments override individual properties (e.g. material("steel"; grade="1040", yield_strength=5e8)).
youngs_modulus(steel), poisson_ratio(steel), density(steel)(2.0e11, 0.29, 7850.0)The lookup is case-insensitive and tolerant of punctuation, so material("aluminum 6061-t6"), material(:aluminum), and material("ALU") all find the same material. A family that comes in several grades (different heat treatments or alloys) is selected with the grade keyword:
material("aluminum"; grade="7075-t6").name"Aluminum (7075-T6)"Rasmah.Materials.grades — Function
grades(name) -> Vector{Material}All grade variants of a material family (e.g. grades("steel")).
length(grades("steel"))3Steel has three grades in the library — the default A36 plus 1040 and 4340. materials() returns the whole library as a vector, and fluid(name) / fluids() do the same for the fluid library:
Rasmah.Materials.fluid — Function
fluid(name) -> FluidMaterialLook up a built-in fluid by name (case-insensitive, slug-normalized).
fluid("gly").name"Glycerin"The fluid lookup uses the same name-matching rules ("gly" is an unambiguous prefix of "glycerin").
Reading properties
Every property has an accessor, so you read youngs_modulus(steel) rather than reaching into fields. The isotropic accessors are the $E$, $\nu$, $\rho$, $k$, $\alpha$, $c$ pair plus the strength, fracture, and multiphysics quantities:
Rasmah.Materials.youngs_modulus — Function
youngs_modulus(m) -> Float64Young's modulus E in Pa. youngs_modulus(m, T) interpolates the material's temperature_data table when present, otherwise returns the nominal value.
Rasmah.Materials.poisson_ratio — Function
poisson_ratio(m) -> Float64Poisson's ratio ν (dimensionless). poisson_ratio(m, T) returns the temperature-aware value when a table is present.
Rasmah.Materials.density — Function
density(m) -> Float64Mass density ρ in kg/m³. density(m, T) returns the temperature-aware value when a table is present.
Rasmah.Materials.thermal_conductivity — Function
thermal_conductivity(m) -> Float64Thermal conductivity k in W/(m·K). thermal_conductivity(m, T) returns the temperature-aware value when a table is present.
Rasmah.Materials.yield_strength — Function
yield_strength(m) -> Float64Yield strength σy in Pa. yield_strength(m, T) returns the temperature-aware value when a table is present.
The rest of the set (specific_heat, thermal_expansion, ultimate_strength, elongation, hardening_modulus, fatigue_strength, fracture_toughness, hardness, latent_heat_fusion, piezoelectric_d33, saturation_magnetization, seebeck_coefficient, electrical_conductivity, relative_permittivity, refractive_index, melting_point, …) follow the same pattern.
Derived quantities
Some useful quantities are not stored — they are computed from the stored ones. The shear and bulk moduli come from $E$ and $\nu$, the thermal diffusivity from $k$, $\rho$, and $c$, and the sound speed and acoustic impedance from the elastic constants and density:
Rasmah.Materials.shear_modulus — Function
shear_modulus(m) -> Float64Shear modulus G in Pa = E / (2(1+ν)). shear_modulus(m, T) is the temperature-aware form.
Rasmah.Materials.bulk_modulus — Function
bulk_modulus(m) -> Float64Bulk modulus K in Pa = E / (3(1−2ν)). bulk_modulus(m, T) is the temperature-aware form.
Rasmah.Materials.thermal_diffusivity — Function
thermal_diffusivity(m) -> Float64Thermal diffusivity a in m²/s = k / (ρ c). thermal_diffusivity(m, T) is the temperature-aware form.
Rasmah.Materials.sound_speed — Function
sound_speed(m) -> Float64Longitudinal (dilatational) sound speed cₛ in m/s = √((K+4G/3)/ρ). sound_speed(m, T) is the temperature-aware form.
Rasmah.Materials.acoustic_impedance — Function
acoustic_impedance(m) -> Float64Acoustic impedance Z in kg/(m²·s) = ρ cₛ. acoustic_impedance(m, T) is the temperature-aware form.
sound_speed(steel)5778.163724983053The longitudinal sound speed in steel is about $5.8\ \text{km/s}$.
Customizing materials
You rarely need to type a whole material from scratch. The library values are a starting point, and you derive a new material from an existing one:
Rasmah.Materials.override — Function
override(base::Material; kwargs...) -> MaterialA copy of base with any property (or relative_uncertainty) overridden by keyword arguments; everything else is inherited. E.g. override(steel; yield_strength=5e8).
strong_steel = override(steel; yield_strength=5.0e8)
yield_strength(strong_steel), youngs_modulus(strong_steel)(5.0e8, 2.0e11)override copies everything from the base and changes only what you name — here the yield strength, leaving Young's modulus untouched. with_grade is a convenience alias for giving the copy a new grade designation:
Rasmah.Materials.with_grade — Function
with_grade(base::Material; grade, kwargs...) -> MaterialA new grade of base (a convenience alias for override with a grade keyword).
Temperature dependence
Material properties are usually tabulated at room temperature, but $k$, $c$, $\alpha$, and $E$ all drift as temperature rises. A material can carry a table of values at increasing temperatures, and the accessors interpolate it:
Rasmah.Materials.TempSeries — Type
TempSeries(temperatures, values)A piecewise-linear temperature series: a property's values at increasing temperatures (K). Callable — series(T) returns the linearly-interpolated value, clamped to the endpoints outside the tabulated range.
Fields
temperatures::Vector{Float64}: strictly increasing temperatures (K).values::Vector{Float64}: property value at each temperature.
Rasmah.Materials.Series — Type
SeriesAlias for TempSeries — a general 1-D piecewise-linear interpolation series usable for any independent variable (temperature, frequency, wavelength, field, …).
A TempSeries is callable — pass it a temperature and it returns the piecewise-linearly interpolated value, clamped to the endpoints outside the tabulated range:
s = TempSeries([300.0, 400.0, 600.0], [100.0, 200.0, 400.0])
s(500.0)300.0You attach a table to a material with with_temperature_data, and from then on the temperature-aware accessor form property(m, T) interpolates it:
Rasmah.Materials.with_temperature_data — Function
with_temperature_data(m::Material; kwargs...) -> MaterialA copy of m with temperature-dependent property tables attached, e.g. with_temperature_data(steel, :k => TempSeries([300, 600], [51.9, 30.0])). Each value must be a TempSeries.
thermal_conductivity(steel, 500.0)45.55Steel's conductivity table runs from $51.9\ \text{W/(m·K)}$ at 300 K down to $30.0$ at 1000 K, so at 500 K it interpolates to $45.55$. Materials without a table simply fall back to their nominal scalar, so thermal_conductivity(m, T) is always safe to call. The generic evaluation functions value_at and property_curve expose the same tables without needing a dedicated accessor:
Rasmah.Materials.value_at — Function
value_at(m, key::Symbol, T::Real) -> Float64The value of property key at temperature T, interpolated from the material's temperature_data table when present, else the nominal scalar value.
Rasmah.Materials.property_curve — Function
property_curve(m, key::Symbol) -> FunctionA callable T -> value for property key, interpolated over T from the material's temperature_data table when present, else constant.
Uncertainty and provenance
Every material records where its numbers came from, and — when the handbooks document it — how uncertain they are:
Rasmah.Materials.source — Function
source(m) -> StringThe handbook/documentation source of the material's properties.
Rasmah.Materials.property_source — Function
property_source(key::Symbol) -> StringThe handbook/manual source for a property group (e.g. :youngs_modulus); falls back to the per-material source field for unknown keys.
Rasmah.Materials.property_sources — Function
property_sources() -> Dict{Symbol,String}A copy of the property-group → handbook/manual traceability table.
source(steel)"ASM Metals Handbook (ASTM A36)"Rasmah.Materials.property_range — Function
property_range(m, f) -> Tuple{Float64,Float64}The uncertainty band (v(1−δ), v(1+δ)) of property f around its value v, using the material's relative_uncertainty δ; a degenerate (v, v) band when the uncertainty is undocumented (missing).
property_range(override(steel; relative_uncertainty=0.05), youngs_modulus)(1.9e11, 2.1e11)The built-in library does not document uncertainty for steel (so relative_uncertainty(steel) is missing and its band is degenerate). Setting relative_uncertainty = 0.05 says "these properties are known to about 5%", and property_range expands that into the $(v(1-\delta),\, v(1+\delta))$ band.
Anisotropic materials
Isotropic materials behave the same in every direction. A single crystal, a piece of rolled metal, or a unidirectional fiber composite does not: it is stiffer along one axis than another. That anisotropy is described by the generalized Hooke's law,
\[\boldsymbol{\sigma} = \mathbf{C} \boldsymbol{\varepsilon} ,\]
where $\mathbf{C}$ is the $6 \times 6$ Voigt stiffness tensor instead of the two scalars $E$, $\nu$. Rasmah represents this with AnisotropicMaterial:
Rasmah.Materials.AnisotropicMaterial — Type
AnisotropicMaterialA fully anisotropic linear-elastic solid carrying the 6×6 Voigt stiffness tensor C (Pa), a 3×3 thermal-conductivity tensor K (W/(m·K)), and a Voigt thermal- expansion vector α (1/K), plus the same scalar multiphysics properties as Material.
Fields
name::String,grade::String,source::String: identification and provenance.stiffness: 6×6 Voigt stiffness matrix (Pa).thermal_conductivity: 3×3 conductivity matrix (W/(m·K)).thermal_expansion: Voigt thermal-expansion vector (1/K).density::Float64: mass density (kg/m³).specific_heat::Float64: specific heat (J/(kg·K)).yield_strength::Float64,ultimate_strength::Float64: strength (Pa).elongation::Float64: elongation at break (fraction).hardening_modulus::Float64: hardening modulus (Pa).fatigue_strength::Float64: fatigue strength (Pa).fracture_toughness::Float64: fracture toughness (Pa·√m).hardness::Union{Float64,Missing}: Vickers hardness (HV).latent_heat_fusion::Float64: latent heat of fusion (J/kg).piezoelectric_d33::Float64,piezoelectric_d31::Float64,piezoelectric_d15::Float64: piezoelectric charge coefficients (m/V).saturation_magnetization::Float64: saturation magnetization (A/m).magnetostriction::Float64: saturation magnetostriction.pyroelectric_coefficient::Float64: pyroelectric coefficient (C/(m²·K)).seebeck_coefficient::Float64: Seebeck coefficient (V/K).dielectric_loss_tangent::Float64: dielectric loss tangent.electrical_conductivity::Float64: electrical conductivity (S/m).relative_permeability::Float64: relative permeability.emissivity::Float64: emissivity.relative_permittivity::Float64: relative permittivity.melting_point::Float64: melting point (K).refractive_index::Float64: refractive index.curie_temperature::Float64: Curie temperature (K).loss_factor::Float64: loss factor (damping).relative_uncertainty::Union{Float64,Missing}: coefficient of variation.texture::Texture: surface appearance.
Rather than assemble the $6 \times 6$ tensor by hand, build an orthotropic or transversely isotropic material from its engineering constants:
Rasmah.Materials.orthotropic_material — Function
orthotropic_material(; E1, E2, E3, ν12, ν13, ν23, G12, G13, G23, kwargs...) -> AnisotropicMaterialAn orthotropic material built from its engineering constants. The 6×6 Voigt compliance is assembled, symmetrized via νji/Ej = νij/Ei, and inverted to the stiffness tensor.
Rasmah.Materials.transversely_isotropic_material — Function
transversely_isotropic_material(; E1, E2, ν12, ν23, G12, kwargs...) -> AnisotropicMaterialA transversely isotropic material (single symmetry axis, e.g. unidirectional fibre composite): in-plane E1, out-of-plane E2 = E3, with G23 = E2/(2(1+ν23)).
o = orthotropic_material(;
E1=1.0e11, E2=2.0e10, E3=2.0e10,
ν12=0.3, ν13=0.3, ν23=0.4,
G12=5.0e9, G13=5.0e9, G23=3.0e9,
density=1500.0,
)
engineering_constants(o).E19.999999999999998e10The stiffness tensor (and its inverse, the compliance) and the engineering constants can be recovered from any material:
Rasmah.Materials.stiffness — Function
stiffness(m) -> Matrix{Float64}The 6×6 Voigt elasticity tensor of a material: isotropic Material (from E, ν), the stored tensor for AnisotropicMaterial, or the homogenized tensor for composites/laminates.
Rasmah.Materials.compliance_tensor — Function
compliance_tensor(m) -> Matrix{Float64}The inverse of the 6×6 stiffness tensor, satisfying compliance_tensor(m) ≈ inv(stiffness(m)).
Rasmah.Materials.engineering_constants — Function
engineering_constants(m) -> NamedTupleEngineering constants of an (orthotropic or isotropic) material, returned as a named tuple with E1, E2, E3, ν12, ν13, ν23, G12, G13, G23, and the scalar multiphysics properties (k1, ρ, σy, …).
Composites and laminates
A fiber composite mixes a stiff fiber with a softer matrix, in a chosen volume fraction and orientation:
Rasmah.Materials.fiber_composite — Function
fiber_composite(matrix, fiber, vf; orientation=:unidirectional) -> CompositeMaterialA two-constituent fibre composite with fibre volume fraction vf (in [0, 1)), oriented :unidirectional or :random. Homogenized on demand.
Rasmah.Materials.CompositeMaterial — Type
CompositeMaterialA two-constituent fibre composite (matrix + fibre + fibre volume fraction), oriented either unidirectionally or in-plane random. Homogenized to concrete properties on demand.
Fields
name::String: composite name.matrix: matrix material.fiber: fibre material.fiber_volume_fraction::Float64: fibre volume fraction.fiber_orientation::Symbol::unidirectionalor:random.
Rasmah.Materials.unidirectional_fiber_composite — Function
unidirectional_fiber_composite(matrix, fiber, vf) -> AnisotropicMaterialChamis / rule-of-mixtures homogenization of a unidirectional fibre composite into a transversely isotropic material (axial ‖ properties by rule of mixtures, transverse ⊥ by the Chamis square-root model).
Rasmah.Materials.random_fiber_composite — Function
random_fiber_composite(matrix, fiber, vf) -> MaterialAn in-plane random (quasi-isotropic) short-fibre composite, using the Cox–Krenchel estimate of the in-plane modulus from the unidirectional E1, E2.
ud = unidirectional_fiber_composite(epoxy, carbon_fiber, 0.6)
engineering_constants(ud).E18.22e10The axial modulus of the unidirectional carbon/epoxy composite follows the rule of mixtures: ``E1 = vf Ef + (1 - vf) E_m = 0.6 \cdot 1.35!\times!10^{11}
- 0.4 \cdot 3.0!\times!10^{9} \approx 8.2!\times!10^{10}`` Pa, far stiffer
than the epoxy matrix alone. A composite is homogenized on demand — homogenize reduces it to an equivalent anisotropic (or, for random orientation, isotropic) material.
A laminate stacks plies at different angles:
Rasmah.Materials.Ply — Type
PlyA single ply of a laminate: a material (isotropic or anisotropic) placed at an orientation angle (degrees) with a given thickness.
Fields
material: the ply's material.angle::Float64: orientation angle (degrees).thickness::Float64: ply thickness.
Rasmah.Materials.Laminate — Type
LaminateA stacked laminate (classical lamination theory).
Fields
name::String: laminate name.plies::Vector{Ply}: the stacked plies.
Rasmah.Materials.laminate_ABD — Function
laminate_ABD(l::Laminate) -> Tuple{Matrix,Matrix,Matrix}Classical lamination theory stiffness matrices: in-plane A, coupling B and bending D.
l = Laminate([Ply(ud; angle=0.0, thickness=0.125), Ply(ud; angle=90.0, thickness=0.125)])
A, B, D = laminate_ABD(l)
size(A)(3, 3)laminate_ABD returns the classical lamination theory matrices: the in-plane $A$, the coupling $B$ (which vanishes for a symmetric stack), and the bending $D$ stiffness.
Fluids
A Newtonian fluid has no shear modulus or yield strength — it flows. Instead it carries a dynamic viscosity $\mu$ and a bulk modulus for compressibility:
Rasmah.Materials.FluidMaterial — Type
FluidMaterialA Newtonian fluid (for Stokes/Navier–Stokes flow and acoustic media). Fluids have no shear modulus or yield strength; instead they carry dynamic_viscosity (Pa·s) and bulk_modulus (Pa, compressibility). melting_point is the freezing point and boiling_point the boiling point (K).
Fields
name::String,grade::String,source::String: identification and provenance.density::Float64: mass density (kg/m³).dynamic_viscosity::Float64: dynamic viscosity (Pa·s).bulk_modulus::Float64: bulk modulus (Pa).specific_heat::Float64: specific heat (J/(kg·K)).thermal_conductivity::Float64: thermal conductivity (W/(m·K)).thermal_expansion::Float64: thermal expansion (1/K).surface_tension::Float64: surface tension (N/m).electrical_conductivity::Float64: electrical conductivity (S/m).relative_permittivity::Float64: relative permittivity.refractive_index::Float64: refractive index.melting_point::Float64: freezing point (K).boiling_point::Float64: boiling point (K).latent_heat_fusion::Float64: latent heat of fusion (J/kg).latent_heat_vaporization::Float64: latent heat of vaporization (J/kg).specific_heat_ratio::Float64: ratio of specific heats.relative_uncertainty::Union{Float64,Missing}: coefficient of variation.temperature_data::Dict{Symbol,TempSeries}: optional temperature-dependent property tables.texture::Texture: surface appearance.
Rasmah.Materials.dynamic_viscosity — Function
dynamic_viscosity(f) -> Float64Dynamic viscosity μ in Pa·s. dynamic_viscosity(f, T) returns the temperature-aware value when a table is present.
Rasmah.Materials.kinematic_viscosity — Function
kinematic_viscosity(f) -> Float64Kinematic viscosity ν in m²/s = μ / ρ. kinematic_viscosity(f, T) is the temperature-aware form.
Rasmah.Materials.prandtl_number — Function
prandtl_number(f) -> Float64Prandtl number Pr = μ c / k (dimensionless). prandtl_number(f, T) is the temperature-aware form.
kinematic_viscosity(water)1.0040080160320641e-6The kinematic viscosity $\nu = \mu / \rho$ appears in the Navier–Stokes equations, and the Prandtl number $\mathrm{Pr} = \mu c / k$ measures how fast momentum diffuses relative to heat. A fluid's sound speed has no shear term: $c = \sqrt{K/\rho}$.
Field and frequency models
Some properties are not a single number but a function of an applied field or frequency. The magnetic response — the $B$–$H$ curve — saturates for a ferromagnet:
Rasmah.Materials.magnetization — Function
magnetization(m, H::Real) -> Float64Magnetization M at applied field H (A/m): a saturation (tanh) model for ferromagnets, and linear M = (μr − 1) H otherwise.
Rasmah.Materials.magnetic_flux_density — Function
magnetic_flux_density(m, H::Real) -> Float64Magnetic flux density B (T) at applied field H (A/m): μ0 (H + M(H)).
Rasmah.Materials.bh_curve — Function
bh_curve(m) -> FunctionA callable H -> B(H) describing the material's B–H curve.
magnetization(iron, 1.0e7)1.71e6At $H = 10^7\ \text{A/m}$ iron is fully saturated, so $M$ equals its saturation magnetization. The magnetostrictive strain, the piezoelectric strain matrix, the spectral emissivity, and the Debye permittivity follow the same "model returns a function of the input" pattern:
Rasmah.Materials.magnetostrictive_strain — Function
magnetostrictive_strain(m, M::Real) -> Float64Magnetostrictive strain λ(M) = (3/2) λs (M/Ms)² at magnetization M (A/m) (quadratic saturation model).
Rasmah.Materials.piezoelectric_strain_matrix — Function
piezoelectric_strain_matrix(m) -> Matrix{Float64}The 3×6 piezoelectric strain matrix d (m/V = C/N) for 6mm-class piezoelectrics (PZT, BaTiO3, ZnO, PVDF). Quartz is trigonal, not this form.
Rasmah.Materials.spectral_emissivity — Function
spectral_emissivity(m, λ::Real) -> Float64Spectral emissivity ε(λ) at wavelength λ; gray-body (constant) unless a spectral Series table is supplied.
Rasmah.Materials.debye_permittivity — Function
debye_permittivity(εs, ε∞, τ, f) -> Float64Debye single-relaxation permittivity at frequency f (Hz): εr(f) = ε∞ + (εs − ε∞)/(1 + (2πfτ)²).
Using materials in simulation
The point of the material library is that a material plugs straight into the physics layer: name the physics and pass the material, and solve picks the PDE, boundary conditions, and solver from the material's property set. Stress and specific quantities (compliance, von_mises_stress) take the material directly too, and an anisotropic material routes through its full $6 \times 6$ stiffness tensor:
m = tetrahedralize_box(1.0, 1.0, 1.0, 2, 2, 2)
n = size(m.nodes, 2)
fixed = Int[]
for i in 1:n
m.nodes[1, i] ≈ 0.0 && append!(fixed, 3i - 2, 3i - 1, 3i)
end
forces = zeros(3n)
for i in 1:n
m.nodes[1, i] ≈ 1.0 && (forces[3i - 2] = 1.0)
end
u = solve(Elasticity(), m, steel; fixed = fixed, loads = forces)
compliance(m, steel, fixed, forces)4.2266053835887635e-10This fixes the $x = 0$ face and pulls the $x = 1$ face, then reports the compliance $\mathbf{f}^{\top}\mathbf{u}$ — the same call you would make for any material, with its full property set (and its temperature table, if any) carried along.
Next steps
Materials are the input to the solvers. The FEM & simulation chapter puts a material to work in a solve, and the Topology optimization chapter shows how density scaling modulates the material stiffness inside a differentiable design loop. For the physical dimensions that every material property carries, see Units.
