Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphics Objects - Contours #307

Merged
merged 20 commits into from
Jul 31, 2023
Merged

Graphics Objects - Contours #307

merged 20 commits into from
Jul 31, 2023

Conversation

hpohekar
Copy link
Collaborator

@hpohekar hpohekar commented Jul 24, 2023

import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
from ansys.fluent.visualization.contour import Contour
from ansys.fluent.visualization.pyvista import Graphics

case_filename = examples.download_file("elbow.cas.h5", "pyfluent/examples/DOE-ML-Mixing-Elbow")
data_filename = "../mixing_elbow.dat.h5"

solver = pyfluent.launch_fluent()
solver.tui.file.read_case(case_filename)
solver.tui.file.read_data(data_filename)

contour_1 = Contour("y-face-area", ["cold-inlet"])
contour_1.draw(solver, Graphics(solver))
contour_api_object_1 = contour_1.draw(solver, solver)
solver.results.graphics.contour.display(object_name=contour_api_object_1.name())

contour_2 = Contour("y-face-area", ["cold-inlet"], solver)
contour_2.draw(solver, Graphics(solver))
contour_api_object_2 = contour_2.draw(solver, solver)
solver.results.graphics.contour.display(object_name=contour_api_object_2.name())

image

@hpohekar hpohekar linked an issue Jul 24, 2023 that may be closed by this pull request
@hpohekar hpohekar marked this pull request as ready for review July 26, 2023 07:40
Copy link
Member

@raph-luc raph-luc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
from ansys.fluent.visualization.contour import Contour
from ansys.fluent.visualization.pyvista import Graphics

case_filename = examples.download_file("elbow.cas.h5", "pyfluent/examples/DOE-ML-Mixing-Elbow")
data_filename = "../mixing_elbow.dat.h5"

solver = pyfluent.launch_fluent()
solver.tui.file.read_case(case_filename)
solver.tui.file.read_data(data_filename)

contour_1 = Contour("y-face-area", ["cold-inlet"])
contour_1.draw(solver, Graphics(solver))
contour_api_object_1 = contour_1.draw(solver, solver)

contour_2 = Contour("y-face-area", ["cold-inlet"], solver)
contour_2.draw(solver, Graphics(solver))
contour_api_object_2 = contour_2.draw(solver, solver) 

Shouldn't we add this example in the documentation of the Contour class? And perhaps some docstrings in the methods as well?

Also, would probably be useful to have this show up in the documentation somewhere, for example maybe: https://visualization.fluent.docs.pyansys.com/version/stable/users_guide/index.html#display-contour

@seanpearsonuk
Copy link
Collaborator

import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
from ansys.fluent.visualization.contour import Contour
from ansys.fluent.visualization.pyvista import Graphics

case_filename = examples.download_file("elbow.cas.h5", "pyfluent/examples/DOE-ML-Mixing-Elbow")
data_filename = "../mixing_elbow.dat.h5"

solver = pyfluent.launch_fluent()
solver.tui.file.read_case(case_filename)
solver.tui.file.read_data(data_filename)

contour_1 = Contour("y-face-area", ["cold-inlet"])
contour_1.draw(solver, Graphics(solver))
contour_api_object_1 = contour_1.draw(solver, solver)

contour_2 = Contour("y-face-area", ["cold-inlet"], solver)
contour_2.draw(solver, Graphics(solver))
contour_api_object_2 = contour_2.draw(solver, solver) 

Shouldn't we add this example in the documentation of the Contour class? And perhaps some docstrings in the methods as well?

Also, would probably be useful to have this show up in the documentation somewhere, for example maybe: https://visualization.fluent.docs.pyansys.com/version/stable/users_guide/index.html#display-contour

I agree. We also want to do a bit more work here to maximise the usefulness of this.

@hpohekar
Copy link
Collaborator Author

import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
from ansys.fluent.visualization.contour import Contour
from ansys.fluent.visualization.pyvista import Graphics

case_filename = examples.download_file("elbow.cas.h5", "pyfluent/examples/DOE-ML-Mixing-Elbow")
data_filename = "../mixing_elbow.dat.h5"

solver = pyfluent.launch_fluent()
solver.tui.file.read_case(case_filename)
solver.tui.file.read_data(data_filename)

contour_1 = Contour("y-face-area", ["cold-inlet"])
contour_1.draw(solver, Graphics(solver))
contour_api_object_1 = contour_1.draw(solver, solver)

contour_2 = Contour("y-face-area", ["cold-inlet"], solver)
contour_2.draw(solver, Graphics(solver))
contour_api_object_2 = contour_2.draw(solver, solver) 

Shouldn't we add this example in the documentation of the Contour class? And perhaps some docstrings in the methods as well?

Also, would probably be useful to have this show up in the documentation somewhere, for example maybe: https://visualization.fluent.docs.pyansys.com/version/stable/users_guide/index.html#display-contour

@raph-luc Done. Thank you.

Copy link
Member

@raph-luc raph-luc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, only a few additional minor suggestions

doc/source/users_guide/index.rst Outdated Show resolved Hide resolved
src/ansys/fluent/visualization/contour.py Outdated Show resolved Hide resolved
src/ansys/fluent/visualization/contour.py Outdated Show resolved Hide resolved
@hpohekar hpohekar merged commit 1c5fa62 into main Jul 31, 2023
17 checks passed
@hpohekar hpohekar deleted the feat/contours_objects branch July 31, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

visualization objects
5 participants