Application of computer algebra for the construction of shell models of turbulence

. The technique for automatic constructing of shell models of turbulence has been developed. The compilation of a model equations and its exactly solution is implemented using computer algebra (symbolic calculation) systems. The technique allows one to vary the scaling nonlocality of nonlinear interaction, form of expressions for conservation laws in models, and the form of stationary solutions with power distributions to scales.


Introduction
The main idea of shell models turbulence is to constructing a chain of ordinary differential equations describing the processes of energy transfer along scale spectrum in developed turbulence [1]. The shell models contain variables, each of which describes (by absolute value) the pulsations measure for certain scale. To do this, the axis of the wave numbers k is divided into progressively expanding octaves k n < k < k n+1 , k n = 2 n k 0 .
For each zone k n variable x n , y n , z n , ... (by number of fileds) are introduced, characterizing fields pulsations at appropriate scales. For this variables it is required to write a system of equations that preserves the type of nonlinearity (quadratic) and conservation laws that the original equations satisfy in the nondissipative limit. The general form of shell model can be written in from (two fields, for example): (1) Specific models, as a rule, differ in the form of a matrix of nonlinear interactions P nij and Q nij . The dissipative terms is written as K x n x n ∼ k 2 n x n and K y n y n ∼ k 2 n x n , and the variables f x n and f y n are describes the action of external forces in a octave of wave numbers [1][2][3].
Next, we will describe the developed techniq for constructing of shell models in which the compilation of a system of equations and its exact solution is implemented using symbolic computing systems. Note, that the using of symbolic calculations is proposed to not for shell models research, but for their automated generation.
Previously, the authors considered the possible use of computer algebra systems for the automated generation of spectral models of dynamo [4].

Conservation laws
In the absence of dissipation and external forces, the equations of hydrodynamics and magnetohydrodynamics satisfy a certain set of conservation laws. These conservation laws differ in the case of «pure» hydrodynamics and in the case of magnetohydrodynamics, and also depend on the dimension of the physical space [2,3]. We list the conservation laws in their original form and their analogues in shell models in Table 1.
Since, there are no geometrical form of motion at all in shell models, the only way to introduce information about two or three-dimensional flows into the model is to ensure that conservation laws are satisfied in each of these situations.
Let's consider analogues of conservation laws in shell models in Table 1. The underlined formal analogues are positive quantities, and their exact prototype are alternating. Therefore, we will modify them by introducing coefficients to ensure alternating sign [3].
Substituting the values of derivatives from the equation (1) into these expressions, we obtain cubic forms from variables in shell models. And the coefficients of these cubic forms will be linear combinations of the coefficients of the matrix of linear interactions.
In the system (1) in quadratic form Q nij member contains three indexes. Let be x n and y n -variables in shell models. It is better to rewrite the matrix of nonlinear interactions in the form of a term with two indices and a separate wave number 2 n through the formula where i = n + i , j = n + j . The extraction of the factor 2 n corresponds to the presence of the nabla operator in nonlinear terms of hydrodynamic equations. The new hatched index define the logarithmic distance between hierarchical scales.

MHD turbulence
Consider the proposed technique as an example of the shell model MHD turbulence equations. The general view of the shell model of MHD turbulence, including nonlocal interactions, has the form where S nij = 2 n s i−n,j−n , L nij = 2 n l i−n,j−n , W nij = 2 n w i−n,j−n , Re -Reynolds number, and Re m -magnetic Reynolds number.

Kinetic energy
Kinetic energy

Magnetohydrodynamics Total energy
Total energy

Cross helicity
Cross helicity In the case Re m = ∞ and Re = ∞, the shell model equations has a four quadratic conservative quantities: the total energy E = After substituting into the laws of conservation of equations (3) we obtain the following families of equations written using new indexes with strokes The system (4) is also complemented by the following symmetries: Thus, the system is composed of seven types of equations for matrix elements s[i, j], l[i, j], and w[i, j].
As a result, the construction of a shell model is reduced to the compilation of a system of linear equations with rational coefficients of large dimension. Even for a small number of spatial scales, for example, equal to two, the number of equations becomes more than the spirit of hundreds. It is clear that even building such a system «manually» is very problematic and requires automation. Symbol computing packages allow you to quickly build and process such systems.

