Skip to content

fix d(SdW/dxj)/dxj processing#245

Open
nick-morse wants to merge 1 commit intoExtremeFLOW:mainfrom
nick-morse:fix/scalar_wtheta_budget_mol_diff
Open

fix d(SdW/dxj)/dxj processing#245
nick-morse wants to merge 1 commit intoExtremeFLOW:mainfrom
nick-morse:fix/scalar_wtheta_budget_mol_diff

Conversation

@nick-morse
Copy link
Contributor

Fix $\frac{\partial}{\partial x_j} \left( S \frac{\partial W}{\partial x_j} \right)$ term in $\langle w' \theta' \rangle$ molecular diffusion, which was affecting the $\langle w' \theta' \rangle$ budget in the passive scalar statistics. Other budgets are not affected.

Copilot AI review requested due to automatic review settings March 2, 2026 16:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes incorrect processing of the (\partial_{x_j}(S,\partial_{x_j} W)) contribution used in the (\langle w'\theta'\rangle) molecular diffusion term, addressing an error in the passive scalar (\langle w'\theta'\rangle) budget.

Changes:

  • Corrects the file-key mapping used to read/write the SdWdx, SdWdy, and SdWdz statistic fields.
  • Switches these fields from file_keys_UidSdxj[...] to file_keys_SdUidxj[...] to align with the intended stored quantity.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

file_type="fld",
file_name=full_fname_stat,
file_key=file_keys_UidSdxj[6],
file_key=file_keys_SdUidxj[6],
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

These hard-coded indices (6/7/8) are magic numbers and are easy to mis-map (which appears to be what happened previously for the SdW*d* fields). Consider replacing them with named constants (e.g., SDWDX_KEY_IDX = 6, etc.) or a small mapping (e.g., {'SdWdx': ..., 'SdWdy': ..., 'SdWdz': ...}) so it’s explicit which component each key refers to and reduces the chance of future index mistakes.

Copilot uses AI. Check for mistakes.
file_type="fld",
file_name=full_fname_stat,
file_key=file_keys_UidSdxj[7],
file_key=file_keys_SdUidxj[7],
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

These hard-coded indices (6/7/8) are magic numbers and are easy to mis-map (which appears to be what happened previously for the SdW*d* fields). Consider replacing them with named constants (e.g., SDWDX_KEY_IDX = 6, etc.) or a small mapping (e.g., {'SdWdx': ..., 'SdWdy': ..., 'SdWdz': ...}) so it’s explicit which component each key refers to and reduces the chance of future index mistakes.

Copilot uses AI. Check for mistakes.
file_type="fld",
file_name=full_fname_stat,
file_key=file_keys_UidSdxj[8],
file_key=file_keys_SdUidxj[8],
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

These hard-coded indices (6/7/8) are magic numbers and are easy to mis-map (which appears to be what happened previously for the SdW*d* fields). Consider replacing them with named constants (e.g., SDWDX_KEY_IDX = 6, etc.) or a small mapping (e.g., {'SdWdx': ..., 'SdWdy': ..., 'SdWdz': ...}) so it’s explicit which component each key refers to and reduces the chance of future index mistakes.

Copilot uses AI. Check for mistakes.
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.

2 participants