tAdd command line options for fluid parameters - cngf-pf - continuum model for … | |
git clone git://src.adamsgaard.dk/cngf-pf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 03ccad01366b146793639c634b0e109a70492598 | |
parent 8af65eb27f641cdaeb39010af5ccd8d90c515824 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Mon, 15 Apr 2019 15:36:43 +0200 | |
Add command line options for fluid parameters | |
Diffstat: | |
M main.c | 53 ++++++++++++++++++++---------… | |
1 file changed, 34 insertions(+), 19 deletions(-) | |
--- | |
diff --git a/main.c b/main.c | |
t@@ -14,23 +14,26 @@ static void usage(void) | |
{ | |
printf("%s: %s [OPTIONS]\n" | |
"optional arguments:\n" | |
- " -N, --normalize normalize output velocity\n" | |
- " -G, --gravity VAL gravity magnitude [m/s^2]\n" | |
- " -P, --pressure VAL normal stress on top [Pa]\n" | |
- " -m, --stress-ratio VAL applied stress ratio [-]\n" | |
- " -V, --velocity-bottom VAL base velocity at bottom [m/s]\n" | |
- " -A, --nonlocal-amplitude VAL amplitude of nonlocality [-]\n" | |
- " -b, --rate-dependence VAL rate dependence beyond yield [-]\… | |
- " -f, --friction-coefficient VAL grain friction coefficient [-]\n" | |
- " -p, --porosity VAL porosity fraction [-]\n" | |
- " -d, --grain-size VAL representative grain size [m]\n" | |
- " -r, --density VAL grain material density [kg/m^3]\n" | |
- " -n, --resolution VAL number of cells in domain [-]\n" | |
- " -o, --origo VAL coordinate system origo [m]\n" | |
- " -L, --length VAL domain length [m]\n" | |
- " -F, --fluid enable pore fluid computations\n" | |
- " -v, --version show version information\n" | |
- " -h, --help show this message\n" | |
+ " -N, --normalize normalize output velocity\n" | |
+ " -G, --gravity VAL gravity magnitude [m/s^2]\n" | |
+ " -P, --pressure VAL normal stress on top [Pa]\n" | |
+ " -m, --stress-ratio VAL applied stress ratio [-]\n" | |
+ " -V, --velocity-bottom VAL base velocity at bottom [m/s]\n" | |
+ " -A, --nonlocal-amplitude VAL amplitude of nonlocality [-]\n" | |
+ " -b, --rate-dependence VAL rate dependence beyond yield [-]… | |
+ " -f, --friction-coefficient VAL grain friction coefficient [-]\n" | |
+ " -p, --porosity VAL porosity fraction [-]\n" | |
+ " -d, --grain-size VAL representative grain size [m]\n" | |
+ " -r, --density VAL grain material density [kg/m^3]\… | |
+ " -n, --resolution VAL number of cells in domain [-]\n" | |
+ " -o, --origo VAL coordinate system origo [m]\n" | |
+ " -L, --length VAL domain length [m]\n" | |
+ " -F, --fluid enable pore fluid computations\n" | |
+ " -c, --fluid-compressibility VAL enable pore fluid computations\n" | |
+ " -i, --fluid-viscosity VAL enable pore fluid computations\n" | |
+ " -R, --fluid-density VAL enable pore fluid computations\n" | |
+ " -v, --version show version information\n" | |
+ " -h, --help show this message\n" | |
, __func__, PROGNAME); | |
} | |
t@@ -52,7 +55,7 @@ int main(int argc, char* argv[]) | |
int normalize = 0; | |
int opt; | |
- const char* optstring = "hvNn:G:P:m:V:A:b:f:Fp:d:r:o:L:"; | |
+ const char* optstring = "hvNn:G:P:m:V:A:b:f:Fp:d:r:o:L:c:i:R:"; | |
const struct option longopts[] = { | |
{"help", no_argument, NULL, 'h'}, | |
{"version", no_argument, NULL, 'v'}, | |
t@@ -63,13 +66,16 @@ int main(int argc, char* argv[]) | |
{"nonlocal-amplitude", required_argument, NULL, 'A'}, | |
{"rate-dependence", required_argument, NULL, 'b'}, | |
{"friction-coefficient", required_argument, NULL, 'f'}, | |
- {"fluid", no_argument, NULL, 'F'}, | |
{"porosity", required_argument, NULL, 'p'}, | |
{"grain-size", required_argument, NULL, 'd'}, | |
{"density", required_argument, NULL, 'r'}, | |
{"resolution", required_argument, NULL, 'n'}, | |
{"origo", required_argument, NULL, 'o'}, | |
{"length", required_argument, NULL, 'L'}, | |
+ {"fluid", no_argument, NULL, 'F'}, | |
+ {"fluid-compressiblity", required_argument, NULL, 'c'}, | |
+ {"fluid-viscosity", required_argument, NULL, 'i'}, | |
+ {"fluid-density", required_argument, NULL, 'R'}, | |
{NULL, 0, NULL, 0} | |
}; | |
t@@ -131,6 +137,15 @@ int main(int argc, char* argv[]) | |
case 'F': | |
sim.fluid = 1; | |
break; | |
+ case 'c': | |
+ sim.beta_f = atof(optarg); | |
+ break; | |
+ case 'i': | |
+ sim.mu_f = atof(optarg); | |
+ break; | |
+ case 'R': | |
+ sim.rho_f = atof(optarg); | |
+ break; | |
default: | |
fprintf(stderr, "%s: invalid option -- %c\n", argv[0], opt); |