aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-10-11 21:02:42 +0200
committerAdrian Kummerlaender2018-10-11 21:02:42 +0200
commita2476312c64a565736beaf791df1a464e7e2ef68 (patch)
tree5f9c5226f91a083741f1516d12317ab87dd735cc
parente720bbf4ead889a607a11513c4a64cc3ccb3e691 (diff)
downloadboltzbub-a2476312c64a565736beaf791df1a464e7e2ef68.tar
boltzbub-a2476312c64a565736beaf791df1a464e7e2ef68.tar.gz
boltzbub-a2476312c64a565736beaf791df1a464e7e2ef68.tar.bz2
boltzbub-a2476312c64a565736beaf791df1a464e7e2ef68.tar.lz
boltzbub-a2476312c64a565736beaf791df1a464e7e2ef68.tar.xz
boltzbub-a2476312c64a565736beaf791df1a464e7e2ef68.tar.zst
boltzbub-a2476312c64a565736beaf791df1a464e7e2ef68.zip
Check for instabilities during cell equilibration
-rw-r--r--src/lbm.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lbm.cc b/src/lbm.cc
index ca84cee..33c6824 100644
--- a/src/lbm.cc
+++ b/src/lbm.cc
@@ -1,9 +1,16 @@
#include "lbm.h"
+#include <iostream>
+
void Cell::equilibrize(Density d, Velocity v) {
for ( int i = -1; i <= 1; ++i ) {
for ( int j = -1; j <= 1; ++j ) {
get(i,j) = weight.get(i,j) * d * (1 + 3*v.comp(i,j) + 4.5*sq(v.comp(i,j)) - 1.5*sq(v.norm()));
+
+ if ( std::isnan(get(i,j)) ) {
+ std::cerr << "Instability detected!" << std::endl;
+ std::exit(-1);
+ }
}
}
}