ComputeCylindrical

Description

Transform variables from the Cartesian coordinate system to the cylindrical coordinate system.

Parameters

  • base: Base

    The input base to be transformed.

  • coordinates: list(str)

    The coordinate names of the Cartesian coordinate system. If no value is given, the default coordinate system of the base is used (see antares.api.Base.Base.coordinate_names) if any or [‘x’, ‘y’, ‘z’] otherwise.

  • axis: list(float),

    The Cartesian coordinates of the revolution unit axis of the new cylindrical coordinate system. Valid values are [1., 0., 0.] or [0., 1., 0.] or [0., 0., 1.].

  • origin: list(float),

    The Cartesian coordinates (list of 3 floats) of the origin of the new cylindrical coordinate system.

  • vector: list(str), default= None

    List of 3 strings denoting the name of the X, Y, Z components of the vector in the Cartesian coordinate system. The order is important. This vector will be projected into the cylindrical coordinate system.

  • matrix: list(str), default= None

    List of 6 strings denoting the name of the XX, XY, XZ, YY, YZ, ZZ components of the matrix in the Cartesian coordinate system. The order is important. This matrix will be projected into the cylindrical coordinate system.

Preconditions

The coordinates must be (at least) in the first instant.

Postconditions

If vector and matrix are not given, the treatment will only return ‘r’ and ‘theta’ coordinates.

The output variables are:

  • ‘u_r’ and ‘u_theta’ for the vector

  • ‘Mcyl_r_r’, ‘Mcyl_r_theta’, ‘Mcyl_r_axe’, ‘Mcyl_r_theta’, ‘Mcyl_theta_theta’, ‘Mcyl_theta_axe’, ‘Mcyl_r_axe’, ‘Mcyl_theta_axe’, ‘Mcyl_axe_axe’ for the matrix

Example

The following example shows the full potential of this treatment. A transformation of the velocity vector and the Reynolds stress tensor is performed in the cylindrical coordinate system using the axis of rotation (1., 0., 0.) and (0., 0., 0.) as the origin.

import antares
myt = antares.Treatment('ComputeCylindrical')
myt['base'] = base
myt['origin'] = [0., 0., 0.]
myt['axis'] = [1., 0., 0.]
myt['vector'] = ['Vx', 'Vy', 'Vz']
myt['matrix'] = ['ReynoldsStress_XX', 'ReynoldsStress_XY', 'ReynoldsStress_XZ',
                 'ReynoldsStress_YY', 'ReynoldsStress_YZ',
                 'ReynoldsStress_ZZ']
base_cyl = myt.execute()

Main functions

class antares.treatment.TreatmentComputeCylindrical.TreatmentComputeCylindrical
calculate_matrix(base)
calculate_vector(base)
execute()

Execute the treatment.

Returns:

Return type:

Base