From ff59431d6518ff67e1540a646578429f80c55687 Mon Sep 17 00:00:00 2001 From: JackHsu Date: Tue, 13 Aug 2019 17:43:52 +0800 Subject: [PATCH] Added modularized term for accretion range, which is some wave function, and module that'll allow time-dependent accretion. --- acc/mhd_solver/stencil_process.sps | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/acc/mhd_solver/stencil_process.sps b/acc/mhd_solver/stencil_process.sps index ce2e434..247c739 100644 --- a/acc/mhd_solver/stencil_process.sps +++ b/acc/mhd_solver/stencil_process.sps @@ -108,15 +108,25 @@ accretion_profile(int3 globalVertexIdx, in Scalar lnrho){ const Scalar profile_range = DCONST_REAL(AC_accretion_range); const Scalar accretion_distance = length(grid_pos - sink_pos); Scalar accretion_density; - if ((accretion_distance) <= profile_range){ - // calculate accretion according to chosen criterion for the grid cell. - accretion_density = truelove_density(lnrho); - } else { - accretion_density = Scalar(0.0); - } +// if ((accretion_distance) <= profile_range){ +// // calculate accretion according to chosen criterion for the grid cell. +// accretion_density = truelove_density(lnrho); +// } else { +// accretion_density = Scalar(0.0); +// } +// return accretion_density; + + // multiplying the truelove density by a wave function to avoid step-function like accretion profile. + const Scalar weight = exp(-(accretion_distance/profile_range)); + const Scalar rate = truelove_density(lnrho); + accretion_density = weight * rate; + return accretion_density; + + } + #endif //TODO: basic structure of this part is as follows // update_accretion_buffer() <--> accretion_profile() <--> truelove_density()