Live data from Hacker News

Simulating fluids, fire, and smoke in real-time

andrewkchan.dev

151–160 of 174 posts

Re: Simulating fluids, fire, and smoke in real-time

#151

As a person who did a PhD in CFD, I must admit I never encountered the vorticity confinement method and curl-noise turbulence. I guess you learn something new every day! Also, in industrial CFD, where the Reynolds numbers are higher you'd never want something like counteracting artificial dissipation of the numerical method by trying to applying noise. In fact, quite often people want artificial dissipation to stabil…

Was the PhD worth it in your opinion?

What does worth it mean? FWIW PhDs are really more or less required if you want to teach at a university, or do academic research, or do private/industrial research. Most companies that hire researchers look primarily for PhDs. The other reason would be to get to have 5 years to explore and study some subject in depth and become an expert, but that tends to go hand-in-hand with wanting to do research as a career. If you don’t want to teach college or do research, then PhD might be a questionable choice, and if you do it’s not really a choice, it’s just a prerequisite.

The two sibling comments both mention the economics isn’t guaranteed - and of course nothing is guaranteed on a case by case basis. However, you should be aware that people with PhDs in the US earn an average of around 1.5x more than people with bachelor’s degrees, and the income average for advanced degrees is around 3x higher than people without a 4-year degree. Patents are pretty well dominated by people with PhDs. There’s lots of stats on all this, but I learned it specifically from a report by the St Louis Fed that examined both the incomes as well as the savings rates for people with different educational attainment levels, and also looked at the changing trends over the years, and the differences by race. Statistically speaking, the economics absolutely favor getting an advanced degree of some kind, whether it’s a PhD or MD or JD or whatever.

Re: Simulating fluids, fire, and smoke in real-time

#152

Earlier quoted context omitted.

It looks like the GPU is doing most of the work… from that point of view when do we start to wonder if the GPU can “offload” anything to the whole computer that is hanging off of it, haha.

> It looks like the GPU is doing most of the work Yes. The GPU is doing most of the work in a lot of modern games. It isn't great at everything though, and there are limitations due to its architecture being structured almost solely for the purpose of computing massively parallel instructions. > when do we start to wonder if the GPU can “offload” anything to the whole computer that is hanging off of it The main bottl…

> Eventually, the CPU may cease to exist as its fundamental design becomes obsolete. This is usually called a GPGPU in modern server infrastructure.

There’s no reason yet to think CPU designs are becoming obsolete. SISD (Single Instruction, Single Data) is the CPU core model and it’s easier to program and does lots of things that you don’t want to use SIMD for. SISD is good for heterogenous workloads, and SIMD is good for homogeneous workloads.

I thought GPGPU was waning these days. That term was used a lot during the period when people were ‘hacking’ GPUs to do general compute when the APIs like OpenGL didn’t offer general programmable computation. Today with CUDA, and compute shades in every major API, it’s a given that GPUs are for general purpose computation, and it’s even becoming an anachronism that the G in GPU stands for graphics. My soft prediction is that GPU might get a new name & acronym soon that doesn’t have “graphics” in it.

Re: Simulating fluids, fire, and smoke in real-time

#153
post #146

Earlier quoted context omitted.

Rayteacing doesn't simulate light, it simulates a very primitive idea of light. There's no diffraction, no interference patterns. You can't simulate the double-slit experiment in a game engine, unless you explicitly program it. Our universe has a surprising amount of detail. We can't even simulate the simplest molecular interactions fully. Even a collision of two hydrogen atoms is too hard - time resolution and space…

Btw there is some movement towards including wave-optics into graphics instead of traditional ray-optics: https://ssteinberg.xyz/2023/03/27/rtplt/

This is very cool. Thx for sharing

Re: Simulating fluids, fire, and smoke in real-time

#154
post #107
post #95

Earlier quoted context omitted.

It’s still a model at the end of the day. Material properties like roughness are approximated with numerical values instead of being physical features. Also light is REALLY complicated when you get close to a surface. A light simulation that properly handles refraction, diffraction, elastic and inelastic scattering, and anisotropic material properties would be very difficult to build and run. It’s much easier to use…

If I understood Feynman’s QED at all, light gets quite simple once you get close enough to the surface. ;) Isn’t the idea was that everything’s a mirror? It sounds like all the complexity comes entirely from all the surface variation - a cracked or ground up mirror is still a mirror at a smaller scale but has a complex aggregate behavior at a larger scale. Brian Green’s string theory talks also send the same message,…

Orbital shapes and energies influence how light interacts with a material. Yes, once you get to QED, it’s simple. Before that is a whole bunch of layers of QFT to determine where the electrons are, and their energy. From that, there are many emergent behaviors.

Also QED is still a model. If you want to simulate every photon action, might as well build a universe.

Re: Simulating fluids, fire, and smoke in real-time

#155

As a person who did a PhD in CFD, I must admit I never encountered the vorticity confinement method and curl-noise turbulence. I guess you learn something new every day! Also, in industrial CFD, where the Reynolds numbers are higher you'd never want something like counteracting artificial dissipation of the numerical method by trying to applying noise. In fact, quite often people want artificial dissipation to stabil…

Too bad they don't reference the actual inventor of vorticity confinement, Dr. John Steinhoff of the University of Tennessee Space Institute:

https://en.wikipedia.org/wiki/John_Steinhoff

https://en.wikipedia.org/wiki/Vorticity_confinement

And some papers:

