mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-20 18:18:31 +00:00
feat(materials): add element-wise scalar diffusion coefficient cache
Support piecewise-constant per-element κ fields for nonlinear diffusion assembly. - Implement `ElementWiseScalarDiffusion` behavior trait and evaluation hooks.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
"""
|
||||
ElementWiseScalarDiffusion <: AbstractMaterial
|
||||
|
||||
Piecewise **constant** isotropic scalar conductivity on each volume element
|
||||
(index matches `mesh.connectivity` order): at quadrature points of element `e`
|
||||
the tensor is `λ_by_elem[e] · I`.
|
||||
|
||||
Used with [`HeatKernel`](@ref) and either [`Temperature`](@ref) (thermal
|
||||
conductivity values in ``k``) or [`PressurePotential`](@ref) (hydraulic
|
||||
conductivity ``K``). For a spatially smooth ``λ(x)``, refine the mesh or use
|
||||
per-region assembly; truly pointwise ``λ`` at quadrature nodes is not covered
|
||||
here.
|
||||
|
||||
# Example
|
||||
|
||||
```julia
|
||||
# Two bricks along x with different K; λ_by_elem[i] is conductivity of element i.
|
||||
mat = ElementWiseScalarDiffusion([1.0, 4.0])
|
||||
kernel = HeatKernel(ContinuumFormulation{FullThreeD}(), mat, PressurePotential())
|
||||
```
|
||||
"""
|
||||
|
||||
struct ElementWiseScalarDiffusion <: AbstractMaterial
|
||||
λ_by_elem::Vector{Float64}
|
||||
end
|
||||
|
||||
material_behavior(::ElementWiseScalarDiffusion) = StatelessConstantTangent()
|
||||
supported_physics(::ElementWiseScalarDiffusion) = (Thermal{3}(),)
|
||||
required_state_variables(::ElementWiseScalarDiffusion) = ()
|
||||
Reference in New Issue
Block a user