tfix one-off error in write of fluid pressure solution - cngf-pf - continuum mo… | |
git clone git://src.adamsgaard.dk/cngf-pf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 41c495d99bab0f2d2d14f312c3ab6428b88db246 | |
parent 97e88f765d0b872280c99f2cd5753ed1afefe420 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Wed, 18 Nov 2020 12:07:21 +0100 | |
fix one-off error in write of fluid pressure solution | |
Diffstat: | |
M fluid.c | 6 +----- | |
M simulation.c | 4 ++-- | |
2 files changed, 3 insertions(+), 7 deletions(-) | |
--- | |
diff --git a/fluid.c b/fluid.c | |
t@@ -252,11 +252,7 @@ darcy_solver_1d(struct simulation *sim, | |
… | |
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)… | |
- | |
+ sim->p_f_dot[i] = epsilon * p_f_dot_impl[i] + … | |
p_f_ghost_new[i + 1] += sim->p_f_dot[i] * sim-… | |
r_norm[i] = fabs(residual(sim->p_f_dot[i], old… | |
} | |
diff --git a/simulation.c b/simulation.c | |
t@@ -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; | |
} |