1d_fd_simple_shear

Continuum model for granular flows with pore-pressure dynamics
git clone git://src.adamsgaard.dk/1d_fd_simple_shear
Log | Files | Refs | README | LICENSE

commit 7aae935b8bcbc846acbc37ef0a279042061b2e51
parent d2352ce3b61f0effffb1ffff16888e00b66cb013
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Wed, 21 Aug 2019 10:42:09 +0200

Fix velocity-constraint nan-output when initial forcing is below yield

Diffstat:
Mmain.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/main.c b/main.c @@ -313,12 +313,12 @@ main(int argc, char* argv[]) if (!isnan(sim.v_x_limit) || !isnan(sim.v_x_fix)) { if (!isnan(sim.v_x_limit)) { res_norm = (sim.v_x_limit - sim.v_x[sim.nz-1]) - /sim.v_x[sim.nz-1]; + /(sim.v_x[sim.nz-1] + 1e-12); if (res_norm > 0.0) res_norm = 0.0; } else { res_norm = (sim.v_x_fix - sim.v_x[sim.nz-1]) - /sim.v_x[sim.nz-1]; + /(sim.v_x[sim.nz-1] + 1e-12); } sim.mu_wall *= 1.0 + (res_norm*1e-2); }