Exemple #1
0
def test_find_equilibrium_position():
    bearing = flow.fluid_flow_example2()
    find_equilibrium_position(bearing,
                              print_along=False,
                              tolerance=0.1,
                              increment_factor=0.01,
                              max_iterations=5,
                              increment_reduction_limit=1e-03)
    assert_allclose(bearing.eccentricity,
                    (bearing.radius_stator - bearing.radius_rotor) * 0.2663,
                    atol=0.001)
Exemple #2
0
    def __init__(
        self,
        nz,
        ntheta,
        length,
        omega,
        p_in,
        p_out,
        radius_rotor,
        radius_stator,
        viscosity,
        density,
        attitude_angle=None,
        eccentricity=None,
        load=None,
        omegap=None,
        immediately_calculate_pressure_matrix_numerically=True,
        bearing_type=None,
        shape_geometry="cylindrical",
        preload=0.4,
        displacement=0,
        max_depth=None,
    ):

        self.nz = nz
        self.ntheta = ntheta
        self.n_interv_z = nz - 1
        self.n_interv_theta = ntheta - 1
        self.length = length
        self.ltheta = 2.0 * np.pi
        self.dz = length / self.n_interv_z
        self.dtheta = self.ltheta / self.n_interv_theta
        self.ntotal = self.nz * self.ntheta
        self.omega = omega
        self.p_in = p_in
        self.p_out = p_out
        self.radius_rotor = radius_rotor
        self.radius_stator = radius_stator
        self.viscosity = viscosity
        self.density = density
        self.characteristic_speed = self.omega * self.radius_rotor
        self.radial_clearance = self.radius_stator - self.radius_rotor
        self.bearing_type = bearing_type
        if bearing_type is None:
            if self.length / (2 * self.radius_stator) <= 1 / 4:
                self.bearing_type = "short_bearing"
            elif self.length / (2 * self.radius_stator) > 4:
                self.bearing_type = "long_bearing"
            else:
                self.bearing_type = "medium_size"
        self.shape_geometry = shape_geometry
        self.preload = preload
        self.displacement = displacement
        self.max_depth = max_depth
        self.eccentricity = eccentricity
        self.attitude_angle = attitude_angle
        self.eccentricity_ratio = None
        self.load = load

        self.omegap = omegap
        if self.omegap is None:
            self.omegap = self.omega
        else:
            self.omegap = omegap
        self.z_list = np.zeros(self.nz)
        self.re = np.zeros([self.nz, self.ntheta])
        self.ri = np.zeros([self.nz, self.ntheta])
        self.xre = np.zeros([self.nz, self.ntheta])
        self.xri = np.zeros([self.nz, self.ntheta])
        self.yre = np.zeros([self.nz, self.ntheta])
        self.yri = np.zeros([self.nz, self.ntheta])
        self.gama = np.zeros([self.nz, self.ntheta])
        self.t = 0
        self.xp = 0
        self.yp = 0
        if (self.bearing_type == "short_bearing"
                and self.shape_geometry == "cylindrical"):
            if self.eccentricity is None and load is not None:
                modified_s = modified_sommerfeld_number(
                    self.radius_stator,
                    self.omega,
                    self.viscosity,
                    self.length,
                    self.load,
                    self.radial_clearance,
                )
                self.eccentricity_ratio = calculate_eccentricity_ratio(
                    modified_s)
                self.eccentricity = (calculate_eccentricity_ratio(modified_s) *
                                     self.radial_clearance)
                if attitude_angle is None:
                    self.attitude_angle = calculate_attitude_angle(
                        self.eccentricity_ratio)
            elif self.eccentricity is not None and load is not None:
                modified_s = modified_sommerfeld_number(
                    self.radius_stator,
                    self.omega,
                    self.viscosity,
                    self.length,
                    self.load,
                    self.radial_clearance,
                )
                self.eccentricity_ratio = calculate_eccentricity_ratio(
                    modified_s)
                if attitude_angle is None:
                    self.attitude_angle = calculate_attitude_angle(
                        self.eccentricity_ratio)
            elif eccentricity is not None and load is None:
                self.eccentricity_ratio = self.eccentricity / self.radial_clearance
                self.load = calculate_rotor_load(
                    self.radius_stator,
                    self.omega,
                    self.viscosity,
                    self.length,
                    self.radial_clearance,
                    self.eccentricity_ratio,
                )
                if attitude_angle is None:
                    self.attitude_angle = calculate_attitude_angle(
                        self.eccentricity_ratio)
            else:
                sys.exit("Either load or eccentricity must be given.")

            self.xi = self.eccentricity * np.cos(3 * np.pi / 2 +
                                                 self.attitude_angle)
            self.yi = self.eccentricity * np.sin(3 * np.pi / 2 +
                                                 self.attitude_angle)
            self.geometry_description()

        else:
            if load is not None:
                find_equilibrium_position(self)
                if eccentricity is not None:
                    self.eccentricity = eccentricity
                if attitude_angle is not None:
                    self.attitude_angle = attitude_angle
            else:
                if attitude_angle is None:
                    sys.exit("Attitude angle or load must be given.")
                if eccentricity is None:
                    sys.exit("Eccentricity or load must be given.")
            self.geometry_description()
            self.eccentricity_ratio = self.eccentricity / self.radial_clearance
            self.xi = self.eccentricity * np.cos(3 * np.pi / 2 +
                                                 self.attitude_angle)
            self.yi = self.eccentricity * np.sin(3 * np.pi / 2 +
                                                 self.attitude_angle)

        self.p_mat_analytical = np.zeros([self.nz, self.ntheta])
        self.p_mat_numerical = np.zeros([self.nz, self.ntheta])
        self.analytical_pressure_matrix_available = False
        self.numerical_pressure_matrix_available = False

        if immediately_calculate_pressure_matrix_numerically:
            self.calculate_pressure_matrix_numerical()
Exemple #3
0
def test_find_equilibrium_position():
    bearing = fluid_flow_short_friswell()
    eccentricity = find_equilibrium_position(bearing, print_along=False)
    assert_allclose(eccentricity,
                    (bearing.radius_stator - bearing.radius_rotor) * 0.2663,
                    rtol=0.0002)