Commit f6be1837 authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

fix parameter construction

parent 7112e71b
Pipeline #22395 failed with stage
in 6 minutes and 36 seconds
...@@ -691,6 +691,8 @@ class DNS(_code): ...@@ -691,6 +691,8 @@ class DNS(_code):
opt.fk1 = self.parameters['fk1'] opt.fk1 = self.parameters['fk1']
if type(opt.injection_rate) == type(None): if type(opt.injection_rate) == type(None):
opt.injection_rate = self.parameters['injection_rate'] opt.injection_rate = self.parameters['injection_rate']
if type(opt.dealias_type) == type(None):
opt.fk1 = self.parameters['dealias_type']
self.parameters['nu'] = (opt.kMeta * 2 / opt.n)**(4./3) self.parameters['nu'] = (opt.kMeta * 2 / opt.n)**(4./3)
if opt.forcing_type == 'linear': if opt.forcing_type == 'linear':
# custom famplitude for 288 and 576 # custom famplitude for 288 and 576
...@@ -698,20 +700,17 @@ class DNS(_code): ...@@ -698,20 +700,17 @@ class DNS(_code):
self.parameters['famplitude'] = 0.45 self.parameters['famplitude'] = 0.45
elif opt.n == 576: elif opt.n == 576:
self.parameters['famplitude'] = 0.47 self.parameters['famplitude'] = 0.47
kM = opt.n * 0.5
if opt.dealias_type == 1:
kM *= 0.8
elif opt.forcing_type == 'fixed_energy_injection_rate': elif opt.forcing_type == 'fixed_energy_injection_rate':
kM = opt.n * 0.5
if self.parameters['dealias_type'] == 1:
kM *= 0.8
# use the fact that mean dissipation rate is equal to injection rate # use the fact that mean dissipation rate is equal to injection rate
self.parameters['nu'] = ( self.parameters['nu'] = (
self.parameters['injection_rate'] * opt.injection_rate *
(opt.kMeta / kM)**4)**(1./3) (opt.kMeta / kM)**4)**(1./3)
elif opt.forcing_type == 'fixed_energy': elif opt.forcing_type == 'fixed_energy':
kM = opt.n * 0.5 kf = 1. / (1./opt.fk0 +
if self.parameters['dealias_type'] == 1: 1./opt.fk1)
kM *= 0.8
kf = 1. / (1./self.parameters['fk0'] +
1./self.parameters['fk1'])
self.parameters['nu'] = ( self.parameters['nu'] = (
(opt.kMeta / kM)**(4./3) * (opt.kMeta / kM)**(4./3) *
(np.pi / kf)**(1./3) * (np.pi / kf)**(1./3) *
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment