GithubHelp home page GithubHelp logo

Comments (3)

janbender avatar janbender commented on May 14, 2024

In pressureSolve it uses computeDensityAdv which calculates the exact same thing as computeDensityChange

That is not correct. computeDensityAdv computes the advected density, i.e. a preview of the density at time t+h (first equation in section 3.3). computeDensityChange computes the divergence of the velocity field (equation 6 in the paper). So the first is a density and the second the density derived wrt. t.

The computation of the solvers is the same since the matrix on the left hand side is equal, only the right hand side of the linear system changes.

from splishsplash.

ibchristensen avatar ibchristensen commented on May 14, 2024

In computeDensityAdv:

densityAdv = density + h*delta;
densityAdv = max(densityAdv, density0);

In computeDensityChange:

densityAdv = density + h*densityAdv;
densityAdv = max(densityAdv, density0);
densityAdv = (densityAdv - density0) * (1.0 / h);

The value of delta and densityAdv are calculated exactly the same in both functions so the only difference is the last line in computeDensityChange. Looking at how the final value is used in pressureSolve (which uses computeDensityAdv):

const Real b_i = m_simulationData.getDensityAdv(i) - density0;
const Real ki = b_i*m_simulationData.getFactor(i);

And how factor is adjusted for the pressureSolve:
m_simulationData.getFactor(i) *= invH2;
vs how factor is adjusted for the divergenceSolve:
m_simulationData.getFactor(i) *= invH;
(this gets multiplied back out at the end of the divergenceSolve to reset the factor)
k_i ends up being the same value for both solvers.

from splishsplash.

janbender avatar janbender commented on May 14, 2024

Maybe there is a bug in the open-source implementation. I will check this. Unfortunately, this will take a while since currently I have not much time for the maintainance of the open-source libraries.

from splishsplash.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.