[DOC]: Lunar Lander Outdated API

Open Beginner friendly
#5,463 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #5482 by @vaidii2008 — closed without merging
  • #5570 by @pyansys-ci-bot — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
66/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
documentation

Research direction

The failing example is the Lunar Lander thermal page linked in the issue; its get_surf_mean_temp function calls solver.field_info, which no longer exists on the Solver object. Replace that call with the suggested solver.fields.field_data._get_scalar_field_data path and add the itertools.chain import. Done when the example script runs past that function without an AttributeError and the docs page reflects the updated code.

Written by the indexing model from the issue text.

Description

documentation
🔗 Affected page or URL

https://fluent.docs.pyansys.com/version/stable/examples/00-fluent/lunar_lander_thermal.html

⚠️ What is wrong or missing?

AttributeError: 'Solver' object has no attribute 'field_info'

✏️ Suggested improvement

from itertools import chain

and update the function to get surface mean temperature:

def get_surf_mean_temp(
    surf_names: list[str],
    solver: pyfluent.session_solver.Solver,
) -> float:
    """Calculate mean surface temperature."""
    # Get temperature data for the requested surfaces.
    temp_data = solver.fields.field_data._get_scalar_field_data(
        field_name="temperature",
        surfaces=surf_names,
    )

    # Calculate mean temperature across surfaces.
    return float(np.mean(np.concatenate(list(temp_data.values()))))
📌 Additional context

No response

Dominant language
Python
Stars
550
Forks
86
Avg merge
2d 1h
Merged PRs (30d)
58

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ansys/pyfluent

All issues in ansys/pyfluent

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.