Skip to content

stress_tf

Code generating the TF coil inboard mid-plane stress/strain summary plots The whole radial distribution is displayed

Input file: SIG_TF.json

StressPlotConfig dataclass

Source code in process/core/io/plot/stress_tf.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@dataclass
class StressPlotConfig:
    axis_font_size: float
    axis_tick_size: int = 16
    legend_size: int = 12
    mark_size: int = 13
    line_width: float = 3.5
    outdir: Path | None = None

    def __post_init__(self):
        if self.outdir is None:
            self.outdir = Path.cwd()
        if not Path(self.outdir).is_dir():
            Path(self.outdir).mkdir()

axis_font_size instance-attribute

axis_tick_size = 16 class-attribute instance-attribute

legend_size = 12 class-attribute instance-attribute

mark_size = 13 class-attribute instance-attribute

line_width = 3.5 class-attribute instance-attribute

outdir = None class-attribute instance-attribute

plot_stress(plot_selection, save_format, axis_font_size, term_output, input_file, plot_conf=None)

Source code in process/core/io/plot/stress_tf.py
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
def plot_stress(
    plot_selection,
    save_format,
    axis_font_size,
    term_output,
    input_file,
    plot_conf: StressPlotConfig | dict | None = None,
):
    if plot_conf is None:
        plot_conf = StressPlotConfig(axis_font_size)
    elif isinstance(plot_conf, dict):
        plot_conf = StressPlotConfig(axis_font_size, **plot_conf)

    # Boolean swiches for plot selection
    # -----------------------------------
    plot_sig = ("sig" in plot_selection) or ("all" in plot_selection)
    plot_disp = ("disp" in plot_selection) or ("all" in plot_selection)
    plot_strain = ("strain" in plot_selection) or ("all" in plot_selection)
    plot_sm_sig = ("sm_sig" in plot_selection) or ("all" in plot_selection)

    # Step 1 : Data extraction
    # ----------------------------------------------------------------------------------------------
    # Number of physical quantity value per coil layer
    n_radial_array_layer = 0

    with open(input_file) as f:
        sig_file_data = json.load(f)

    # Getting the data to be plotted
    n_radial_array_layer = sig_file_data["Points per layers"]
    n_points = len(sig_file_data["Radius (m)"])
    n_layers = int(n_points / n_radial_array_layer)

    # Assumes n_layers >= 1

    # Physical quantities : full vectors
    def _empty_lists(n_l):
        return [[] for _ in range(n_l)]

    radius = _empty_lists(n_layers)
    radial_smeared_stress = _empty_lists(n_layers)
    toroidal_smeared_stress = _empty_lists(n_layers)
    vertical_smeared_stress = _empty_lists(n_layers)
    tresca_smeared_stress = _empty_lists(n_layers)
    radial_stress = _empty_lists(n_layers)
    toroidal_stress = _empty_lists(n_layers)
    vertical_stress = _empty_lists(n_layers)
    vm_stress = _empty_lists(n_layers)
    tresca_stress = _empty_lists(n_layers)
    cea_tresca_stress = _empty_lists(n_layers)
    radial_strain = _empty_lists(n_layers)
    toroidal_strain = _empty_lists(n_layers)
    vertical_strain = _empty_lists(n_layers)
    radial_displacement = _empty_lists(n_layers)

    # Physical quantity : WP stress
    wp_vertical_stress = []

    # Physical quantity : values at layer border
    bound_radius = []
    bound_radial_smeared_stress = []
    bound_toroidal_smeared_stress = []
    bound_vertical_smeared_stress = []
    bound_tresca_smeared_stress = []
    bound_radial_stress = []
    bound_toroidal_stress = []
    bound_vertical_stress = []
    bound_vm_stress = []
    bound_tresca_stress = []
    bound_cea_tresca_stress = []
    bound_radial_strain = []
    bound_toroidal_strain = []
    bound_vertical_strain = []
    bound_radial_displacement = []

    for ii in range(n_layers):
        # Full vector
        lb_ind = ii * n_radial_array_layer
        ub_ind = (ii + 1) * n_radial_array_layer - 1
        lb_ub = itemgetter(lb_ind, ub_ind)

        for jj in range(n_radial_array_layer):
            ij_ind = lb_ind + jj

            radius[ii].append(sig_file_data["Radius (m)"][ij_ind])
            radial_stress[ii].append(sig_file_data["Radial stress (MPa)"][ij_ind])
            toroidal_stress[ii].append(sig_file_data["Toroidal stress (MPa)"][ij_ind])
            vertical_stress[ii].append(
                sig_file_data["Vertical stress (MPa)"][
                    0 if len(sig_file_data["Vertical stress (MPa)"]) == 1 else ij_ind
                ]
            )
            radial_smeared_stress[ii].append(
                sig_file_data["Radial smear stress (MPa)"][ij_ind]
            )
            toroidal_smeared_stress[ii].append(
                sig_file_data["Toroidal smear stress (MPa)"][ij_ind]
            )
            vertical_smeared_stress[ii].append(
                sig_file_data["Vertical smear stress (MPa)"][ij_ind]
            )
            vm_stress[ii].append(sig_file_data["Von-Mises stress (MPa)"][ij_ind])
            tresca_stress[ii].append(sig_file_data["CEA Tresca stress (MPa)"][ij_ind])
            cea_tresca_stress[ii].append(
                sig_file_data["CEA Tresca stress (MPa)"][ij_ind]
            )
            radial_displacement[ii].append(
                sig_file_data["rad. displacement (mm)"][ij_ind]
            )

        # Layer lower/upper boundaries values
        bound_radius.extend(lb_ub(sig_file_data["Radius (m)"]))
        bound_radial_stress.extend(lb_ub(sig_file_data["Radial stress (MPa)"]))
        bound_toroidal_stress.extend(lb_ub(sig_file_data["Toroidal stress (MPa)"]))

        if len(sig_file_data["Vertical stress (MPa)"]) == 1:
            bvs_l = bvs_u = 0
        else:
            bvs_l = lb_ind
            bvs_u = ub_ind
        bound_vertical_stress.extend([
            sig_file_data["Vertical stress (MPa)"][bvs_l],
            sig_file_data["Vertical stress (MPa)"][bvs_u],
        ])

        bound_radial_smeared_stress.extend(
            lb_ub(sig_file_data["Radial smear stress (MPa)"])
        )
        bound_toroidal_smeared_stress.extend(
            lb_ub(sig_file_data["Toroidal smear stress (MPa)"])
        )
        bound_vertical_smeared_stress.extend(
            lb_ub(sig_file_data["Vertical smear stress (MPa)"])
        )
        bound_vm_stress.extend(lb_ub(sig_file_data["Von-Mises stress (MPa)"]))
        bound_tresca_stress.extend(lb_ub(sig_file_data["CEA Tresca stress (MPa)"]))
        bound_cea_tresca_stress.extend(lb_ub(sig_file_data["CEA Tresca stress (MPa)"]))
        bound_radial_displacement.extend(lb_ub(sig_file_data["rad. displacement (mm)"]))

        # Layer upper boundaries values

    # TRESCA smeared stress [MPa]
    for ii in range(n_layers):
        bound_tresca_smeared_stress.extend([
            max(abs(radial_smeared_stress[ii][0]), abs(toroidal_smeared_stress[ii][0]))
            + vertical_smeared_stress[ii][0],
            max(
                abs(radial_smeared_stress[ii][n_radial_array_layer - 1]),
                abs(toroidal_smeared_stress[ii][n_radial_array_layer - 1]),
            )
            + vertical_smeared_stress[ii][n_radial_array_layer - 1],
        ])
        for jj in range(n_radial_array_layer):
            tresca_smeared_stress[ii].append(
                max(
                    abs(radial_smeared_stress[ii][jj]),
                    abs(toroidal_smeared_stress[ii][jj]),
                )
                + vertical_smeared_stress[ii][jj]
            )

    # Strains
    if len(sig_file_data) > 16:
        for ii in range(n_layers):
            bound_radial_strain.extend([lb_ub(sig_file_data["Radial strain"])])
            bound_toroidal_strain.extend([lb_ub(sig_file_data["Toroidal strain"])])
            bound_vertical_strain.extend([lb_ub(sig_file_data["Vertical strain"])])
            for jj in range(n_radial_array_layer):
                ij_ind = lb_ind + jj

                radial_strain[ii].append(sig_file_data["Radial strain"][ij_ind])
                toroidal_strain[ii].append(sig_file_data["Toroidal strain"][ij_ind])
                vertical_strain[ii].append(sig_file_data["Vertical strain"][ij_ind])

                if "WP smeared stress (MPa)" in sig_file_data:
                    wp_vertical_stress.append(
                        sig_file_data["WP smeared stress (MPa)"][jj]
                    )

    if term_output:
        terminal_output(
            n_layers,
            n_radial_array_layer,
            sig_file_data,
            radial_stress,
            toroidal_stress,
            vertical_stress,
            tresca_stress,
            wp_vertical_stress,
            radial_smeared_stress,
            toroidal_smeared_stress,
            vertical_smeared_stress,
            tresca_smeared_stress,
            radial_strain,
            toroidal_strain,
            vertical_strain,
        )

    if plot_sig:
        stress_summary(
            n_layers,
            radius,
            bound_radius,
            radial_stress,
            toroidal_stress,
            vertical_stress,
            tresca_stress,
            vm_stress,
            bound_radial_stress,
            bound_toroidal_stress,
            bound_vertical_stress,
            bound_tresca_stress,
            bound_vm_stress,
            save_format,
            plot_conf,
        )

    if plot_sm_sig:
        smeared_stress_summary(
            n_layers,
            radius,
            bound_radius,
            radial_smeared_stress,
            toroidal_smeared_stress,
            vertical_smeared_stress,
            tresca_smeared_stress,
            bound_radial_smeared_stress,
            bound_toroidal_smeared_stress,
            bound_vertical_smeared_stress,
            bound_tresca_smeared_stress,
            save_format,
            plot_conf,
        )

    if plot_strain and len(sig_file_data) > 15:
        strain_summary(
            n_layers,
            radius,
            bound_radius,
            radial_strain,
            bound_radial_strain,
            toroidal_strain,
            bound_toroidal_strain,
            vertical_strain,
            bound_vertical_strain,
            save_format,
            plot_conf,
        )

    if plot_disp:
        displacement(n_layers, radius, radial_displacement, save_format, plot_conf)

terminal_output(n_layers, n_radial_array_layer, sig_file_data, radial_stress, toroidal_stress, vertical_stress, tresca_stress, wp_vertical_stress, radial_smeared_stress, toroidal_smeared_stress, vertical_smeared_stress, tresca_smeared_stress, radial_strain, toroidal_strain, vertical_strain)

Source code in process/core/io/plot/stress_tf.py
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
def terminal_output(
    n_layers,
    n_radial_array_layer,
    sig_file_data,
    radial_stress,
    toroidal_stress,
    vertical_stress,
    tresca_stress,
    wp_vertical_stress,
    radial_smeared_stress,
    toroidal_smeared_stress,
    vertical_smeared_stress,
    tresca_smeared_stress,
    radial_strain,
    toroidal_strain,
    vertical_strain,
):
    ii_ins = 0
    ii_mids = int(0.5 * float(n_radial_array_layer))
    ii_outs = n_radial_array_layer - 1
    dg = itemgetter(ii_ins, ii_mids, ii_outs)

    print("\n\nLayer stress details\n____________________")

    frame = """Layer {}
------------------------------
steel radial   stress in the inner/middle/out point: {} MPa
steel toroidal stress in the inner/middle/out point: {} MPa
steel vertical stress in the inner/middle/out point: {} MPa
steel TRESCA   stress in the inner/middle/out point: {} MPa
smeared radial   stress in the inner/middle/out point: {} MPa
smeared toroidal stress in the inner/middle/out point: {} MPa
smeared vertical stress in the inner/middle/out point: {} MPa
smeared TRESCA   stress in the inner/middle/out point: {} MPa

"""
    frame2 = """
radial   strain in the inner/middle/out point: {}
toroidal strain in the inner/middle/out point: {}
vertical strain: {}

"""
    frame3 = "smeared WP vertical stress in the inner/middle/out point: {} MPa"
    layer_line = "{}/{}/{}"
    for ii in range(n_layers):
        layer = ii + 1
        s_radial = layer_line.format(*dg(radial_stress[ii]))
        s_toro = layer_line.format(*dg(toroidal_stress[ii]))
        s_vert = layer_line.format(*dg(vertical_stress[ii]))
        s_tres = layer_line.format(*dg(tresca_stress[ii]))
        sm_rad = layer_line.format(*dg(radial_smeared_stress[ii]))
        sm_toro = layer_line.format(*dg(toroidal_smeared_stress[ii]))
        sm_vert = layer_line.format(*dg(vertical_smeared_stress[ii]))
        sm_tres = layer_line.format(*dg(tresca_smeared_stress[ii]))

        print(
            frame.format(
                layer,
                s_radial,
                s_toro,
                s_vert,
                s_tres,
                sm_rad,
                sm_toro,
                sm_vert,
                sm_tres,
            )
        )

        if len(sig_file_data) > 16:
            r_strain = layer_line.format(*dg(radial_strain[ii]))
            t_strain = layer_line.format(*dg(toroidal_strain[ii]))
            print(frame2.format(r_strain, t_strain, vertical_strain[ii][0]))

    if len(wp_vertical_stress) != 0:
        print(
            frame3.format(
                wp_vertical_stress[0],
                wp_vertical_stress[ii_mids],
                wp_vertical_stress[ii_outs],
            )
        )
    print()

stress_summary(n_layers, radius, bound_radius, radial_stress, toroidal_stress, vertical_stress, tresca_stress, vm_stress, bound_radial_stress, bound_toroidal_stress, bound_vertical_stress, bound_tresca_stress, bound_vm_stress, save_format, plot_conf)

Source code in process/core/io/plot/stress_tf.py
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
def stress_summary(
    n_layers,
    radius,
    bound_radius,
    radial_stress,
    toroidal_stress,
    vertical_stress,
    tresca_stress,
    vm_stress,
    bound_radial_stress,
    bound_toroidal_stress,
    bound_vertical_stress,
    bound_tresca_stress,
    bound_vm_stress,
    save_format,
    plot_conf,
):
    lw = plot_conf.line_width
    ms = plot_conf.mark_size
    ats = plot_conf.axis_tick_size
    afs = plot_conf.axis_font_size
    for ii in range(n_layers):
        plt.plot(radius[ii], radial_stress[ii], "-", linewidth=lw, color="lightblue")
        plt.plot(radius[ii], toroidal_stress[ii], "-", linewidth=lw, color="wheat")
        plt.plot(radius[ii], vertical_stress[ii], "-", linewidth=lw, color="lightgrey")
        plt.plot(radius[ii], tresca_stress[ii], "-", linewidth=lw, color="pink")
        plt.plot(radius[ii], vm_stress[ii], "-", linewidth=lw, color="violet")
    plt.plot(
        radius[0], radial_stress[0], "--", color="dodgerblue", label=r"$\sigma_{rr}$"
    )
    plt.plot(
        radius[0],
        toroidal_stress[0],
        "--",
        color="orange",
        label=r"$\sigma_{\theta\theta}$",
    )
    plt.plot(
        radius[0],
        vertical_stress[0],
        "--",
        color="mediumseagreen",
        label=r"$\sigma_{zz}$",
    )
    plt.plot(
        radius[0], tresca_stress[0], "-", color="crimson", label=r"$\sigma_{TRESCA}$"
    )
    plt.plot(
        radius[0], vm_stress[0], "-", color="darkviolet", label=r"$\sigma_{Von\ mises}$"
    )
    for ii in range(1, n_layers):
        plt.plot(radius[ii], radial_stress[ii], "--", color="dodgerblue")
        plt.plot(radius[ii], toroidal_stress[ii], "--", color="orange")
        plt.plot(radius[ii], vertical_stress[ii], "--", color="mediumseagreen")
        plt.plot(radius[ii], tresca_stress[ii], "-", color="crimson")
        plt.plot(radius[ii], vm_stress[ii], "-", color="darkviolet")
    plt.plot(bound_radius, bound_radial_stress, "|", markersize=ms, color="dodgerblue")
    plt.plot(bound_radius, bound_toroidal_stress, "|", markersize=ms, color="orange")
    plt.plot(
        bound_radius, bound_vertical_stress, "|", markersize=ms, color="mediumseagreen"
    )
    plt.plot(bound_radius, bound_tresca_stress, "|", markersize=ms, color="crimson")
    plt.plot(bound_radius, bound_vm_stress, "|", markersize=ms, color="darkviolet")
    plt.grid(True)
    plt.ylabel(r"$\sigma$ [$MPa$]", fontsize=afs)
    plt.xlabel(r"$R$ [$m$]", fontsize=afs)
    plt.legend(loc="best", fontsize=plot_conf.legend_size)
    plt.xticks(size=ats)
    plt.yticks(size=ats)
    plt.tight_layout()
    plt.savefig(f"{plot_conf.outdir}/structure_stress.{save_format}")
    plt.clf()
    plt.cla()

