diff --git a/fluidsim/solvers/ns2d/state.py b/fluidsim/solvers/ns2d/state.py index 342ea036..56126305 100644 --- a/fluidsim/solvers/ns2d/state.py +++ b/fluidsim/solvers/ns2d/state.py @@ -31,7 +31,7 @@ def _complete_info_solver(info_solver): { "keys_state_spect": ["rot_fft"], "keys_state_phys": ["ux", "uy", "rot"], - "keys_computable": [], + "keys_computable": ["div", "q", "v"], "keys_phys_needed": ["rot"], "keys_linear_eigenmodes": ["rot_fft"], } @@ -71,6 +71,10 @@ def compute(self, key, SAVE_IN_DICT=True, RAISE_ERROR=True): elif key == "q": rot = self.get_var("rot") result = rot + elif key == "v": + ux = self.state_phys.get_var("ux") + uy = self.state_phys.get_var("uy") + result = np.sqrt(ux**2 + uy**2) else: to_print = 'Do not know how to compute "' + key + '".' if RAISE_ERROR: