Adding cpp example - 2D imcompressible cylinder flow#274
Adding cpp example - 2D imcompressible cylinder flow#274yiyuef wants to merge 10 commits intocsrc-sdsu:mainfrom
Conversation
| - $$y \in [-1,1]$$ | ||
| - $$t \in [0, t_{\text{final}}]$$ with $$t_{\text{final}} = \texttt{tspan}$$ (default in code: `tspan = 32.0`) | ||
|
|
||
| A “cylinder” is represented by a masked block of cells located near |
There was a problem hiding this comment.
Hi @yiyuef , thank you so much for your terrific contribution! I would specify that it is a "square cylinder" since it's not really the same as a round cylinder.
| A “cylinder” is represented by a masked block of cells located near | |
| A “square cylinder” is represented by a masked block of cells located near |
| std::cerr << "[warn] PNG conversion uses macOS 'sips'. Kept " << ppmFile << "\n"; | ||
| #endif | ||
|
|
||
| std::cout << "Wrote U_final.csv, V_final.csv, p_final.csv, speed_final.png\n"; |
There was a problem hiding this comment.
This line gets printed also in the case of non-MAC-OS, but the file name should be consistent in the string. In case of non-MAC-OS it is not speed_final.png, but speed_final.ppm.
There was a problem hiding this comment.
Also, any specific reason why the extension .ppm was chosen for non-MAC-OS users? It is a quite uncommon and unsupported file format.
|
Thank you, @yiyuef for this terrific contribution! I ran the example and can see the output figure is quite small. Can you please increase its size? Also, any specific reason why the extension Finally, I thought we also wanted to include the MATLAB/octave version to the library. I thought you had completed that implementation, first? Thank you! |
Description
This PR adds a new C++ example
cylinder_flow_2Dthat solves 2D incompressible channel flow past a cylinder-like obstacle (implemented as a masked no-slip region) using a projection (pressure-correction) method built on MOLE mimetic operators.It also adds Sphinx/MyST documentation for the example and includes a representative output figure.
Type of Change
Mathematical Details
Not applicable (no new operators added).
The example solves the incompressible Navier–Stokes equations with a fractional-step (projection) method and uses MOLE discrete operators (divergence, gradient, Laplacian) for the Helmholtz/Poisson solves.
Testing
Documentation
Related Issues
#211
Additional Notes
cylinder_flow_2D_output1.pngis included alongside the documentation page.