smeared_stress_summary(n_layers, radius, bound_radius, radial_smeared_stress, toroidal_smeared_stress, vertical_smeared_stress, tresca_smeared_stress, bound_radial_smeared_stress, bound_toroidal_smeared_stress, bound_vertical_smeared_stress, bound_tresca_smeared_stress, save_format, plot_conf)

Source code in process/core/io/plot/stress_tf.py
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
def smeared_stress_summary(
    n_layers,
    radius,
    bound_radius,
    radial_smeared_stress,
    toroidal_smeared_stress,
    vertical_smeared_stress,
    tresca_smeared_stress,
    bound_radial_smeared_stress,
    bound_toroidal_smeared_stress,
    bound_vertical_smeared_stress,
    bound_tresca_smeared_stress,
    save_format,
    plot_conf,
):
    lw = plot_conf.line_width
    ms = plot_conf.mark_size
    ats = plot_conf.axis_tick_size
    afs = plot_conf.axis_font_size
    for ii in range(n_layers):
        plt.plot(
            radius[ii], radial_smeared_stress[ii], "-", linewidth=lw, color="lightblue"
        )
        plt.plot(
            radius[ii], toroidal_smeared_stress[ii], "-", linewidth=lw, color="wheat"
        )
        plt.plot(
            radius[ii], vertical_smeared_stress[ii], "-", linewidth=lw, color="lightgrey"
        )
        plt.plot(radius[ii], tresca_smeared_stress[ii], "-", linewidth=lw, color="pink")
    plt.plot(
        radius[0],
        radial_smeared_stress[0],
        "--",
        color="dodgerblue",
        label=r"$\sigma_{rr}^\mathrm{smeared}$",
    )
    plt.plot(
        radius[0],
        toroidal_smeared_stress[0],
        "--",
        color="orange",
        label=r"$\sigma_{\theta\theta}^\mathrm{smeared}$",
    )
    plt.plot(
        radius[0],
        vertical_smeared_stress[0],
        "--",
        color="mediumseagreen",
        label=r"$\sigma_{zz}^\mathrm{smeared}$",
    )
    plt.plot(
        radius[0],
        tresca_smeared_stress[0],
        "-",
        color="crimson",
        label=r"$\sigma_{TRESCA}^\mathrm{smeared}$",
    )
    for ii in range(1, n_layers):
        plt.plot(radius[ii], radial_smeared_stress[ii], "--", color="dodgerblue")
        plt.plot(radius[ii], toroidal_smeared_stress[ii], "--", color="orange")
        plt.plot(radius[ii], vertical_smeared_stress[ii], "--", color="mediumseagreen")
        plt.plot(radius[ii], tresca_smeared_stress[ii], "-", color="crimson")
    plt.plot(
        bound_radius, bound_radial_smeared_stress, "|", markersize=ms, color="dodgerblue"
    )
    plt.plot(
        bound_radius, bound_toroidal_smeared_stress, "|", markersize=ms, color="orange"
    )
    plt.plot(
        bound_radius,
        bound_vertical_smeared_stress,
        "|",
        markersize=ms,
        color="mediumseagreen",
    )
    plt.plot(
        bound_radius, bound_tresca_smeared_stress, "|", markersize=ms, color="crimson"
    )
    plt.grid(True)
    plt.ylabel(r"$\sigma$ [$MPa$]", fontsize=afs)
    plt.xlabel(r"$R$ [$m$]", fontsize=afs)
    plt.legend(loc="best", fontsize=plot_conf.legend_size)
    plt.xticks(size=ats)
    plt.yticks(size=ats)
    plt.tight_layout()
    plt.savefig(f"{plot_conf.outdir}/smeared_stress.{save_format}")
    plt.clf()
    plt.cla()

strain_summary(n_layers, radius, bound_radius, radial_strain, bound_radial_strain, toroidal_strain, bound_toroidal_strain, vertical_strain, bound_vertical_strain, save_format, plot_conf)

Source code in process/core/io/plot/stress_tf.py
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
def strain_summary(
    n_layers,
    radius,
    bound_radius,
    radial_strain,
    bound_radial_strain,
    toroidal_strain,
    bound_toroidal_strain,
    vertical_strain,
    bound_vertical_strain,
    save_format,
    plot_conf,
):
    lw = plot_conf.line_width
    ms = plot_conf.mark_size
    ats = plot_conf.axis_tick_size
    afs = plot_conf.axis_font_size
    for ii in range(n_layers):
        plt.plot(radius[ii], radial_strain[ii], "-", linewidth=lw, color="lightblue")
        plt.plot(radius[ii], toroidal_strain[ii], "-", linewidth=lw, color="wheat")
        plt.plot(radius[ii], vertical_strain[ii], "-", linewidth=lw, color="lightgrey")
    plt.plot(
        radius[0], radial_strain[0], "--", color="dodgerblue", label=r"$\epsilon_{rr}$"
    )
    plt.plot(
        radius[0],
        toroidal_strain[0],
        "--",
        color="orange",
        label=r"$\epsilon_{\theta\theta}$",
    )
    plt.plot(
        radius[0],
        vertical_strain[0],
        "--",
        color="mediumseagreen",
        label=r"$\epsilon_{zz}$",
    )
    for ii in range(1, n_layers):
        plt.plot(radius[ii], radial_strain[ii], "--", color="dodgerblue")
        plt.plot(radius[ii], toroidal_strain[ii], "--", color="orange")
        plt.plot(radius[ii], vertical_strain[ii], "--", color="mediumseagreen")
    plt.plot(bound_radius, bound_radial_strain, "|", markersize=ms, color="dodgerblue")
    plt.plot(bound_radius, bound_toroidal_strain, "|", markersize=ms, color="orange")
    plt.plot(
        bound_radius,
        bound_vertical_strain,
        "|",
        markersize=ms,
        color="mediumseagreen",
    )
    plt.grid(True)
    plt.ylabel(r"$\epsilon$", fontsize=afs)
    plt.xlabel(r"$R$ [$m$]", fontsize=afs)
    plt.legend(loc="best", fontsize=plot_conf.legend_size)
    plt.xticks(size=ats)
    plt.yticks(size=ats)
    plt.tight_layout()
    plt.savefig(f"{plot_conf.outdir}/strains.{save_format}")
    plt.clf()
    plt.cla()

displacement(n_layers, radius, radial_displacement, save_format, plot_conf)

Source code in process/core/io/plot/stress_tf.py
600
601
602
603
604
605
606
607
608
609
610
611
612
def displacement(n_layers, radius, radial_displacement, save_format, plot_conf):
    plt.plot(radius[0], radial_displacement[0], color="dodgerblue")
    for ii in range(1, n_layers):
        plt.plot(radius[ii], radial_displacement[ii], color="dodgerblue")
    plt.grid(True)
    plt.ylabel(r"$u_{r}$ [mm]", fontsize=plot_conf.axis_font_size)
    plt.xlabel(r"$R$ [$m$]", fontsize=plot_conf.axis_font_size)
    plt.xticks(size=plot_conf.axis_tick_size)
    plt.yticks(size=plot_conf.axis_tick_size)
    plt.tight_layout()
    plt.savefig(f"{plot_conf.outdir}/displacement.{save_format}")
    plt.clf()
    plt.cla()