.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/advanced/plot_generatedDFSEMdata.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_advanced_plot_generatedDFSEMdata.py: Create and plot boundaryData for DFSEM from a 1D RANS simulation ================================================================ This example shows how to create a boundary data for turbulentDFSEM inlet boundary condition. In addition, the script also plots the profiles for verification. .. GENERATED FROM PYTHON SOURCE LINES 11-15 First create a 1dprofilDFSEM with create1dprofilDFSEM ----------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 15-39 .. code-block:: Python from fluidfoam import create1dprofilDFSEM, read1dprofilDFSEM import os basepath = "../../output_samples/DFSEM/" case3d = "3D/" case1d = "1D/" sol1d = os.path.join(basepath, case1d) sol3d = os.path.join(basepath, case3d) boundary_name = "inlet/" axis = "Y" create1dprofilDFSEM(sol1d, sol3d, boundary_name, "200", axis, "U","k","omega","turbulenceProperties:R","Y") # if turbulenceProperties:R does not exist type: # "pimpleFoam -postProcess -func R -time 200" # in a terminal Y, U, L, R, ny = read1dprofilDFSEM(sol3d, boundary_name, "0", axis) .. rst-class:: sphx-glr-script-out .. code-block:: none Reading file ../../output_samples/DFSEM/1D//constant/polyMesh/owner Reading file ../../output_samples/DFSEM/1D//constant/polyMesh/faces Reading file ../../output_samples/DFSEM/1D//constant/polyMesh/points Reading file ../../output_samples/DFSEM/1D//constant/polyMesh/neighbour Reading file ../../output_samples/DFSEM/1D/200/U Reading file ../../output_samples/DFSEM/1D/200/k Reading file ../../output_samples/DFSEM/1D/200/omega Reading file ../../output_samples/DFSEM/1D/200/turbulenceProperties:R .. GENERATED FROM PYTHON SOURCE LINES 40-43 Now plot the profiles of the fields ----------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 43-61 .. code-block:: Python import matplotlib.pyplot as plt fig, axarr = plt.subplots(1, 3, sharey=True) axarr[0].set_ylabel("Y (m)") axarr[0].plot(U[:], Y) axarr[0].set_title("U") axarr[0].set_xlabel("U (m/s)") axarr[1].plot(L[:], Y) axarr[1].set_title("L") axarr[1].set_xlabel("L (m)") axarr[2].plot(R[:,1], Y) axarr[2].set_title("R") axarr[2].set_xlabel(r"R ($m^2/s^2$)") plt.show() .. image-sg:: /auto_examples/advanced/images/sphx_glr_plot_generatedDFSEMdata_001.png :alt: U, L, R :srcset: /auto_examples/advanced/images/sphx_glr_plot_generatedDFSEMdata_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.136 seconds) .. _sphx_glr_download_auto_examples_advanced_plot_generatedDFSEMdata.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_generatedDFSEMdata.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_generatedDFSEMdata.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_generatedDFSEMdata.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_