From f921840505802219efffb3966e890f355b6d163b Mon Sep 17 00:00:00 2001 From: Miikka Vaisala Date: Fri, 16 Aug 2019 11:44:41 +0800 Subject: [PATCH] Changed to step function --- acc/mhd_solver/stencil_process.sps | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/acc/mhd_solver/stencil_process.sps b/acc/mhd_solver/stencil_process.sps index f2c99dc..58ba721 100644 --- a/acc/mhd_solver/stencil_process.sps +++ b/acc/mhd_solver/stencil_process.sps @@ -105,9 +105,18 @@ sink_accretion(int3 globalVertexIdx, in ScalarField lnrho, Scalar dt){ // 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)); + + Scalar weight; +// const Scalar weight = exp(-(accretion_distance/profile_range)); + // Step function weighting + if ((accretion_distance) <= profile_range){ + weight = Scalar(1.0); + } else { + weight = Scalar(0.0); + } + const Scalar sink_mass = DCONST_REAL(AC_M_sink); - const Scalar lnrho_min = Scalar(-10.0); + const Scalar lnrho_min = Scalar(-10.0); //TODO Define from astaroth.conf // const Scalar rate = truelove_density(lnrho); // const Scalar B = Scalar(0.5); // const Scalar k = Scalar(1.5);