C/C++ HELP: Fluid Dynamics and Simulating with C++

AI Thread Summary
A student seeks guidance on coding a 3D simulation in C++ to visualize density changes in a gas cylinder as a piston moves, creating shock waves when exceeding the speed of sound. They express frustration over their limited programming experience, having only learned basic C++ functions, and feel overwhelmed by the task of implementing partial differential equations (PDEs) like the advection equation and using graphics libraries such as OpenGL. The student is looking for resources and advice on how to approach this complex project, particularly in terms of coding and visual representation. A response mentions that while the 1D advection problem is relatively straightforward and can be handled with basic coding skills, the student may need to explore more advanced resources for 3D simulations and graphics processing.
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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Back
Top