You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Compute velocity used to estimate max and mean velocity, CFL and Reynolds number
181
+
DG=FunctionSpace(mesh, "DG", 0)
182
+
U=project(sqrt(inner(u, u)), DG)
183
+
local_U=U.vector().get_local()
184
+
U_array=MPI.comm_world.gather(local_U, 0)
176
185
177
186
ifMPI.rank(MPI.comm_world) ==0:
187
+
# Gather velocity arrays and compute max and mean velocity, CFL and Reynolds number
188
+
U_gathered=np.concatenate(U_array)
189
+
U_mean=np.mean(U_gathered)
190
+
U_max=np.max(U_gathered)
191
+
192
+
cfl_mean=U_mean*dt/h
193
+
cfl_max=U_max*dt/h
194
+
195
+
re_mean=U_mean*L/nu
196
+
re_max=U_max*L/nu
197
+
178
198
info_green(
179
199
'Time = {0:2.4e}, timestep = {1:6d}, max Reynolds number={2:2.3f}, mean Reynolds number={3:2.3f}, outlet Reynolds number={4:2.3f}, Womersley number={5:2.3f}, max velocity={6:2.3f}, mean velocity={7:2.3f}, max CFL={8:2.3f}, mean CFL={9:2.3f}'
0 commit comments