Fixed scaling for sink particle, and added softening factor.
This commit is contained in:
@@ -78,6 +78,7 @@
|
||||
FUNC(AC_sink_pos_y),\
|
||||
FUNC(AC_sink_pos_z),\
|
||||
FUNC(AC_M_sink),\
|
||||
FUNC(AC_soft),\
|
||||
/* Run params */\
|
||||
FUNC(AC_cdt), \
|
||||
FUNC(AC_cdtv), \
|
||||
@@ -120,7 +121,7 @@
|
||||
FUNC(AC_ff_hel_imz),\
|
||||
/* Additional helper params */\
|
||||
/* (deduced from other params do not set these directly!) */\
|
||||
FUNC(AC_G_CONST),\
|
||||
FUNC(AC_G_const),\
|
||||
FUNC(AC_GM_star),\
|
||||
FUNC(AC_sq2GM_star),\
|
||||
FUNC(AC_cs2_sound), \
|
||||
|
@@ -21,7 +21,6 @@ uniform int nz_min;
|
||||
uniform int nx;
|
||||
uniform int ny;
|
||||
uniform int nz;
|
||||
//Added declaration for constants used for sink particle.
|
||||
|
||||
Vector
|
||||
value(in Vector uu)
|
||||
@@ -69,8 +68,8 @@ sink_gravity(int3 globalVertexIdx){
|
||||
DCONST_REAL(AC_sink_pos_y),
|
||||
DCONST_REAL(AC_sink_pos_z)};
|
||||
const Scalar distance = length(grid_pos - sink_pos);
|
||||
const Scalar soft = 0.12;
|
||||
const Scalar gravity_magnitude = (Scalar(0.01) * sink_mass) / pow(((distance * distance) + soft*soft), 1.5);
|
||||
const Scalar soft = DCONST_REAL(AC_soft);
|
||||
const Scalar gravity_magnitude = (AC_G_const * sink_mass) / pow(((distance * distance) + soft*soft), 1.5);
|
||||
const Vector direction = (Vector){(sink_pos.x - grid_pos.x) / distance,
|
||||
(sink_pos.y - grid_pos.y) / distance,
|
||||
(sink_pos.z - grid_pos.z) / distance};
|
||||
|
Reference in New Issue
Block a user