This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
How could finer meshes end up with wrong answers? #1044
Labels
You can continue the conversation there. Go to discussion →
I am wondering if there are some settings or considerations that I need to include when setting a proper mesh size for the model? Such as the lower and upper limit for the mesh size.
Problem description:
Below is the Python code using Fipy and Gmsh and can run with different solvers.
This code describes an object with an initial temperature equal to the ambient temperature and stays there with no external heat.
The solution which shows the temperature map of this object in the steady state should always be equal to the ambient temperature.
However, if I change the mesh size, the results can be very different:
If I change the mesh size
dx
(in the Gmsh code) to 5.e-3 or bigger, the final result equals the ambient value.If I change it to 1.e-3 or smaller, the answers suddenly become very small, such as 1.845, for all petsc solvers, while scipy LU & GMRES still can return the correct results.
(I thought a smaller mesh size should usually end up with a more accurate solution but takes a longer time. I did not expect that it could end up with a very different solution.)
Python code:
Gmsh code:
The text was updated successfully, but these errors were encountered: