commit 8bbc6c21842e6820f09d642d03ae1c0cb814a3f5
parent f74ed98b4c7ea4bde059ced6673690a20f85e016
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Mon, 6 Apr 2020 13:56:37 +0200
Move wall friction variable associated with limited shear velocity
Diffstat:
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/1d_fd_simple_shear.c b/1d_fd_simple_shear.c
@@ -262,8 +262,6 @@ main(int argc, char* argv[])
printf("time spent per time step = %g s\n", t_elapsed);
#endif
- if (!isnan(sim.v_x_limit))
- sim.mu_wall = mu_wall_orig;
sim.t += sim.dt;
filetimeclock += sim.dt;
iter++;
diff --git a/simulation.c b/simulation.c
@@ -640,9 +640,10 @@ coupled_shear_solver(const int max_iter,
const double rel_tol)
{
int coupled_iter, stress_iter;
+ double res_norm, mu_wall_orig;
- double res_norm;
res_norm = NAN;
+ mu_wall_orig = sim.mu_wall;
stress_iter = 0;
do { /* stress iterations */
@@ -727,6 +728,10 @@ coupled_shear_solver(const int max_iter,
} while ((!isnan(sim.v_x_fix) || !isnan(sim.v_x_limit))
&& fabs(res_norm) > RTOL_STRESS);
+
+ if (!isnan(sim.v_x_limit))
+ sim.mu_wall = mu_wall_orig;
+
return 0;
}