Materials¶
The material property model, the concrete materials and the tag-keyed registry the domain config resolves.
femforge.materials
¶
Material library: the property model every material fills in, the concrete materials, and the tag-keyed registry the domain config resolves against.
Modules:
-
air–Dry air as a material.
-
copper–Annealed copper with a temperature-dependent conductivity.
-
neodymium–Sintered NdFeB magnets with temperature-dependent remanence and coercivity.
-
pcb–FR4, the glass-epoxy laminate of printed circuit boards.
-
properties–The material property model: four property groups whose fields map onto Elmer material keywords.
-
registry–The single material registry, keyed by each material's
tag— the one source both the CAD/mesh stage and the sif writer read. -
steel–Carbon and stainless steels.
Classes:
-
MaterialProperties–A named material: its registry tag and its mechanical, thermal, magnetic and electrical properties.
-
MechanicalProperties–The mechanical properties of a material.
-
ThermalProperties–The thermal properties of a material.
-
MagneticProperties–The magnetic properties of a material.
-
ElectricalProperties–The electrical properties of a material.
-
Air–Dry air at room temperature.
-
Copper–Annealed copper whose resistivity rises linearly with temperature.
-
FR4–FR4 glass-epoxy laminate, the substrate of printed circuit boards.
-
Neodymium–Sintered NdFeB magnet; grades supply B_r and H_cb at the reference temperature, authored as Expressions so a hot magnet's weakened drive falls out of the operating point.
-
N42–N42 neodymium magnet.
-
N52–N52 neodymium magnet.
-
Steel_1080–1080 High-carbon steel.
-
Steel_316–316 austenitic stainless steel, annealed.
Functions:
-
material–Construct a fresh registered material by its tag (e.g.
"N52"). -
all_materials–A fresh instance of every registered material.
-
available_materials–The tags of every registered material.
-
register_material–Add or replace the material registered under
tag.
MaterialProperties
pydantic-model
¶
Bases: _PropertyModel
A named material: its registry tag and its mechanical, thermal, magnetic and electrical properties.
Fields:
-
name(str) -
tag(str) -
mechanical(MechanicalProperties) -
thermal(ThermalProperties) -
magnetic(MagneticProperties) -
electrical(ElectricalProperties)
is_magnet
property
¶
is_magnet: bool
Whether the material has a remanence, which marks it as a permanent magnet.
to_elmer
¶
to_elmer(*, at: Mapping[str, Quantity], runtime: frozenset[str] = frozenset(), backend: Backend = 'matc') -> dict[str, float | str]
The sif keyword/value pairs of all four property groups.
Parameters:
-
at(Mapping[str, Quantity]) –The operating point the other properties are evaluated at, each stripped to a bare SI float.
-
runtime(frozenset[str], default:frozenset()) –The parameters Elmer supplies at solve time; a property of only these emits as a MATC/Lua expression or table.
-
backend(Backend, default:'matc') –The sif expression language for runtime properties.
Source code in src/femforge/materials/properties.py
is_conductor
¶
Whether this material conducts current for solver purposes: σ(at) ≥ CONDUCTOR_CONDUCTIVITY_FLOOR.
Source code in src/femforge/materials/properties.py
print_tree
¶
A rich tree of this material's properties, added under tree when one is given.
Source code in src/femforge/materials/properties.py
MechanicalProperties
pydantic-model
¶
Bases: _PropertyModel
The mechanical properties of a material.
Fields:
-
density(Optional[_DensityPF]) -
elastic_modulus(Optional[_PressurePF]) -
yield_strength(Optional[_PressurePF]) -
ultimate_tensile_strength(Optional[_PressurePF])
ThermalProperties
pydantic-model
¶
Bases: _PropertyModel
The thermal properties of a material.
Fields:
-
conductivity(Optional[_ThermalConductivityPF]) -
specific_heat_capacity(Optional[_SpecificHeatPF]) -
convective_heat_transfer_coefficient(Optional[_HeatTransferCoefficientPF]) -
glass_transition_temperature(Optional[_TemperaturePF])
conductivity
pydantic-field
¶
conductivity: Optional[_ThermalConductivityPF] = None
k [W/(m·K)]: Thermal conductivity.
specific_heat_capacity
pydantic-field
¶
specific_heat_capacity: Optional[_SpecificHeatPF] = None
c_p [J/(kg·K)]: Specific heat capacity.
MagneticProperties
pydantic-model
¶
Bases: _PropertyModel
The magnetic properties of a material.
Fields:
-
rel_permeability(Optional[_DimensionlessPF]) -
remanence(Optional[_FluxDensityPF]) -
coercivity(Optional[_FieldStrengthPF]) -
bh_curve(Optional[_FieldStrengthPF])
rel_permeability
pydantic-field
¶
rel_permeability: Optional[_DimensionlessPF] = None
μ_r [-]: Relative permeability.
remanence
pydantic-field
¶
remanence: Optional[_FluxDensityPF] = None
B_r [T]: Remanent flux density.
bh_curve
pydantic-field
¶
bh_curve: Optional[_FieldStrengthPF] = None
H(B) [A/m]: Magnetization curve, a 1-D Calibration over flux_density emitted as Elmer's H-B Curve table.
to_elmer
¶
to_elmer(*, at: Mapping[str, Quantity], runtime: frozenset[str] = frozenset(), backend: Backend = 'matc') -> dict[str, float | str]
The sif keyword/value pairs of the magnetic fields, plus the H-B Curve table when bh_curve is set.
Parameters:
-
at(Mapping[str, Quantity]) –The operating point the other properties are evaluated at, each stripped to a bare SI float.
-
runtime(frozenset[str], default:frozenset()) –The parameters Elmer supplies at solve time; a property of only these emits as a MATC/Lua expression or table.
-
backend(Backend, default:'matc') –The sif expression language for runtime properties.
Source code in src/femforge/materials/properties.py
magnetization_magnitude
¶
|M| = Bᵣ/μ₀ in A/m, evaluating the remanence at operating point at; None for a non-magnet (no remanence).
Source code in src/femforge/materials/properties.py
ElectricalProperties
pydantic-model
¶
Bases: _PropertyModel
The electrical properties of a material.
Fields:
-
conductivity(Optional[_ElectricalConductivityPF]) -
resistivity(Optional[_ResistivityPF]) -
permittivity(Optional[_PermittivityPF]) -
permeability(Optional[_PermeabilityPF])
conductivity
pydantic-field
¶
conductivity: Optional[_ElectricalConductivityPF] = None
σ [S/m]: Electrical conductivity.
resistivity
pydantic-field
¶
resistivity: Optional[_ResistivityPF] = None
ρ_e [Ω·m]: Electrical resistivity.
Air
pydantic-model
¶
Bases: MaterialProperties
Dry air at room temperature.
Fields:
-
mechanical(MechanicalProperties) -
thermal(ThermalProperties) -
magnetic(MagneticProperties) -
electrical(ElectricalProperties) -
name(str) -
tag(str)
Source code in src/femforge/materials/air.py
Copper
pydantic-model
¶
Bases: MaterialProperties
Annealed copper whose resistivity rises linearly with temperature.
Fields:
-
mechanical(MechanicalProperties) -
thermal(ThermalProperties) -
magnetic(MagneticProperties) -
electrical(ElectricalProperties) -
name(str) -
tag(str)
Source code in src/femforge/materials/copper.py
FR4
pydantic-model
¶
Bases: MaterialProperties
FR4 glass-epoxy laminate, the substrate of printed circuit boards.
Fields:
-
mechanical(MechanicalProperties) -
thermal(ThermalProperties) -
magnetic(MagneticProperties) -
electrical(ElectricalProperties) -
name(str) -
tag(str)
Source code in src/femforge/materials/pcb.py
Neodymium
pydantic-model
¶
Bases: MaterialProperties
Sintered NdFeB magnet; grades supply B_r and H_cb at the reference temperature, authored as Expressions so a hot magnet's weakened drive falls out of the operating point.
Parameters:
-
name(str) –The display name.
-
tag(str) –The registry key that a body's
materialtag names. -
remanence_at_reference(float) –The remanence B_r at the reference temperature, in T.
-
coercivity_at_reference(float) –The coercivity H_cb at the reference temperature, in A/m.
Config:
arbitrary_types_allowed:Truevalidate_assignment:Trueuse_attribute_docstrings:True
Fields:
-
mechanical(MechanicalProperties) -
thermal(ThermalProperties) -
magnetic(MagneticProperties) -
electrical(ElectricalProperties) -
name(str) -
tag(str)
Source code in src/femforge/materials/neodymium.py
N42
pydantic-model
¶
Bases: Neodymium
N42 neodymium magnet.
Fields:
-
name(str) -
tag(str) -
mechanical(MechanicalProperties) -
thermal(ThermalProperties) -
magnetic(MagneticProperties) -
electrical(ElectricalProperties)
Source code in src/femforge/materials/neodymium.py
N52
pydantic-model
¶
Bases: Neodymium
N52 neodymium magnet.
Fields:
-
name(str) -
tag(str) -
mechanical(MechanicalProperties) -
thermal(ThermalProperties) -
magnetic(MagneticProperties) -
electrical(ElectricalProperties)
Source code in src/femforge/materials/neodymium.py
Steel_1080
pydantic-model
¶
Steel_1080(rel_permeability: float | None = None)
Bases: MaterialProperties
1080 High-carbon steel.
Fields:
-
mechanical(MechanicalProperties) -
thermal(ThermalProperties) -
magnetic(MagneticProperties) -
electrical(ElectricalProperties) -
name(str) -
tag(str)
Source code in src/femforge/materials/steel.py
Steel_316
pydantic-model
¶
Bases: MaterialProperties
316 austenitic stainless steel, annealed.
Fields:
-
mechanical(MechanicalProperties) -
thermal(ThermalProperties) -
magnetic(MagneticProperties) -
electrical(ElectricalProperties) -
name(str) -
tag(str)
Source code in src/femforge/materials/steel.py
material
¶
material(tag: str) -> MaterialProperties
Construct a fresh registered material by its tag (e.g. "N52").
Source code in src/femforge/materials/registry.py
all_materials
¶
all_materials() -> list[MaterialProperties]
available_materials
¶
register_material
¶
register_material(tag: str, factory: type[MaterialProperties]) -> None