trename p_f_next to p_f_next_ghost to be inline with other declarations - cngf-… | |
git clone git://src.adamsgaard.dk/cngf-pf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit cc757725d05e147a37ba1ebb8ac9ff1e6516e26e | |
parent 1e591770b73a80d3b7eccb98c5d6f3704b535229 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 17 Aug 2021 12:36:54 +0200 | |
rename p_f_next to p_f_next_ghost to be inline with other declarations | |
Diffstat: | |
M fluid.c | 16 ++++++++-------- | |
M simulation.c | 9 +++++---- | |
M simulation.h | 2 +- | |
3 files changed, 14 insertions(+), 13 deletions(-) | |
--- | |
diff --git a/fluid.c b/fluid.c | |
t@@ -274,7 +274,7 @@ darcy_solver_1d(struct simulation *sim, | |
/* set fluid BCs (1 of 2) */ | |
set_fluid_bcs(sim->p_f_ghost, sim, p_f_top); | |
- set_fluid_bcs(sim->p_f_next, sim, p_f_top); | |
+ set_fluid_bcs(sim->p_f_next_ghost, sim, p_f_top); | |
/* explicit solution to pressure change */ | |
if (epsilon < 1.0) { | |
t@@ -308,7 +308,7 @@ darcy_solver_1d(struct simulation *sim, | |
#ifdef DEBUG | |
printf("\nEXPLICIT SOLVER IN %s\n", __func__); | |
#endif | |
- copy_values(sim->p_f_next, sim->tmp_ghost, sim->nz + 2); | |
+ copy_values(sim->p_f_next_ghost, sim->tmp_ghost, sim->nz + 2); | |
for (iter = 0; iter < max_iter; ++iter) { | |
copy_values(sim->p_f_dot_impl, sim->fluid_old_val, sim… | |
t@@ -332,7 +332,7 @@ darcy_solver_1d(struct simulation *sim, | |
… | |
… | |
… | |
- … | |
+ … | |
… | |
… | |
… | |
t@@ -347,12 +347,12 @@ darcy_solver_1d(struct simulation *sim, | |
errx(1, "NaN at sim->p_f_dot_impl[%d] … | |
i, sim->t, iter); | |
- set_fluid_bcs(sim->p_f_next, sim, p_f_top); | |
+ set_fluid_bcs(sim->p_f_next_ghost, sim, p_f_top); | |
for (i = 0; i < sim->nz-1; ++i) | |
- sim->p_f_dot_impl_r_norm[i] = fabs(residual(si… | |
+ sim->p_f_dot_impl_r_norm[i] = fabs(residual(si… | |
si… | |
r_norm_max = max(sim->p_f_dot_impl_r_norm, sim->nz - 1… | |
- copy_values(sim->p_f_next, sim->tmp_ghost, sim->nz + 2… | |
+ copy_values(sim->p_f_next_ghost, sim->tmp_ghost, sim->… | |
#ifdef DEBUG | |
puts(".. p_f_ghost_new:"); | |
t@@ -387,10 +387,10 @@ darcy_solver_1d(struct simulation *sim, | |
+ (1.0 - omega) * sim->p_f_dot_old[i]; | |
for (i = 0; i < sim->nz-1; ++i) | |
- sim->p_f_next[i + 1] = sim->p_f_dot[i] * sim->dt + sim->p_f_gh… | |
+ sim->p_f_next_ghost[i + 1] = sim->p_f_dot[i] * sim->dt + sim->… | |
set_fluid_bcs(sim->p_f_ghost, sim, p_f_top); | |
- set_fluid_bcs(sim->p_f_next, sim, p_f_top); | |
+ set_fluid_bcs(sim->p_f_next_ghost, sim, p_f_top); | |
#ifdef DEBUG | |
printf(".. epsilon = %g\n", epsilon); | |
puts(".. p_f_dot_expl:"); | |
diff --git a/simulation.c b/simulation.c | |
t@@ -148,7 +148,7 @@ prepare_arrays(struct simulation *sim) | |
sim->sigma_n_eff = zeros(sim->nz); | |
sim->sigma_n = zeros(sim->nz); | |
sim->p_f_ghost = zeros(sim->nz + 2); | |
- sim->p_f_next = zeros(sim->nz + 2); | |
+ sim->p_f_next_ghost = zeros(sim->nz + 2); | |
sim->p_f_dot = zeros(sim->nz); | |
sim->p_f_dot_expl = zeros(sim->nz); | |
sim->p_f_dot_impl = zeros(sim->nz); | |
t@@ -181,7 +181,7 @@ free_arrays(struct simulation *sim) | |
free(sim->sigma_n_eff); | |
free(sim->sigma_n); | |
free(sim->p_f_ghost); | |
- free(sim->p_f_next); | |
+ free(sim->p_f_next_ghost); | |
free(sim->p_f_dot); | |
free(sim->p_f_dot_expl); | |
free(sim->p_f_dot_impl); | |
t@@ -550,7 +550,8 @@ compute_effective_stress(struct simulation *sim) | |
for (i = 0; i < sim->nz; ++i) { | |
/* average of current and next step pressure values fo… | |
sim->sigma_n_eff[i] = sim->sigma_n[i] | |
- - ((sim->p_f_ghost[i + 1] + sim-… | |
+ - ((sim->p_f_ghost[i + 1] | |
+ + sim->p_f_next_ghost[i + 1]) | |
/ 2.0); | |
/* sim->sigma_n_eff[i] = sim->sigma_n[i] - sim->p_f_gh… | |
if (sim->sigma_n_eff[i] < 0) | |
t@@ -813,7 +814,7 @@ coupled_shear_solver(struct simulation *sim, | |
int i, coupled_iter, stress_iter = 0; | |
double r_norm_max, vel_res_norm = NAN, mu_wall_orig = sim->mu_wall; | |
- copy_values(sim->p_f_ghost,sim->p_f_next,sim->nz+2); | |
+ copy_values(sim->p_f_ghost, sim->p_f_next_ghost, sim->nz + 2); | |
compute_effective_stress(sim); /* Eq. 9 */ | |
do { /* stress iterations */ | |
diff --git a/simulation.h b/simulation.h | |
t@@ -106,7 +106,7 @@ struct simulation { | |
double *sigma_n_eff; /* effective normal pressure [Pa] */ | |
double *sigma_n; /* normal stress [Pa] */ | |
double *p_f_ghost; /* fluid pressure [Pa] */ | |
- double *p_f_next; /* fluid pressure for next iteration [Pa] */ | |
+ double *p_f_next_ghost; /* fluid pressure for next iteration [Pa] */ | |
double *p_f_dot; /* fluid pressure change [Pa/s] */ | |
double *p_f_dot_expl; /* fluid pressure change (explicit solution) [Pa… | |
double *p_f_dot_impl; /* fluid pressure change (implicit solution) [Pa… |