commit 74cf3d782edc4b27b02eeea37d4070b3abbff20d
parent 1085459b26649c3b499cb56715f95257c091c1e8
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 25 Jun 2019 13:11:48 +0200
Add figure 2
Diffstat:
2 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/fig2/Makefile b/fig2/Makefile
@@ -0,0 +1,29 @@
+BIN = ../1d_fd_simple_shear/1d_fd_simple_shear
+FIG = fig2
+
+default: ../$(FIG).pdf
+
+unnamed.output00000.txt: $(BIN)
+ /bin/sh -c '\
+ ./$< --resolution 50 --length 2.0 --normal-stress 150e3 \
+ --fluid --fluid-permeability 2e-17 --fluid-pressure-top 50e3 \
+ --fluid-pressure-ampl 50e3 \
+ --fluid-pressure-freq $$( echo "1.0/(3600*24)" | bc -l ) \
+ --time-step 1e-1 \
+ --file-interval $$( echo "60*10" | bc -l ) \
+ --time-end $$( echo "3600*24*7" | bc -l )'
+
+timeseries.txt: unnamed.output00000.txt
+ /bin/sh -c '\
+ for f in unnamed.output*.txt; do \
+ tail -n 1 "$$f" | cut -f2- >> $@; \
+ done'
+
+../$(FIG).pdf: fig.gp timeseries.txt
+ gnuplot $< > $@
+
+clean:
+ $(RM) *.txt
+ $(RM) ../$(FIG).pdf
+
+.PHONY: default clean
diff --git a/fig2/fig.gp b/fig2/fig.gp
@@ -0,0 +1,26 @@
+#!/usr/bin/env gnuplot
+reset
+
+set terminal pdfcairo color size 7.5 cm, 8.0 cm
+
+# set xrange [0.0:0.7]
+# set yrange [0.0:0.01]
+# set key top left #samplen 0.9
+
+set multiplot layout 2,1
+
+unset xlabel
+unset xtics
+set yrange [0:210]
+set ylabel "Stress [kPa]"
+plot \
+"timeseries.txt" u ($0/1008*7):($2/1000) w l lw 2 lc "black" t "effective normal stress", \
+"" u ($0/1008*7):($3/1000) w l lw 2 lc "blue" dt "-" t "water pressure"
+
+set xtics
+unset yrange
+set xlabel "Time, t [d]"
+set ylabel "Shear velocity, v [km/d]"
+plot "" u ($0/1008*7):($1*60*60*24/1000) w l lw 2 lc "red" t ""
+
+unset multiplot