whding123 commited on
Commit
e558826
·
verified ·
1 Parent(s): b946c68

angioflow_fix_batch2: UPF_P0280.00_ID2_cut1

Browse files
Files changed (30) hide show
  1. .gitattributes +9 -0
  2. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/branch_ranking.npy +3 -0
  3. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/branch_ranking_fallback.npy +3 -0
  4. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/clipped_centerline.npy +3 -0
  5. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/clipped_reconstruction.ply +3 -0
  6. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/clipped_reconstruction_fallback.ply +3 -0
  7. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/dome.ply +3 -0
  8. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/dome_sac.ply +3 -0
  9. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/done.txt +1 -0
  10. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/endpoints_manual.npy +3 -0
  11. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/forward_fusion_info.npz +3 -0
  12. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/forward_fusion_info_fallback.npz +3 -0
  13. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/fusion_info_extruded.npz +3 -0
  14. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/geomagic_processed.obj +3 -0
  15. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/ghd_surface.vtp +0 -0
  16. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/inlet_centroids.csv +0 -0
  17. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/jnl_transient +24 -0
  18. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/merged_centerline.npy +3 -0
  19. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/merged_reconstruction.ply +3 -0
  20. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/merged_reconstruction_remeshed.obj +0 -0
  21. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/mesh.msh +3 -0
  22. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/mesh.vtu +3 -0
  23. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/mesh_params.json +17 -0
  24. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/parabolic_vinlet_udf_full.c +200 -0
  25. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/preprocess_log.txt +79 -0
  26. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/reconstruction.ply +3 -0
  27. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/reg_mesh.obj +0 -0
  28. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/reg_mesh_regularization.json +122 -0
  29. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/remesh_info.json +12 -0
  30. angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/udf_waveform_5cycles.txt +0 -0
.gitattributes CHANGED
@@ -310,3 +310,12 @@ angioflow_fix_batch2/UPF_P0277.00_ID1_cut1/merged_reconstruction.ply filter=lfs
310
  angioflow_fix_batch2/UPF_P0277.00_ID1_cut1/mesh.msh filter=lfs diff=lfs merge=lfs -text
311
  angioflow_fix_batch2/UPF_P0277.00_ID1_cut1/mesh.vtu filter=lfs diff=lfs merge=lfs -text
312
  angioflow_fix_batch2/UPF_P0277.00_ID1_cut1/reconstruction.ply filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
310
  angioflow_fix_batch2/UPF_P0277.00_ID1_cut1/mesh.msh filter=lfs diff=lfs merge=lfs -text
311
  angioflow_fix_batch2/UPF_P0277.00_ID1_cut1/mesh.vtu filter=lfs diff=lfs merge=lfs -text
312
  angioflow_fix_batch2/UPF_P0277.00_ID1_cut1/reconstruction.ply filter=lfs diff=lfs merge=lfs -text
