PLUTO
4.4-patch2
|
Rotate a 1D problem. More...
Functions | |
double | RotateGet_ta (void) |
double | RotateGet_tb (void) |
void | RotateSet (int jx, int jy, int kx, int kz) |
void | RotateVector (double *v, int s) |
Given the initial condition in the 1D, non-rotated frame ( ), we rotate quantities by an angle
around the y-axis and an angle
around the z-axis. The resulting transformation leaves scalar quantities invariant and produce vector rotations
where
where . In 2D, simply set
.
In a discrete domain, the angles and
must be chosen in such a way that an integer shift of cells satisfies, for any flow quantity q, the translational invariance expressed by
where
is orthogonal to
:
The mesh spacing does need to be the same in all directions. For a given pair of rotation angles, there can be more than one set of integers that satisfies this equation. For instance, taking one may choose (if mesh spacing is the same)
,
(useful at a y-boundary) or
(useful at a z-boundary). In practice, we find convenient to provide two pairs of integer numbers,
and
giving the integer shifts along two directions at a time. These numbers are used to find the rotation angles:
This choice allows us to assign boundary conditions using only 2 shifts (rather than 3): one along the x direction and the other in the direction normal to the boundary plane.
Plane of Discontinuity. A plane of discontinuity has equation in the non-rotated frame. Using the inverse transformation we find the equation of the plane in the rotated
-plane:
The normal to this plane is the vector .
Note on periodic domains. In a periodic domain, an integer number of wavelengths must be contained in each direction. Hence the rotation is usuallt applied by specifying and
which express the ratios between the
- and
- components of the wavevector with the
component. For one wavelength in each direction,
,
,
. The integer shifts can then be specified using
Note on the final time. Usually, the rotated domain size differs from the typical 1D configuration since solutions are compared by looking at the profiles in the x direction. The final time is then adjusted in such a way that the intersection of the rotated plane with the x axis travels the same distance covered in the 1D case. Imagine a point in 1D that travels a distance : in 2- or 3-D the same point will be traveling along the direction given by
where
. In the rotated problem the solution is constant on the plane of equation
and its intersection with the x axis is (
) covers the distance
Reference:
double RotateGet_ta | ( | void | ) |
Return the rotation angle tan(alpha)
double RotateGet_tb | ( | void | ) |
Return the rotation angle tan(beta)
void RotateSet | ( | int | jx, |
int | jy, | ||
int | kx, | ||
int | kz | ||
) |
For a given choice of the input shifts, initialize the rotation angles rot_ta and rot_tb
.
void RotateVector | ( | double * | v, |
int | s | ||
) |
Rotate a vector <v[0], v[1], v[2]>;