Skip to content

Conversation

@ns5678
Copy link
Contributor

@ns5678 ns5678 commented Jan 15, 2026

No description provided.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Jan 15, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions
Copy link
Contributor

👋 Thank you for your contribution!

This pull request is from a forked repository so GitHub Actions will not be able to run CI. A maintainer will review your changes shortly and manually trigger the CI.

@maintainers Please review this PR when you have a chance and follow the instructions in the CONTRIBUTING.md file to trigger the CI.

@github-actions
Copy link
Contributor

⚠️ Unsigned Commits Detected

This pull request contains 8 unsigned commit(s):

  • 5d04acd first push of notebook
  • 18e8767 update notebook
  • 92e5247 remove 50MB gif
  • f352bf8 reduce the size of notebook temporarily
  • 0ba5186 consolidate comments
  • f186973 update notebook and it's solution
  • 669dcf8 remove python script
  • 7521f26 restore the previous version of ising notebook

All commits must be signed before this PR can be merged. Please sign your commits by following these steps:

Option 1: SSH Key Signing (Recommended)

  1. Add your SSH key to GitHub (if not already done):

  2. Configure Git to use SSH signing:

    git config --global gpg.format ssh
    git config --global user.signingkey ~/.ssh/id_ed25519.pub  # or your key path
    git config --global commit.gpgsign true
  3. Re-sign your commits:

    git rebase -i HEAD~8 --exec "git commit --amend --no-edit -S"
    git push --force

Option 2: GPG Key Signing

  1. Generate a GPG key: GitHub Docs

  2. Add the GPG key to GitHub: GitHub Docs

  3. Configure Git to sign commits:

    git config --global user.signingkey YOUR_GPG_KEY_ID
    git config --global commit.gpgsign true
  4. Re-sign your commits (same as above):

    git rebase -i HEAD~8 --exec "git commit --amend --no-edit -S"
    git push --force

For more details, see GitHub's commit signature verification docs.


This comment will be updated when you push new commits.

Copy link
Collaborator

@shi-eric shi-eric left a comment

Choose a reason for hiding this comment

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

Some initial comments

"\n",
"## Overview\n",
"\n",
"In this notebook, we will implement a 2-D Navier-Stokes (N-S) solver in a periodic box using the vorticity-streamfunction formulation. The Poisson equation relating streamfunction to vorticity is solved spectrally using tile-based FFT in Warp.\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This intro sentence, while precise, is very technical. We can help novices by at least mentioning that we're building a solver that simulates fluid dynamics.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You should also emphasize the Python aspect, e.g. something like "We will build our high-performance solver entirely in Python using the Warp framework..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"In this notebook, we will build a high-performance fluid solver entirely in Python using the Warp framework. Specifically, we will simulate 2-D turbulent flow in a box." -- How does this sound?

"## Introduction\n",
"\n",
"This seemingly simple 2-D N-S solver example combines multiple Warp features that can be leveraged to build industrial-grade solvers:\n",
" - CUDA kernels for finite difference operators\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

CUDA kernels should probably be Accelerated kernels for finite-difference operators. When I see "CUDA kernels", I think of all the nastiness associated with CUDA C++, which our users don't need to worry about.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to "Accelerated Warp kernels..."

Comment on lines 110 to 116
"### 1. Vorticity-stream function formulation\n",
"\n",
"For 2-D incompressible flow, we define:\n",
"- **Vorticity**: $\\omega = \\partial v/\\partial x - \\partial u/\\partial y$\n",
"- **Streamfunction**: $\\psi$ such that $u = \\partial\\psi/\\partial y$, $v = -\\partial\\psi/\\partial x$\n",
"\n",
"This formulation automatically satisfies continuity and eliminates pressure from the Navier-Stokes equations.\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

You don't explain what the variables u and v are

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, fixed.

"\n",
"### 3. Spectral Poisson solver\n",
"\n",
"For periodic domains, equation (2) can be directly solved in Fourier space. The wavenumbers are defined as $k_x = \\frac{2\\pi m}{L_x}, \\quad k_y = \\frac{2\\pi n}{L_y}$, where $m$ and $n$ are the Fourier space indices. The vorticity field $\\omega$ is converted to its Fourier representation $\\hat{\\omega}_{m,n}$ using a 2-D FFT. The Poisson equation then becomes algebraic as follows\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe you can add some more discussion to help novices. You start off with saying this can be solved in Fourier space, but maybe it's better to acknowledge that it might be tempting to solve the Poisson equation in physical space but we can make use of periodicity to solve the equation in spectral space, which is both efficient and simple to implement.

You can also explain what "Fourier space" is and specifically what the "FFT" means and why it deserves the "Fast" in its name

"$\\hat{\\psi}_{m,n}$ is then converted back to physical space using inverse FFT.\n",
"\n",
"### 4. Time integration \n",
"For time stepping, we use a strong-stability preserving third-order Runge-Kutta method.\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe give a layperson explanation of what SSP and third-order mean

"\n",
"### 5. Initial condition: 2-D decaying turbulence\n",
"\n",
"In this problem, we solve the governing equations on a square box of dimensions $2\\pi \\times 2\\pi$. The initial condition is generated using the energy spectrum from San & Staples CNF (2012)\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Explain why you picked $2 \pi \times 2 \pi$ for the box size. Someone might find it a non-intuitive choice and wonder if this solver can handle other domain sizes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

"\n",
"**NOTE**: Other similar time-stepping schemes can be implemented with minimal changes to the code, but we use the scheme above as a demonstration example.\n",
"\n",
"### 5. Initial condition: 2-D decaying turbulence\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is too much. I would create an appendix section and put the details about the initialization there, and then in this section you just say we're gonna use this particular E(k) because of <...> and you can find more discussion behind this choice of I.C. in the appendix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the construction of \zeta to the appendix A. I still left the definition of E(k) there.

"$$\n",
"\\boxed{\n",
"\\begin{array}{c}\n",
"\\textbf{Solver Pipeline} \\\\[10pt]\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

This "Solver Pipeline" diagram is already pretty good. I would add a "IFFT" in the first arrow that follows "Initialize $\hat{\omega}$"

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