-
Notifications
You must be signed in to change notification settings - Fork 21
Creating meshes from CT scan images
MOOSE already possesses the functionality to read a stack of CT scan images and create the corresponding mesh through its ImageReader. But the following paragraph explains why MOOSE's module is limited.
#MOOSE ImageSubdomain Using the function ImageSubdomain, MOOSE creates a mesh of the stack of CT-scan Images with 2 blocks, the pore space and the grains.
Two parameters can be chosen by the user:
- Type of elements meshed
- Level of refinement (different options available)
HOWEVER one important parameter can not be changed, level of coarsening. The mesh created can not have elements coarser than the resolution of the image.
Mesh coarsening is an important aspect in simulation with CT-scan images. We want to refine the mesh at the grain's boundary because this is where the simulation is complex. But we want to coarsen the region away from these boundaries in order to reduce simulation time.
This is why I would recommend to use REDBACK Image Reader in order to get the full panel of functionalities.
#REDBACK Image Reader ##Installation The first step is to [install VTK](Installing VTK). Then you have to run REDBACK's tests to make sure that those for ImageSubdomain are not skipped and do not fail.
##Usage In the first file, there is many parameters that the user has to change in order to adapt to his stack of images.
- elem_type
- nx/y/z, x/y/zmax They must be adapted to your stack of images
- uniform_refine Generated mesh builds a cubic mesh of 1pixel size. A uniform refinement of x means MOOSE builds a cubic mesh of 2^x pixels size. the second step, adaptivity only coarsens the mesh, so you should take the highest refinement in this step.
- marker -> coarsen
- image_func This is where you indicate the localisation of your stack of files and their names For 2 files in the folder stack named test_00.png, test_01.png The last end of the paragraph sould look like this: file_base = stack/test_0 file_range = '0 1'
In the second and third file you need to change the image_func paragraph like in the first file
-
Run
mesh_generation_step1.i
This generates the file1block_mesh.e
containing the mesh with 1block but the level of refinement/adaptivity that we want. -
Run
mesh_generation_step2.i
This generates the file1block_intermediate.e
and the fileidfile.txt
containing the list of element ids of the subdomain. -
Run
python ~/projects/moose/modules/combined/test_image_reader_subdomain/2D/remove_duplicates.py
This generates the fileidfile_unique.txt
containing the list of unique element ids of the subdomain. -
Run
mesh_generation_step3.i
This generates the file2blocks_mesh.e
containing the mesh of 2blocks. The subdomain has been created. -
Run
simulation.i
This is the simulation of Navier-Stokes using the generated mesh. There might be some convergence issues. It generates the filenavier.e
Same process, but the files change a bit.
- Run
mesh_generation_3D_step1.i
This generates the file1block_mesh_3D.e
- Run
mesh_generation_3D_step2.i
This generates the file1block_intermediate_3D.e
and the fileidfile.txt
- Run
python ~/projects/moose/modules/combined/test_image_reader_subdomain/2D/remove_duplicates.py
This generates the fileidfile_unique.txt
- Run
mesh_generation_3D_step3.i
This generates the file2blocks_mesh_3D.e
- Run
simulation_3D.i
It generates the filenavier_3D.e
REDBACK: Rock mEchanics with Dissipative feedBACKs