whding123 commited on
Commit
6b2b187
·
verified ·
1 Parent(s): 943b6a7

angioflow_fix_batch2: UPF_P0272.00_ID1_cut1

Browse files
Files changed (30) hide show
  1. .gitattributes +9 -0
  2. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/branch_ranking.npy +3 -0
  3. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/branch_ranking_fallback.npy +3 -0
  4. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/clipped_centerline.npy +3 -0
  5. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/clipped_reconstruction.ply +3 -0
  6. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/clipped_reconstruction_fallback.ply +3 -0
  7. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/dome.ply +3 -0
  8. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/dome_sac.ply +3 -0
  9. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/done.txt +1 -0
  10. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/endpoints_manual.npy +3 -0
  11. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/forward_fusion_info.npz +3 -0
  12. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/forward_fusion_info_fallback.npz +3 -0
  13. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/fusion_info_extruded.npz +3 -0
  14. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/geomagic_processed.obj +3 -0
  15. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/ghd_surface.vtp +0 -0
  16. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/inlet_centroids.csv +0 -0
  17. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/jnl_transient +24 -0
  18. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/merged_centerline.npy +3 -0
  19. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/merged_reconstruction.ply +3 -0
  20. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/merged_reconstruction_remeshed.obj +0 -0
  21. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/mesh.msh +3 -0
  22. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/mesh.vtu +3 -0
  23. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/mesh_params.json +17 -0
  24. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/parabolic_vinlet_udf_full.c +200 -0
  25. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/preprocess_log.txt +110 -0
  26. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/reconstruction.ply +3 -0
  27. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/reg_mesh.obj +0 -0
  28. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/reg_mesh_regularization.json +122 -0
  29. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/remesh_info.json +12 -0
  30. angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/udf_waveform_5cycles.txt +0 -0
.gitattributes CHANGED
@@ -294,3 +294,12 @@ angioflow_fix_batch2/UPF_P0232.01_ID1_cut1/merged_reconstruction.ply filter=lfs
294
  angioflow_fix_batch2/UPF_P0232.01_ID1_cut1/mesh.msh filter=lfs diff=lfs merge=lfs -text
295
  angioflow_fix_batch2/UPF_P0232.01_ID1_cut1/mesh.vtu filter=lfs diff=lfs merge=lfs -text
296
  angioflow_fix_batch2/UPF_P0232.01_ID1_cut1/reconstruction.ply filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
294
  angioflow_fix_batch2/UPF_P0232.01_ID1_cut1/mesh.msh filter=lfs diff=lfs merge=lfs -text
295
  angioflow_fix_batch2/UPF_P0232.01_ID1_cut1/mesh.vtu filter=lfs diff=lfs merge=lfs -text
296
  angioflow_fix_batch2/UPF_P0232.01_ID1_cut1/reconstruction.ply filter=lfs diff=lfs merge=lfs -text
297
+ angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/clipped_reconstruction.ply filter=lfs diff=lfs merge=lfs -text
298
+ angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/clipped_reconstruction_fallback.ply filter=lfs diff=lfs merge=lfs -text
299
+ angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/dome.ply filter=lfs diff=lfs merge=lfs -text
300
+ angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/dome_sac.ply filter=lfs diff=lfs merge=lfs -text
301
+ angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/geomagic_processed.obj filter=lfs diff=lfs merge=lfs -text
302
+ angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/merged_reconstruction.ply filter=lfs diff=lfs merge=lfs -text
303
+ angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/mesh.msh filter=lfs diff=lfs merge=lfs -text
304
+ angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/mesh.vtu filter=lfs diff=lfs merge=lfs -text
305
+ angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/reconstruction.ply filter=lfs diff=lfs merge=lfs -text
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/branch_ranking.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28d4b63fdadd72ed19f8fad1638746569959d59ee50d3e10d67810fced9dc78f
3
+ size 136
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/branch_ranking_fallback.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:28d4b63fdadd72ed19f8fad1638746569959d59ee50d3e10d67810fced9dc78f
3
+ size 136
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/clipped_centerline.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5afb20e4bc08799f86a7b95a0f92042094af7a454737411d4689d08aa694f16
3
+ size 12765
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/clipped_reconstruction.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b818b51ee7461fee99887198569fd37e28da56d660016831a1dc9179a90ca68a
3
+ size 1077152
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/clipped_reconstruction_fallback.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:636a0a3e823abf3c585cd59ed1a599ac7ea3e54302ac8e13487d732bd7915a70
3
+ size 932731
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/dome.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:750181442c8a4979d4a63024502439c569ea9b645a6a5674e77f5ec87aea7fae
3
+ size 864744
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/dome_sac.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b0ab600a1eed67f654841024eb50d5e4edc48ccb9031bd2eb068ab3dd8a039f
3
+ size 470802
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/done.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ done
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/endpoints_manual.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c6149234841fbf2aa66caac8c66f0e0cd3e34fcebe6e988f800993f6aa10e1f5
3
+ size 612
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/forward_fusion_info.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c214f9e12b22c77596dfe43f13c249394f9d4978824122e0f0b55c6162f457a4
3
+ size 7168
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/forward_fusion_info_fallback.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f21da6aeffa90fd9721ed18fccb5cc228eab28a1d99064cf16e0594ef210b7a5
3
+ size 19176
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/fusion_info_extruded.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f64dcf8da198a86c5bfd0c4fff087cf9396244ed4392d10036e7bdf021adec2e
3
+ size 7646
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/geomagic_processed.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2712ebccfee57ad18494a9c6f698cbf17e6737eca4407b43658131f5a58fea41
3
+ size 16183294
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/ghd_surface.vtp ADDED
The diff for this file is too large to render. See raw diff
 
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/inlet_centroids.csv ADDED
The diff for this file is too large to render. See raw diff
 
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/jnl_transient ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /file/read-case mesh.msh
2
+ /mesh/scale 0.001 0.001 0.001
3
+ /define/models/unsteady-2nd-order? yes
4
+ /define/models/viscous/laminar yes
5
+ /define/materials/change-create air blood yes constant 1050 no no yes carreau shear-rate-dependent 3.313 0.3568 0.056 0.00345 no no no yes
6
+ /define/boundary-conditions/zone-type 4 velocity-inlet
7
+ /define/boundary-conditions/zone-type 5 pressure-outlet
8
+ /define/user-defined/use-built-in-compiler? yes
9
+ /define/user-defined/compiled-functions compile libudf yes parabolic_vinlet_udf_full.c "" ""
10
+ /define/user-defined/compiled-functions load libudf
11
+ /define/boundary-conditions/set/velocity-inlet surface4 () vmag yes yes udf inlet_x_velocity_transient::libudf quit
12
+ /solve/set/p-v-coupling 24
13
+ /solve/set/p-v-controls 2000000 0.5 0.5
14
+ /solve/monitors/residual/convergence-criteria 0.0001 0.0001 0.0001 0.0001
15
+ /solve/initialize/compute-defaults velocity-inlet surface4
16
+ /solve/initialize/initialize-flow
17
+ /file/transient-export/ensight-gold-transient ensight_files () * () absolute-pressure dynamic-pressure x-velocity y-velocity z-velocity wall-shear x-wall-shear y-wall-shear z-wall-shear dx-velocity-dx dy-velocity-dy dz-velocity-dz dx-velocity-dy dy-velocity-dx dx-velocity-dz dz-velocity-dx dy-velocity-dz dz-velocity-dy dp-dx dp-dy dp-dz dp-dt viscosity-lam x-coordinate y-coordinate z-coordinate quit no yes export-1 time-step 10 yes
18
+ /file/autosave/data-frequency 10
19
+ /solve/set/time-step 0.001
20
+ /solve/dual-time-iterate 1600 100
21
+ /file/write-case mesh_new.cas yes
22
+ /file/write-data mesh_new.dat yes
23
+ exit
24
+ yes
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/merged_centerline.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d2f934bdf660e1355248091834a2b7e2f3eaffb201234cda4e3054e52dd9a2e1
3
+ size 10921
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/merged_reconstruction.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:289eaf3e848f28eab8c030217adfb3f31c75320ea29d342859a06c27b4c3d621
3
+ size 848746
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/merged_reconstruction_remeshed.obj ADDED
The diff for this file is too large to render. See raw diff
 
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/mesh.msh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9794b60a9e073a5d95f509579eed29c24ef577d709e0aa294e40182d32f98436
3
+ size 246242800
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/mesh.vtu ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:48681ad6af5df709c0c0c554b7879cdc4965973c1debed2c55c8800ac32014b3
3
+ size 53718010
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/mesh_params.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "preset": "legacy",
3
+ "params": {
4
+ "base_edge": 0.13,
5
+ "ref_volume": 320.0,
6
+ "ref_area": 320.0,
7
+ "vol_exponent": 0.3,
8
+ "area_exponent": 0.5,
9
+ "max_edge": 1.0
10
+ },
11
+ "inflation": true,
12
+ "surface": "ghd_surface.vtp",
13
+ "volume": 464.0499046715672,
14
+ "area": 514.6136603924986,
15
+ "edge": 0.1649,
16
+ "n_volume_cells": 3164774
17
+ }
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/parabolic_vinlet_udf_full.c ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ vprofile_transient_parabolic.c
3
+ UDF for specifying steady-state velocity profile boundary condition
4
+
5
+ AUTHOR Wenhao Ding
6
+ DATE 22.03.2024
7
+
8
+ Instruction:
9
+ define VINREF, the maximum velocity at the center
10
+ define FIXED_TIME_STEP and make sure MAX_PCD_SIZE is larger than int(total_time/FIXED_TIME_STEP)
11
+ define filename (txt for the waveform, this txt file must be in the same directory as this script)
12
+ */
13
+
14
+ #include "udf.h"
15
+ #include <math.h>
16
+ #include <stdio.h>
17
+
18
+ #define PI 3.14159265358979323846
19
+ #define VINREF 1.3158 /* ref inlet v */
20
+ #define VIN 0 /* ref inlet v */
21
+ #define MAX_PCD_SIZE 400001 /* Least PCD number the waveform file has cannot exceed point number in txt 574578 41160*/
22
+ #define MAX_LOG_SIZE 600
23
+ #define FIXED_TIME_STEP 0.00001 /* Fixed time step during transient simulation*/
24
+ #define MAX_POINTS 6000 /* Maximum point number on the inlet*/
25
+ #define ND_ND 3
26
+ /* static double* Q_array[MAX_PCD_SIZE]; */
27
+
28
+
29
+ typedef struct {
30
+ double x;
31
+ double y;
32
+ double z;
33
+ } Vector3D;
34
+
35
+ double dot_product(Vector3D v1, Vector3D v2) {
36
+ return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
37
+ }
38
+
39
+ Vector3D cross_product(Vector3D v1, Vector3D v2) {
40
+ Vector3D cross_v;
41
+
42
+ cross_v.x = v1.y * v2.z - v1.z * v2.y;
43
+ cross_v.y = v1.z * v2.x - v1.x * v2.z;
44
+ cross_v.z = v1.x * v2.y - v1.y * v2.x;
45
+
46
+ return cross_v;
47
+ }
48
+
49
+ double get_norm(Vector3D result) {
50
+ return sqrt(pow(result.x, 2) + pow(result.y, 2) + pow(result.z, 2));
51
+ }
52
+
53
+ double getDegAngle(Vector3D v1, Vector3D v2) {
54
+ Vector3D v_cross = cross_product(v1, v2);
55
+ double radian_angle = atan2(get_norm(v_cross), dot_product(v1, v2));
56
+ if (v_cross.z < 0) {
57
+ radian_angle = 2 * PI - radian_angle;
58
+ }
59
+ return radian_angle;
60
+ }
61
+
62
+
63
+
64
+ DEFINE_PROFILE(inlet_x_velocity_transient, thread, position)
65
+ {
66
+ /*Domain* d;*/
67
+ /*d = Get_Domain(1);*/
68
+ /*Thread* tr = Lookup_Thread(d, 5);*/
69
+ real x[ND_ND]; /* ND_ND=3 for 3D */
70
+ real curr_x, curr_y, curr_z;
71
+ face_t f;
72
+ /* real current_time; */
73
+ FILE* rfile; /* declare a FILE pointer */
74
+ rfile = fopen("udf_waveform_5cycles.txt", "r+");
75
+ double Q_array[MAX_PCD_SIZE];
76
+ int i = 0;
77
+ for (i = 0; i < MAX_PCD_SIZE; i++) {
78
+ fscanf(rfile, "%lf", &Q_array[i]); /* that supposes one value per line */
79
+ }fclose(rfile);
80
+ /* load from csv file */
81
+ double centroids[MAX_POINTS][ND_ND];
82
+ int num_points_inlet = 0;
83
+ FILE* file;
84
+ char line[256];
85
+ file = fopen("inlet_centroids.csv", "r");
86
+ if (file == NULL)
87
+ {
88
+ Message("Error: Cannot open file %s\n", "inlet_centroids.csv");
89
+ return;
90
+ }
91
+ fgets(line, sizeof(line), file);
92
+ num_points_inlet = 0;
93
+ while (fgets(line, sizeof(line), file) && num_points_inlet < MAX_POINTS)
94
+ {
95
+ sscanf(line, "%lf,%lf,%lf", &centroids[num_points_inlet][0], &centroids[num_points_inlet][1], &centroids[num_points_inlet][2]);
96
+ num_points_inlet++;
97
+ }
98
+ fclose(file);
99
+ /* record average coordinates on the inlet (center) */
100
+ double center_x = 0.0, center_y = 0.0, center_z = 0.0;
101
+ for (i = 0; i < num_points_inlet; i++)
102
+ {
103
+ center_x += centroids[i][0];
104
+ center_y += centroids[i][1];
105
+ center_z += centroids[i][2];
106
+ }
107
+
108
+ if (num_points_inlet > 0)
109
+ {
110
+ center_x /= num_points_inlet;
111
+ center_y /= num_points_inlet;
112
+ center_z /= num_points_inlet;
113
+ }
114
+ /*Message("Average centroid coordinates: x=%lf, y=%lf, z=%lf\n", center_x, center_y, center_z);*/
115
+ /* get 12 clock tick */
116
+ double tick_x = 0.0, tick_y = 0.0, tick_z = 0.0;
117
+ double tick_radius = 0.0;
118
+ double tick_radius_record = 0.0;
119
+ for (i = 0; i < num_points_inlet; i++)
120
+ {
121
+ tick_radius = sqrt(pow((centroids[i][0] - center_x), 2) + pow((centroids[i][1] - center_y), 2) + pow((centroids[i][2] - center_z), 2));
122
+ if (tick_radius > tick_radius_record) {
123
+ tick_x = x[0];
124
+ tick_y = x[1];
125
+ tick_z = x[2];
126
+ }
127
+ tick_radius_record = tick_radius;
128
+ }
129
+
130
+ /* start spinning and record maximum radius for every sector */
131
+ int num_sector = 30;
132
+ double angle = 0.0;
133
+ int id_sector = 0;
134
+ double current_radius = 0.0;
135
+ /* tick & tock vector for cross and dot production */
136
+ Vector3D v_tick;
137
+ v_tick.x = tick_x - center_x;
138
+ v_tick.y = tick_y - center_y;
139
+ v_tick.z = tick_z - center_z;
140
+ Vector3D v_tock;
141
+ double radius_list[num_sector];
142
+ for (i = 0; i < num_sector; ++i) {
143
+ radius_list[i] = 0.0;
144
+ }
145
+ /* loop and fill radius_list */
146
+ for (i = 0; i < num_points_inlet; i++)
147
+ {
148
+ v_tock.x = centroids[i][0] - center_x;
149
+ v_tock.y = centroids[i][1] - center_y;
150
+ v_tock.z = centroids[i][2] - center_z;
151
+ angle = getDegAngle(v_tick, v_tock);
152
+ id_sector = floor((angle + PI) / (2 * PI / num_sector));
153
+ if (id_sector < 0) {
154
+ id_sector = 0;
155
+ }
156
+ if (id_sector >= num_sector) {
157
+ id_sector = num_sector - 1;
158
+ }
159
+ current_radius = sqrt(pow(v_tock.x, 2) + pow(v_tock.y, 2) + pow(v_tock.z, 2));
160
+ if (current_radius > radius_list[id_sector]) {
161
+ radius_list[id_sector] = current_radius;
162
+ }
163
+ }
164
+
165
+ /* clean radius list and check (sometimes there are no nodes in the sector) */
166
+ for (i = 0; i < num_sector; ++i) {
167
+ if (radius_list[i] == 0.0) {
168
+ radius_list[i] = tick_radius_record;
169
+ }
170
+ }
171
+
172
+ /* assign parabolic profile */
173
+ begin_f_loop(f, thread)
174
+ {
175
+ F_CENTROID(x, f, thread);
176
+ /* current_time = CURRENT_TIME */
177
+ int current_time_id = (int)floor(CURRENT_TIME / FIXED_TIME_STEP);
178
+ double current_Q_ratio = Q_array[current_time_id];
179
+ curr_x = x[0]; /* x[0] is x coordinate */
180
+ curr_y = x[1]; /* x[1] is y coordinate */
181
+ curr_z = x[2]; /* x[2] is z coordinate */
182
+
183
+ v_tock.x = x[0] - center_x;
184
+ v_tock.y = x[1] - center_y;
185
+ v_tock.z = x[2] - center_z;
186
+ angle = getDegAngle(v_tick, v_tock);
187
+ id_sector = floor((angle + PI) / (2 * PI / num_sector));
188
+ if (id_sector < 0) {
189
+ id_sector = 0;
190
+ }
191
+ if (id_sector >= num_sector) {
192
+ id_sector = num_sector - 1;
193
+ }
194
+ current_radius = radius_list[id_sector];
195
+
196
+ /* write inlet velocity profile - need to centre the x,y,z coords and divide by Rref^2 */
197
+ F_PROFILE(f, thread, position) = current_Q_ratio * VINREF * (1 + VIN) * (1 - (pow((curr_x - center_x), 2) + pow((curr_y - center_y), 2) + pow((curr_z - center_z), 2)) / (current_radius * current_radius));
198
+ }
199
+ end_f_loop(f, thread)
200
+ }
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/preprocess_log.txt ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ============================================================
3
+ Session started: 2026-04-22 11:08:18
4
+ ============================================================
5
+
6
+ ════════════════════════════════════════════════════════════
7
+ Processing: UPF_P0272.00_ID1_cut1
8
+ ════════════════════════════════════════════════════════════
9
+
10
+ ── Step 1: Centerline extraction ──
11
+ Reading PLY surface file.
12
+ Cleaning surface.
13
+ Triangulating surface.
14
+ Computing centerlines.
15
+ Computing centerlines...
16
+ Centerlines [accept / redo / skip] (default=accept):
17
+ ── Step 2: Vessel clipping ──
18
+
19
+ Current cut distances (how far from aneurysm to cut each branch):
20
+ Branch 0 (downstream): 4.0 mm (branch total: 37.9 mm)
21
+ Branch 1 (downstream): 4.0 mm (branch total: 12.0 mm)
22
+ Accept these cut distances? (Y/n): Branch 0 (downstream) distance [4.0]: Branch 1 (downstream) distance [4.0]:
23
+ Current cut distances (how far from aneurysm to cut each branch):
24
+ Branch 0 (downstream): 8.0 mm (branch total: 37.9 mm)
25
+ Branch 1 (downstream): 5.0 mm (branch total: 12.0 mm)
26
+ Accept these cut distances? (Y/n): Dome protection: dome_sac.ply, 10153 vertices protected (dist < 0.50 mm)
27
+ Clipping: 37103 vertices removed, 10153 dome-protected
28
+
29
+ ────────────────────────────────────────────────────────
30
+ Cut cross-section equivalent diameters (2 openings):
31
+ ────────────────────────────────────────────────────────
32
+ Opening 0: D_eq = 3.379 mm ← outlet (branch 1)
33
+ Opening 1: D_eq = 3.469 mm ← inlet (branch 0)
34
+ ────────────────────────────────────────────────────────
35
+ Suggested extension length: ~4× diameter for single outlet.
36
+ ────────────────────────────────────────────────────────
37
+
38
+ Accept clipping? (Y/n):
39
+ ── Step 3: Vessel extension ──
40
+
41
+ Extension modes:
42
+ centerline = use original centerline only
43
+ straight = straight extension from opening
44
+ centerline+straight = original centerline a mm + straight b mm
45
+
46
+ Branch 0 (upstream, CL=29.9mm) mode [centerline]: centerline part a [2.0mm]: straight part b [2.0mm]: Branch 1 (downstream, CL=6.9mm) mode [centerline]: centerline part a [2.0mm]: straight part b [2.0mm]: Branch 0: centerline+straight, centerline=5.89 mm, straight=4.00 mm
47
+ Branch 1: centerline+straight, centerline=3.88 mm, straight=6.00 mm
48
+ Accept vessel extension? (Y/n):
49
+ Extension rejected.
50
+ Choose next action:
51
+ 1 = re-try Step 3 with different extension settings
52
+ 2 = go back to Step 2 and re-select clipping lengths
53
+ Action [1/2, default=2]:
54
+ Tuning:
55
+ min_boundary_verts: minimum boundary vertices for a real opening.
56
+ init_step: choose centerline starting point.
57
+ Increase if extension overlaps with dome.
58
+ min_boundary_verts [5]: init_step [1]: default extension length [2.0]:
59
+ Extension modes:
60
+ centerline = use original centerline only
61
+ straight = straight extension from opening
62
+ centerline+straight = original centerline a mm + straight b mm
63
+
64
+ Branch 0 (upstream, CL=29.9mm) mode [centerline]: centerline part a [2.0mm]: straight part b [2.0mm]: Branch 1 (downstream, CL=6.9mm) mode [centerline]: centerline part a [2.0mm]: straight part b [2.0mm]: Branch 0: centerline+straight, centerline=5.89 mm, straight=4.00 mm
65
+ Branch 1: centerline+straight, centerline=2.88 mm, straight=7.00 mm
66
+ Accept vessel extension? (Y/n): Saved: F:\NUS\labwork\paper3\aneux\PostTr\AneuX\UPF_P0272.00_ID1_cut1\merged_reconstruction.ply
67
+ Saved: branch_ranking.npy → [0, 1]
68
+
69
+ ── Step 4: Fallback clipping (side-wall sac isolation) ──
70
+ Clipping the ORIGINAL reconstruction mesh at the parent vessel.
71
+
72
+ Parent centerline: upstream branch 0 → neck → downstream branch 1
73
+ Upstream arc (neck → inlet): 37.9 mm
74
+ Downstream arc (neck → outlet): 12.0 mm
75
+
76
+ Keep upstream (toward inlet) [6.0 mm]: Keep downstream (toward outlet) [6.0 mm]: Single centerline: 503 pts, neck at index 381, upstream=0, downstream=1
77
+ Upstream cut: index 340, arc from neck = 4.1 mm
78
+ Downstream cut: index 422, arc from neck = 4.1 mm
79
+ Dome protection: dome_sac.ply, 10153 vertices protected (dist < 0.50 mm)
80
+ After scalar clip: 17778 vertices
81
+ Kept component 0 (closest to centroid), removed 2 disconnected parts
82
+ Saved fallback-clipped mesh → F:\NUS\labwork\paper3\aneux\PostTr\AneuX\UPF_P0272.00_ID1_cut1\clipped_reconstruction_fallback.ply
83
+ Accept fallback clipping? (Y/n):
84
+ Fallback clipping rejected.
85
+ Choose next action:
86
+ 1 = re-try Step 4 with different keep lengths
87
+ 2 = go back to Step 3 (re-do extension)
88
+ Action [1/2, default=1]:
89
+ Parent centerline: upstream branch 0 → neck → downstream branch 1
90
+ Upstream arc (neck → inlet): 37.9 mm
91
+ Downstream arc (neck → outlet): 12.0 mm
92
+
93
+ Keep upstream (toward inlet) [6.0 mm]: Keep downstream (toward outlet) [6.0 mm]: Single centerline: 503 pts, neck at index 381, upstream=0, downstream=1
94
+ Upstream cut: index 320, arc from neck = 6.0 mm
95
+ Downstream cut: index 422, arc from neck = 4.1 mm
96
+ Dome protection: dome_sac.ply, 10153 vertices protected (dist < 0.50 mm)
97
+ After scalar clip: 19881 vertices
98
+ Kept component 0 (closest to centroid), removed 2 disconnected parts
99
+ Saved fallback-clipped mesh → F:\NUS\labwork\paper3\aneux\PostTr\AneuX\UPF_P0272.00_ID1_cut1\clipped_reconstruction_fallback.ply
100
+ Accept fallback clipping? (Y/n): Fallback clipping accepted → clipped_reconstruction_fallback.ply
101
+ Saved: forward_fusion_info_fallback.npz (2 branches)
102
+ Saved: branch_ranking_fallback.npy → [0, 1]
103
+
104
+ ── Step 5: Final review ──
105
+ Accept final mesh? (Y/n): Accept final mesh? (Y/n):
106
+ Branch ordering (2 branches):
107
+ Branch 0 = inlet (upstream)
108
+ Branch 1 = outlet
109
+ (Inlet = endpoint 0 from registration, auto-detected as upstream)
110
+ ✓ UPF_P0272.00_ID1_cut1 complete.
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/reconstruction.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:299f15c75487aae53418d7302c7c1b5037c81e69d15ad7ae0b9c38a7f9e704fc
3
+ size 2934760
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/reg_mesh.obj ADDED
The diff for this file is too large to render. See raw diff
 
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/reg_mesh_regularization.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "input": "/media/yaplab2/wd8tb/wenhao/angioflow/cfd/angioflow_fix/UPF_P0272.00_ID1_cut1/merged_reconstruction_remeshed.obj",
3
+ "tolerance": 0.25,
4
+ "mode": "millimetre",
5
+ "dome_sac_mm": null,
6
+ "stopping": null,
7
+ "snap_levels": null,
8
+ "assessment": {
9
+ "needs_regularization": true,
10
+ "worst_target_excess_sd": 1.9669517383481427,
11
+ "tolerance_sd": 0.25,
12
+ "signed_excess_sd": {
13
+ "0.3": 1.9669517383481427,
14
+ "0.5": 0.20263275063107064,
15
+ "0.8": -0.5132935966108009,
16
+ "1.0": -0.7118444989417765,
17
+ "1.2": -0.835966545765746,
18
+ "1.6": -0.9607746235811332
19
+ },
20
+ "verdict": "rougher_than_reference",
21
+ "guard_scale": 1.6,
22
+ "guard_below_band": 0.9850148366485619,
23
+ "target_scales": [
24
+ 0.3,
25
+ 0.5,
26
+ 0.8,
27
+ 1.0,
28
+ 1.2
29
+ ],
30
+ "measured_at_edge": 0.13194732076851365,
31
+ "edge_after_measurement_remesh": 0.10969777341735171,
32
+ "remesher": "auto",
33
+ "n_seeds": 4000,
34
+ "elapsed_s": 296.51
35
+ },
36
+ "forward": {
37
+ "status": "guard_stopped",
38
+ "converged": false,
39
+ "guard_scale_below_reference_at_input": false,
40
+ "smoother": "mcf",
41
+ "remesher": "auto",
42
+ "sigma_step_mm": 0.08,
43
+ "tolerance_sd": 0.25,
44
+ "time_budget_s": null,
45
+ "overshoot_limit_sd": -1.0,
46
+ "guard_tolerance_sd": 1.0,
47
+ "target_scales": [
48
+ 0.3,
49
+ 0.5,
50
+ 0.8,
51
+ 1.0,
52
+ 1.2
53
+ ],
54
+ "guard_scale": 1.6,
55
+ "rounds": 0,
56
+ "total_sigma_mm": 0.0,
57
+ "target_edge": 0.13194732076851365,
58
+ "export_edge": null,
59
+ "metrics_measured_at_edge": 0.13194732076851365,
60
+ "n_vertices_in": 33681,
61
+ "n_vertices_out": 46369,
62
+ "n_seeds_used": 4000,
63
+ "elapsed_s": 308.47,
64
+ "edge_out": 0.10969777341735171,
65
+ "quality_out": 0.982740253404408,
66
+ "smoothing_displacement_mm": 0.0,
67
+ "surface_deviation_vs_original_max_mm": 3.948214346594469e-06,
68
+ "surface_deviation_vs_original_mean_mm": 9.216646880623187e-07,
69
+ "patch_truncation_fraction": {
70
+ "0.3": 0.0,
71
+ "0.5": 0.0,
72
+ "0.8": 0.0,
73
+ "1.0": 0.0,
74
+ "1.2": 0.0,
75
+ "1.6": 0.0
76
+ },
77
+ "signed_excess_before": {
78
+ "0.3": 1.9669517383481427,
79
+ "0.5": 0.20263275063107064,
80
+ "0.8": -0.5132935966108009,
81
+ "1.0": -0.7118444989417765,
82
+ "1.2": -0.835966545765746,
83
+ "1.6": -0.9607746235811332
84
+ },
85
+ "signed_excess_after": {
86
+ "0.3": 1.9669517383481427,
87
+ "0.5": 0.20263275063107064,
88
+ "0.8": -0.5132935966108009,
89
+ "1.0": -0.7118444989417765,
90
+ "1.2": -0.835966545765746,
91
+ "1.6": -0.9607746235811332
92
+ },
93
+ "below_band_after": {
94
+ "0.3": 0.0,
95
+ "0.5": 0.0,
96
+ "0.8": 0.43985790301236777,
97
+ "1.0": 0.6235585012679711,
98
+ "1.2": 0.7572315051116861,
99
+ "1.6": 0.9850148366485619
100
+ },
101
+ "input_inspection": {
102
+ "n_vertices": 33681,
103
+ "n_faces": 67192,
104
+ "bbox_diagonal": 27.41325199225941,
105
+ "watertight": false,
106
+ "n_components": 1,
107
+ "n_degenerate_faces": 0,
108
+ "edge_mean": 0.1297272638043727,
109
+ "edge_cv": 0.11639411241632282,
110
+ "n_boundary_vertices": 170,
111
+ "warnings": []
112
+ },
113
+ "reference_cases": 315
114
+ },
115
+ "cap_shift_mm": [
116
+ 0.03343687098606752,
117
+ 0.1043948883406182
118
+ ],
119
+ "action": "rejected",
120
+ "surface_used": "/media/yaplab2/wd8tb/wenhao/angioflow/cfd/angioflow_fix/UPF_P0272.00_ID1_cut1/merged_reconstruction_remeshed.obj",
121
+ "reason": "regularized surface not used: no smoothing round completed (regularizer status guard_stopped)"
122
+ }
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/remesh_info.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "source": "merged_reconstruction.ply",
3
+ "method": "mesh_regularizer.remesh(backend='pymeshlab', calibrate=True)",
4
+ "target_edge_mm": 0.132,
5
+ "edge_median_mm": 0.1298969285557315,
6
+ "edge_max_mm": 0.24374362216999904,
7
+ "area_before": 482.05940529987333,
8
+ "area_after": 481.5154583779954,
9
+ "openings": 2,
10
+ "opening_centroid_shift_mm": 0.12145051965621016,
11
+ "made_by": "angioflow/debugging/remesh_aneux_merged.py"
12
+ }
angioflow_fix_batch2/UPF_P0272.00_ID1_cut1/udf_waveform_5cycles.txt ADDED
The diff for this file is too large to render. See raw diff