cngf-pf

continuum model for granular flows with pore-pressure dynamics (renamed from 1d_fd_simple_shear)
git clone git://src.adamsgaard.dk/cngf-pf # fast
git clone https://src.adamsgaard.dk/cngf-pf.git # slow
Log | Files | Refs | README | LICENSE Back to index

commit 41c495d99bab0f2d2d14f312c3ab6428b88db246
parent 97e88f765d0b872280c99f2cd5753ed1afefe420
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Wed, 18 Nov 2020 12:07:21 +0100

fix one-off error in write of fluid pressure solution

Diffstat:
Mfluid.c | 6+-----
Msimulation.c | 4++--
2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/fluid.c b/fluid.c @@ -252,11 +252,7 @@ darcy_solver_1d(struct simulation *sim, sim->D); for (i = 0; i < sim->nz - 1; ++i) { - sim->p_f_dot[i] = epsilon * p_f_dot_impl[i]; - - if (epsilon < 1.0) - sim->p_f_dot[i + 1] += (1.0 - epsilon) * p_f_dot_expl[i]; - + sim->p_f_dot[i] = epsilon * p_f_dot_impl[i] + (1.0 - epsilon) * p_f_dot_expl[i]; p_f_ghost_new[i + 1] += sim->p_f_dot[i] * sim->dt; r_norm[i] = fabs(residual(sim->p_f_dot[i], old_val[i])); } diff --git a/simulation.c b/simulation.c @@ -745,8 +745,8 @@ temporal_increment(struct simulation *sim) sim->phi[i] += sim->phi_dot[i] * sim->dt; if (sim->fluid) - for (i = 1; i <= sim->nz; ++i) - sim->p_f_ghost[i] += sim->p_f_dot[i] * sim->dt; + for (i = 0; i < sim->nz; ++i) + sim->p_f_ghost[i + 1] += sim->p_f_dot[i] * sim->dt; sim->t += sim->dt; }