One of the features of the DSMC method is that it divides the physical space into minute spatial elements called cells, and calculates intermolecular collisions between molecules that exist in the same cell. For this reason, the cells must be very small, and ideally, one side of the cell must be less than the mean free path (some reports have said that less than 1/3 of the mean free path is necessary depending on the calculation target). This condition would not be a big problem in outer space, where the density is very low, but if it is atmospheric pressure, for example, the mean free path is about 0.066 μm, and 15,000 cells are required for a length of 1 mm, and 2.3 × 10
When I was explaining the distribution function of the equilibrium molecular velocity (Maxwell distribution) in my university lectures, I wondered if we could make the cell larger by making good use of this Maxwell distribution, which was the trigger for devising this U_system. In normal intermolecular collisions in the DSMC method, molecules in the same cell are all calculated as being in the same position (for example, the center of the cell) even though they are in different positions within the cell. The larger the cell is beyond the mean free path, the more molecules that are far away in the cell and should not collide are calculated as colliding, creating distortions in the results. So, what if, when two molecules collide, we add corrections to the molecular velocity components according to their original positions? In that case, can we use the equilibrium distribution function? This is the underlying idea of the U_system.
In the following, we will use an example program for the U_system to explain the U_system, and this is the basic program for the DSMC method explained in Section 5.1 with the U_system part added. Therefore, you should have a good understanding of Section 5.1 and the basic programs that accompany it. In the explanation of U_system, we use notations such as “see line XX to line XX” in the example program, but rather than a detailed explanation like in section 5.1, we keep it to a rough explanation, and the variable symbols in the explanation do not necessarily match the variable symbols in the Fortran program, so please read it with great care. Regarding the U_system code, in addition to the supersonic jet in the axisymmetric flow field used here, the code for one-dimensional normal shock waves is also included in the electronic appendix of Reference(9), so please refer to that as well.
As mentioned earlier, in conventional collision calculation methods, as the cell becomes larger, the positions of the two colliding molecules become proportionally farther apart, so the simulation is not performed faithfully. Ideally, two colliding molecules should be selected at the same position, but in a simulation that uses only a finite number of molecules, it is difficult to find two molecules in the exact same position even if the cell is made smaller.
In U_system, the molecular velocity is corrected just before the collision calculation as if one molecule P was aligned with the position of the other molecule Q. Now, we assume that all molecules in the flow field follow the velocity distribution function of a local equilibrium state with a certain temperature and flow velocity (Maxwell distribution or Maxwellian). In the following, the correction formula is derived assuming that the velocity distribution function at the two molecular positions is a Maxwell distribution, but the obtained correction formula itself is valid even if the distribution function at the two positions is not necessarily a Maxwell distribution (for example, the exponential function that appears in the Maxwell distribution formula can be replaced with another function). The only necessary condition is that “the distribution shape is such that the center of distribution moves in parallel to the left and right according to the flow velocity, and the peculiar or thermal velocity component of the molecules is proportional to the square root of the temperature.” Because two molecules are in the same cell even large cell, it is not particularly difficult to satisfy the above conditions, even if the distribution is not Maxwellian.
Now, let us assume that the distribution function of the position of molecule P is

When calculating collisions, this point A should be moved somewhere on the distribution function
If
Therefore, the following equation is obtained.
Using this corrected velocity
Here, to use equations (4) and (5), data on the flow velocity
<Bilinear Interpolation> How to find the flow velocity and temperature at any position within a cell in a two-dimensional problem (axisymmetric problem):
If the coordinates of the four corners of a rectangular cell are (
The same is true for the flow velocity. By the way, there is a simple way to experience this bilinear interpolation, although it is not exact. There is a cooking tool called a “makissu (rolling mat)” that is used to make sushi rolls in Japanese cuisine, and it can be purchased for 110 yen at large 100-yen shops. First, stretch it taut with both hands to create a square plane, and then twist both hands in an appropriate way to create any smooth curved surface. Makissu are made by weaving straight bamboo strips with string, so they are basically linear, but it is possible to obtain a smooth curved surface. The formula for trilinear interpolation using the data of the eight corners of a cell when applied to a three-dimensional problem is a little complicated, but it is recommended that readers derive it as an exercise.
Now, for the first calculation only, the flow velocity and temperature of each cell are obtained using the conventional DSMC method (Bird method). In the long iterations of the DSMC method, the calculation using the conventional method is only required the first time, and thereafter, the flow velocity and temperature data are updated sequentially by U_system. Although the time required for one calculation with the U_system is longer than with conventional calculation methods, considering that the cells can be made larger, the U_system has an advantage in terms of time comparison for the entire calculation.
However, when correcting for molecular velocity, the momentum and energy of each colliding molecular pair are not strictly conserved before and after the collision. Of course, if the average is taken for the entire flow field or over a long period of time, they will be conserved within the range of statistical variation. However, after examining many calculation examples, it was found that if there is a large difference in energy before and after a collision in a single collision, this can cause distortion in the results to grow, especially in a flow field with rapid changes such as shock waves occurring in the range of several cells. Therefore, improvements were made to conserve energy before and after the collision, and the calculation stability of the U_system was greatly improved (U_system-3). However, it was pointed out that the conservation of momentum was not guaranteed, and there were also cases where temperature increases unexpectedly occurred depending on the calculation conditions, so further improvement was desired. Sun et al. (Reference 7) considered that intermolecular collisions take place in a dimensionless velocity space, and performed DSMC analysis by introducing the concept of using flow velocity and temperature as scale variables to make the velocity dimensionless (LCDSMC method). The calculation method is basically the same as the U_system that I proposed, but what is noteworthy is that the correction method proposed by Pareschi et al. (Reference 8) was adopted to strictly conserve the momentum and translational energy of the molecules for each cell. The method is explained next.
When the velocities of many molecules are reproduced using random numbers from the velocity distribution function of a local equilibrium state with a given flow velocity and temperature, even if the flow velocity and temperature are calculated in reverse from the reproduced molecular velocities, they do not strictly return to the original state. To strictly return to the original state, Pareschi et al. devised a method for strictly conserving momentum and energy. Now, let us consider applying this method to the U_system. Let the molecular velocity components before and after the collision be
Here, to find
As a result,
The U_system included in this blog strictly conserves momentum and energy as shown above. When calculating τ, it is necessary to use a positive sign before the square root. The conservation law is satisfied even if it is negative, but if it is negative, the correction parameters
The Fortran program USYS2024-3NEG.F (click here to jump to the program) is the original basic program in section 5.1 with the U_system part added (or modified), and the lines after the line ‘C2024-11-1 CUxx’ are the added parts. Note that the ‘xx’ after CU is numbered 1 to 9, and there are a total of nine places. The first line of each has ‘xx-start’ at the end, the last line has ‘xx^end’ at the end, and there is an additional part in between. Specifically, CU1 is 2 lines, CU2 is 8 lines, CU3 is 16 lines, CU4 is 14 lines, CU5 is 4 lines, CU6 is 1 line, CU7 is 249 lines from lines 573 to 821, CU8 is 112 lines from lines 872 to 983, and CU9 is 15 lines. The last CU9 part has ‘C’ at the beginning of every line, so it is a comment line and does not function, but if you remove this ‘C’, a plot file for tecplot will be created (if left as is, it will be a plot file for gnuplot).
The CU1 part changes the array of the original program from memory saving 4-byte single precision real numbers to 8-byte double precision real numbers, and this change was made to accurately check whether the conservation of energy and momentum is being performed correctly in the intermolecular collision process of U_system.
Before explaining the CU2 part, please remember that the cells of the space are arranged in a regular lattice on a two-dimensional plane. In present the grid size is 164×240, but in case we need to use the area upstream of the orifice in the future, KST9=260, KOT9=240 in the PARAMETER statement on line 51. Cells with the same
The CU3 part specifies whether to use U_system for the calculation (IUB=1) or not (IUB=0), initializes various error counters IERR3 to IERR8 (zeroing), and is the initial setting to check the maximum and minimum values of temperature and flow velocity, but the results of the investigation of the maximum and minimum values are not specifically used in this calculation.
In the CU4 section, AUV calculates the leftmost coordinate and width of the
In the CU5 section, the display output during the calculation shows which calculation ( J1), the total number of molecules at that point (NM), the maximum total number of molecules up to that point (NMM), and the number of errors. Note that OV is the number of times the relative velocity during collision calculation has exceeded the maximum relative velocity set in advance, divided by the total number of collision calculations, and checks whether the probability is sufficiently small.
In the CU6 section, the calculation starts at line 493 for the first U_system or Bird method, but jumps to line 575 for the second or subsequent U_system calculations.
The CU7 part is the main part of the U_system calculation, and the DO_13241 loop is repeated for the total number of cells NC=KS×(KO-2). I7 on line 579 is the cell number in the
Lines 768-817 are calculations of the strict conservation of momentum and energy proposed by Pareschi et al., which ultimately determine the molecular velocity after the collision. BV3, which appears in lines 768-775, is the sum of the squared sum of the velocity components of the molecules in the cell (it means the sum of the kinetic energy of the molecules in the cell, but 1/2 and the molecular mass
In lines 790-817, a check is made to see if momentum and energy are indeed conserved; if they are not within a tolerance range that I have arbitrarily set, an error counter is advanced and the number is displayed during the calculation.
In lines 872-982 of CU8, the flow velocity and temperature at the four corners of the cell are calculated, and these are updated every number of times specified by K100 in line 101. First, in lines 872-916, the flow velocity and temperature at the center of the cell are calculated, but the maximum and minimum values of the temperature and flow velocity calculated there are not used this time. Lines 923-947 are for the data at the upper and lower sides of each cell, and lines 949-968 are for the data at the left and right sides of each cell. There are some parts that are a little difficult to understand, but we ask the reader to decipher them for themselves. Lines 970-975 are for the data at the left end of the cell along the wall of the orifice, where the flow velocity is zero and the temperature is 288K. Lines 977-982 are for the data at the left end of the cell along the aperture of the orifice, where the conditions (flow velocity and temperature) of the flow entering from the orifice are given.
Regarding the Fortran source program, there has been a request to make the parallel calculation code for the DSMC method publicly available, but at present there are no clear plans for its release. For information on parallel calculation methods, please refer to Reference 10, which contains sufficient hints. However, the explanation in Reference 10 is not the final form of program parallelization, and improvements have been made since then. For example, the array element of “number of cells times number of threads” that was initially required for “molecule rearrangement processing” is no longer necessary, and there is a good chance that a better parallel program than my current one will appear in the future. All three executable programs posted on this website (blog) are capable of parallel calculation, so by comparing the calculation speed, readers can roughly judge the level of the parallel program of the DSMC method that they have created.
Finally, some people may suspect that the U in the name U_system does not mean U-turn as mentioned above, but rather comes from the U in my name Usami. This is a reasonable argument for those who know me well, a lowly person. However, I would like to say something similar to the following about this. In the novel “Gan” by the great Japanese writer Ogai Mori, there are people who wonder if the beautiful woman “Otama” who appears in the novel became my (Ogai’s) lover, and at the end of the novel Ogai says the following: “Readers are advised not to make unnecessary speculations.”