.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_3_postprocprobe.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_3_postprocprobe.py: Time series of postProcessing probe =================================== This example reads and plots a series of postProcessing probe .. 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-24 .. code-block:: Python # import readprobes function from fluidfoam package from fluidfoam.readpostpro import readprobes sol = '../output_samples/ascii/' # import readprobes function from fluidfoam package probes_locU, timeU, u = readprobes(sol, time_name = 'mergeTime', name = 'U') probes_locP, timeP, p = readprobes(sol, time_name = 'mergeTime', name = 'p') .. rst-class:: sphx-glr-script-out .. code-block:: none Reading file ../output_samples/ascii//postProcessing/probes/0/U 4 probes over 10 timesteps Reading file ../output_samples/ascii//postProcessing/probes/0.2/U 4 probes over 6 timesteps Reading file ../output_samples/ascii//postProcessing/probes/0/p 1 probes over 10 timesteps Reading file ../output_samples/ascii//postProcessing/probes/0.2/p 1 probes over 6 timesteps .. GENERATED FROM PYTHON SOURCE LINES 25-28 Now plots the pressure and y velocity for the first probe --------------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 28-45 .. code-block:: Python import matplotlib.pyplot as plt plt.figure() plt.plot(timeU, u[:, 0, 1]) plt.plot(timeP, p[:, 0]) # Setting axis labels plt.xlabel('t (s)') # add grid and legend plt.grid() plt.legend(["Uy", "p"]) # show plt.show() .. image-sg:: /auto_examples/images/sphx_glr_plot_3_postprocprobe_001.png :alt: plot 3 postprocprobe :srcset: /auto_examples/images/sphx_glr_plot_3_postprocprobe_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.055 seconds) .. _sphx_glr_download_auto_examples_plot_3_postprocprobe.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_3_postprocprobe.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_3_postprocprobe.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_3_postprocprobe.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_