.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_2_postprocforce.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_2_postprocforce.py: Time series of postProcessing force =================================== This example reads and plots a series of postProcessing force .. GENERATED FROM PYTHON SOURCE LINES 9-14 Read the postProcessing files ----------------------------- .. note:: In this example it reads and merges two postProcessing files automatically (with the 'mergeTime' option) .. GENERATED FROM PYTHON SOURCE LINES 14-22 .. code-block:: Python # import readforce function from fluidfoam package from fluidfoam.readpostpro import readforce sol = '../output_samples/ascii/' force = readforce(sol, time_name = 'mergeTime') .. GENERATED FROM PYTHON SOURCE LINES 23-26 Now plots the pressure force ---------------------------- .. GENERATED FROM PYTHON SOURCE LINES 26-39 .. code-block:: Python 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() .. image-sg:: /auto_examples/images/sphx_glr_plot_2_postprocforce_001.png :alt: plot 2 postprocforce :srcset: /auto_examples/images/sphx_glr_plot_2_postprocforce_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.051 seconds) .. _sphx_glr_download_auto_examples_plot_2_postprocforce.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_2_postprocforce.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_2_postprocforce.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_2_postprocforce.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_