tfluid.c: add comment on underrelaxation parameter - cngf-pf - continuum model … | |
git clone git://src.adamsgaard.dk/cngf-pf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 98e82ec48621114493aa95f533f2a82c56581739 | |
parent cd1860a031d74199c9308ee12bee5dea8572f7be | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 9 Mar 2021 15:24:14 +0100 | |
fluid.c: add comment on underrelaxation parameter | |
Diffstat: | |
M fluid.c | 4 ++++ | |
1 file changed, 4 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/fluid.c b/fluid.c | |
t@@ -179,6 +179,9 @@ darcy_solver_1d(struct simulation *sim, | |
* epsilon = 0.5: Crank-Nicolson | |
* epsilon = 1.0: implicit */ | |
epsilon = 0.5; | |
+ | |
+ /* underrelaxation parameter in ]0.0; 1.0], | |
+ * where omega = 1.0: no underrelaxation */ | |
omega = 1e-4; | |
for (i = 0; i < sim->nz; ++i) | |
t@@ -301,6 +304,7 @@ darcy_solver_1d(struct simulation *sim, | |
+ (1.0 - epsilon) * sim->p_f_dot_expl[i]; | |
set_fluid_bcs(sim->p_f_ghost, sim, p_f_top); | |
+ | |
for (i = 0; i < sim->nz; ++i) | |
sim->p_f_dot[i] = omega * sim->p_f_dot[i] | |
+ (1.0 - omega) * sim->p_f_dot_old[i]; |