Skip to content

GIMP shape function returns zero weight in Z-direction for elevated domainsΒ #29

@fabricix

Description

@fabricix

🐞 Issue: GIMP shape function returns zero weight in Z-direction for elevated domains

Description:

When running simulations with an elevated mesh origin (e.g., "origin": [0, 0, 300]), material points fail to transfer mass to the background grid, despite having correct mass and external forces due to gravity.

Upon debugging, it was found that the GIMP shape function evaluation in the Z-direction returns zero:

Sz = computeShape(posParticle(2) - posNode(2), cellDim(2), particleSize(2)/2.0);
// Sz = 0.0 β†’ total weight = 0.0

As a result, particles have no contributing mass, and nodal quantities remain zero.

Potential Cause:

The method Mesh::getContributionNodes(...) relies on getParentCellIdConstribution(...), which selects the parent node based on relative particle location. If the particle is located before the cell center, the logic shifts the parent cell index backward:

const int k = relDz < 0.5 ? pk - 1 : pk;

If this causes the node to fall outside the effective GIMP support region, the shape function will return zero. This issue is more likely when particles are near domain boundaries or if ghost cells are insufficient.

Suggested Fixes:

  • Re-evaluate the logic in getParentCellIdConstribution(...) to ensure selected nodes are within the support of the GIMP shape function.
  • Add a runtime check in ShapeGimp::update(...) to detect when any directional shape component is zero due to distance.
  • Consider redesigning getContributionNodes(...) to include only nodes within the actual GIMP support range (based on particle size and cell size).
  • Ensure the number of ghost cells (nGhosts) is sufficient for GIMP support in all directions.

Note:
This issue does not occur when the mesh origin is [0, 0, 0], suggesting the problem is due to grid-particle alignment rather than the physical model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions