Skip to content
Snippets Groups Projects
Commit a65f50da authored by Filip Husko's avatar Filip Husko
Browse files

Run formatting

parent 246bbc7d
No related branches found
No related tags found
1 merge request!2056(Draft) Idealized agn jets
......@@ -1146,14 +1146,18 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
p->u_dt = 0.f;
}
// only kick the particle if it hasn't yet been launched, and if it is time to kick it //
// max particle ID we should be kicking by now //
const float max_id = (hydro_props->jet_power * time) / (0.5 * p->mass * hydro_props->jet_velocity * hydro_props->jet_velocity);
// only kick the particle if it hasn't yet been launched, and if it is time to
// kick it // max particle ID we should be kicking by now //
const float max_id =
(hydro_props->jet_power * time) /
(0.5 * p->mass * hydro_props->jet_velocity * hydro_props->jet_velocity);
if (p->id < max_id) {
// particle position relative to the box centre
double delta_x = (p->x[0] - hydro_props->box_aspect_ratio * hydro_props->box_size / 2.f);
double delta_y = (p->x[1] - hydro_props->box_aspect_ratio * hydro_props->box_size / 2.f);
double delta_x =
(p->x[0] - hydro_props->box_aspect_ratio * hydro_props->box_size / 2.f);
double delta_y =
(p->x[1] - hydro_props->box_aspect_ratio * hydro_props->box_size / 2.f);
double delta_z = (p->x[2] - hydro_props->box_size / 2.f);
// cylindrical and spherical radius
......@@ -1180,8 +1184,8 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
// assign velocity to be given. We do a radial kick from the origin
float vel_kick_vec[3];
vel_kick_vec[0] = hydro_props->jet_velocity * sin_theta * cos(phi);
vel_kick_vec[1] = hydro_props->jet_velocity * sin_theta * sin(phi);
vel_kick_vec[0] = hydro_props->jet_velocity * sin_theta * cos(phi);
vel_kick_vec[1] = hydro_props->jet_velocity * sin_theta * sin(phi);
vel_kick_vec[2] = hydro_props->jet_velocity * cos_theta;
p->v[0] = vel_kick_vec[0];
......@@ -1203,7 +1207,6 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
// increase the particle's id so it's no longer ever kicked
p->id += 1e7;
}
}
/**
......
......@@ -217,7 +217,6 @@ void hydro_props_init(struct hydro_props *p,
p->jet_power = parser_get_param_float(params, "SPH:jet_power");
p->jet_velocity = parser_get_param_float(params, "SPH:jet_velocity");
p->jet_duration = parser_get_param_float(params, "SPH:jet_duration");
}
/**
......
......@@ -146,7 +146,6 @@ struct hydro_props {
float jet_power;
float jet_velocity;
float jet_duration;
};
void hydro_props_print(const struct hydro_props *p);
......
......@@ -220,7 +220,8 @@ __attribute__((always_inline)) INLINE static void kick_part(
const struct hydro_props *hydro_props,
const struct entropy_floor_properties *floor_props,
const integertime_t ti_start, const integertime_t ti_end,
const integertime_t ti_start_mesh, const integertime_t ti_end_mesh, const double time) {
const integertime_t ti_start_mesh, const integertime_t ti_end_mesh,
const double time) {
#ifdef SWIFT_DEBUG_CHECKS
if (p->ti_kick != ti_start)
......@@ -277,8 +278,8 @@ __attribute__((always_inline)) INLINE static void kick_part(
chemistry_kick_extra(p, dt_kick_therm, dt_kick_grav, dt_kick_hydro,
dt_kick_corr, cosmo, hydro_props);
hydro_kick_extra(p, xp, dt_kick_therm, dt_kick_grav, dt_kick_mesh_grav,
dt_kick_hydro, dt_kick_corr, cosmo, hydro_props,
floor_props, time);
dt_kick_hydro, dt_kick_corr, cosmo, hydro_props, floor_props,
time);
mhd_kick_extra(p, xp, dt_kick_therm, dt_kick_grav, dt_kick_hydro,
dt_kick_corr, cosmo, hydro_props, floor_props);
if (p->gpart != NULL) gravity_kick_extra(p->gpart, dt_kick_grav);
......
......@@ -179,7 +179,8 @@ void runner_do_kick1(struct runner *r, struct cell *c, const int timer) {
/* Do the kick */
kick_part(p, xp, dt_kick_hydro, dt_kick_grav, dt_kick_mesh_grav,
dt_kick_therm, dt_kick_corr, cosmo, hydro_props,
entropy_floor, ti_begin, ti_end, ti_begin_mesh, ti_end_mesh, e->time);
entropy_floor, ti_begin, ti_end, ti_begin_mesh, ti_end_mesh,
e->time);
/* Update the accelerations to be used in the drift for hydro */
if (p->gpart != NULL) {
......@@ -452,7 +453,8 @@ void runner_do_kick2(struct runner *r, struct cell *c, const int timer) {
/* Finish the time-step with a second half-kick */
kick_part(p, xp, dt_kick_hydro, dt_kick_grav, dt_kick_mesh_grav,
dt_kick_therm, dt_kick_corr, cosmo, hydro_props,
entropy_floor, ti_begin, ti_end, ti_begin_mesh, ti_end_mesh, e->time);
entropy_floor, ti_begin, ti_end, ti_begin_mesh, ti_end_mesh,
e->time);
#ifdef SWIFT_DEBUG_CHECKS
/* Check that kick and the drift are synchronized */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment