From 9ddfd0f54ddb95b181421c851826e0bb462c249d Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 26 Oct 2019 13:42:11 +0200 Subject: Add BGK relaxation time argument Still thinking how various collision models (BGK, MRT and so on) may be nicely abstracted in this setting. --- boltzgen/lbm/__init__.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'boltzgen/lbm') diff --git a/boltzgen/lbm/__init__.py b/boltzgen/lbm/__init__.py index f80feaa..bafe331 100644 --- a/boltzgen/lbm/__init__.py +++ b/boltzgen/lbm/__init__.py @@ -51,6 +51,9 @@ class LBM: return f_eq def bgk(self, tau, f_eq, optimize = True): + if tau <= 0.5: + raise Exception('Relaxation time must be larger than 0.5') + exprs = [ self.f_curr[i] + 1/tau * (f_eq_i - self.f_curr[i]) for i, f_eq_i in enumerate(f_eq) ] if optimize: -- cgit v1.2.3