|
| 1 | +""" |
| 2 | +Bond-Based Thermal Diffusion Module with Temperature-Dependent Properties |
| 3 | +
|
| 4 | +This module extends the standard bond-based thermal diffusion model |
| 5 | +by incorporating temperature-dependent thermal properties, including: |
| 6 | +
|
| 7 | +Thermal conductivity in PD (kp) |
| 8 | +Specific heat capacity (cv) |
| 9 | +Thermal expansion coefficient (aph). |
| 10 | +
|
| 11 | +Customizable Functions: |
| 12 | +kp_T(kc, kp, T): 3-parameter function (classical Thermal conductivity, PD Thermal conductivity , temperature T). |
| 13 | +cv_T(cv, T): 2-parameter function (specific heat cv, temperature T). |
| 14 | +aph_T(aph, T): 2-parameter function (expansion coefficient aph, temperature T). |
| 15 | +
|
| 16 | +Default Behavior: |
| 17 | +If no function is assigned (e.g., kp_T is undefined), the property is treated as temperature-independent. |
| 18 | +""" |
| 19 | + |
| 20 | +@inline thermal_temp_kwargs() = (:E, :nu, :G, :K, :lambda, :mu, :rho, :horizon, |
| 21 | +:Gc, :epsilon_c, :kc, :aph, :cv, :rft, :h, :hσ, :hϵ, :tem∞, :thick, :kp_T, :cv_T, :aph_T) |
| 22 | + |
| 23 | +struct BBTTMaterial{Correction,DM} <: Peridynamics.AbstractBondSystemMaterial{Correction} |
| 24 | + dmgmodel::DM |
| 25 | + function BBTTMaterial{C}(dmgmodel::DM) where {C,DM} #BB_Temperature_dependent_Theermal |
| 26 | + new{C,DM}(dmgmodel) |
| 27 | + end |
| 28 | +end |
| 29 | + |
| 30 | +function BBTTMaterial{C}(; dmgmodel::Peridynamics.AbstractDamageModel=CriticalStretch()) where {C} |
| 31 | + return BBTTMaterial{C}(dmgmodel) |
| 32 | +end |
| 33 | + |
| 34 | +BBTTMaterial(; kwargs...) = BBTTMaterial{NoCorrection}(; kwargs...) |
| 35 | + |
| 36 | +struct BBTTPointParameters <: Peridynamics.AbstractPointParameters |
| 37 | + δ::Float64 |
| 38 | + rho::Float64 |
| 39 | + E::Float64 |
| 40 | + nu::Float64 |
| 41 | + G::Float64 |
| 42 | + K::Float64 |
| 43 | + λ::Float64 |
| 44 | + μ::Float64 |
| 45 | + Gc::Float64 |
| 46 | + εc::Float64 |
| 47 | + bc::Float64 |
| 48 | + kc::Float64 # thermal conductivity at room temperature |
| 49 | + kp::Float64 # microconductivity at room temperature |
| 50 | + aph::Float64 # thermal expansion at room temperature |
| 51 | + cv::Float64 # specific heat capacity at room temperature |
| 52 | + rft::Float64 # Reference temperature at room temperature |
| 53 | + h::Float64 # convective heat transfer coefficient, |
| 54 | + hσ::Float64 # Stefan-Boltzman constant, |
| 55 | + hϵ::Float64 # emissivity |
| 56 | + tem∞::Float64 # temperature of the surrounding medium |
| 57 | + kp_T::Function # function describing kp variation with temperature f(kp,T) |
| 58 | + cv_T::Function # function describing kp variation with temperature f(kp,T) |
| 59 | + aph_T::Function # function describing kp variation with temperature f(kp,T) |
| 60 | +end |
| 61 | + |
| 62 | +function const_kp(kc, kp, T) |
| 63 | + return kp |
| 64 | +end |
| 65 | + |
| 66 | +function const_cv(cv, T) |
| 67 | + return cv |
| 68 | +end |
| 69 | + |
| 70 | +function const_aph(aph, T) |
| 71 | + return aph |
| 72 | +end |
| 73 | + |
| 74 | +function BBTTPointParameters(mat::BBTTMaterial, p::Dict{Symbol,Any}) |
| 75 | + par = Peridynamics.get_given_elastic_params(p) |
| 76 | + (; E, nu, G, K, λ, μ) = par |
| 77 | + |
| 78 | + if haskey(p, :thick) |
| 79 | + p[:nu] = 1/3 |
| 80 | + else |
| 81 | + p[:nu] = 1/4 |
| 82 | + end |
| 83 | + |
| 84 | + (; δ, rho, E, nu, G, K, λ, μ) = Peridynamics.get_required_point_parameters(mat, p) |
| 85 | + Gc, εc = Peridynamics.get_frac_params(mat.dmgmodel, p, δ, K) |
| 86 | + kc, aph, cv, rft, h, hσ, hϵ, tem∞ = get_thermal_params(p, δ) |
| 87 | + |
| 88 | + if haskey(p, :thick) #2D |
| 89 | + thick = float(p[:thick]) |
| 90 | + bc = 9 * E / (π * thick * δ^3) # bond constant |
| 91 | + kp = 6 * kc / (π * thick * δ^3) # microcndicitvity constant |
| 92 | + else #3D |
| 93 | + bc = 12 * E / (π * δ^4) |
| 94 | + kp = 6 * kc / (π * δ^4) |
| 95 | + end |
| 96 | + |
| 97 | + kp_T = get(p, :kp_T, const_kp) |
| 98 | + cv_T = get(p, :cv_T, const_cv) |
| 99 | + aph_T = get(p, :aph_T, const_aph) |
| 100 | + |
| 101 | + return BBTTPointParameters(δ, rho, E, nu, G, K, λ, μ, Gc, εc, bc, kc, kp, aph, cv, rft, h, hσ, hϵ, tem∞, kp_T, cv_T, aph_T) |
| 102 | +end |
| 103 | + |
| 104 | +@Peridynamics.params BBTTMaterial BBTTPointParameters |
| 105 | + |
| 106 | +@Peridynamics.storage BBTTMaterial struct BBTTStorage <: Peridynamics.AbstractStorage |
| 107 | + @lthfield position::Matrix{Float64} |
| 108 | + @pointfield displacement::Matrix{Float64} |
| 109 | + @pointfield velocity::Matrix{Float64} |
| 110 | + @pointfield velocity_half::Matrix{Float64} |
| 111 | + @pointfield velocity_half_old::Matrix{Float64} |
| 112 | + @pointfield acceleration::Matrix{Float64} |
| 113 | + @pointfield b_int::Matrix{Float64} |
| 114 | + @pointfield b_int_old::Matrix{Float64} |
| 115 | + @pointfield b_ext::Matrix{Float64} |
| 116 | + @pointfield density_matrix::Matrix{Float64} |
| 117 | + @pointfield damage::Vector{Float64} |
| 118 | + bond_stretch::Vector{Float64} |
| 119 | + bond_active::Vector{Bool} |
| 120 | + @pointfield n_active_bonds::Vector{Int} |
| 121 | + @lthfield temperature::Matrix{Float64} |
| 122 | + @pointfield pflux::Matrix{Float64} |
| 123 | + @pointfield hsource::Matrix{Float64} |
| 124 | +end |
| 125 | + |
| 126 | +function Peridynamics.Peridynamics.init_field(::BBTTMaterial, ::Peridynamics.AbstractTimeSolver, system::Peridynamics.BondSystem, |
| 127 | + ::Val{:bond_stretch}) |
| 128 | + return zeros(Peridynamics.get_n_bonds(system)) |
| 129 | +end |
| 130 | + |
| 131 | +function Peridynamics.Peridynamics.allowed_material_kwargs(::BBTTMaterial) |
| 132 | + return (thermal_temp_kwargs()) |
| 133 | +end |
| 134 | + |
| 135 | +function pflux_point!(storage::BBTTStorage, system::Peridynamics.BondSystem, |
| 136 | + ::BBTTMaterial, param::BBTTPointParameters, i::Int, mbd_t::Vector{Float64}) |
| 137 | + |
| 138 | + for bond_id in system.bond_ids[i] |
| 139 | + bond = system.bonds[bond_id] |
| 140 | + j, L = bond.neighbor, bond.length |
| 141 | + |
| 142 | + mof_th = mbd_t[bond_id] |
| 143 | + |
| 144 | + Δtem = storage.temperature[1, j] - storage.temperature[1, i] |
| 145 | + |
| 146 | + kp_tm = 0.5*(param.kp_T(param.kc, param.kp, storage.temperature[1, i]) + param.kp_T(param.kc, param.kp, storage.temperature[1, j])) |
| 147 | + |
| 148 | + storage.pflux[1, i] += storage.bond_active[bond_id] * Δtem / L * kp_tm * system.volume[j] * mof_th |
| 149 | + end |
| 150 | + return nothing |
| 151 | +end |
| 152 | + |
| 153 | +function pflux_point!(storage::BBTTStorage, system::Peridynamics.BondSystem, |
| 154 | + ::BBTTMaterial, paramhandler::Peridynamics.ParameterHandler, i::Int, mbd_t::Vector{Float64}) |
| 155 | + |
| 156 | + params_i = Peridynamics.get_params(paramhandler, i) |
| 157 | + for bond_id in system.bond_ids[i] |
| 158 | + bond = system.bonds[bond_id] |
| 159 | + j, L = bond.neighbor, bond.length |
| 160 | + |
| 161 | + mof_th = mbd_t[bond_id] |
| 162 | + |
| 163 | + Δtem = storage.temperature[1, j] - storage.temperature[1, i] |
| 164 | + |
| 165 | + params_j = Peridynamics.get_params(paramhandler, j) |
| 166 | + |
| 167 | + kp_tm = 0.5*(params_j.kp_T(params_j.kc, params_j.kp, storage.temperature[1, j]) + params_i.kp_T(params_i.kc, params_i.kp, storage.temperature[1, i])) |
| 168 | + |
| 169 | + storage.pflux[1, i] += storage.bond_active[bond_id] * kp_tm * Δtem / L * system.volume[j] * mof_th |
| 170 | + end |
| 171 | + return nothing |
| 172 | +end |
0 commit comments