diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2022-11-27 00:28:12 +1300 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2022-11-27 00:28:12 +1300 |
commit | 08943d554ebbf75256ef737d3192289a1a7dc271 (patch) | |
tree | 5b88f42b8f4a87504a587249633b999885b8e23d /src/fluid_simulator.adb | |
parent | 5dc8da7d15147a67f2fd1e27fff894bf885be3fc (diff) |
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; |