313
+ angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/clipped_reconstruction.ply filter=lfs diff=lfs merge=lfs -text
314
+ angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/clipped_reconstruction_fallback.ply filter=lfs diff=lfs merge=lfs -text
315
+ angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/dome.ply filter=lfs diff=lfs merge=lfs -text
316
+ angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/dome_sac.ply filter=lfs diff=lfs merge=lfs -text
317
+ angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/geomagic_processed.obj filter=lfs diff=lfs merge=lfs -text
318
+ angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/merged_reconstruction.ply filter=lfs diff=lfs merge=lfs -text
319
+ angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/mesh.msh filter=lfs diff=lfs merge=lfs -text
320
+ angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/mesh.vtu filter=lfs diff=lfs merge=lfs -text
321
+ angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/reconstruction.ply filter=lfs diff=lfs merge=lfs -text
angioflow_fix_batch2/UPF_P0280.00_ID2_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_P0280.00_ID2_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_P0280.00_ID2_cut1/clipped_centerline.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4302107411fb9847bdd06b61f690538e2306a7a84439656238c19a31f2d465a
3
+ size 29853
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/clipped_reconstruction.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b360c68928a8a92cb41a78fb3069d3240c90b9a37d76b84b1dbee17a2691efde
3
+ size 1236801
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/clipped_reconstruction_fallback.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d970b24f30dadf428eba39a7bf281f12a610440fe2216f8b5f703263693a7198
3
+ size 686148
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/dome.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a2b10da31fa35b37d62f44c68360ddb7eaf1cd74bd73345812841a3ed3dab53e
3
+ size 530803
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/dome_sac.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a2ffcedc501c1937b94a45c10cf692dc29e51a2fe8703ea6813f3a337f185c8c
3
+ size 148536
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/done.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ done
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/endpoints_manual.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed5aa53b699417ac805ff25b5808064d5e9f4a3176fb14c19c42342f167ba3bb
3
+ size 612
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/forward_fusion_info.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b70e35c16ffdb6955d99139db447d81176abeb539cb72195f448f15757f91ffa
3
+ size 5882
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/forward_fusion_info_fallback.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d71c213b6baa7a5f11bca4fc9e77f7b73aa43f24e3afb799ac9410505bf4b23c
3
+ size 43496
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/fusion_info_extruded.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae3c471dbbbfff2074080fccbb70b94eaaaaaf13f027ac6391fe9c9de7002300
3
+ size 5978
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/geomagic_processed.obj ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb49216cc24da038cbd7e940c28501b5ffaf09c26bc6be27eeaa1ab86563f358
3
+ size 15191012
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/ghd_surface.vtp ADDED
The diff for this file is too large to render. See raw diff
 
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/inlet_centroids.csv ADDED
The diff for this file is too large to render. See raw diff
 
