From 67cc22150d50a7ec6b452e15b1b8419329293134 Mon Sep 17 00:00:00 2001 From: paugier Date: Wed, 24 Jul 2024 08:44:56 +0200 Subject: [PATCH] ns2d plot velocity with key='v' --- fluidsim/solvers/ns2d/state.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fluidsim/solvers/ns2d/state.py b/fluidsim/solvers/ns2d/state.py index 342ea0364..561263052 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: