Added declaration of constants for sink particle. Still in the process of understanding how values are passed, but I've realized how physical equations are defined in stencil_process.sps and in principle I can replicate that for sink particle(which will mostly be gravity).

This commit is contained in:
JackHsu
2019-07-29 13:18:24 +08:00
parent 89e6f8673f
commit d1ca196ccd
2 changed files with 14 additions and 3 deletions

View File

@@ -21,8 +21,11 @@ uniform int nz_min;
uniform int nx;
uniform int ny;
uniform int nz;
uniform Scalar AC_sink_pos_x;
uniform Scalar AC_sink_pos_y;
uniform Scalar AC_sink_pos_z;
uniform Scalar AC_M_sink;
//Added declaration for constants used for sink particle.
Vector
value(in Vector uu)
@@ -57,6 +60,14 @@ continuity(in Vector uu, in Scalar lnrho) {
- divergence(uu);
}
//#if SINK
//Here I'm more or less copying the format of the LENTROPY module below
//Vector
//gravity(in Vector xx, in Vector yy, in Vector zz) {
//Here I need to define how gravity works for sink particle, probably based on the distance to the sink particle and its mass.
//Then apply Newton's equation for force, and also remember to consider xyz directions.
//}
#if LENTROPY
Vector
momentum(in Vector uu, in Scalar lnrho, in Scalar ss, in Vector aa) {

View File

@@ -94,7 +94,7 @@ write_mesh_info(const AcMeshInfo* config)
fprintf(infotxt, "real AC_sink_pos_x %e \n", (double)config->real_params[AC_sink_pos_x]);
fprintf(infotxt, "real AC_sink_pos_y %e \n", (double)config->real_params[AC_sink_pos_y]);
fprintf(infotxt, "real AC_sink_pos_z %e \n", (double)config->real_params[AC_sink_pos_z]);
fprintf(infotxt, "real AC_M_sink %e \n", (double)config->real_params[AC_M_sink]);
fprintf(infotxt, "real AC_M_sink %e \n", (double)config->real_params[AC_M_sink]);
fclose(infotxt);
}