summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2022-11-27 00:28:12 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2022-11-27 00:28:12 +1300
commit08943d554ebbf75256ef737d3192289a1a7dc271 (patch)
tree5b88f42b8f4a87504a587249633b999885b8e23d
parent5dc8da7d15147a67f2fd1e27fff894bf885be3fc (diff)
Acceleration calculation for walls is now ignoredHEADmaster
-rw-r--r--src/fluid_simulator.adb28
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;