underworldcode / underworld2

underworld2: A parallel, particle-in-cell, finite element code for Geodynamics.
http://www.underworldcode.org/
Other
168 stars 58 forks source link

Under resolved cell #609

Closed PatriceFRey closed 2 years ago

PatriceFRey commented 2 years ago

G'day all, Running a simple 2D convection model (for teaching) on version 2.11.0-dev-485ad28, I got a under resolved cell issue. The model is relatively simple: viscosity = 1, Tsurf=Tmin=0, Tbase=Tmax=1, diffusivity=1, visc=1, g=1, density=1, expansivity=RayleighNb=1.43e7, free slip everywhere excepted at the surface Vx=0, and the model includes a fixed plate (visc=10000) covering a thrid of the model length. This model stops after a while due to an unresolved cell. I have played with swarm.particles.per.cell.2D, popcontrol.max.splits, popcontrol.particles.per.cell.2D, and popcontrol.aggressive with no luck. Inspection of the swarm reveals that indeed the particles get clustered in a strange pattern at a very early stage of the run (see image attached), and quickly cells are depleted of particles. It looks like the re-population doesn't work properly. I have attached an image, does anyone have seen this behavior before?

Image2

rbeucher commented 2 years ago

WoW! Beautiful! Solar Flares? or Aliens? Clearly violating the laws of thermodynamic. Can you tell us more about the setup?

julesghub commented 2 years ago

Never seen this before, looks like you have some velocity field oscillations between time steps causing those funky patterns. Yes to some more information on this setup.

rbeucher commented 2 years ago

I had a quick chat about this with Louis. Could be some locked elements, this thing can happen if you violate mass conservation too... Just repeating what I have been told though...

PatriceFRey commented 2 years ago

I have attached the zipped notebook. The setup is super simple, though perhaps unusual, everything is explained in the notebook. Not sure which of the law I am violating. I suspect I am doing something wrong with the scaling perhaps, though all the convection models without plate worked fine. Cheers 2Plates_and_Mantle.ipynb.zip

julesghub commented 2 years ago

Hi Patrice, I gave the model a quick run and can see the reporting of time step is like this. Step: 1 Model Time: 0.0 second dt: 0.0 second

This suggests the model has scaling issues resulting in crazy high velocities. Do you observe this behaviour?

julesghub commented 2 years ago

Also there's a bug with one of the notebook cell destroying the Model.outputDir. The where the notebook is copied into the outputDir.

PatriceFRey commented 2 years ago

Hi Julian, thanks for looking at this. The velocity field (and all other fields) looks fine. If you remove the plate, the model runs without any issues. The reporting time step stays at zero, but with appropriate scaling, the time displayed in Paraview is as expected. I have run this model without a plate for over 2 billion years with no problem. As for the bug, I go around by creating the output folder manually, then the notebook is saved in this folder properly.

julesghub commented 2 years ago

With no plate is without a viscosity contrast right? Improper scaling can make models sensitive especially when shape viscosity contrasts exist.

PatriceFRey commented 2 years ago

Correct, no viscosity contrast. When I look at the particle swarm, I can see holes developing. I can see particle repopulation kicks in to fill these holes, but not fast enough which causes the number of particles in some cells to drop down to zero.

PatriceFRey commented 2 years ago

Convection depends only on the Rayleigh number which is defined as: 𝑅𝑎=𝜌⋅𝛼⋅𝑔⋅Δ𝑇⋅ℎ^3/(𝜅⋅𝜇) Therefore the values of each parameter are of little importance. Hence, I assign to all of them a value of 1 (using their SI units), except for the coefficient of thermal expansion (𝛼) whose value becomes the Raleigh number. The length of the model is 6 m, and its depth is 1 m. The scaling factor for time derives from the scaling factor of length and diffusivity.

julesghub commented 2 years ago

@patrice-rey - is this still an issue? It went quite.

PatriceFRey commented 2 years ago

Yes, but it isn't worth investing time in it. You can close this issue, thanks Julian and Romain.

rbeucher commented 2 years ago

Thanks @patrice-rey