HELP: Fluid Dynamics and Simulating with C++

In summary, the speaker is seeking help with coding in C++ and implementing a PDE into a graphics library for a project assigned by their professor. They express difficulty with this task and envy those who are skilled in coding and implementing PDEs. They are specifically looking for guidance on where to get help and what steps to take in order to successfully implement the PDE.
  • #1
bboydocument
2
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
  • #2
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.
 

1. What is fluid dynamics and why is it important?

Fluid dynamics is the study of how fluids (liquids and gases) behave when they are in motion. It is important because it helps us understand and predict the behavior of fluids in various systems and environments, such as in air and water flow, weather patterns, and in the human body.

2. How can C++ be used to simulate fluid dynamics?

C++ is a programming language that is commonly used for scientific and engineering applications, including fluid dynamics simulations. With its speed and efficiency, C++ allows for complex mathematical calculations and simulations to be performed accurately and efficiently.

3. What are the key concepts and equations used in fluid dynamics simulations?

Some key concepts and equations used in fluid dynamics simulations include the Navier-Stokes equations, which describe the motion of fluids, and the continuity equation, which relates the velocity and pressure of a fluid. Other important concepts include viscosity, turbulence, and boundary conditions.

4. What are some common challenges when simulating fluid dynamics with C++?

Some common challenges when simulating fluid dynamics with C++ include dealing with large amounts of data and complex calculations, ensuring accuracy and stability of the simulation, and optimizing the code for efficiency. Debugging and troubleshooting can also be challenging, as errors in the code can lead to incorrect results.

5. What are some applications of fluid dynamics simulations in real-world scenarios?

Fluid dynamics simulations have a wide range of applications in various industries and fields. Some examples include predicting and improving aerodynamics in the design of airplanes and cars, studying and predicting weather patterns, simulating blood flow in the human body for medical research, and optimizing the performance of turbines and other machinery.

Similar threads

Replies
1
Views
46
  • STEM Academic Advising
Replies
4
Views
788
  • Classical Physics
Replies
6
Views
310
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • Mechanical Engineering
Replies
1
Views
905
  • Programming and Computer Science
Replies
1
Views
769
Replies
14
Views
299
  • Programming and Computer Science
Replies
19
Views
2K
  • Advanced Physics Homework Help
Replies
5
Views
955
Back
Top