Fluid: Updated Mantaflow source files

Includes outflow optimization - might have been the cause of instabilities.
This commit is contained in:
Sebastián Barschkis
2020-12-06 21:56:43 +01:00
parent ee70eb96cf
commit 6f22a536e6
3 changed files with 8 additions and 16 deletions

View File

@@ -1,3 +1,3 @@
#define MANTA_GIT_VERSION "commit bb7cde47b6e04fa62815c70775dc70f02065599f"
#define MANTA_GIT_VERSION "commit 327917cd59b03bef3a953b5f58fc1637b3a83e01"

View File

@@ -1090,8 +1090,8 @@ struct extrapolateVelConvectiveBC : public KernelBase {
Real timeStep) const
{
if (flags.isOutflow(i, j, k)) {
Vec3 bulkVel = getBulkVel(flags, vel, i, j, k);
int dim = flags.is3D() ? 3 : 2;
const Vec3 bulkVel = getBulkVel(flags, vel, i, j, k);
const int dim = flags.is3D() ? 3 : 2;
const Vec3i cur = Vec3i(i, j, k);
Vec3i low, up, flLow, flUp;
int cnt = 0;
@@ -1099,8 +1099,8 @@ struct extrapolateVelConvectiveBC : public KernelBase {
for (int c = 0; c < dim; c++) {
low = up = flLow = flUp = cur;
Real factor = timeStep *
max((Real)1.0, bulkVel[c]); // prevent the extrapolated velocity from
// exploding when bulk velocity below 1
max((Real)1.0, abs(bulkVel[c])); // prevent the extrapolated velocity from
// exploding when bulk velocity below 1
low[c] = flLow[c] = cur[c] - 1;
up[c] = flUp[c] = cur[c] + 1;
// iterate over bWidth to allow for extrapolation into more distant outflow cells;

View File

@@ -1147,26 +1147,18 @@ void solvePressureSystem(Grid<Real> &rhs,
gcg->setAccuracy(cgAccuracy);
gcg->setUseL2Norm(useL2Norm);
int maxIter = 0;
int maxIter = (int)(cgMaxIterFac * flags.getSize().max()) * (flags.is3D() ? 1 : 4);
Grid<Real> *pca0 = nullptr, *pca1 = nullptr, *pca2 = nullptr, *pca3 = nullptr;
GridMg *pmg = nullptr;
// optional preconditioning
if (preconditioner == PcNone || preconditioner == PcMIC) {
maxIter = (int)(cgMaxIterFac * flags.getSize().max()) * (flags.is3D() ? 1 : 4);
if (preconditioner == PcMIC) {
pca0 = new Grid<Real>(parent);
pca1 = new Grid<Real>(parent);
pca2 = new Grid<Real>(parent);
pca3 = new Grid<Real>(parent);
gcg->setICPreconditioner(preconditioner == PcMIC ? GridCgInterface::PC_mICP :
GridCgInterface::PC_None,
pca0,
pca1,
pca2,
pca3);
gcg->setICPreconditioner(GridCgInterface::PC_mICP, pca0, pca1, pca2, pca3);
}
else if (preconditioner == PcMGDynamic || preconditioner == PcMGStatic) {
maxIter = 100;