Attempted to add accretion_profile function, and made it adjustable within astaroth.conf

This commit is contained in:
JackHsu
2019-08-07 11:21:24 +08:00
parent e199ca196d
commit 2a26b58c38
2 changed files with 35 additions and 1 deletions

View File

@@ -90,10 +90,40 @@ truelove_density(in Scalar lnrho){
Scalar accrection_rho = rho - TJ_rho;
if (accrection_rho < 0){
accrection_rho = Scalar(0);
accrection_rho = Scalar(0);
}
return accretion_rho;
}
accretion_profile(int3 globalVertexIdx){
const Vector grid_pos = (Vector){(globalVertexIdx.x - nx_min) * dsx,
(globalVertexIdx.y - ny_min) * dsy,
(globalVertexIdx.z - nz_min) * dsz};
const Vector sink_pos = (Vector){DCONST_REAL(AC_sink_pos_x),
DCONST_REAL(AC_sink_pos_y),
DCONST_REAL(AC_sink_pos_z)};
// Here I'm trying to make the accretion profile adjustable within astaroth.conf, i.e., making it possible to
// choose how many "cells" around the sink particle we want to accrete mass from.
const Scalar profile = DCONST_REAL(AC_accretion_range) * dsx;
if ((grid_pos - sink_pos) <= profile){
}
// I'm still trying to figure out what to put in if statement when the cell is within the range we set
// and what should this kernel return.
return
}
update_accretion_buffer(){
}
#endif
//TODO: basic structure of this part is as follows

View File

@@ -56,6 +56,10 @@ AC_sink_pos_z = 3.14
AC_M_sink_Msun = 1.0
AC_soft = 0.12
// Accretion Parameters
// profile_range is multiple of dsx
AC_profile_range = 2.0
// Physical properties of the domain
AC_unit_velocity = 1.0
AC_unit_density = 1.0