Skip to content

Commit 97416a8

Browse files
committed
Use a relative path instead of an absolute path
1 parent 1c36d2b commit 97416a8

File tree

5 files changed

+45
-28
lines changed

5 files changed

+45
-28
lines changed

test/test_data/fsi.jl renamed to test/IBM/test_FSI_job.jl

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
using HyperFSI
2-
1+
@testitem "FSI_job" begin
2+
using HyperFSI: FSI_job
3+
34
set = KitBase.Setup(
45
case = "rectangle", # Case identifier
56
space = "2d0f0v", # 2D simulation space
@@ -18,9 +19,11 @@ using HyperFSI
1819
density = 0.603, # Reference density [kg/m³]
1920
pressure = 52500 * 2, # Reference pressure [Pa]
2021
k = 1.0 # Thermal diffusion factor
21-
)
22+
)
23+
2224
ps = KitBase.PSpace2D(-3.0, 3.0, 140, -2.0, 2.0, 90, 1, 1)
2325
vs = nothing
26+
2427
U_∞ = 0.8 * KitBase.sound_speed(1.0, 1.4) # Freestream velocity
2528
Re = 2000.0 # Reynolds number
2629
gas = KitBase.Gas(
@@ -42,36 +45,50 @@ using HyperFSI
4245
ctr, a1face, a2face = KitBase.init_fvm(ks; structarray = true)
4346
dtf = KitBase.timestep(ks, ctr, 0.0) * ref.time
4447
fv = Flowstep(steps=1, stepsize=dtf)
45-
geo = Post2D("Ring.inp", ["Line5","Line6","Line7","Line8"])
46-
bc_index = geo.bc_nodes # Boundary node indices
48+
49+
mesh_file = joinpath(@__DIR__, "..", "test_data", "Ring.inp")
50+
geo = Post2D(mesh_file, ["Line5","Line6","Line7","Line8"])
4751
pos = geo.pos # Node positions [m]
4852
area = geo.area # Nodal areas [m²]
4953
height = sqrt(minimum(area)) # Characteristic length
5054
vol = height * area # Nodal volumes [m³]
5155
body = Peridynamics.Body(BBTMaterial(), pos, vol)
56+
Peridynamics.material!(body; horizon=4height, E=2.0e11, rho=1e3, epsilon_c=1e-2, kc=11400.0, aph=1.0e-6, cv=1.0, rft=273,
57+
h=25.0, hσ=5.73e-8, hϵ=0.9, tem∞=0.0, thick=height)
58+
bcst = Bcstruct(pos) #
5259

53-
Peridynamics.material!(body;
54-
horizon = 4*height, # Peridynamic horizon (4× characteristic length)
55-
E = 2.0e11, # Elastic modulus
56-
rho = 1e3, # Material density
57-
epsilon_c = 1e-2, # Critical fracture strain
58-
kc = 11400.0, # Thermal conductivity
59-
aph = 1.0e-6, # Thermal expansion
60-
cv = 1.0, # Heat capacity
61-
rft = 273, # Reference temperature [K]
62-
h = 25.0, # Convection coefficient [W/(m²·K)]
63-
= 5.73e-8, # Stefan-Boltzmann Constant
64-
= 0.9, # Emissivity
65-
tem∞ = 0.0, # Ambient temperature [K]
66-
thick = height # Thickness for 2D
67-
)
68-
bcst = Bcstruct(pos)
69-
70-
hsource_databc!(body, bcst.hsource, :all_points)
60+
hsource_databc!(body, bcst.hsource, :all_points)
7161
vv = Thermstep(steps=1)
7262
job = FSI_job(ks, body, fv, vv;
7363
path = joinpath(@__DIR__, "cylinder"), # - Output directory "./cylinder"
7464
freq = 1, # Output frequency
7565
fields = (:displacement, :temperature, :damage)# - Output fields
7666
)
77-
ret = FSI_submit(job, bcst, geo, "T"; ref = ref)
67+
68+
@test job isa FSI_job
69+
@test job.f_time_solver isa Flowstep
70+
@test job.s_time_solver isa Thermstep
71+
@test job.spatial_setup isa Peridynamics.Body
72+
@test job.flow_setup isa KitBase.SolverSet
73+
@test job.options.export_allowed == true
74+
@test job.options.freq == 1
75+
@test job.options.root == joinpath(@__DIR__, "cylinder")
76+
@test job.options.vtk == joinpath(@__DIR__, "cylinder/structure")
77+
@test job.options.fields == [:displacement, :temperature, :damage]
78+
@test job.options.flow == joinpath(@__DIR__, "cylinder/flow")
79+
end
80+
81+
@testitem "Bcstruct" begin
82+
using HyperFSI: Bcstruct
83+
84+
pos = [ -0.25 0.25 -0.25 0.25
85+
-0.25 -0.25 0.25 0.25
86+
0.0 0.0 0.0 0.0]
87+
88+
bc = Bcstruct(pos)
89+
@test bc isa Bcstruct
90+
@test size(bc.hsource) == (1, 4)
91+
@test size(bc.pressure) == (3, 4)
92+
@test all(bc.hsource .== 0.0)
93+
@test all(bc.pressure .== 0.0)
94+
end

test/IBM/test_post_2d.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@testitem "Post2D" begin
22
using HyperFSI: Post2D
3-
mesh_file = "/Users/shiweihu/Codes/Develops/HyperFSI/test/test_data/squ.inp"
3+
mesh_file = joinpath(@__DIR__, "..", "test_data", "squ.inp")
44
geo = Post2D(mesh_file, ["Line1", "Line2", "Line3", "Line4"])
55
pos0 = [ -0.25 0.25 -0.25 0.25
66
-0.25 -0.25 0.25 0.25

test/IBM/test_post_3d.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@testitem "Post3D" begin
22
using HyperFSI: Post3D
3-
mesh_file = "/Users/shiweihu/Codes/Develops/HyperFSI/test/test_data/vol.inp"
3+
mesh_file = joinpath(@__DIR__, "..", "test_data", "vol.inp")
44
geo = Post3D(mesh_file, ["Surface1", "Surface2", "Surface3", "Surface4", "Surface5", "Surface6"])
55
pos0 = [ -0.25 0.25 -0.25 0.25 -0.25 0.25 -0.25 0.25
66
-0.25 -0.25 0.25 0.25 -0.25 -0.25 0.25 0.25

test/coupling_solvers/test_FSI_job.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
dtf = KitBase.timestep(ks, ctr, 0.0) * ref.time
4747
fv = Flowstep(steps=1, stepsize=dtf)
4848

49-
mesh_file = "/Users/shiweihu/Codes/Develops/HyperFSI/test/test_data/Ring.inp"
49+
mesh_file = joinpath(@__DIR__, "..", "test_data", "Ring.inp")
5050
geo = Post2D(mesh_file, ["Line5","Line6","Line7","Line8"])
5151
pos = geo.pos # Node positions [m]
5252
area = geo.area # Nodal areas [m²]

test/coupling_solvers/test_FSI_submit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
dtf = KitBase.timestep(ks, ctr, 0.0) * ref.time
4747
fv = Flowstep(steps=1, stepsize=dtf)
4848

49-
mesh_file = "/Users/shiweihu/Codes/Develops/HyperFSI/test/test_data/Ring.inp"
49+
mesh_file = joinpath(@__DIR__, "..", "test_data", "Ring.inp")
5050
geo = Post2D(mesh_file, ["Line5","Line6","Line7","Line8"])
5151
pos = geo.pos # Node positions [m]
5252
area = geo.area # Nodal areas [m²]

0 commit comments

Comments
 (0)