Skip to content

Commit c1b0584

Browse files
authored
add some asserts to the compressible solver (#312)
this catches negative density and internal energy if these become a problem, then the solution is to do a dual energy formulation or to introduce some floors.
1 parent 1289879 commit c1b0584

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pyro/compressible/simulation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ def cons_to_prim(U, gamma, ivars, myg):
6565
out=np.zeros_like(U[:, :, ivars.iener]),
6666
where=(U[:, :, ivars.idens] != 0.0))
6767

68+
assert e.v().min() > 0.0
69+
assert q.v(n=ivars.irho).min() > 0.0
70+
6871
q[:, :, ivars.ip] = eos.pres(gamma, q[:, :, ivars.irho], e)
6972

7073
if ivars.naux > 0:

0 commit comments

Comments
 (0)