HELP: Fluid Dynamics and Simulating with C++

Click For Summary
SUMMARY

The discussion centers on simulating fluid dynamics using C++ to visualize density changes in a gas cylinder when a piston moves, particularly under supersonic conditions. The user expresses a lack of experience with graphics libraries and the implementation of partial differential equations (PDEs) like the advection equation. Key tools mentioned include OpenGL for graphics and plot3D for post-processing. The conversation highlights the need for guidance on coding techniques and libraries necessary for successful simulation.

PREREQUISITES
  • Basic understanding of C++ programming
  • Familiarity with partial differential equations (PDEs), specifically the advection equation
  • Knowledge of OpenGL for graphics rendering
  • Experience with post-processing tools like plot3D
NEXT STEPS
  • Learn how to implement the advection equation in C++
  • Research OpenGL tutorials for 3D graphics programming
  • Explore numerical methods for solving PDEs
  • Investigate post-processing techniques using plot3D
USEFUL FOR

This discussion is beneficial for students in mechanical engineering, software developers interested in computational fluid dynamics (CFD), and anyone looking to enhance their skills in C++ graphics programming and PDE implementation.

bboydocument
Messages
2
Reaction score
0
Sorry I'm not sure where to post this as there is no explicit fluid dynamics forum - i just did a search and noticed majority of posts fell into the "mechanical engineering" forum for some reason. Sorry about that.

Today my professor has told the class that by next week we have to code in C++ and visually simulate the change in density in 3D when a piston moves through a cylinder of gas ie. creates a shock as speed increases past the speed of sound.

Look i know that's a very vague intro, but what I am trying to get at here is that I have no idea how to code in a graphics library..but more importantly how do i even implement a PDE into C++ and actually get something to show on the screen? i mean, like a fluid of some sort, piston moving through it, density changing as piston moves through it. This is such a crazy request by my professor, I envy all those students who are skilled in coding in openGL and know how to implement a PDE like the advection equation. All i have been taught in C++ is how to calculate the factorial of a number and output it to the console!

Please experts, guide me in the right direction! Where do I go to get help? When implementing PDEs into C++ what do I need to do?
 
Technology news on Phys.org
I could tell you a lot of CFD and the coding of it, but as far as post-processing and graphics libraries, I leave that to the experts...mostly plot3D actually.

If you're talking about the 1D advection problem, then that's rather simple. The code isn't too hard, and you can post-process in Excel.
 

Similar threads

Replies
1
Views
2K
  • · Replies 29 ·
Replies
29
Views
8K
Replies
0
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 45 ·
2
Replies
45
Views
7K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
6K