Scheme for generation of equations in a symbolic package
Let the integer parameter J determine the size of the non-locality of the model in the space of scales.
In all the equations considered above, the indexes i and j can take any integer values, thus the equations themselves are also infinitely many. On the other hand, we consider only nonlinear interactions limited in range in the space of scales. Therefore, if least one of indexes exceeds |J|, then coefficient equal to zero. If all indexes in equation more than |J|, then equation will be executed automatically.  In the all equations in the considered models the matrix elements are associated with the indices (±i , ±j ), (±i , ±(i − j )) and (±j , ±(i − j )), and vice versa. Other combinations do not occur. Therefore, in the plane of indexes (i , j ) conditional area will correspond not to equations, but to identities.
This region is external with respect to the cross-shaped region shown in the figure 1, therefore, real equations need to be compiled and solved only for pairs of indexes from the cross-shaped region. The sets of calculated coefficients can then be represented in a character packet using two-dimensional arrays whose indexes vary −J to J.
If you use a symbolic package that does not support arrays with negative indexes, it is enough to use a linear shift of J for each range. We assume that negative indexes are allowed.
In general, the following arrays of functions s[i, j], l[i, j] and w[i, j] are constructed, the indices of which vary in the range from −J to J. An array of equations is introduced, but since the number of equations is not known in advance, it is determined during the calculation, the dimension of this array is dynamic. The resulting system is usually has infinitely set of solutions. To build the model and search for its exact solution, the Maple program was used.
The resulting system for matrix elements will be linear, homogeneous, and with rational coefficients. This makes it possible to absolutely accurately solve it in the case of using software that supports arithmetic of rational numbers. In particular, computer algebra systems allow this, any of which contains appropriate procedures.
We also note that the resulting system, as calculations show, is, as a rule, underdetermined and its general solution always determines a whole parametric class of models that exactly satisfy the conservation laws.
Moreover, if there are nonzero solutions, then each of them corresponds to one specific shell model from an entire class. The allocation of specific values can be done for any additional reasons. For example, we can introduce an additional equation that ensures the existence of a stationary solution with a power-law distribution over the scales in the model.
For example, the result of generating shell equations for MHD turbulence, with J = 2, has the following form , 0 Only nonzero matrix elements are shown here; it is clear that we get a two-parameter family of models. For J = 1, we get only zero solutions. For J = 3, the number of degrees of freedom already increases to 6.
Let us consider in more detail the introduction of additional restrictions on the coefficients. We will require the existence of stationary solutions with a power-law distribution over the scales. For this, additional equations of the form are added to the system where rational number p/q -degree of law. For the considered model, the introduction of constraints of the form (8) leads to the fact that the α parameter is expressed in terms of β (α = −β), and the two-parameter solution turns into a one-parameter solution, that is, generally speaking, it is determined uniquely. Moreover, this solution is obtained for various exponents p/q. The question of the stability of these solutions must be investigated further.
There are many shell models of turbulence. Various models reproduce certain characteristics of turbulence, but there is no model that would reproduce all turbulence modes and it hardly exists. Therefore, to study turbulence in the framework of the shell approach, software tools are very useful, which would make it possible to quickly generate a class of models that can then be specified using additional physical considerations. In addition, one may require that the model implement stationary solutions with the desired power distribution over the scale.

Conclusions
There are many shell models of turbulence. Various models reproduce certain characteristics of turbulence, but there is no model that would reproduce all turbulence modes and it hardly exists. Therefore, to study turbulence in the framework of the shell approach, software tools are very useful, which would make it possible to quickly generate a class of models that can then be specified using additional physical considerations. In addition, one may require that the model implement stationary solutions with the desired power distribution over the scale.
The paper describes the developed methodology for constructing shell models in which the compilation of a system of equations and its exact solution is implemented using symbolic computing systems. The technique allows one to vary the sizes of nonlocality of nonlinear interaction in the space of scales, expressions for analogues in shell models of conservation laws, and the nature of stationary solutions of power scale.