Skip to content

Commit

Permalink
fix bug in moving surface
Browse files Browse the repository at this point in the history
  • Loading branch information
ilhamv committed Dec 16, 2024
1 parent ac5be7c commit 40913f9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mcdc/src/surface/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,12 @@ def _get_distance_moving(particle_container, speed, surface):
return total_distance + distance

# Accumulate distance
additional_distance = dt * speed
total_distance += additional_distance
total_distance += dt * speed

# Modify the particle
particle["x"] = x_original + additional_distance * ux_original
particle["y"] = y_original + additional_distance * uy_original
particle["z"] = z_original + additional_distance * uz_original
particle["x"] = x_original + total_distance * ux_original
particle["y"] = y_original + total_distance * uy_original
particle["z"] = z_original + total_distance * uz_original
particle["ux"] = ux_original
particle["uy"] = uy_original
particle["uz"] = uz_original
Expand Down

0 comments on commit 40913f9

Please sign in to comment.