tsimulation.h: remove unneeded vars - granular - granular dynamics simulation
(HTM) git clone git://src.adamsgaard.dk/granular
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 8f579780a9ac18da8a43ef60385fdd81da125103
(DIR) parent ad2bc6049831e53de63e8d2d20402a9cdb8e99a9
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 18 Mar 2021 08:16:13 +0100
simulation.h: remove unneeded vars
Diffstat:
M simulation.h | 115 ++-----------------------------
1 file changed, 6 insertions(+), 109 deletions(-)
---
(DIR) diff --git a/simulation.h b/simulation.h
t@@ -1,6 +1,7 @@
-#ifndef SIMULATION_
-#define SIMULATION_
+#ifndef GRANULAR_SIMULATION_
+#define GRANULAR_SIMULATION_
+#include "granular.h"
#include "arrays.h"
#define DEFAULT_SIMULATION_NAME "unnamed_simulation"
t@@ -11,43 +12,10 @@ extern struct simulation sim;
struct simulation {
/* simulation name to use for output files */
- char name[100];
+ char name[255];
- /* gravitational acceleration magnitude [m/s^2] */
- double G;
-
- /* normal stress from the top wall [Pa] */
- double P_wall;
-
- /* optionally fix top shear velocity to this value [m/s] */
- double v_x_fix;
-
- /* optionally fix top shear velocity to this value [m/s] */
- double v_x_limit;
-
- /* bottom velocity along x [m/s] */
- double v_x_bot;
-
- /* stress ratio at top wall */
- double mu_wall;
-
- /* nonlocal amplitude [-] */
- double A;
-
- /* rate dependence beyond yield [-] */
- double b;
-
- /* bulk and critical state static yield friction coefficient [-] */
- double mu_s;
-
- /* material cohesion [Pa] */
- double C;
-
- /* representative grain size [m] */
- double d;
-
- /* grain material density [kg/m^3] */
- double rho_s;
+ /* gravitational acceleration [m/s^2] */
+ double gravacc[ND];
/* nodes along z */
int nz;
t@@ -79,82 +47,11 @@ struct simulation {
/* output file number */
int n_file;
- double transient;
- double phi_min;
- double phi_max;
- double dilatancy_constant;
-
- /* Fluid parameters */
- int fluid; /* flag to switch fluid on (1) or off (0) */
- double p_f_top; /* fluid pressure at the top [Pa] */
- double p_f_mod_ampl; /* amplitude of fluid pressure variations [Pa] */
- double p_f_mod_freq; /* frequency of fluid pressure variations [s^-1] */
- double p_f_mod_phase; /* phase of fluid pressure variations [s^-1] */
- double p_f_mod_pulse_time; /* single pressure pulse at this time [s] */
- int p_f_mod_pulse_shape; /* waveform for fluid-pressure pulse */
- double beta_f; /* adiabatic fluid compressibility [Pa^-1] */
- double alpha; /* adiabatic grain compressibility [Pa^-1] */
- double mu_f; /* fluid dynamic viscosity [Pa*s] */
- double rho_f; /* fluid density [kg/m^3] */
- double D; /* diffusivity [m^2/s], overrides k, beta_f, alpha, mu_f */
-
- /* arrays */
- double *mu; /* static yield friction [-] */
- double *mu_c; /* critical-state static yield friction [-] */
- double *sigma_n_eff; /* effective normal pressure [Pa] */
- double *sigma_n; /* normal stress [Pa] */
- double *p_f_ghost; /* fluid pressure [Pa] */
- double *p_f_dot; /* fluid pressure change [Pa/s] */
- double *p_f_dot_expl; /* fluid pressure change (explicit solution) [Pa/s] */
- double *p_f_dot_impl; /* fluid pressure change (implicit solution) [Pa/s] */
- double *p_f_dot_impl_r_norm; /* normalized residual fluid pressure change [-] */
- double *k; /* hydraulic permeability [m^2] */
- double *phi; /* porosity [-] */
- double *phi_c; /* critical-state porosity [-] */
- double *phi_dot; /* porosity change [s^-1] */
- double *xi; /* cooperativity length */
- double *gamma_dot_p; /* plastic shear strain rate [s^-1] */
- double *v_x; /* shear velocity [m/s] */
- double *g_local; /* local fluidity */
- double *g_ghost; /* fluidity with ghost nodes */
- double *g_r_norm; /* normalized residual of fluidity field */
- double *I; /* inertia number [-] */
- double *tan_psi; /* tan(dilatancy_angle) [-] */
- double *old_val; /* temporary storage for iterative solvers */
- double *fluid_old_val;/* temporary storage for fluid iterative solver */
- double *tmp_ghost; /* temporary storage for iterative solvers */
- double *p_f_dot_old; /* temporary storage for old p_f_dot */
};
void init_sim(struct simulation *sim);
-void prepare_arrays(struct simulation *sim);
-void free_arrays(struct simulation *sim);
-void check_simulation_parameters(struct simulation *sim);
-void lithostatic_pressure_distribution(struct simulation *sim);
-void compute_effective_stress(struct simulation *sim);
-
-void set_bc_neumann(double *a,
- const int nz,
- const int boundary,
- const double df,
- const double dx);
-
-void set_bc_dirichlet(double *a,
- const int nz,
- const int boundary,
- const double value);
-
-double residual(double new_val, double old_val);
void write_output_file(struct simulation *sim, const int normalize);
void print_output(struct simulation *sim, FILE *fp, const int normalize);
-int coupled_shear_solver(struct simulation *sim,
- const int max_iter,
- const double rel_tol);
-
-void set_coupled_fluid_transient_timestep(struct simulation *sim, const double safety);
-
-double find_flux(const struct simulation *sim);
-
#endif