def __init__( self, nz, ntheta, nradius, 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, ): if load is None and eccentricity is None: sys.exit("Either load or eccentricity must be given.") self.nz = nz self.ntheta = ntheta self.nradius = nradius self.n_interv_z = nz - 1 self.n_interv_theta = ntheta - 1 self.n_interv_radius = nradius - 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 = "" 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.eccentricity = eccentricity self.eccentricity_ratio = None self.load = load if self.eccentricity is None: modified_s = modified_sommerfeld_number( self.radius_stator, self.omega, self.viscosity, self.length, self.load, self.radial_clearance, ) self.eccentricity = ( calculate_eccentricity_ratio(modified_s) * self.radial_clearance ) self.omegap = omegap if self.omegap is None: self.omegap = self.omega else: self.omegap = omegap self.eccentricity_ratio = self.eccentricity / self.radial_clearance if self.load is None: 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: self.attitude_angle = attitude_angle 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.re = np.zeros([self.nz, self.ntheta]) self.ri = np.zeros([self.nz, self.ntheta]) self.z_list = np.zeros(self.nz) 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.p_mat_analytical = np.zeros([self.nz, self.ntheta]) self.c1 = np.zeros([self.nz, self.ntheta]) self.c2 = np.zeros([self.nz, self.ntheta]) self.c0w = np.zeros([self.nz, self.ntheta]) self.M = np.zeros([self.ntotal, self.ntotal]) self.f = np.zeros([self.ntotal, 1]) self.P = np.zeros([self.ntotal, 1]) self.p_mat_numerical = np.zeros([self.nz, self.ntheta]) self.gama = np.zeros([self.nz, self.ntheta]) self.calculate_coefficients() self.analytical_pressure_matrix_available = False self.numerical_pressure_matrix_available = False self.calculate_pressure_matrix_numerical() if immediately_calculate_pressure_matrix_numerically: self.calculate_pressure_matrix_numerical()
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()