How to adapt Cartesian grids automatically for an IBM case.
Adaptation is based on a sensor that must be computed by the user.
Here, the example is the inviscid supersonic flow around a 2D diamond and the sensor is the difference of the
Mach number.
Requirements
The IBM workflow tutorial should be achieved before: see tutorial .
Adaptation is done after a solution is obtained on an initial IBM Cartesian mesh.
Input data are:
case.cgns: describes bodies immersed in the mesh;
octree.cgns: unstructured octree mesh corresponding to the computed mesh that must be adapted;
restart.cgns: mesh to be adapted and corresponding solution
Settings
vmin: number of points per adaptive Cartesian elementary grid. It is generally the same as for the generation;
refineNearBodies: if set to True, enables to refine the mesh near the body defined as input;
refineFinestLevel: if True, enables to add a refinement level (twice as fine as previously);
factor: number of points is controlled by this factor after adaption: factor=1.2 means that the adapted mesh is expected to have a number of points 1.2 times the number of points of the current mesh.
How to run
A solution must be first obtained on an initial mesh.
You can download the sample file [body].
Then you can download, edit (to modify some parameters) and run the following scripts:
Generation of Cartesian grids adapted to the body and IBM preprocessing: prep.py.