Skip to content
Snippets Groups Projects
Commit 74dce30f authored by podlesny's avatar podlesny
Browse files

towards final foam output

parent 5474019f
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
#/home/joscha/Downloads/ #/home/joscha/Downloads/
[directories] [directories]
simulation = /home/joscha/software/dune/build-release/dune-tectonic/src/foam/output/tresca-0.6/ simulation = /home/joscha/software/dune/build-release/dune-tectonic/src/foam/output/pipping-2013-euler/
experiment = ~/group/publications/2016-RosenauCorbiDominguezRudolfRitterPipping experiment = ~/group/publications/2016-RosenauCorbiDominguezRudolfRitterPipping
output = generated output = generated
...@@ -35,7 +35,7 @@ def build_patch(coords, percentage): ...@@ -35,7 +35,7 @@ def build_patch(coords, percentage):
NBODIES = 2 NBODIES = 2
FINAL_TIME = 150 # s FINAL_TIME = 15 # s
FINAL_VELOCITY = 2e-4 # m/s FINAL_VELOCITY = 2e-4 # m/s
THRESHOLD_VELOCITY = 0.5*FINAL_VELOCITY # 1000e-6 + FINAL_VELOCITY THRESHOLD_VELOCITY = 0.5*FINAL_VELOCITY # 1000e-6 + FINAL_VELOCITY
...@@ -53,7 +53,9 @@ params = { ...@@ -53,7 +53,9 @@ params = {
h5file = read_h5file() h5file = read_h5file()
print(list(h5file.keys())) print(list(h5file.keys()))
iterations(h5file, FINAL_TIME) interval = [0.75*FINAL_TIME, FINAL_TIME]
iterations(h5file, FINAL_TIME, interval)
for body_ID in range(NBODIES): for body_ID in range(NBODIES):
body = 'body' + str(body_ID) body = 'body' + str(body_ID)
...@@ -62,9 +64,9 @@ for body_ID in range(NBODIES): ...@@ -62,9 +64,9 @@ for body_ID in range(NBODIES):
continue continue
coords = np.array(h5file[body + '/coordinates']) coords = np.array(h5file[body + '/coordinates'])
patch = build_patch(coords, 0.05) patch = build_patch(coords, 1.0)
friction_stats(h5file, body_ID, FINAL_TIME, [], [0, FINAL_TIME]) friction_stats(h5file, body_ID, FINAL_TIME, patch, interval)
plt.show() plt.show()
......
...@@ -27,12 +27,13 @@ def friction_stats(h5file, body_ID, FINAL_TIME, patch=[], interval=[], TANGENTIA ...@@ -27,12 +27,13 @@ def friction_stats(h5file, body_ID, FINAL_TIME, patch=[], interval=[], TANGENTIA
min_v = np.min(v_tx, axis=1) min_v = np.min(v_tx, axis=1)
max_v = np.max(v_tx, axis=1) max_v = np.max(v_tx, axis=1)
# plot # plot
ax_slip = fig.add_subplot(3, 1, 1) ax_slip = fig.add_subplot(2, 1, 1)
#ax_slip.plot(time, min_v, color='gray', linestyle='--') #ax_slip.plot(time, min_v, color='gray', linestyle='--')
ax_slip.plot(time, avg_v, color='black', linestyle='-') ax_slip.plot(time, avg_v, color='black', linestyle='-')
#ax_slip.plot(time, max_v, color='gray', linestyle='--') #ax_slip.plot(time, max_v, color='gray', linestyle='--')
ax_slip.set_ylabel('slip rate') ax_slip.set_ylabel('slip rate V')
#ax_slip.set_yscale('log') ax_slip.set_yscale('log')
ax_slip.set_ylim([1e-6,1e-2])
#------------------------- #-------------------------
print(np.min(min_v)) print(np.min(min_v))
...@@ -48,27 +49,28 @@ def friction_stats(h5file, body_ID, FINAL_TIME, patch=[], interval=[], TANGENTIA ...@@ -48,27 +49,28 @@ def friction_stats(h5file, body_ID, FINAL_TIME, patch=[], interval=[], TANGENTIA
min_states = np.min(states_tx, axis=1) min_states = np.min(states_tx, axis=1)
max_states = np.max(states_tx, axis=1) max_states = np.max(states_tx, axis=1)
# plot # plot
ax_state = fig.add_subplot(3, 1, 2) ax_state = fig.add_subplot(2, 1, 2)
ax_state.plot(time, min_states, color='gray', linestyle='--') #ax_state.plot(time, min_states, color='gray', linestyle='--')
ax_state.plot(time, avg_states, color='black', linestyle='-') ax_state.plot(time, avg_states, color='black', linestyle='-')
ax_state.plot(time, max_states, color='gray', linestyle='--') #ax_state.plot(time, max_states, color='gray', linestyle='--')
ax_state.set_ylabel('state') ax_state.set_ylabel('state')
ax_state.set_xlabel('time in s')
#------------------------- #-------------------------
# friction coefficient # friction coefficient
friction_coeff = np.array(h5file[body + '/coefficient']) # friction_coeff = np.array(h5file[body + '/coefficient'])
friction_coeff_t = friction_coeff[t,:] # friction_coeff_t = friction_coeff[t,:]
friction_coeff_tx = friction_coeff_t[:,patch] # friction_coeff_tx = friction_coeff_t[:,patch]
# statistics # # statistics
avg_friction_coeff = np.average(friction_coeff_tx, axis=1) # avg_friction_coeff = np.average(friction_coeff_tx, axis=1)
min_friction_coeff = np.min(friction_coeff_tx, axis=1) # min_friction_coeff = np.min(friction_coeff_tx, axis=1)
max_friction_coeff = np.max(friction_coeff_tx, axis=1) # max_friction_coeff = np.max(friction_coeff_tx, axis=1)
# plot # # plot
ax_friction = fig.add_subplot(3, 1, 3) # ax_friction = fig.add_subplot(3, 1, 3)
ax_friction.plot(time, min_friction_coeff, color='gray', linestyle='--') # ax_friction.plot(time, min_friction_coeff, color='gray', linestyle='--')
ax_friction.plot(time, avg_friction_coeff, color='black', linestyle='-') # ax_friction.plot(time, avg_friction_coeff, color='black', linestyle='-')
ax_friction.plot(time, max_friction_coeff, color='gray', linestyle='--') # ax_friction.plot(time, max_friction_coeff, color='gray', linestyle='--')
ax_friction.set_ylabel('friction coefficient') # ax_friction.set_ylabel('friction coefficient')
#------------------------- #-------------------------
fig.canvas.draw() fig.canvas.draw()
\ No newline at end of file
...@@ -27,19 +27,20 @@ def iterations(h5file, FINAL_TIME, interval = []): ...@@ -27,19 +27,20 @@ def iterations(h5file, FINAL_TIME, interval = []):
# plot # plot
fig = plt.figure() fig = plt.figure()
ax_fpi = fig.add_subplot(3, 1, 1) ax_fpi = fig.add_subplot(2, 1, 1)
ax_fpi.plot(time, fpi_final[t], color='black', linestyle='-') ax_fpi.plot(time, fpi_final[t], color='black', linestyle='-')
ax_fpi.set_ylabel('fpi') ax_fpi.set_ylabel('fpi')
#------------------------- #-------------------------
ax_mg = fig.add_subplot(3, 1, 2) ax_mg = fig.add_subplot(2, 1, 2)
ax_mg.plot(time, multigrid_final[t], color='black', linestyle='-') ax_mg.plot(time, multigrid_final[t], color='black', linestyle='-')
ax_mg.set_ylabel('multigrid') ax_mg.set_ylabel('multigrid iter.')
ax_mg.set_xlabel('time in s')
#------------------------- #-------------------------
ax_tau = fig.add_subplot(3, 1, 3) #ax_tau = fig.add_subplot(3, 1, 3)
ax_tau.plot(time, tau[t], color='black', linestyle='-') #ax_tau.plot(time, tau[t], color='black', linestyle='-')
ax_tau.set_ylabel('tau') #ax_tau.set_ylabel('tau')
#------------------------- #-------------------------
fig.canvas.draw() fig.canvas.draw()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment