From 08943d554ebbf75256ef737d3192289a1a7dc271 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Sun, 27 Nov 2022 00:28:12 +1300 Subject: Acceleration calculation for walls is now ignored --- src/fluid_simulator.adb | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/fluid_simulator.adb') 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; -- cgit