Skip to content

Airfoil field output#238

Open
fgvangessel-umd wants to merge 13 commits into
mainfrom
airfoil-field-output
Open

Airfoil field output#238
fgvangessel-umd wants to merge 13 commits into
mainfrom
airfoil-field-output

Conversation

@fgvangessel-umd

@fgvangessel-umd fgvangessel-umd commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Description

Created optional capability to output airfoil fields

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files
  • I have run ruff check . and ruff format
  • I have run mypy .
  • I have commented my code, particularly in hard-to-understand areas

Reviewer Checklist:

  • The content of this PR brings value to the community. It is not too specific to a particular use case.
  • The tests and checks pass (linting, formatting, type checking). For a new problem, double check the github actions workflow to ensure the problem is being tested.
  • The documentation is updated.
  • The code is understandable and commented. No large code blocks are left unexplained, no huge file. Can I read and understand the code easily?
  • There is no merge conflict.
  • The changes are not breaking the existing results (datasets, training curves, etc.). If they do, is there a good reason for it? And is the associated problem version bumped?

fgvangessel-umd and others added 4 commits March 25, 2026 13:09
Extends simulate() with a field_output flag that additionally returns
surface pressure and velocity fields (shape 6×N) from the post-simulation
slice file alongside the aerodynamic performance array.

- utils.py: add reorder_coords_fields(), mirroring reorder_coords() but
  carrying VelocityX/Y/Z and CoefPressure through the reordering pipeline
- v0.py: extend simulator_output_to_design() and simulate() with
  field_output=False parameter; simulate returns tuple[NDArray, NDArray]
  when field_output=True
- simulation_jobs.py: propagate field_output through simulate_slurm(),
  adding surface_fields key to the result dict when requested
- dataset_slurm_airfoil.py: add --field_output CLI flag and forward it
  to each job config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Brings the command line argument descriptions up to date with all current
arguments, including the previously undocumented -account, -type,
-minutes_per_sim, -n_slurm_array, and the new --field_output flag.
Adds defaults to each entry for clarity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cashend

cashend commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Looks good to me @fgvangessel-umd. I think you can go ahead and merge.

fgvangessel-umd and others added 6 commits June 8, 2026 16:42
Replace the standalone simulate_field method with an AirfoilSimulationResult
subclass of SimulationResult returned from simulate_verbose, carrying the
(6, N) surface field array alongside the [drag, lift] objective values.
Route simulate_slurm through a verbose flag (simulate_verbose vs simulate)
instead of field_output, and rename the dataset generation CLI flag to
--verbose. Document the airfoil/slurm workflow in CLAUDE.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@fgvangessel-umd

Copy link
Copy Markdown
Contributor Author

@g-braeunlich can you review my implementation in problems/airfoil/v0.py, specifically the AirfoilSimulationResult derived class and the simulate_verbose implementation. Specifically, that I implemented this in accordance with the approach you had in mind. I've verified that my implementation works with slurm and appropriately returns different data structures based on whether the verbose flag is passed or not.

@g-braeunlich g-braeunlich left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@fgvangessel-umd Yes, thats exactly how I imagined the use of the new result class.
I have some minor suggestion.
On top of that:
Would not it be more consistent, to also unpack the surface field values into the dict, you are returning in the job result? I.e. position (2d), velocity (3d) and coef_pressure (scalar)?

Comment thread engibench/problems/airfoil/simulation_jobs.py Outdated
Comment thread CLAUDE.md Outdated
fgvangessel-umd and others added 3 commits July 1, 2026 11:49
Slice surface_fields by row (axis 0) to match its (6, N) layout when
splitting into coords, velocity, and pressure_coeff; update the docstring
Returns section accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CLAUDE.md was accidentally committed; keep it locally as Claude Code
guidance but stop tracking it in the repo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

3 participants