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

Propagated changes to the other SPH schemes.

parent 1a851b57
Branches
Tags
1 merge request!160Sph properties
......@@ -27,10 +27,14 @@
*
*/
__attribute__((always_inline)) INLINE static float hydro_compute_timestep(
struct part* p, struct xpart* xp) {
struct part* p, struct xpart* xp,
const struct hydro_props* hydro_properties) {
const float CFL_condition = hydro_properties->CFL_condition;
/* CFL condition */
const float dt_cfl = 2.f * const_cfl * kernel_gamma * p->h / p->force.v_sig;
const float dt_cfl =
2.f * kernel_gamma * CFL_condition * p->h / p->force.v_sig;
/* Limit change in u */
const float dt_u_change =
......
......@@ -104,10 +104,10 @@ void writeSPHflavour(hid_t h_grpsph) {
/* Kernel function description */
writeAttribute_s(h_grpsph, "Kernel", kernel_name);
writeAttribute_f(h_grpsph, "Kernel eta", const_eta_kernel);
writeAttribute_f(h_grpsph, "Weighted N_ngb", kernel_nwneigh);
writeAttribute_f(h_grpsph, "Delta N_ngb", const_delta_nwneigh);
writeAttribute_f(h_grpsph, "Hydro gamma", const_hydro_gamma);
// writeAttribute_f(h_grpsph, "Kernel eta", const_eta_kernel);
// writeAttribute_f(h_grpsph, "Weighted N_ngb", kernel_nwneigh);
// writeAttribute_f(h_grpsph, "Delta N_ngb", const_delta_nwneigh);
// writeAttribute_f(h_grpsph, "Hydro gamma", const_hydro_gamma);
/* Viscosity and thermal conduction */
writeAttribute_s(h_grpsph, "Thermal Conductivity Model",
......@@ -123,11 +123,11 @@ void writeSPHflavour(hid_t h_grpsph) {
writeAttribute_f(h_grpsph, "Viscosity decay length", const_viscosity_length);
/* Time integration properties */
writeAttribute_f(h_grpsph, "CFL parameter", const_cfl);
writeAttribute_f(h_grpsph, "Maximal ln(Delta h) change over dt",
const_ln_max_h_change);
writeAttribute_f(h_grpsph, "Maximal Delta h change over dt",
exp(const_ln_max_h_change));
// writeAttribute_f(h_grpsph, "CFL parameter", const_cfl);
// writeAttribute_f(h_grpsph, "Maximal ln(Delta h) change over dt",
// const_ln_max_h_change);
// writeAttribute_f(h_grpsph, "Maximal Delta h change over dt",
// exp(const_ln_max_h_change));
writeAttribute_f(h_grpsph, "Maximal Delta u change over dt",
const_max_u_change);
}
......@@ -23,14 +23,15 @@ __attribute__((always_inline))
"x=[%.3e,%.3e,%.3e], "
"v=[%.3e,%.3e,%.3e],v_full=[%.3e,%.3e,%.3e] \n a=[%.3e,%.3e,%.3e],\n "
"h=%.3e, "
"wcount=%d, wcount_dh=%.3e, m=%.3e, dh_drho=%.3e, rho=%.3e, P=%.3e, S=%.3e, "
"wcount=%d, wcount_dh=%.3e, m=%.3e, dh_drho=%.3e, rho=%.3e, P=%.3e, "
"S=%.3e, "
"dS/dt=%.3e, c=%.3e\n"
"divV=%.3e, curlV=%.3e, rotV=[%.3e,%.3e,%.3e] \n "
"v_sig=%e dh/dt=%.3e t_begin=%d, t_end=%d\n",
p->x[0], p->x[1], p->x[2], p->v[0], p->v[1], p->v[2], xp->v_full[0],
xp->v_full[1], xp->v_full[2], p->a_hydro[0], p->a_hydro[1], p->a_hydro[2],
p->h, (int)p->density.wcount, p->density.wcount_dh, p->mass, p->rho_dh, p->rho,
p->force.pressure, p->entropy, p->entropy_dt, p->force.soundspeed,
p->h, (int)p->density.wcount, p->density.wcount_dh, p->mass, p->rho_dh,
p->rho, p->force.pressure, p->entropy, p->entropy_dt, p->force.soundspeed,
p->div_v, p->force.curl_v, p->density.rot_v[0], p->density.rot_v[1],
p->density.rot_v[2], p->force.v_sig, p->h_dt, p->ti_begin, p->ti_end);
}
......@@ -104,10 +104,10 @@ void writeSPHflavour(hid_t h_grpsph) {
/* Kernel function description */
writeAttribute_s(h_grpsph, "Kernel", kernel_name);
//writeAttribute_f(h_grpsph, "Kernel eta", const_eta_kernel);
//writeAttribute_f(h_grpsph, "Weighted N_ngb", kernel_nwneigh);
//writeAttribute_f(h_grpsph, "Delta N_ngb", const_delta_nwneigh);
//writeAttribute_f(h_grpsph, "Hydro gamma", const_hydro_gamma);
// writeAttribute_f(h_grpsph, "Kernel eta", const_eta_kernel);
// writeAttribute_f(h_grpsph, "Weighted N_ngb", kernel_nwneigh);
// writeAttribute_f(h_grpsph, "Delta N_ngb", const_delta_nwneigh);
// writeAttribute_f(h_grpsph, "Hydro gamma", const_hydro_gamma);
/* Viscosity and thermal conduction */
writeAttribute_s(h_grpsph, "Thermal Conductivity Model",
......@@ -118,9 +118,9 @@ void writeSPHflavour(hid_t h_grpsph) {
writeAttribute_f(h_grpsph, "Viscosity beta", 3.f);
/* Time integration properties */
//writeAttribute_f(h_grpsph, "CFL parameter", const_cfl);
//writeAttribute_f(h_grpsph, "Maximal ln(Delta h) change over dt",
// writeAttribute_f(h_grpsph, "CFL parameter", const_cfl);
// writeAttribute_f(h_grpsph, "Maximal ln(Delta h) change over dt",
// const_ln_max_h_change);
//writeAttribute_f(h_grpsph, "Maximal Delta h change over dt",
// writeAttribute_f(h_grpsph, "Maximal Delta h change over dt",
// exp(const_ln_max_h_change));
}
......@@ -27,13 +27,18 @@
*
* @param p Pointer to the particle data
* @param xp Pointer to the extended particle data
* @param hydro_properties The SPH parameters
*
*/
__attribute__((always_inline)) INLINE static float hydro_compute_timestep(
struct part* p, struct xpart* xp) {
struct part* p, struct xpart* xp,
const struct hydro_props* hydro_properties) {
const float CFL_condition = hydro_properties->CFL_condition;
/* CFL condition */
const float dt_cfl = 2.f * const_cfl * kernel_gamma * p->h / p->force.v_sig;
const float dt_cfl =
2.f * kernel_gamma * CFL_condition * p->h / p->force.v_sig;
return dt_cfl;
}
......
......@@ -104,9 +104,9 @@ void writeSPHflavour(hid_t h_grpsph) {
/* Kernel function description */
writeAttribute_s(h_grpsph, "Kernel", kernel_name);
writeAttribute_f(h_grpsph, "Kernel eta", const_eta_kernel);
writeAttribute_f(h_grpsph, "Weighted N_ngb", kernel_nwneigh);
writeAttribute_f(h_grpsph, "Delta N_ngb", const_delta_nwneigh);
// writeAttribute_f(h_grpsph, "Kernel eta", const_eta_kernel);
// writeAttribute_f(h_grpsph, "Weighted N_ngb", kernel_nwneigh);
// writeAttribute_f(h_grpsph, "Delta N_ngb", const_delta_nwneigh);
writeAttribute_f(h_grpsph, "Hydro gamma", const_hydro_gamma);
/* Viscosity and thermal conduction */
......@@ -115,11 +115,11 @@ void writeSPHflavour(hid_t h_grpsph) {
writeAttribute_s(h_grpsph, "Viscosity Model", "No model");
/* Time integration properties */
writeAttribute_f(h_grpsph, "CFL parameter", const_cfl);
writeAttribute_f(h_grpsph, "Maximal ln(Delta h) change over dt",
const_ln_max_h_change);
writeAttribute_f(h_grpsph, "Maximal Delta h change over dt",
exp(const_ln_max_h_change));
// writeAttribute_f(h_grpsph, "CFL parameter", const_cfl);
// writeAttribute_f(h_grpsph, "Maximal ln(Delta h) change over dt",
// const_ln_max_h_change);
// writeAttribute_f(h_grpsph, "Maximal Delta h change over dt",
// exp(const_ln_max_h_change));
writeAttribute_f(h_grpsph, "Maximal Delta u change over dt",
const_max_u_change);
}
......@@ -21,6 +21,7 @@
#include "hydro_properties.h"
/* Standard headers */
#include <float.h>
#include <math.h>
/* Local headers. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment