Maxis—A rezoning and remapping code in two dimensional cylindrical geometry

https://doi.org/10.1016/j.cpc.2018.02.006Get rights and content

Abstract

This paper presents the new version of our code Maxis (Lin et al., 2011). Maxis is a local rezoning and remapping code in two dimensional cylindrical geometry, which can be employed to address the grid distortion problem of unstructured meshes. The new version of Maxis is mostly programmed in the C language which considerably improves its computational efficiency with respect to the former Matlab version. A new algorithm for determining the intersection of two arbitrary convex polygons is also incorporated into the new version. Some additional linking functions are further provided in the new version for the purpose of combining Maxis and MULTI2D.

New version program summary

Program title: Maxis

Program files doi: http://dx.doi.org/10.17632/nnxvbg9pbz.1

Licensing provisions: GPLv3

Programming language: C and Matlab

Subprograms used: MULTI2D CPC 180 (2009) 977

Journal reference of previous version: Zhiwei Lin, Comput. Phys. Commun. 182 (2011) 1361–1376

Does the new version supersede the previous version?: Yes

Nature of problem: Although the large distortion of mesh zones moving with fluid velocities causes the shortening of time step and the increasing of computational error, and thus makes it indispensable that the rezoning of distorted zones and the remapping of physical variables are performed, it should be noted that rezoning and remapping can also bring in the loss of the Lagrangian motion information of the original mesh. Therefore the essential problem is how to minimize the loss caused by rezoning and remapping and to improve the mesh quality concurrently.

Solution method: We employ the local rezoning and remapping technique to confine the loss within the worse or insignificant regions, that is, only those worse regions determined by the mesh-closure or mesh-union methods are rezoned.

Reasons for the new version: Due to the multi loops of the remapping algorithm, the former version of Maxis [1] in the Matlab language is quite inefficient. Moreover, the linking functions for combining Maxis and MULTI2D [2] are not present in the previous version.

Summary of revisions: The new version of Maxis is mostly programmed in the C language and its computational efficiency is greatly increased. The remapping algorithm of the new version is based on a new scheme for determining the intersection of two arbitrary convex polygons. Some linking functions are also provided along. The detailed new features of Maxis are as follows.

(1) The development of Maxis in C

The former version of Maxis is developed in the Matlab language and is quite inefficient due to the multi loops of the remapping algorithm. Hence we programme the time consuming part of Maxis in the C language because of its high efficiency, that is, the following C functions are developed:

closure_of_polygon.c:

which can be used to compute mesh closure;

new_topology.c:

which can be used to compute the topology of the new mesh;

cell_remapping.c:

which can be used to compute the zone/cell centered physical variables of the new mesh such as mass densities;

node_remapping.c:

which can be used to compute the node centered physical variables of the new mesh such as nodal velocities;

convex_polygon_intersection.c:

which can be used to compute the intersection of two arbitrary convex polygons. But the top level of the code Maxis still uses the Matlab language, since Matlab is easy to use and makes it rather convenient to visualize and analyze numerical results. The advantages of the C and Matlab languages can be fully exploited by doing so. The thought of combining two computer languages is also adopted by MULTI2D in which the C and r94 languages are utilized at different computing levels.

(2) A new scheme for determining the intersection of two arbitrary convex polygons

Both cell_remapping.c and node_remapping.c are based on a new algorithm for computing the intersection of two arbitrary convex polygons as follows. Let P1 and P2 be two convex polygons. Then it holds that P1=i=1n1li, where li is the half plane determined by the ith edge of P1 and n1 is the number of the edges of P1. Then we can have that P1P2=P2l1l2ln1.Hence the calculation of the intersection of two convex polygons can be reduced to a series of calculations of the intersection between a convex polygon and a half plane, which can be readily programmed. Such an example is given in Fig. 1.

(3) Some linking functions

The new version of Maxis comprises some linking functions for the purpose of combining Maxis and MULTI2D. For example, the r94 function readremap.r is supplied to import the data of the Maxis remap.out into MULTI2D so that the Lagrangian calculation of an ALE simulation [3,4] can proceed.

(4) New Maxis manual

A new Maxis manual for detailed operations is provided along.

Restrictions: It appears that there is no uniform criterion to distinguish the worse mesh zones from the good ones.

Unusual features: The time consuming part of Maxis is developed in the C language, whereas the top level of the code still utilizes the Matlab language, which takes full advantage of both languages.

References

  • [1]

    Z.W. Lin, S.E. Jiang, S.C. Wu, L.Y. Kuang, Comput. Phys. Commun. 182 (2011) 1361.

  • [2]

    R. Ramis, J. Meyer-ter-Vehn, J. Ramirez, Comput. Phys. Commun. 180 (2009) 977.

  • [3]

    C.W. Hirt, A.A. Amsden, J. Cook, J. Comput. Phys. 14 (1974) 227, reprinted in 135 (1997) 203.

  • [4]

    M. Kenamond, M. Bement, M. Shashkov, J. Comput. Phys. 268 (2014) 154.

Section snippets

Acknowledgment

The first author’s research was supported by the National Natural Science Foundation of China under Grant 11475154.

References (0)

View full text