diff options
author | Adrian Kummerlaender | 2018-10-11 21:02:42 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2018-10-11 21:02:42 +0200 |
commit | a2476312c64a565736beaf791df1a464e7e2ef68 (patch) | |
tree | 5f9c5226f91a083741f1516d12317ab87dd735cc | |
parent | e720bbf4ead889a607a11513c4a64cc3ccb3e691 (diff) | |
download | boltzbub-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.cc | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); + } } } } |