.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/props/plot_reference_props.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_props_plot_reference_props.py: Bag model reference properties ============================== Plot the parameters of fluid_reference .. GENERATED FROM PYTHON SOURCE LINES 7-59 .. image-sg:: /auto_examples/props/images/sphx_glr_plot_reference_props_001.png :alt: $v_+$, $\tilde{v}_+$, $w_+$, $v_-$, $\tilde{v}_-$, $w_-$ :srcset: /auto_examples/props/images/sphx_glr_plot_reference_props_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none [4.67331368e-01 0.00000000e+00 1.08863984e-03 4.68181818e-01 2.11693715e+00 3.84344953e-03] [0.4905997 0.1962519 0.31094667 0.57810487 3.15112627 1.24924176] [0. 0.75620914 0.93181818 0.59457831 1. 7.69201511] | .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from examples import utils from pttools.bubble import fluid_reference from pttools.bubble.transition import SolutionType def main() -> plt.Figure: ref = fluid_reference.ref() fig: plt.Figure = plt.figure() axs: np.ndarray = fig.subplots(nrows=2, ncols=3) ax_vp: plt.Axes = axs[0, 0] ax_vm: plt.Axes = axs[1, 0] ax_vp_tilde: plt.Axes = axs[0, 1] ax_vm_tilde: plt.Axes = axs[1, 1] ax_wp: plt.Axes = axs[0, 2] ax_wm: plt.Axes = axs[1, 2] ax_vp.contourf(ref.v_wall, ref.alpha_n, ref.vp) ax_vm.contourf(ref.v_wall, ref.alpha_n, ref.vm) ax_vp_tilde.contourf(ref.v_wall, ref.alpha_n, ref.vp_tilde) ax_vm_tilde.contourf(ref.v_wall, ref.alpha_n, ref.vm_tilde) ax_wp.contourf(ref.v_wall, ref.alpha_n, ref.wp) ax_wm.contourf(ref.v_wall, ref.alpha_n, ref.wm) ax_vp.set_title("$v_+$") ax_vm.set_title("$v_-$") ax_vp_tilde.set_title(r"$\tilde{v}_+$") ax_vm_tilde.set_title(r"$\tilde{v}_-$") ax_wp.set_title("$w_+$") ax_wm.set_title("$w_-$") for ax in axs.flat: ax.set_xlabel("$v_w$") ax.set_ylabel(r"$\alpha_n$") fig.tight_layout() print(ref.get(v_wall=0.25, alpha_n=0.8, sol_type=SolutionType.SUB_DEF)) print(ref.get(v_wall=0.7, alpha_n=0.25, sol_type=SolutionType.HYBRID)) print(ref.get(v_wall=0.1, alpha_n=0.95, sol_type=SolutionType.DETON)) return fig if __name__ == "__main__": fig = main() utils.save_and_show(fig, "reference_props.png") .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.633 seconds) **Estimated memory usage:** 265 MB .. _sphx_glr_download_auto_examples_props_plot_reference_props.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_reference_props.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_reference_props.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_reference_props.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_