Skip to content
Snippets Groups Projects
Commit b36a83a6 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

Merge branch 'bugfix/fix_CFL_estimate' into 'master'

fix CFL estimate for box length other than 2pi

See merge request !122
parents 42d80867 e1a91df0
No related branches found
No related tags found
1 merge request!122fix CFL estimate for box length other than 2pi
Pipeline #223211 failed
......@@ -460,8 +460,14 @@ def plot_basic_stats(
with self.get_data_file() as data_file:
if 'CFL_velocity' in data_file['statistics'].keys():
self.statistics['CFL_velocity(t)'] = data_file['statistics/CFL_velocity'][ii0:ii1+1]
dx = ((2*np.pi/self.parameters['dkx'])/self.parameters['nx']) # Lx / nx
dy = ((2*np.pi/self.parameters['dky'])/self.parameters['ny'])
dz = ((2*np.pi/self.parameters['dkz'])/self.parameters['nz'])
if ((np.round(dx, 5) != np.round(dy, 5))
or (np.round(dx, 5) != np.round(dz, 5))):
print('WARNING: CFL computation does not make sense for non-isotropic grids')
tresolution2 = (self.parameters['dt'] * self.statistics['CFL_velocity(t)']
/ (2*np.pi/self.parameters['nx']))
/ dx)
a.plot(self.statistics['t'] / self.statistics['Tint'],
tresolution2,
label = '$\\frac{\\Delta t}{\\Delta x} \\| u \\|_{CFL}$')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment