From 1c090d2752b158e9a7d766077c9a2e08bedd4e67 Mon Sep 17 00:00:00 2001 From: AhmedSalih3d <36305327+AhmedSalih3d@users.noreply.github.com> Date: Mon, 6 Jul 2026 01:51:11 +0200 Subject: [PATCH] Branch shifting limiter terms --- src/SPHCellList.jl | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/SPHCellList.jl b/src/SPHCellList.jl index ed740550..1e89d5aa 100644 --- a/src/SPHCellList.jl +++ b/src/SPHCellList.jl @@ -510,10 +510,11 @@ using TimerOutputs: @timeit kernel_acc, kernel_grad_acc = compute_kernel_output_local(SimMetaData, kernel_acc, kernel_grad_acc, SimKernel, q, ∇ᵢWᵢⱼ) - MotionLimiterCondition = ParticleType[i]==Fluid && ParticleType[j]==Fluid #MotionLimiterValue(eltype(ρᵢ), ParticleType[i]) * MotionLimiterValue(eltype(ρᵢ), ParticleType[j]) - Vᵢ = m₀ / ρᵢ - shift_c_acc += Vⱼ * Wᵢⱼ * Vᵢ * ∇ᵢWᵢⱼ * MotionLimiterCondition - shift_r_acc += Vⱼ * dot(-xᵢⱼ, ∇ᵢWᵢⱼ) * MotionLimiterCondition + if ParticleType[i] == Fluid && ParticleType[j] == Fluid + Vᵢ = m₀ / ρᵢ + shift_c_acc += Vⱼ * Wᵢⱼ * Vᵢ * ∇ᵢWᵢⱼ + shift_r_acc += Vⱼ * dot(-xᵢⱼ, ∇ᵢWᵢⱼ) + end end return dρdt_acc, acc_acc, kernel_acc, kernel_grad_acc, shift_c_acc, shift_r_acc @@ -566,9 +567,10 @@ using TimerOutputs: @timeit acc_acc += dvdt⁺ + visc_term - MotionLimiterCondition = ParticleType[i]==Fluid && ParticleType[j]==Fluid #MotionLimiterValue(eltype(ρᵢ), ParticleType[i]) * MotionLimiterValue(eltype(ρᵢ), ParticleType[j]) - shift_c_acc += Vⱼ * Wᵢⱼ * Vⱼ * ∇ᵢWᵢⱼ * MotionLimiterCondition - shift_r_acc += Vⱼ * dot(-xᵢⱼ, ∇ᵢWᵢⱼ) * MotionLimiterCondition + if ParticleType[i] == Fluid && ParticleType[j] == Fluid + shift_c_acc += Vⱼ * Wᵢⱼ * Vⱼ * ∇ᵢWᵢⱼ + shift_r_acc += Vⱼ * dot(-xᵢⱼ, ∇ᵢWᵢⱼ) + end end return dρdt_acc, acc_acc, shift_c_acc, shift_r_acc