Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/VSM/core/Filament.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def velocity_3D_trailing_vortex_semiinfinite(
# determine the three velocity components
return K * r1XVf
# if point is on the filament
elif jit_norm(r1XVf) / jit_norm(Vf) == 0:
elif jit_norm(r1XVf) / jit_norm(Vf) < 1e-12 * epsilon:
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from exact equality comparison (== 0) to a tolerance-based comparison (< 1e-12 * epsilon) is good practice for floating-point arithmetic. However, similar exact equality comparisons exist in other methods of the same file that should also be updated for consistency:

  • Line 105 in velocity_3D_bound_vortex method: elif jit_norm(r1Xr0) / jit_norm(r0) == 0:
  • Line 182 in velocity_3D_trailing_vortex method: elif jit_norm(r1Xr0) / jit_norm(r0) == 0:

These methods have similar logic for checking if a point is on the filament and should use the same tolerance-based comparison approach.

Copilot uses AI. Check for mistakes.
return np.zeros(3)
# else, if point within core
else:
Expand Down
2 changes: 1 addition & 1 deletion src/VSM/core/Solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(
max_iterations: int = 5000,
allowed_error: float = 1e-6,
relaxation_factor: float = 0.01,
core_radius_fraction: float = 1e-20,
core_radius_fraction: float = 0.05, # Following Damiani et al. (2019) https://docs.nrel.gov/docs/fy19osti/72777.pdf
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the default core_radius_fraction from 1e-20 to 0.05 represents a significant change (approximately 6 orders of magnitude increase). While the reference to Damiani et al. (2019) provides justification, this is a breaking change that will affect all existing code using the default value.

The test file (tests/Solver/test_solver.py line 318) uses test values of [1e-6, 1e-4, 1e-2], which suggests the old default of 1e-20 may have been far outside the practical range. However, users who rely on the default behavior may experience different results after this change. Consider documenting this as a breaking change in the changelog or migration guide.

Copilot uses AI. Check for mistakes.
gamma_loop_type: str = "base",
gamma_initial_distribution_type: str = "elliptical",
is_only_f_and_gamma_output: bool = False,
Expand Down
Loading