diff options
Diffstat (limited to 'src/fluid_simulator.adb')
-rw-r--r-- | src/fluid_simulator.adb | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/fluid_simulator.adb b/src/fluid_simulator.adb index 4f33a2f..e9e86b9 100644 --- a/src/fluid_simulator.adb +++ b/src/fluid_simulator.adb @@ -87,19 +87,21 @@ procedure Fluid_Simulator is Rij : Quantity; begin for P of Store loop - P.Acceleration := Gravity_Factor; - for Q of Store loop - Displacement := P.Place - Q.Place; - Rij := Plane.Modulus (Displacement); - if Rij < Particle_Radius then - Pressure := (P.Density + Q.Density - 2.0 * P0) * - Pressure_Factor * Displacement; - Viscosity := (P.Velocity - Q.Velocity) * Viscosity_Factor; - P.Acceleration := P.Acceleration + - Plane.Compose_From_Cartesian (1.0 - Rij / Particle_Radius) / - P.Density * (Pressure - Viscosity); - end if; - end loop; + if not P.Solid then + P.Acceleration := Gravity_Factor; + for Q of Store loop + Displacement := P.Place - Q.Place; + Rij := Plane.Modulus (Displacement); + if Rij < Particle_Radius then + Pressure := (P.Density + Q.Density - 2.0 * P0) * + Pressure_Factor * Displacement; + Viscosity := (P.Velocity - Q.Velocity) * Viscosity_Factor; + P.Acceleration := P.Acceleration + + Plane.Compose_From_Cartesian (1.0 - Rij / Particle_Radius) / + P.Density * (Pressure - Viscosity); + end if; + end loop; + end if; end loop; end Calculate_Interaction; |