https://www.researchgate.net/publication/239547604_Modificat...

https://www.researchgate.net/publication/265066926_Computati...

Re: Simulating fluids, fire, and smoke in real-time

#156
post #48

As a person who did a PhD in CFD, I must admit I never encountered the vorticity confinement method and curl-noise turbulence. I guess you learn something new every day! Also, in industrial CFD, where the Reynolds numbers are higher you'd never want something like counteracting artificial dissipation of the numerical method by trying to applying noise. In fact, quite often people want artificial dissipation to stabil…

> Guess the requirements in computer graphics are more inclined towards making something that looks right instead of getting the physics right. The first rule of real-time computer graphics has essentially always been "Cheat as much as you can get away with (and usually, even if you can't)." Also, it doesn't even have to look right , it just has to look cool! =)

This reminds me of how the Quake-3-based game Tremulous has just two functions to simulate physics:

https://github.com/darklegion/tremulous/blob/master/src/game...

Re: Simulating fluids, fire, and smoke in real-time

#157
post #36

Does anyone have any recommendations for a former math major turned SWE to get into CFD simulations? I find this material fascinating but it's been a while since I've done any vector calculus or PDEs so my math is very rusty.

I used to work at NASA (contractor) doing this. One thing, get a job in the field. If you really want to, apply to Marshall Space Flight Center and / or Ames (Top500: Aitken [#85, 9.07 PFlops], Pleiades [#132, 5.95 PFlops], Electra [#143, 5.44 PFlops] systems) on either the Federal or Contractor side. GRC, LARC, and JSC also have some. At least a few years ago, the Contractor / Federal integration was actually quite good, and nearly transparent (except for allocating money). These groups are both fairly well known at NASA (MSFC, Propulsion Structural, Thermal & Fluid Analysis [2][3], and Ames, Entry Systems [4])

When I was there we were running ~100 million cell (vehicle) or (vehicle + pad) Hybrid RANS/LES sims with moving overset grids, maybe 10-20 species reactive combustion chemistry (SSMEs and SRBs lighting together), and Lagrangian evaporative particle dynamics (launch water suppression) using Overflow/LARC [5], or Loci/Mississippi State University [6]. Note: My info's a decade out of data, so no idea what the SOTA is these days. More than this.

If you're interested in the field and what a lot of the industry is concerned about, then while old (2014), the CFD Vision 2030 Study is not a bad orientation. [7]

Try to get a ticket to Supercomputing and go wander around. This year was in Denver. [8] Their focus tends to be on "large" though, so you'll mostly get massive weather simulations and stellar cloud dynamics. I like the conference, yet its difficult to get any notice unless you did #CPUs/#GPUs/#FPGAs++.

GOV Outside NASA: NIST (Gaithersburg), DOE (Oak Ridge, Sandia, Los Alamos), Air Force (AF Research Lab), Huntington Beach.

[1] NASA Advanced Supercomputing Division: https://en.wikipedia.org/wiki/NASA_Advanced_Supercomputing_D...

[2] NASA, MSFC: https://www.nasa.gov/wp-content/uploads/2016/01/g-28367g_pst...

[3] Somewhat old examples: https://ntrs.nasa.gov/api/citations/20140016892/downloads/20...

[4] NASA Ames: https://www.nasa.gov/entry-systems-and-technology-division/

[5] OVERFLOW/NASA/LARC: https://overflow.larc.nasa.gov/

[6] Loci/MSU: https://simcenter.msstate.edu/

[7] CFD Vision 2030 Study: https://ntrs.nasa.gov/api/citations/20140003093/downloads/20...

[8] Supercomputing SC23: https://sc23.supercomputing.org/

Re: Simulating fluids, fire, and smoke in real-time

#159

Earlier quoted context omitted.

> Something I’ve never understood, if these effects are to run in a game, isn’t the GPU already busy? Short answer: No, it's not "already busy". GPU's are so powerful now that you can do physics, fancy render passes, fluid sims, "Game AI" unit pathing, and more, at 100+ FPS. Long answer: You have a "frame budget" which is the amount of time between rendering the super fast "slide show" of frames at 60+ FPS. This give…

In theory it's perfectly possible to do all you describe in 8ms (i.e. VR render times). In reality we're 1. still far from properly utilizing modern graphics APIs as is. Some of the largest studios are close but knowledge is tight lipped in the industry. 2. even when those top studios can/do, they choose to focus more of the budget on higher render resolution over adding more logic or simulation. Makes for superficia…

If you enjoy simulation on that level, you might find Star Citizen [0] or the latest updates to No Man's Sky [1] interesting.

You're right that simulation is often an after thought. Most games prioritize narrative, combat, artist's vision and high fidelity environments over complex systems you can interact with. There are a few outliers though.

Alternatively, you get so far into the simulation side of things with stuff like Dwarf Fortress [2] and all visual fidelity is thrown away for the sake of prioritizing simulation complexity!

[0] https://robertsspaceindustries.com/

[1] https://www.nomanssky.com/

[2] https://www.bay12games.com/dwarves/

Re: Simulating fluids, fire, and smoke in real-time

#160

Earlier quoted context omitted.

Do you have hardware acceleration disabled in your browser?

I checked and I have it enabled. But, I don't have a dedicated GPU, just whatever is inside of i7-14700k. Maybe it's just not up for the task?

That may be it. The page runs a fire simulation, so it really struggles when my hardware acceleration is off.
Post reply on HN