Changing units of stiffness parameter in classical (new) SPH solver: used to be speed of sound squared; now just speed of sound.

The classical SPH solver was not in 2.65, so this change is unlikely to affect many users. But beta users who have been trying it out will need to change the stiffness parameter to sqrt(old value).
This commit is contained in:
Alex Fraser
2013-01-11 03:06:10 +00:00
parent 61833ddd5a
commit 17c428d4df
2 changed files with 4 additions and 3 deletions

View File

@@ -2697,7 +2697,8 @@ static void sphclassical_force_cb(void *sphdata_v, ParticleKey *state, float *fo
/* 4.77 is an experimentally determined density factor */
float rest_density = fluid->rest_density * (fluid->flag & SPH_FAC_DENSITY ? 4.77f : 1.0f);
float stiffness = fluid->stiffness_k;
// Use speed of sound squared
float stiffness = pow2(fluid->stiffness_k);
ParticleData *npa;
float vec[3];

View File

@@ -1545,9 +1545,9 @@ static void rna_def_fluid_settings(BlenderRNA *brna)
/* Double density relaxation */
prop = RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "stiffness_k");
RNA_def_property_range(prop, 0.0f, 100000.0f);
RNA_def_property_range(prop, 0.0f, 1000.0f);
RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
RNA_def_property_ui_text(prop, "Stiffness", "How incompressible the fluid is");
RNA_def_property_ui_text(prop, "Stiffness", "How incompressible the fluid is (speed of sound)");
RNA_def_property_update(prop, 0, "rna_Particle_reset");
prop = RNA_def_property(srna, "repulsion", PROP_FLOAT, PROP_NONE);