Skip to content

Commit

Permalink
Merge pull request #265 from mabarnes/fix-wall_exp_decay-distributed-mpi
Browse files Browse the repository at this point in the history
Fix "wall_exp_decay" source for distributed MPI
  • Loading branch information
johnomotani authored Sep 26, 2024
2 parents f82fca8 + 0ab4c72 commit cae381f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions moment_kinetics/src/external_sources.jl
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,9 @@ function get_source_profile(profile_type, width, relative_minimum, coord)
return profile
elseif profile_type == "wall_exp_decay"
x = coord.grid
return @. (1.0 - relative_minimum) * exp(-(x-x[1]) / width) + relative_minimum +
(1.0 - relative_minimum) * exp(-(x[end]-x) / width) + relative_minimum
L = coord.L
return @. (1.0 - relative_minimum) * exp(-(x+0.5*L) / width) + relative_minimum +
(1.0 - relative_minimum) * exp(-(0.5*L-x) / width) + relative_minimum
else
error("Unrecognised source profile type '$profile_type'.")
end
Expand Down

0 comments on commit cae381f

Please sign in to comment.