Skip to content

Commit 96f314d

Browse files
committed
add Nusslt plot to study
1 parent fbdf9c9 commit 96f314d

File tree

3 files changed

+70
-12
lines changed

3 files changed

+70
-12
lines changed

examples/study1/study1.jl

Lines changed: 65 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cases = [
4343
for (n, model, bcs) in paramlist
4444
]
4545

46-
outs = []
46+
outs1 = []
4747
out = nothing
4848
for (i, case) in enumerate(cases)
4949
name = "square_$(i)_$(case.n)"
@@ -66,7 +66,7 @@ for (i, case) in enumerate(cases)
6666
nlsolver_init_guess_type=:zero,
6767
case.bcs...
6868
)
69-
push!(outs, out)
69+
push!(outs1, out)
7070
GeMotion.contourplot_unitsquare(;
7171
fun=out.psih,
7272
name=name*"/psi",
@@ -112,19 +112,19 @@ end
112112

113113
# 2)
114114
if haskey(ENV, "GITHUB_ACTIONS")
115-
# model_annulus = GmshDiscreteModel(
116-
# joinpath("../meshes/2.5/co-annulus_unstructured_2.msh")
117-
# )
118115
model_annulus = GmshDiscreteModel(
119-
joinpath("../meshes/2.5/co-annulus_structured_2.msh")
116+
joinpath("../meshes/2.5/co-annulus_unstructured_4.msh")
120117
)
121-
else
122118
# model_annulus = GmshDiscreteModel(
123-
# joinpath("../meshes/2.5/co-annulus_unstructured_3.msh")
119+
# joinpath("../meshes/2.5/co-annulus_structured_2.msh")
124120
# )
121+
else
125122
model_annulus = GmshDiscreteModel(
126-
joinpath("../meshes/2.5/co-annulus_structured_5.msh")
123+
joinpath("../meshes/2.5/co-annulus_unstructured_6.msh")
127124
)
125+
# model_annulus = GmshDiscreteModel(
126+
# joinpath("../meshes/2.5/co-annulus_structured_6.msh")
127+
# )
128128
end
129129
uniform_annulus = (;
130130
T_diri_tags=["inner", "outer"],
@@ -154,7 +154,7 @@ cases = [
154154
for (n, model, bcs, Sfl_lvls) in paramlist
155155
]
156156

157-
outs = []
157+
outs2 = []
158158
for (i, case) in enumerate(cases)
159159
name = "annulus_$(i)_$(case.n)"
160160

@@ -199,8 +199,7 @@ for (i, case) in enumerate(cases)
199199
nlsolver_init_guess_type=:custom,
200200
case.bcs...
201201
)
202-
push!(outs, out)
203-
# opts=(;ri=5/8,ro=13/8,eps=0.01,n_plot=100)
202+
push!(outs2, out)
204203
opts=(;ri=2/3,ro=5/3,eps=0.01,n_plot=100)
205204
GeMotion.contourplot_coannulus(
206205
;opts...,
@@ -233,3 +232,57 @@ for (i, case) in enumerate(cases)
233232
surfaceargs=(;colormap=:Blues)
234233
) |> display
235234
end
235+
236+
begin
237+
scale = 1.5
238+
f = Figure(
239+
size=scale .* (600, 250),
240+
figure_padding= (0,10,0,0)
241+
)
242+
nplot_Nu = 100
243+
phis_Nu = LinRange(0, 2*pi, 2*nplot_Nu)[1:end]
244+
245+
map(enumerate([1:3,4:6])) do (i_indices, indices)
246+
247+
ax = Axis(
248+
f[1, i_indices],
249+
title=i_indices==1 ? "inner wall, uniform heating" : "inner wall, non-uniform heating",
250+
xlabel="angle ϕ",
251+
ylabel="Nusselt number Nu",
252+
xminorticksvisible=true,
253+
yminorticksvisible=true,
254+
xticks = (0:1/2*pi:2*pi, ["0", "π/2", "π", "3π/2", ""]),
255+
yticks=LinearTicks(5),
256+
limits=((0.0, 2*pi), (-0.5,10.5))
257+
)
258+
259+
map(outs2[indices]) do o
260+
nb = get_normal_vector(o.btrian)
261+
Nu = Interpolable(
262+
# get (-dT/dr) with a transformation to polar coordinates
263+
(- (o.Th) (x->VectorValue([x[1],x[2]] / sqrt(x[1]^2 + x[2]^2))));
264+
searchmethod=KDTreeSearch(num_nearest_vertices=50)
265+
)
266+
cache = return_cache(Nu, Gridap.Point(0.0, 0.0))
267+
dist = 0.0
268+
ri = 2/3
269+
Nu_inner = [
270+
evaluate!(cache, Nu, Gridap.Point([(ri+dist)*cos(p), (ri+dist)*sin(p)]))
271+
for p in phis_Nu
272+
]
273+
lines!(
274+
phis_Nu,
275+
Nu_inner,
276+
label="n = $(o.n)",
277+
)
278+
end
279+
axislegend(
280+
labelsize=10,
281+
position=:lt,
282+
orientation=:horizontal,
283+
nbanks=1,
284+
)
285+
end
286+
f |> display
287+
save("nusselt_number_annulus.pdf", f)
288+
end

src/Postprocessing.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ function plot_all_unitsquare2(psih, Th, uh, model, name, levels)
225225
Nu = Interpolable(
226226
((Th) nb); searchmethod=KDTreeSearch(num_nearest_vertices=5)
227227
)
228+
# writevtk(Ωₕ, joinpath(name, "nusselt.vtu"), cellfields=[
229+
# "Nu" => Nu
230+
# ])
228231

229232
# entropies
230233
Sth = interpolate(

src/Solver.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ function simulate3(;
8181
)
8282

8383
reffe_T = ReferenceFE(lagrangian, Float64, order)
84+
# reffe_T = ReferenceFE(lagrangian, Float64, order-1)
8485

8586
reffeₚ = ReferenceFE(lagrangian, Float64, order - 1; space=:P)
8687
Q = TestFESpace(model, reffeₚ, conformity=:L2, constraint=:zeromean)
@@ -238,6 +239,7 @@ function simulate3(;
238239
Ωₕ=Ωₕ,
239240
Pr=Pr,
240241
Ra=Ra,
242+
n=n,
241243
res_op=res_op,
242244
)
243245
end

0 commit comments

Comments
 (0)