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:
@@ -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];
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user