|
2 | 2 | .. _ref_fluids_isosurface: |
3 | 3 |
|
4 | 4 | Compute iso-surfaces on fluid models |
5 | | ------------------------------------------- |
| 5 | +------------------------------------ |
6 | 6 |
|
7 | 7 | This example demonstrates how to compute iso-surfaces on fluid models. |
8 | 8 |
|
|
14 | 14 |
|
15 | 15 | ############################################################################### |
16 | 16 | # Import the ``dpf-core`` module and its examples files. |
17 | | -# ~~~~~~~~~~~~~~~~~~ |
| 17 | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
18 | 18 |
|
19 | 19 | import ansys.dpf.core as dpf |
20 | 20 | from ansys.dpf.core import examples |
21 | 21 | from ansys.dpf.core.plotter import DpfPlotter |
22 | 22 |
|
23 | 23 | ############################################################################### |
24 | 24 | # Specify the file path. |
25 | | -# ~~~~~~~~~~~~~~~~~~ |
| 25 | +# ~~~~~~~~~~~~~~~~~~~~~~ |
26 | 26 | # We work on a cas/dat.h5 file with only nodal variables. |
27 | 27 |
|
28 | 28 | path = examples.download_cfx_heating_coil() |
|
33 | 33 |
|
34 | 34 | ############################################################################### |
35 | 35 | # Whole mesh scoping. |
36 | | -# ~~~~~~~~~~~~~~~~~~ |
| 36 | +# ~~~~~~~~~~~~~~~~~~~ |
37 | 37 | # We evaluate the mesh with the mesh_provider operator to scope the mesh_cut operator |
38 | 38 | # with the whole mesh. |
39 | 39 |
|
|
44 | 44 |
|
45 | 45 | ############################################################################### |
46 | 46 | # Extract the physics variable |
47 | | -# ~~~~~~~~~~~~~~~~~ |
| 47 | +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
48 | 48 | # Here we choose to work with the static pressure by default which is a scalar and |
49 | 49 | # nodal variable without multi-species/phases. With a multi-species case, |
50 | 50 | # select one using qualifier ellipsis pins and connecting a LabelSpace "species"/"phase". |
|
63 | 63 |
|
64 | 64 | ############################################################################### |
65 | 65 | # Evaluate iso-surfaces |
66 | | -# ~~~~~~~~~~~~~~ |
| 66 | +# ~~~~~~~~~~~~~~~~~~~~~ |
67 | 67 | # We can finally use the iso_surfaces operator on this specific variable. |
68 | 68 | # We choose to cut the whole mesh with 9 iso-surface manually selected between |
69 | 69 | # the min and max of the static_pressure variable. |
|
102 | 102 |
|
103 | 103 | ############################################################################### |
104 | 104 | # Important note |
105 | | -# ------------------------------ |
| 105 | +# -------------- |
106 | 106 | # Iso-surfaces computation through the `mesh_cut` operator are only supported for Nodal Fields. |
107 | 107 | # For Elemental variables, you must perform an averaging operation on the Nodes before |
108 | 108 | # running the `mesh_cut` operator. This can be done by chaining the `elemental_to_nodal` operator |
|
0 commit comments