Skip to content

Commit a47cc08

Browse files
committed
Uncompleted axis_symmetric thermal diffusion module
1 parent 22851c1 commit a47cc08

File tree

2 files changed

+133
-0
lines changed

2 files changed

+133
-0
lines changed

src/HyperFSI.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ include("structure/physics/bond_based_thermal_diffusion.jl")
4646
include("structure/physics/bond_based_thermomechanics.jl")
4747
include("structure/physics/bond_based_dualstep_thermomechanics.jl")
4848
include("structure/physics/bond_based_thermal_diffusion_temp_dependent.jl")
49+
#include("structure/physics/bond_based_thermal_diffusion_axis.jl")
4950

5051
include("fluid/FlowTimesolver.jl")
5152
include("fluid/Evolution.jl")
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
struct BBTAMaterial{Correction,DM} <: Peridynamics.AbstractBondSystemMaterial{Correction}
2+
dmgmodel::DM
3+
function BBTAMaterial{C}(dmgmodel::DM) where {C,DM}
4+
new{C,DM}(dmgmodel)
5+
end
6+
end
7+
8+
function BBTAMaterial{C}(; dmgmodel::Peridynamics.AbstractDamageModel=CriticalStretch()) where {C}
9+
return BBTAMaterial{C}(dmgmodel)
10+
end
11+
BBTAMaterial(; kwargs...) = BBTAMaterial{NoCorrection}(; kwargs...)
12+
13+
struct BBTAPointParameters <: Peridynamics.AbstractPointParameters
14+
δ::Float64
15+
rho::Float64
16+
E::Float64
17+
nu::Float64
18+
G::Float64
19+
K::Float64
20+
λ::Float64
21+
μ::Float64
22+
Gc::Float64
23+
εc::Float64
24+
bc::Float64
25+
kc::Float64 # thermal conductivity
26+
kp::Float64 # microconductivity
27+
aph::Float64 # thermal expansion
28+
cv::Float64 # specific heat capacity
29+
rft::Float64 # Reference temperature
30+
h::Float64 # convective heat transfer coefficient,
31+
::Float64 # Stefan-Boltzman constant,
32+
::Float64 # emissivity
33+
tem∞::Float64 # temperature of the surrounding medium
34+
end
35+
36+
function BBTAPointParameters(mat::BBTAMaterial, p::Dict{Symbol,Any})
37+
par = Peridynamics.get_given_elastic_params(p)
38+
(; E, nu, G, K, λ, μ) = par
39+
40+
if haskey(p, :thick)
41+
p[:nu] = 1/3
42+
else
43+
p[:nu] = 1/4
44+
end
45+
46+
(; δ, rho, E, nu, G, K, λ, μ) = Peridynamics.get_required_point_parameters(mat, p)
47+
Gc, εc = Peridynamics.get_frac_params(mat.dmgmodel, p, δ, K)
48+
kc, aph, cv, rft, h, hσ, hϵ, tem∞ = get_thermal_params(p, δ)
49+
50+
if haskey(p, :thick) #1D_axis_symmetric
51+
thick = float(p[:thick])
52+
bc = 9 * E /* thick * δ^3) # bond constant
53+
kp = kc / δ # microcndicitvity constant
54+
else #2D_axis_symmetric
55+
bc = 12 * E /* δ^4)
56+
kp = 4 * kc /* δ^2)
57+
end
58+
return BBTAPointParameters(δ, rho, E, nu, G, K, λ, μ, Gc, εc, bc, kc, kp, aph, cv, rft, h, hσ, hϵ, tem∞)
59+
end
60+
61+
62+
@Peridynamics.params BBTAMaterial BBTAPointParameters
63+
64+
@Peridynamics.storage BBTAMaterial struct BBTAStorage <: Peridynamics.AbstractStorage
65+
@lthfield position::Matrix{Float64}
66+
@pointfield displacement::Matrix{Float64}
67+
@pointfield velocity::Matrix{Float64}
68+
@pointfield velocity_half::Matrix{Float64}
69+
@pointfield velocity_half_old::Matrix{Float64}
70+
@pointfield acceleration::Matrix{Float64}
71+
@pointfield b_int::Matrix{Float64}
72+
@pointfield b_int_old::Matrix{Float64}
73+
@pointfield b_ext::Matrix{Float64}
74+
@pointfield density_matrix::Matrix{Float64}
75+
@pointfield damage::Vector{Float64}
76+
bond_stretch::Vector{Float64}
77+
bond_active::Vector{Bool}
78+
@pointfield n_active_bonds::Vector{Int}
79+
@lthfield temperature::Matrix{Float64}
80+
@pointfield pflux::Matrix{Float64}
81+
@pointfield hsource::Matrix{Float64}
82+
end
83+
84+
function Peridynamics.Peridynamics.init_field(::BBTAMaterial, ::Peridynamics.AbstractTimeSolver, system::Peridynamics.BondSystem,
85+
::Val{:bond_stretch})
86+
return zeros(Peridynamics.get_n_bonds(system))
87+
end
88+
89+
function Peridynamics.Peridynamics.allowed_material_kwargs(::BBTAMaterial)
90+
return (thermal_kwargs())
91+
end
92+
93+
function pflux_point!(storage::BBTAStorage, system::Peridynamics.BondSystem,
94+
::BBTAMaterial, param::BBTAPointParameters, i::Int, mbd_t::Vector{Float64})
95+
96+
for bond_id in system.bond_ids[i]
97+
bond = system.bonds[bond_id]
98+
j, L = bond.neighbor, bond.length
99+
100+
mof_th = mbd_t[bond_id]
101+
vol_A = L * (param.δ/3) * π * (storage.position[1, j]+storage.position[1, i])
102+
103+
Δtem = storage.temperature[1, j] - storage.temperature[1, i]
104+
105+
shape = 2*storage.position[1, j]/(storage.position[1, j] + storage.position[1, i])
106+
107+
storage.pflux[1, i] += (param.kp * Δtem / L^2) * shape * vol_A
108+
end
109+
return nothing
110+
end
111+
112+
function pflux_point!(storage::BBTAStorage, system::Peridynamics.BondSystem,
113+
::BBTAMaterial, paramhandler::Peridynamics.ParameterHandler, i::Int, mbd_t::Vector{Float64})
114+
115+
params_i = Peridynamics.get_params(paramhandler, i)
116+
for bond_id in system.bond_ids[i]
117+
bond = system.bonds[bond_id]
118+
j, L = bond.neighbor, bond.length
119+
120+
mof_th = mbd_t[bond_id]
121+
122+
shape = 2*storage.position[1, j]/(storage.position[1, j] + storage.position[1, i])
123+
124+
Δtem = storage.temperature[1, j] - storage.temperature[1, i]
125+
126+
params_j = Peridynamics.get_params(paramhandler, j)
127+
128+
storage.pflux[1, i] += storage.bond_active[bond_id] * (0.5*(params_i.kp + params_j.kp) * Δtem / L^2) *
129+
system.volume[j] * shape
130+
end
131+
return nothing
132+
end

0 commit comments

Comments
 (0)