Skip to content

Usage of DBL_MIN to avoid division by 0 #1935

Description

@hepap

To avoid division by zero in navier_stokes_vof_assembler, a tolerance of DBL_MIN was used. However, since DBL_MIN is approx. 1e-300, it doesn't avoid a division by zero if the numerator is small (e.g., 1e-150), but larger than DBL_MIN. It led to issues for fine meshes. This is addressed in PR #1934 by changing DBL_MIN for 1e-14.

However, other parts of the code also use DBL_MIN as a tolerance to avoid division by 0 (shape, dem, cfd-dem) that are not fixed in PR #1934. I tried to change the uses of DBL_MIN there also, but it changed the test results, so I think it is worth checking in more details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions