commit 8050a4f258c3648cf3bc6f9dad04d4173b6450b6
parent 561aedb1a72628bcb9ffaa31e8303dc460407cf8
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 12 Jan 2021 14:17:39 +0100
add option -j to specify numerical time step manually
Diffstat:
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/cngf-pf.1 b/cngf-pf.1
@@ -24,6 +24,7 @@
.Op Fl h
.Op Fl I Ar file-interval
.Op Fl i Ar fluid-viscosity
+.Op Fl j Ar time-step
.Op Fl K Ar dilatancy-constant
.Op Fl k Ar fluid-permeability
.Op Fl L Ar length
@@ -107,6 +108,12 @@ Simulation time interval between writing output to disk [s] (default
Fluid dynamic viscosity [Pa*s] (1.787e-3).
Only relevant with fluid dynamics enabled
.Fl ( F ) .
+.It Fl j Ar time-step
+Override numerical time step length [s].
+Only relevant with fluid dynamics enabled
+.Fl ( F ) .
+Outside of stability testing, is not recommended to specify the
+time step length manually.
.It Fl K Ar dilatancy-constant
Factor relating dilatancy angle to the volume fraction [-] (default
4.09). Only relevant with transient granular dynamics enabled
diff --git a/cngf-pf.c b/cngf-pf.c
@@ -38,6 +38,7 @@ usage(void)
"[-h] "
"[-I file-interval] "
"[-i fluid-viscosity] "
+ "[-j time-step] "
"[-K dilatancy-constant] "
"[-k fluid-permeability] "
"[-L length] "
@@ -87,6 +88,7 @@ main(int argc, char *argv[])
normalize = 0;
new_phi = sim.phi[0];
new_k = sim.k[0];
+ sim.dt = -1.0;
ARGBEGIN {
case 'A':
@@ -134,6 +136,9 @@ main(int argc, char *argv[])
case 'i':
sim.mu_f = atof(EARGF(usage()));
break;
+ case 'j':
+ sim.dt = atof(EARGF(usage()));
+ break;
case 'K':
sim.dilatancy_constant = atof(EARGF(usage()));
break;
@@ -240,17 +245,18 @@ main(int argc, char *argv[])
sim.k[i] = new_k;
lithostatic_pressure_distribution(&sim);
+ compute_effective_stress(&sim);
if (sim.fluid) {
hydrostatic_fluid_pressure_distribution(&sim);
- if (set_largest_fluid_timestep(&sim, 0.5)) {
+ if (sim.dt <= 0.0 && set_largest_fluid_timestep(&sim, 0.5)) {
free_arrays(&sim);
return 20;
}
}
+
if (sim.dt > sim.file_dt)
sim.dt = sim.file_dt;
- compute_effective_stress(&sim);
check_simulation_parameters(&sim);