Skip to content

Commit

Permalink
ns2d plot velocity with key='v'
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jul 24, 2024
1 parent ddbbc7a commit 67cc221
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fluidsim/solvers/ns2d/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
}
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 67cc221

Please sign in to comment.