angioflow_fix_batch2/UPF_P0280.00_ID2_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_P0280.00_ID2_cut1/merged_centerline.npy ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:efdb8cbf4ca469d3a6fa5677002729466f10667335f00383db5816eb9b316e25
3
+ size 23801
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/merged_reconstruction.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd44ac328f4a255189b2b06ef1ecc0fd70d637afe857cba02ee13bd546fc12bb
3
+ size 993625
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/merged_reconstruction_remeshed.obj ADDED
The diff for this file is too large to render. See raw diff
 
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/mesh.msh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82a691b666626c6e77e9cad358895078625104ce3083d30e2cbb5838a159f734
3
+ size 257412317
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/mesh.vtu ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:439b69b8252f27ba8d885e266b6ed4819874093be8a4f7c9afde695eda62199d
3
+ size 56472878
angioflow_fix_batch2/UPF_P0280.00_ID2_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": 569.6115635741451,
14
+ "area": 485.3536010601786,
15
+ "edge": 0.1601,
16
+ "n_volume_cells": 3305487
17
+ }
angioflow_fix_batch2/UPF_P0280.00_ID2_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_P0280.00_ID2_cut1/preprocess_log.txt ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ============================================================
3
+ Session started: 2026-04-22 11:38:38
4
+ ============================================================
5
+
6
+ ════════════════════════════════════════════════════════════
7
+ Processing: UPF_P0280.00_ID2_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: 89.9 mm)
21
+ Branch 1 (downstream): 4.0 mm (branch total: 24.2 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): 18.0 mm (branch total: 89.9 mm)
25
+ Branch 1 (downstream): 8.0 mm (branch total: 24.2 mm)
26
+ Accept these cut distances? (Y/n): Branch 0 (downstream) distance [18.0]: Branch 1 (downstream) distance [8.0]:
27
+ Current cut distances (how far from aneurysm to cut each branch):
28
+ Branch 0 (downstream): 16.0 mm (branch total: 89.9 mm)
29
+ Branch 1 (downstream): 8.0 mm (branch total: 24.2 mm)
30
+ Accept these cut distances? (Y/n): Dome protection: dome_sac.ply, 3630 vertices protected (dist < 0.50 mm)
31
+ Clipping: 90996 vertices removed, 3630 dome-protected
32
+
33
+ ────────────────────────────────────────────────────────
34
+ Cut cross-section equivalent diameters (2 openings):
35
+ ────────────────────────────────────────────────────────
36
+ Opening 0: D_eq = 4.553 mm ← inlet (branch 0)
37
+ Opening 1: D_eq = 3.391 mm ← outlet (branch 1)
38
+ ────────────────────────────────────────────────────────
39
+ Suggested extension length: ~4× diameter for single outlet.
40
+ ────────────────────────────────────────────────────────
41
+
42
+ Accept clipping? (Y/n):
43
+ ── Step 3: Vessel extension ──
44
+
45
+ Extension modes:
46
+ centerline = use original centerline only
47
+ straight = straight extension from opening
48
+ centerline+straight = original centerline a mm + straight b mm
49
+
50
+ Branch 0 (upstream, CL=73.9mm) mode [centerline]: centerline part a [2.0mm]: straight part b [2.0mm]: Branch 1 (downstream, CL=16.2mm) mode [centerline]: centerline part a [2.0mm]: straight part b [2.0mm]: Branch 0: centerline+straight, centerline=0.88 mm, straight=3.00 mm
51
+ Branch 1: centerline+straight, centerline=3.89 mm, straight=6.00 mm
52
+ Accept vessel extension? (Y/n): Saved: F:\NUS\labwork\paper3\aneux\PostTr\AneuX\UPF_P0280.00_ID2_cut1\merged_reconstruction.ply
53
+ Saved: branch_ranking.npy → [0, 1]
54
+
55
+ ── Step 4: Fallback clipping (side-wall sac isolation) ──
56
+ Clipping the ORIGINAL reconstruction mesh at the parent vessel.
57
+
58
+ Parent centerline: upstream branch 0 → neck → downstream branch 1
59
+ Upstream arc (neck → inlet): 89.9 mm
60
+ Downstream arc (neck → outlet): 24.2 mm
61
+
62
+ Keep upstream (toward inlet) [6.0 mm]: Keep downstream (toward outlet) [6.0 mm]: Single centerline: 1147 pts, neck at index 902, upstream=0, downstream=1
63
+ Upstream cut: index 841, arc from neck = 6.1 mm
64
+ Downstream cut: index 963, arc from neck = 6.1 mm
65
+ Dome protection: dome_sac.ply, 3630 vertices protected (dist < 0.50 mm)
66
+ After scalar clip: 18962 vertices
67
+ Kept component 0 (closest to centroid), removed 1 disconnected parts
68
+ Saved fallback-clipped mesh → F:\NUS\labwork\paper3\aneux\PostTr\AneuX\UPF_P0280.00_ID2_cut1\clipped_reconstruction_fallback.ply
69
+ Accept fallback clipping? (Y/n): Fallback clipping accepted → clipped_reconstruction_fallback.ply
70
+ Saved: forward_fusion_info_fallback.npz (2 branches)
71
+ Saved: branch_ranking_fallback.npy → [0, 1]
72
+
73
+ ── Step 5: Final review ──
74
+ Accept final mesh? (Y/n): Accept final mesh? (Y/n):
75
+ Branch ordering (2 branches):
76
+ Branch 0 = inlet (upstream)
77
+ Branch 1 = outlet
78
+ (Inlet = endpoint 0 from registration, auto-detected as upstream)
79
+ ✓ UPF_P0280.00_ID2_cut1 complete.
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/reconstruction.ply ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:49403e95ae2b1cb49f6bfd1995b8b8a69b119bbe09a80bd0ee1c2c442a494a99
3
+ size 5854735
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/reg_mesh.obj ADDED
The diff for this file is too large to render. See raw diff
 
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/reg_mesh_regularization.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "input": "/media/yaplab2/wd8tb/wenhao/angioflow/cfd/angioflow_fix/UPF_P0280.00_ID2_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.9616516140212028,
11
+ "tolerance_sd": 0.25,
12
+ "signed_excess_sd": {
13
+ "0.3": 1.9616516140212028,
14
+ "0.5": -0.643076752996976,
15
+ "0.8": -1.5540138749115984,
16
+ "1.0": -1.5181202352659484,
17
+ "1.2": -1.4045344841319982,
18
+ "1.6": -1.3021086957261454
19
+ },
20
+ "verdict": "rougher_than_reference",
21
+ "guard_scale": 1.6,
22
+ "guard_below_band": 1.498553375142044,
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.10972600348120257,
32
+ "remesher": "auto",
33
+ "n_seeds": 4000,
34
+ "elapsed_s": 163.86
35
+ },
36
+ "forward": {
37
+ "status": "overshoot_limited",
38
+ "converged": false,
39
+ "guard_scale_below_reference_at_input": true,
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": 34193,
61
+ "n_vertices_out": 47279,
62
+ "n_seeds_used": 4000,
63
+ "elapsed_s": 198.1,
64
+ "edge_out": 0.10972600348120257,
65
+ "quality_out": 0.9830545386911241,
66
+ "smoothing_displacement_mm": 0.0,
67
+ "surface_deviation_vs_original_max_mm": 1.7229717903562748e-06,
68
+ "surface_deviation_vs_original_mean_mm": 3.333960963755978e-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.9616516140212028,
79
+ "0.5": -0.643076752996976,
80
+ "0.8": -1.5540138749115984,
81
+ "1.0": -1.5181202352659484,
82
+ "1.2": -1.4045344841319982,
83
+ "1.6": -1.3021086957261454
84
+ },
85
+ "signed_excess_after": {
86
+ "0.3": 1.9616516140212028,
87
+ "0.5": -0.643076752996976,
88
+ "0.8": -1.5540138749115984,
89
+ "1.0": -1.5181202352659484,
90
+ "1.2": -1.4045344841319982,
91
+ "1.6": -1.3021086957261454
92
+ },
93
+ "below_band_after": {
94
+ "0.3": 0.0,
95
+ "0.5": 0.8596245114547202,
96
+ "0.8": 1.6363299275273375,
97
+ "1.0": 1.4758046959463513,
98
+ "1.2": 1.3946329682188354,
99
+ "1.6": 1.498553375142044
100
+ },
101
+ "input_inspection": {
102
+ "n_vertices": 34193,
103
+ "n_faces": 68191,
104
+ "bbox_diagonal": 28.465451122489913,
105
+ "watertight": false,
106
+ "n_components": 1,
107
+ "n_degenerate_faces": 0,
108
+ "edge_mean": 0.12986833012879379,
109
+ "edge_cv": 0.11113008470652415,
110
+ "n_boundary_vertices": 195,
111
+ "warnings": []
112
+ },
113
+ "reference_cases": 315
114
+ },
115
+ "cap_shift_mm": [
116
+ 0.08192501927336046,
117
+ 0.02424818296003414
118
+ ],
119
+ "action": "rejected",
120
+ "surface_used": "/media/yaplab2/wd8tb/wenhao/angioflow/cfd/angioflow_fix/UPF_P0280.00_ID2_cut1/merged_reconstruction_remeshed.obj",
121
+ "reason": "regularized surface not used: no smoothing round completed (regularizer status overshoot_limited)"
122
+ }
angioflow_fix_batch2/UPF_P0280.00_ID2_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.12989140338498334,
6
+ "edge_max_mm": 0.22437591345662095,
7
+ "area_before": 491.3443111505326,
8
+ "area_after": 491.1791821646336,
9
+ "openings": 2,
10
+ "opening_centroid_shift_mm": 0.05913457085280596,
11
+ "made_by": "angioflow/debugging/remesh_aneux_merged.py"
12
+ }
angioflow_fix_batch2/UPF_P0280.00_ID2_cut1/udf_waveform_5cycles.txt ADDED
The diff for this file is too large to render. See raw diff