From a5bb56873a45d5808a21dc6dfa3a173ed5890208 Mon Sep 17 00:00:00 2001 From: JackHsu Date: Thu, 15 Aug 2019 17:51:39 +0800 Subject: [PATCH] Now resets accretion buffer at every step. --- acc/mhd_solver/stencil_process.sps | 1 - src/standalone/simulation.cc | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/acc/mhd_solver/stencil_process.sps b/acc/mhd_solver/stencil_process.sps index 145d0c0..e05c3f9 100644 --- a/acc/mhd_solver/stencil_process.sps +++ b/acc/mhd_solver/stencil_process.sps @@ -434,7 +434,6 @@ solve(Scalar dt) { out_accretion = rk3(out_accretion, accretion, accretion_profile(globalVertexIdx, lnrho, dt), dt);// unit now is rho! out_lnrho = log(exp(out_lnrho) - out_accretion); out_accretion = out_accretion * dsx * dsy * dsz;// unit is now mass! - //TODO: reset accretion buffer in the beginning. //TODO: implement accretion correction to contiunity equation and momentum equation. #endif } diff --git a/src/standalone/simulation.cc b/src/standalone/simulation.cc index fc2d901..cf5d05e 100644 --- a/src/standalone/simulation.cc +++ b/src/standalone/simulation.cc @@ -256,9 +256,10 @@ run_simulation(void) printf("sink mass is: %e \n", sink_mass); printf("accreted mass is: %e \n", accreted_mass); acLoadDeviceConstant(AC_M_sink, sink_mass); + vertex_buffer_set(VTXBUF_ACCRETION, 0.0, mesh); #endif -#if LSINK +#if LFORCING const ForcingParams forcing_params = generateForcingParams(mesh_info); loadForcingParamsToDevice(forcing_params); #endif