|
| 1 | +""" |
| 2 | + DHBBMaterial() |
| 3 | + DHBBMaterial{Correction}() |
| 4 | +
|
| 5 | +A material type used to assign the material of a [`Body`](@ref) with the dual-horizon |
| 6 | +bond-based formulation of peridynamics. |
| 7 | +
|
| 8 | +# Keywords |
| 9 | +- `dmgmodel::AbstractDamageModel`: Damage model defining the fracture behavior. |
| 10 | + (default: `CriticalStretch()`) |
| 11 | +
|
| 12 | +Possible correction methods are: |
| 13 | +- [`NoCorrection`](@ref): No correction is applied. (default) |
| 14 | +- [`EnergySurfaceCorrection`](@ref): The energy based surface correction method of |
| 15 | + Le and Bobaru (2018) is applied. |
| 16 | +
|
| 17 | +# Examples |
| 18 | +
|
| 19 | +```julia-repl |
| 20 | +julia> mat = DHBBMaterial() |
| 21 | +DHBBMaterial{NoCorrection}() |
| 22 | +
|
| 23 | +julia> mat = DHBBMaterial{EnergySurfaceCorrection}() |
| 24 | +DHBBMaterial{EnergySurfaceCorrection}() |
| 25 | +``` |
| 26 | +--- |
| 27 | +
|
| 28 | +```julia |
| 29 | +DHBBMaterial{Correction} |
| 30 | +``` |
| 31 | +
|
| 32 | +Material type for the dual-horizon bond-based peridynamics formulation. |
| 33 | +
|
| 34 | +# Type Parameters |
| 35 | +- `Correction`: A correction algorithm type. See the constructor docs for more informations. |
| 36 | +- `DM`: A damage model type. |
| 37 | +
|
| 38 | +# Allowed material parameters |
| 39 | +When using [`material!`](@ref) on a [`Body`](@ref) with `DHBBMaterial`, then the following |
| 40 | +parameters are allowed: |
| 41 | +Material parameters: |
| 42 | +- `horizon::Float64`: Radius of point interactions. |
| 43 | +- `rho::Float64`: Density. |
| 44 | +Elastic parameters: |
| 45 | +- `E::Float64`: Young's modulus. |
| 46 | +- `G::Float64`: Shear modulus. |
| 47 | +- `K::Float64`: Bulk modulus. |
| 48 | +- `lambda::Float64`: 1st Lamé parameter. |
| 49 | +- `mu::Float64`: 2nd Lamé parameter. |
| 50 | +Fracture parameters: |
| 51 | +- `Gc::Float64`: Critical energy release rate. |
| 52 | +- `epsilon_c::Float64`: Critical strain. |
| 53 | +
|
| 54 | +!!! note "Poisson's ratio and bond-based peridynamics" |
| 55 | + In bond-based peridynamics, the Poisson's ratio is limited to 1/4 for 3D simulations. |
| 56 | + Therefore, only one additional elastic parameter is required. |
| 57 | + Optionally, the specification of a second keyword is allowed, if the parameter |
| 58 | + combination results in `nu = 1/4`. |
| 59 | +
|
| 60 | +# Allowed export fields |
| 61 | +When specifying the `fields` keyword of [`Job`](@ref) for a [`Body`](@ref) with |
| 62 | +`DHBBMaterial`, the following fields are allowed: |
| 63 | +- `position::Matrix{Float64}`: Position of each point. |
| 64 | +- `displacement::Matrix{Float64}`: Displacement of each point. |
| 65 | +- `velocity::Matrix{Float64}`: Velocity of each point. |
| 66 | +- `velocity_half::Matrix{Float64}`: Velocity parameter for Verlet time solver. |
| 67 | +- `acceleration::Matrix{Float64}`: Acceleration of each point. |
| 68 | +- `b_int::Matrix{Float64}`: Internal force density of each point. |
| 69 | +- `b_ext::Matrix{Float64}`: External force density of each point. |
| 70 | +- `damage::Vector{Float64}`: Damage of each point. |
| 71 | +- `n_active_bonds::Vector{Int}`: Number of intact bonds of each point. |
| 72 | +""" |
| 73 | +struct DHBBMaterial{Correction,DM} <: AbstractBondBasedMaterial{Correction} |
| 74 | + dmgmodel::DM |
| 75 | + function DHBBMaterial{C}(dmgmodel::DM) where {C,DM} |
| 76 | + new{C,DM}(dmgmodel) |
| 77 | + end |
| 78 | +end |
| 79 | + |
| 80 | +function DHBBMaterial{C}(; dmgmodel::AbstractDamageModel=CriticalStretch()) where {C} |
| 81 | + return DHBBMaterial{C}(dmgmodel) |
| 82 | +end |
| 83 | +DHBBMaterial(; kwargs...) = DHBBMaterial{NoCorrection}(; kwargs...) |
| 84 | + |
| 85 | +function StandardPointParameters(mat::DHBBMaterial{C,D}, p::Dict{Symbol,Any}) where {C,D} |
| 86 | + (; δ, rho, E, nu, G, K, λ, μ) = get_required_point_parameters_bb(mat, p) |
| 87 | + (; Gc, εc) = get_frac_params(mat.dmgmodel, p, δ, K) |
| 88 | + bc = 0.5 * 18 * K / (π * δ^4) # half of the normal bond constant |
| 89 | + return StandardPointParameters(δ, rho, E, nu, G, K, λ, μ, Gc, εc, bc) |
| 90 | +end |
| 91 | + |
| 92 | +@params DHBBMaterial StandardPointParameters |
| 93 | + |
| 94 | +@storage DHBBMaterial struct DHBBStorage <: AbstractStorage |
| 95 | + @lthfield position::Matrix{Float64} |
| 96 | + @pointfield displacement::Matrix{Float64} |
| 97 | + @pointfield velocity::Matrix{Float64} |
| 98 | + @pointfield velocity_half::Matrix{Float64} |
| 99 | + @pointfield velocity_half_old::Matrix{Float64} |
| 100 | + @pointfield acceleration::Matrix{Float64} |
| 101 | + @htlfield b_int::Matrix{Float64} |
| 102 | + @pointfield b_int_old::Matrix{Float64} |
| 103 | + @pointfield b_ext::Matrix{Float64} |
| 104 | + @pointfield density_matrix::Matrix{Float64} |
| 105 | + @pointfield damage::Vector{Float64} |
| 106 | + bond_stretch::Vector{Float64} |
| 107 | + bond_active::Vector{Bool} |
| 108 | + @pointfield n_active_bonds::Vector{Int} |
| 109 | +end |
| 110 | + |
| 111 | +function init_field(::DHBBMaterial, ::AbstractTimeSolver, system::BondSystem, ::Val{:b_int}) |
| 112 | + return zeros(3, get_n_points(system)) |
| 113 | +end |
| 114 | + |
| 115 | +function init_field(::DHBBMaterial, ::AbstractTimeSolver, system::BondSystem, |
| 116 | + ::Val{:bond_stretch}) |
| 117 | + return zeros(get_n_bonds(system)) |
| 118 | +end |
| 119 | + |
| 120 | +function force_density_point!(storage::DHBBStorage, system::BondSystem, ::DHBBMaterial, |
| 121 | + params::StandardPointParameters, t, Δt, i) |
| 122 | + (; position, bond_stretch, bond_active, b_int) = storage |
| 123 | + (; bonds, correction, volume) = system |
| 124 | + for bond_id in each_bond_idx(system, i) |
| 125 | + bond = bonds[bond_id] |
| 126 | + j = bond.neighbor |
| 127 | + Δxij = get_vector_diff(position, i, j) |
| 128 | + ε = bond_stretch[bond_id] |
| 129 | + ω = bond_active[bond_id] * surface_correction_factor(correction, bond_id) |
| 130 | + b = ω * params.bc * ε .* Δxij |
| 131 | + update_add_vector!(b_int, i, b * volume[j]) |
| 132 | + update_add_vector!(b_int, j, -b * volume[i]) |
| 133 | + end |
| 134 | + return nothing |
| 135 | +end |
| 136 | + |
| 137 | +function force_density_point!(storage::DHBBStorage, system::BondSystem, ::DHBBMaterial, |
| 138 | + paramhandler::ParameterHandler, t, Δt, i) |
| 139 | + (; position, bond_stretch, bond_active, b_int) = storage |
| 140 | + (; bonds, correction, volume) = system |
| 141 | + params_i = get_params(paramhandler, i) |
| 142 | + for bond_id in each_bond_idx(system, i) |
| 143 | + bond = bonds[bond_id] |
| 144 | + j = bond.neighbor |
| 145 | + Δxij = get_vector_diff(position, i, j) |
| 146 | + ε = bond_stretch[bond_id] |
| 147 | + params_j = get_params(paramhandler, j) |
| 148 | + ω = bond_active[bond_id] * surface_correction_factor(correction, bond_id) |
| 149 | + b = ω * (params_i.bc + params_j.bc) / 2 * ε .* Δxij |
| 150 | + update_add_vector!(b_int, i, b * volume[j]) |
| 151 | + update_add_vector!(b_int, j, -b * volume[i]) |
| 152 | + end |
| 153 | + return nothing |
| 154 | +end |
0 commit comments