neperfepx / neper

Polycrystal generation and meshing
http://neper.info
GNU General Public License v3.0
199 stars 53 forks source link

3D mesh from 2D tessellation for simulation #371

Closed rquey closed 2 years ago

rquey commented 2 years ago

Discussed in https://github.com/rquey/neper/discussions/370

Originally posted by **xshang93** January 24, 2022 After generating 3D meshes from a 2D tessellation with the option `-dim 3` in `neper -M`, I realized it can't be readily used for fepx simulation. Specifically, in this .msh file the node set $nset and $faset sections are missing (I think fepx relies on these to place boundary conditions?) and the orientation section is missing too. For the $nset and $faset mssing, I think the `-nset` option in module M should help, but I couldn't make it work. For the missing orientation, I believe I can just copy from tessellation file. The commands I used are: ``` $ neper -T -n '10' -id 1 -dim 2 -domain 'square(1,1)' -ori 'random' -morpho 'gg' -reg 1 -sel 0.0018257 -o 10 $ neper -M 10.tess -cl '0.06' -order 2 -dim 3 -pl 100 -meshqualmin 1.0 ``` And a picture of what I'm dealing with: ![10_iso](https://user-images.githubusercontent.com/86078353/150725401-baeee4c6-1281-427e-a87a-908ac2da47b5.png)
xshang93 commented 2 years ago

Just a bit more insight to this issue: I believe this issue roots from that the mesh generated this way does not give the third dimensional information. I output the .bcs file and it only contains the face sets in X and Y directions.

Then I thought about a workaround - to load the mesh again and reprint. This time the $Nset section and $Faset sections are included, but looks like neper is treating it as if it is a cylinder - instead of [x-z][0,1], it gives f1, which, according to the manual, is the cylinder face.

rquey commented 2 years ago

This is a known bug and, yes, it comes from the fact that the 3D mesh is not generated in the standard way.

At this time, FEPX does not use the $NSets field of the msh file, but it does use/need the $Fasets field and expects 6 faces, while Neper "rebuilds" only 1 when you load/reprint... (f1, f2, etc. are for "arbitrary" faces, in contrast to x0, x1, etc., which are the min and max faces along x, etc.).

So, there does not seem to be a real workaround, and the best way probably is to generate a "thin" 3D tessellation and mesh it in the standard way.

mkasemer commented 2 years ago

I will also step in to preemptively caution that there may be issues with proper constraint of the domain for thin plates/films, leading to convergence issues when simulating with FEPX. Appropriate boundary conditions must be applied, that balance both an accurate reflection of those expected in an experimental setup, as well as conditions which will aid (not hamper) numerical stability. Should you have issues with convergence, please start a discussion in the FEPX discussions page.

xshang93 commented 2 years ago

I will also step in to preemptively caution that there may be issues with proper constraint of the domain for thin plates/films, leading to convergence issues when simulating with FEPX. Appropriate boundary conditions must be applied, that balance both an accurate reflection of those expected in an experimental setup, as well as conditions which will aid (not hamper) numerical stability. Should you have issues with convergence, please start a discussion in the FEPX discussions page.

This is a very valid point that i'm also thinking about. I opted for thin plates not because of the actual sample size, but for computational efficiency. The most ideal case is that I can just run simulations in 2D, but I know at the moment fepx doesn't allow 2d simulations. The BCs I'm using is simply uniaxial tension on the x(or y) direction. I think the most ideal case would be if I can have some periodical boundary conditions on the z direction, but I'm not yet sure how to do it. So far I have successfully converged with a few thin models, and the results doesn't look too off compared with literature (actually your co-authored paper https://doi.org/10.1016/j.actamat.2018.07.011). I plan to do some thickness convergence study by comparing results from various thicknesses, which I hope would help me find a thickness that makes most sense. Not sure how much sense this approach makes to you, and I would appreciate so much if you can give some insights.

rquey commented 2 years ago

Won't fix as FEPX would not properly support the resulting meshes anyway, and the current meshes seem to work well with other codes.