doyubkim/fluid-engine-dev

GridSmokeSolver3::computeDiffusion is diffusing smokeDensity instead of temperature

kentbarber opened this issue · 2 comments

I noticed that on line 107 of grid_smoke_solver3.cpp that it is using smokeDensity

if (_temperatureDiffusionCoefficient > kEpsilonD) {
            auto temp = smokeDensity();

But shouldn't that be using temperature?

if (_temperatureDiffusionCoefficient > kEpsilonD) {
            auto temp = temperature();

Same issue in GridSmokeSolver2. I changed my local code to use temperature() instead of smokeDensity() and now it looks like it is giving the correct results.

This is the result I get now, where in this example I have the temperature diffusion coefficient is set to 0.1 and it is now diffusing the temperature grid properly, resulting here in the fire using the temperature grid in a blackbody rendering using Redshift.

smoke_sphere.mp4

Nice catch!! Feel free to raise a PR for the fix.