Skip to content

Commit f6b6033

Browse files
committedJun 1, 2023
Added sanity check for Nz=1 in D2Q9
1 parent b6a3c78 commit f6b6033

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/lbm.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,9 @@ void LBM::sanity_checks_constructor(const vector<Device_Info>& device_infos, con
623623
}
624624
if(nu==0.0f) print_error("Viscosity cannot be 0. Change it in setup.cpp."); // sanity checks for viscosity
625625
else if(nu<0.0f) print_error("Viscosity cannot be negative. Remove the \"-\" in setup.cpp.");
626+
#ifdef D2Q9
627+
if(Nz!=1u) print_error("D2Q9 is the 2D velocity set. You have to set Nz=1u in the LBM constructor! Currently you have set Nz="+to_string(Nz)+"u.");
628+
#endif // D2Q9
626629
#if !defined(SRT)&&!defined(TRT)
627630
print_error("No LBM collision operator selected. Uncomment either \"#define SRT\" or \"#define TRT\" in defines.hpp");
628631
#elif defined(SRT)&&defined(TRT)

0 commit comments

Comments
 (0)
Please sign in to comment.