corrected grid boundary check, debugging cfd