Preparing isothermal collapse.

This commit is contained in:
Miikka Vaisala
2019-08-22 18:18:30 +08:00
parent a81bc22fb6
commit 1410e57866
8 changed files with 330 additions and 23 deletions

View File

@@ -207,6 +207,81 @@ inflow_vedge(AcMesh* mesh)
}
}
// This is the initial condition type for the infalling vedge in the pseudodisk
// model.
void
simple_uniform_core(AcMesh* mesh)
{
const int mx = mesh->info.int_params[AC_mx];
const int my = mesh->info.int_params[AC_my];
const int mz = mesh->info.int_params[AC_mz];
//const int nx_min = mesh->info.int_params[AC_nx_min];
//const int nx_max = mesh->info.int_params[AC_nx_max];
//const int ny_min = mesh->info.int_params[AC_ny_min];
//const int ny_max = mesh->info.int_params[AC_ny_max];
//const int nz_min = mesh->info.int_params[AC_nz_min];
//const int nz_max = mesh->info.int_params[AC_nz_max];
const double DX = mesh->info.real_params[AC_dsx];
const double DY = mesh->info.real_params[AC_dsy];
const double DZ = mesh->info.real_params[AC_dsz];
const double ampl_lnrho = mesh->info.real_params[AC_ampl_lnrho];
//const double AMPL_UU = mesh->info.real_params[AC_ampl_uu];
// const double SQ2GM = mesh->info.real_params[AC_sq2GM_star];
// const double GM = mesh->info.real_params[AC_GM_star];
// const double M_star = mesh->info.real_params[AC_M_star];
// const double G_CONST = mesh->info.real_params[AC_G_CONST];
// const double unit_length = mesh->info.real_params[AC_unit_length];
// const double unit_density = mesh->info.real_params[AC_unit_density];
// const double unit_velocity = mesh->info.real_params[AC_unit_velocity];
const double xorig = mesh->info.real_params[AC_xorig];
const double yorig = mesh->info.real_params[AC_yorig];
const double zorig = mesh->info.real_params[AC_zorig];
//const double trans = mesh->info.real_params[AC_trans];
double xx, yy, zz, RR;
double delx, dely, delz;
//double u_x, u_y, u_z;
double tanhRR;
//const double sink_pos_x = mesh->info.real_params[AC_sink_pos_x];
//const double sink_pos_y = mesh->info.real_params[AC_sink_pos_y];
//const double sink_pos_z = mesh->info.real_params[AC_sink_pos_z];
//TEMPORARY TEST INPUT PARAMETERS
const double core_radius = DX*32.0;
const double trans = DX*6.0;
for (int k = 0; k < mz; k++) {
for (int j = 0; j < my; j++) {
for (int i = 0; i < mx; i++) {
int idx = i + j*mx + k*mx*my;
xx = DX * double(i) - xorig;
yy = DY * double(j) - yorig;
zz = DZ * double(k) - zorig;
delx = xx;
dely = yy;
delz = zz;
RR = sqrt(delx*delx + dely*dely + delz*delz);
tanhRR = double(0.5)*tanh((core_radius-RR)/trans) + double(0.5)
+ double(0.1);
mesh->vertex_buffer[VTXBUF_LNRHO][idx] = log(exp(ampl_lnrho)*tanhRR);
mesh->vertex_buffer[VTXBUF_UUX][idx] = double(0.0);
mesh->vertex_buffer[VTXBUF_UUY][idx] = double(0.0);
mesh->vertex_buffer[VTXBUF_UUZ][idx] = double(0.0);
}
}
}
}
// This is the initial condition type for the infalling vedge in the pseudodisk
// model.
void
@@ -582,6 +657,10 @@ acmesh_init_to(const InitType& init_type, AcMesh* mesh)
}
}
break;
case INIT_TYPE_SIMPLE_CORE:
acmesh_clear(mesh);
simple_uniform_core(mesh);
break;
case INIT_TYPE_VEDGE:
acmesh_clear(mesh);
inflow_vedge_freefall(mesh);

View File

@@ -34,6 +34,7 @@
FUNC(INIT_TYPE_XWAVE), \
FUNC(INIT_TYPE_GAUSSIAN_RADIAL_EXPL), \
FUNC(INIT_TYPE_ABC_FLOW) , \
FUNC(INIT_TYPE_SIMPLE_CORE), \
FUNC(INIT_TYPE_VEDGE), \
FUNC(INIT_TYPE_VEDGEX), \
FUNC(INIT_TYPE_RAYLEIGH_TAYLOR), \