tShow fluid pressure in stdout - cngf-pf - continuum model for granular flows w… | |
git clone git://src.adamsgaard.dk/cngf-pf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit fc8db4ee3cef05e5f3620fc0f62c6733fb61ad38 | |
parent f7d86023d0088369e36a6f887dd04e0ca096616c | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 16 Apr 2019 13:14:55 +0200 | |
Show fluid pressure in stdout | |
Diffstat: | |
M fluid.c | 4 ++-- | |
M main.c | 14 +++++++++++--- | |
2 files changed, 13 insertions(+), 5 deletions(-) | |
--- | |
diff --git a/fluid.c b/fluid.c | |
t@@ -80,8 +80,8 @@ int darcy_solver_1d( | |
* theta in ]0.0; 1.0]: underrelaxation | |
* theta = 1.0: Gauss-Seidel | |
* theta > 1.0: overrrelaxation */ | |
- /* const double theta = 0.05; */ | |
- const double theta = 1.7; | |
+ const double theta = 0.05; | |
+ /* const double theta = 1.7; */ | |
double p_f; | |
diff --git a/main.c b/main.c | |
t@@ -233,7 +233,7 @@ int main(int argc, char* argv[]) | |
while (sim.t <= sim.t_end) { | |
if (sim.fluid) { | |
- if (darcy_solver_1d(&sim, 10000, 1e-5)) | |
+ if (darcy_solver_1d(&sim, 10000, 1e-3)) | |
exit(1); | |
/* puts(".. p_f_ghost:"); print_array(sim.p_f_ghost, sim.nz+2); */ | |
/* puts(""); */ | |
t@@ -251,7 +251,7 @@ int main(int argc, char* argv[]) | |
puts(".. mu:"); print_array(sim.mu, sim.nz); | |
#endif | |
- if (implicit_1d_jacobian_poisson_solver(&sim, 10000, 1e-5)) | |
+ if (implicit_1d_jacobian_poisson_solver(&sim, 10000, 1e-3)) | |
exit(1); | |
compute_shear_strain_rate_plastic(&sim); | |
t@@ -269,7 +269,15 @@ int main(int argc, char* argv[]) | |
if (normalize) | |
print_arrays_2nd_normalized(sim.z, sim.v_x, sim.nz); | |
else | |
- print_three_arrays(sim.z, sim.v_x, sim.sigma_n_eff, sim.nz); | |
+ if (sim.fluid) | |
+ for (int i=0; i<sim.nz; ++i) | |
+ printf("%.17g\t%.17g\t%.17g\t%.17g\n", | |
+ sim.z[i], | |
+ sim.v_x[i], | |
+ sim.sigma_n_eff[i], | |
+ sim.p_f_ghost[idx1g(i)]); | |
+ else | |
+ print_three_arrays(sim.z, sim.v_x, sim.sigma_n_eff, sim.nz); | |
free_arrays(&sim); | |
return 0; |