Skip to content
Snippets Groups Projects
Commit f849e58a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Documentation fixes and restored default configuration file.

parent f22a6a40
Branches
Tags
1 merge request!217Disk patch
...@@ -36,8 +36,7 @@ ...@@ -36,8 +36,7 @@
/* Time integration constants. */ /* Time integration constants. */
#define const_max_u_change 0.1f #define const_max_u_change 0.1f
/* Thermal energy per unit mass to use as a constant when using an isothermal /* Thermal energy per unit mass used as a constant for the isothermal EoS */
* EoS */
#define const_isothermal_internal_energy 20.2615290634f #define const_isothermal_internal_energy 20.2615290634f
/* Dimensionality of the problem */ /* Dimensionality of the problem */
...@@ -51,8 +50,8 @@ ...@@ -51,8 +50,8 @@
//#define HYDRO_GAMMA_2_1 //#define HYDRO_GAMMA_2_1
/* Equation of state choice */ /* Equation of state choice */
//#define EOS_IDEAL_GAS #define EOS_IDEAL_GAS
#define EOS_ISOTHERMAL_GAS //#define EOS_ISOTHERMAL_GAS
/* Kernel function to use */ /* Kernel function to use */
#define CUBIC_SPLINE_KERNEL #define CUBIC_SPLINE_KERNEL
...@@ -74,9 +73,9 @@ ...@@ -74,9 +73,9 @@
#define const_gravity_eta 0.025f #define const_gravity_eta 0.025f
/* External gravity properties */ /* External gravity properties */
//#define EXTERNAL_POTENTIAL_POINTMASS #define EXTERNAL_POTENTIAL_POINTMASS
//#define EXTERNAL_POTENTIAL_ISOTHERMALPOTENTIAL //#define EXTERNAL_POTENTIAL_ISOTHERMALPOTENTIAL
#define EXTERNAL_POTENTIAL_DISK_PATCH //#define EXTERNAL_POTENTIAL_DISK_PATCH
/* Add viscuous force to gas particles to speed-up glass making for disk-patch /* Add viscuous force to gas particles to speed-up glass making for disk-patch
* ICs */ * ICs */
//#define EXTERNAL_POTENTIAL_DISK_PATCH_ICS //#define EXTERNAL_POTENTIAL_DISK_PATCH_ICS
......
...@@ -129,12 +129,13 @@ __attribute__((always_inline)) INLINE static void gravity_end_force( ...@@ -129,12 +129,13 @@ __attribute__((always_inline)) INLINE static void gravity_end_force(
* *
* This function only branches towards the potential chosen by the user. * This function only branches towards the potential chosen by the user.
* *
* @param time The current time in internal units.
* @param potential The properties of the external potential. * @param potential The properties of the external potential.
* @param phys_const The physical constants in internal units. * @param phys_const The physical constants in internal units.
* @param gp The particle to act upon. * @param gp The particle to act upon.
*/ */
__attribute__((always_inline)) INLINE static void external_gravity( __attribute__((always_inline)) INLINE static void external_gravity(
const double time, const struct external_potential* potential, double time, const struct external_potential* potential,
const struct phys_const* const phys_const, struct gpart* gp) { const struct phys_const* const phys_const, struct gpart* gp) {
#ifdef EXTERNAL_POTENTIAL_POINTMASS #ifdef EXTERNAL_POTENTIAL_POINTMASS
......
...@@ -29,12 +29,13 @@ ...@@ -29,12 +29,13 @@
* of units. * of units.
* *
* @param parameter_file The parsed parameter file * @param parameter_file The parsed parameter file
* @param phys_const Physical constants in internal units
* @param us The current internal system of units * @param us The current internal system of units
* @param potential The external potential properties to initialize * @param potential The external potential properties to initialize
*/ */
void potential_init(const struct swift_params* parameter_file, void potential_init(const struct swift_params* parameter_file,
const struct phys_const* const phys_const, const struct phys_const* phys_const,
struct UnitSystem* us, const struct UnitSystem* us,
struct external_potential* potential) { struct external_potential* potential) {
#ifdef EXTERNAL_POTENTIAL_POINTMASS #ifdef EXTERNAL_POTENTIAL_POINTMASS
......
...@@ -162,9 +162,6 @@ external_gravity_disk_patch_potential( ...@@ -162,9 +162,6 @@ external_gravity_disk_patch_potential(
G_newton; /* returned acceleraton is multiplied by G later on */ G_newton; /* returned acceleraton is multiplied by G later on */
if (dz < 0) g->a_grav[2] += z_accel / G_newton; if (dz < 0) g->a_grav[2] += z_accel / G_newton;
if (abs(g->id_or_neg_offset) == 1)
message(" time= %e, rf= %e, az= %e", time, reduction_factor, g->a_grav[2]);
#ifdef EXTERNAL_POTENTIAL_DISK_PATCH_ICS #ifdef EXTERNAL_POTENTIAL_DISK_PATCH_ICS
/* TT: add viscous drag */ /* TT: add viscous drag */
g->a_grav[0] -= g->v_full[0] / (2 * t_dyn) / G_newton; g->a_grav[0] -= g->v_full[0] / (2 * t_dyn) / G_newton;
...@@ -179,7 +176,8 @@ external_gravity_disk_patch_potential( ...@@ -179,7 +176,8 @@ external_gravity_disk_patch_potential(
#ifdef EXTERNAL_POTENTIAL_ISOTHERMALPOTENTIAL #ifdef EXTERNAL_POTENTIAL_ISOTHERMALPOTENTIAL
/** /**
* @brief Computes the time-step due to the acceleration from a point mass * @brief Computes the time-step due to the acceleration from an isothermal
* potential.
* *
* @param potential The #external_potential used in the run. * @param potential The #external_potential used in the run.
* @param phys_const The physical constants in internal units. * @param phys_const The physical constants in internal units.
...@@ -213,9 +211,7 @@ external_gravity_isothermalpotential_timestep( ...@@ -213,9 +211,7 @@ external_gravity_isothermalpotential_timestep(
} }
/** /**
* @brief Computes the gravitational acceleration of a particle due to a * @brief Computes the gravitational acceleration from an isothermal potential.
* point
* mass
* *
* Note that the accelerations are multiplied by Newton's G constant * Note that the accelerations are multiplied by Newton's G constant
* later on. * later on.
...@@ -315,8 +311,8 @@ __attribute__((always_inline)) INLINE static void external_gravity_pointmass( ...@@ -315,8 +311,8 @@ __attribute__((always_inline)) INLINE static void external_gravity_pointmass(
/* Now, some generic functions, defined in the source file */ /* Now, some generic functions, defined in the source file */
void potential_init(const struct swift_params* parameter_file, void potential_init(const struct swift_params* parameter_file,
const struct phys_const* const phys_const, const struct phys_const* phys_const,
struct UnitSystem* us, const struct UnitSystem* us,
struct external_potential* potential); struct external_potential* potential);
void potential_print(const struct external_potential* potential); void potential_print(const struct external_potential* potential);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment