From ec8e16d253ad6ab9d1d4621de4c134aeb409bffd Mon Sep 17 00:00:00 2001
From: Cristian C Lalescu <Cristian.Lalescu@ds.mpg.de>
Date: Fri, 1 Dec 2017 11:29:36 +0100
Subject: [PATCH] fix parameter tweaking

---
 bfps/DNS.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/bfps/DNS.py b/bfps/DNS.py
index bbc354d0..48d5c455 100644
--- a/bfps/DNS.py
+++ b/bfps/DNS.py
@@ -694,15 +694,17 @@ class DNS(_code):
         if type(opt.dealias_type) == type(None):
             opt.dealias_type = self.parameters['dealias_type']
         self.parameters['nu'] = (opt.kMeta * 2 / opt.n)**(4./3)
+        # check value of kMax
+        kM = opt.n * 0.5
+        if opt.dealias_type == 1:
+            kM *= 0.8
+        # tweak forcing/viscosity based on forcint type
         if opt.forcing_type == 'linear':
             # custom famplitude for 288 and 576
             if opt.n == 288:
                 self.parameters['famplitude'] = 0.45
             elif opt.n == 576:
                 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':
             # use the fact that mean dissipation rate is equal to injection rate
             self.parameters['nu'] = (
-- 
GitLab