Skip to content

Commit 90c9af6

Browse files
committed
Fix stall example
1 parent a57a1e1 commit 90c9af6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/solver.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ function gamma_loop!(
542542

543543
# Apply damping if needed
544544
if solver.is_with_artificial_damping
545-
damp, is_damping_applied = smooth_circulation(gamma, 0.1, 0.5)
545+
is_damping_applied = smooth_circulation!(damp, gamma, 0.1, 0.5)
546546
@debug "damp: $damp"
547547
else
548548
damp .= 0.0
@@ -582,7 +582,7 @@ function gamma_loop!(
582582
end
583583

584584
"""
585-
smooth_circulation(circulation,
585+
smooth_circulation!(damp, circulation,
586586
smoothness_factor::Float64,
587587
damping_factor::Float64)
588588
@@ -591,7 +591,8 @@ Smooth circulation distribution if needed.
591591
Returns:
592592
- Tuple of smoothed circulation and boolean indicating if smoothing was applied
593593
"""
594-
function smooth_circulation(
594+
function smooth_circulation!(
595+
damp,
595596
circulation,
596597
smoothness_factor::Float64,
597598
damping_factor::Float64
@@ -628,8 +629,8 @@ function smooth_circulation(
628629
total_smoothed = sum(smoothed)
629630
smoothed .*= total_original / total_smoothed
630631

631-
damp = smoothed - circulation
632-
return damp, true
632+
damp .= smoothed .- circulation
633+
return true
633634
end
634635

635636
"""

0 commit comments

Comments
 (0)