Commit 7df88c0b authored by Bert Vandenbroucke's avatar Bert Vandenbroucke
Browse files

Added an option to disable particle movement in GIZMO_SPH.

parent c33df916
......@@ -55,6 +55,10 @@
#define SLOPE_LIMITER_PER_FACE
#define SLOPE_LIMITER_CELL_WIDE
/* Options to control the movement of particles for GIZMO_SPH. */
/* This option disables particle movement */
#define GIZMO_FIX_PARTICLES
/* Source terms */
#define SOURCETERMS_NONE
//#define SOURCETERMS_SN_FEEDBACK
......
......@@ -79,13 +79,19 @@ __attribute__((always_inline)) INLINE static void hydro_timestep_extra(
__attribute__((always_inline)) INLINE static void hydro_first_init_part(
struct part* p, struct xpart* xp) {
xp->v_full[0] = p->v[0];
xp->v_full[1] = p->v[1];
xp->v_full[2] = p->v[2];
p->primitives.v[0] = p->v[0];
p->primitives.v[1] = p->v[1];
p->primitives.v[2] = p->v[2];
#if defined(GIZMO_FIX_PARTICLES)
p->v[0] = 0.;
p->v[1] = 0.;
p->v[2] = 0.;
#else
xp->v_full[0] = p->v[0];
xp->v_full[1] = p->v[1];
xp->v_full[2] = p->v[2];
#endif
}
/**
......@@ -357,6 +363,13 @@ __attribute__((always_inline)) INLINE static void hydro_end_force(
/* Add normalization to h_dt. */
p->force.h_dt *= p->h * hydro_dimension_inv;
#if defined(GIZMO_FIX_PARTICLES)
p->a_hydro[0] = 0.0f;
p->a_hydro[1] = 0.0f;
p->a_hydro[2] = 0.0f;
p->du_dt = 0.0f;
#else
/* Set the hydro acceleration, based on the new momentum and mass */
/* NOTE: the momentum and mass are only correct for active particles, since
only active particles have received flux contributions from all their
......@@ -383,6 +396,7 @@ __attribute__((always_inline)) INLINE static void hydro_end_force(
p->du_dt = 0.0f;
}
#endif
}
/**
......
......@@ -23,6 +23,13 @@
#include "io_properties.h"
#include "riemann.h"
/* Set the description of the particle movement. */
#if defined(GIZMO_FIX_PARTICLES)
#define GIZMO_PARTICLE_MOVEMENT "Fixed particles."
#else
#define GIZMO_PARTICLE_MOVEMENT "Particles move with flow velocity."
#endif
/**
* @brief Specifies which particle fields to read from a dataset
*
......@@ -155,6 +162,9 @@ void writeSPHflavour(hid_t h_grpsph) {
/* Riemann solver information */
io_write_attribute_s(h_grpsph, "Riemann solver type",
RIEMANN_SOLVER_IMPLEMENTATION);
/* Particle movement information */
io_write_attribute_s(h_grpsph, "Particle movement", GIZMO_PARTICLE_MOVEMENT);
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment