Skip to content

Conversation

@gsabinoo
Copy link
Collaborator

Code changes:

Reasons for changes

Variable Initialization: Regardless of the perturbation method chosen, the variables used in the initialization of self.theta_range must exist.

theta_pivot Access: The self.theta_pivot object is accessed by the _forces method, which is called regardless of the bearing geometry. For any geometry different than "lobe", this variable was not being initialized.

Dimensionless Pressure: For both methods, self.P must be dimensionless. What was happening is that for the "perturbation" method, the non-dimensionalization of self.P did not influence the coefficient calculation, but for the "lund" method, the dynamic coefficients were affected.

Changes made

1. Variables initialization

Standardized the initialization of angle variables:

pad_ct = np.arange(0, 360, int(360 / self.n_pad))
self.thetaI = np.radians(pad_ct + 180 / self.n_pad + self.betha_s_dg / 2)
self.thetaF = np.radians(pad_ct + 180 / self.n_pad + self.betha_s_dg / 2)
self.theta_range = [
    np.arange(start_rad + (self.dtheta / 2), end_rad, self.dtheta)
    for start_rad, end_rad in zip(self.thetaI, self.thetaF)
]

2. Lobe geometry parameter

Line 291: Changed comment from "lobe" to lobe geometry

Line 293: Added initialization of self.theta_pivot for lobe geometry:

self.theta_pivot = np.array([90, 270]) * np.pi / 180

Lines 610-612:

  • Removed: self.P = Pdim and self.T = Tdim
  • Modified self.P assignment to:
# self.P must receive the adimensional pressure field
self.P = Pdim * (self.radial_clearance**2) / (self.reference_viscosity * speed * (self.journal_radius**2))

Lines 614-615: Added pressure field reshaping using Pdim:

# Reshape dimensional pressure field from (axial, circumferential, pads) to (axial, all_other_dims)
PPlot = Pdim.reshape(self.elements_axial, -1, order="F")

@gsabinoo gsabinoo marked this pull request as ready for review September 15, 2025 16:49
@gsabinoo
Copy link
Collaborator Author

Hi @jguarato,

Just to clarify, the bearing classes in the library have been renamed to maintain a consistent naming pattern:

Previously, the common naming convention for thermo-hydro-dynamic bearings relied on the THD prefix. Since new models may be added in the future, the THD part has been refactored into a class attribute instead (model_type = 'thermo_hydro_dynamic').

The changes related to the THDCylindrical class are included in commits c54f7ac, 68c63d9, and 6e7fef5. The renaming was incorporated into this PR to take advantage of the already open PR, rather than opening a separate one solely for naming adjustments.

This comment is meant to provide additional details on the scope of the current PR. The upcoming commits will focus on adding a test in test_plain_journal.py (previously test_cylindrical.py) for the Lund perturbation method (method='lund').

@raphaeltimbo raphaeltimbo merged commit 795715e into petrobras:main Oct 3, 2025
9 checks passed
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.11%. Comparing base (07a5a63) to head (246bf8b).
⚠️ Report is 332 commits behind head on main.

Files with missing lines Patch % Lines
ross/bearings/plain_journal.py 92.30% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1211      +/-   ##
==========================================
- Coverage   82.91%   79.11%   -3.81%     
==========================================
  Files          39       40       +1     
  Lines        8247    11058    +2811     
==========================================
+ Hits         6838     8748    +1910     
- Misses       1409     2310     +901     
Files with missing lines Coverage Δ
ross/__init__.py 93.10% <100.00%> (-6.90%) ⬇️
ross/bearings/plain_journal.py 65.20% <92.30%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e6a51f...246bf8b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants