Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Velocity may not be extrapolated sufficiently far to accomodate CFL number #593

Closed
zx-82 opened this issue Aug 10, 2022 · 2 comments
Closed
Labels

Comments

@zx-82
Copy link

zx-82 commented Aug 10, 2022

Hi,

browsing through the source code, I came across the following possible glitch: Calculating the number of "extrapolation layers" (i.e. L1-distance) this way may significantly underestimate the actual number of layers needed to cover a given euklidian distance (as specified via CFL number).:

void FluidSimulation::_extrapolateFluidVelocities(MACVelocityField &MACGrid,
ValidVelocityComponentGrid &validVelocities) {
int numLayers = (int)ceil(_CFLConditionNumber) + 2;
MACGrid.extrapolateVelocityField(validVelocities, numLayers);
}

I propose to use numLayers = ceil( (3./MT_SQRT3)*(CFLConditionNumber) ) )+3) instead which accomodates enough layers also in the diagonal directions (plus an extra cell diagonal to include all corners of the interpolation stencil)

@rlguy rlguy added the bug label Aug 17, 2022
@rlguy
Copy link
Owner

rlguy commented Aug 17, 2022

Hi, thanks for the report and for this helpful information! That is something I had overlooked.

We should be able to get this change into a future version of the FLIP Fluids addon, hopefully the next version. The next GitHub release will be version 1.5.0 around September 7th 2022.

First we will need to take time to test if this change causes any large differences to the simulation behaviour in case this breaks any example scenes or could cause artists' scenes to function incorrectly on a version update.

@rlguy
Copy link
Owner

rlguy commented Nov 14, 2022

Hi, I wasn't able to completely test this before the release of FLIP Fluids 1.5.0. This has now been tested and does not seem to cause any negative changes. This fix will be included in FLIP Fluids 1.6.0 (Release TBA, before December 7th 2022).

Thanks again for the correction!

@rlguy rlguy closed this as completed Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants