Note
Go to the end to download the full example code
Time series of postProcessing force
This example reads and plots a series of postProcessing force
Read the postProcessing files
Note
In this example it reads and merges two postProcessing files automatically (with the ‘mergeTime’ option)
# import readforce function from fluidfoam package
from fluidfoam.readpostpro import readforce
sol = '../output_samples/ascii/'
force = readforce(sol, time_name = 'mergeTime')
Now plots the pressure force
import matplotlib.pyplot as plt
plt.figure()
plt.plot(force[:, 0], force[:, 1])
# Setting axis labels
plt.xlabel('t (s)')
plt.ylabel('p (Pa)')
# add grid
plt.grid()
Total running time of the script: (0 minutes 0.117 seconds)