From 98b47016473640a20abbc21177e70d83378b36b1 Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Sun, 22 Jul 2007 02:48:53 +0000
Subject: * Aerobic erosion now uses Navier Stokes algorithms for wind
calculations.
---
.../Channel/Manipulators/AerobicErosion.cs | 29 +++++++++++++++++-----
.../Channel/Manipulators/NavierStokes.cs | 6 ++---
2 files changed, 26 insertions(+), 9 deletions(-)
(limited to 'OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators')
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs
index 870b9b2..97c2762 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs
@@ -74,7 +74,7 @@ namespace libTerrain
/// The percentage of rock which can be picked up to pickup 0..1
/// The number of erosion rounds (recommended: 25+)
/// Drop sediment at the lowest point?
- public void AerobicErosion(double windspeed, double pickup_talus_minimum, double drop_talus_minimum, double carry, int rounds, bool lowest)
+ public void AerobicErosion(double windspeed, double pickup_talus_minimum, double drop_talus_minimum, double carry, int rounds, bool lowest, bool usingFluidDynamics)
{
Channel wind = new Channel(w, h) ;
Channel sediment = new Channel(w, h);
@@ -83,7 +83,15 @@ namespace libTerrain
wind = this.copy();
wind.normalise(); // Cheap wind calculations
wind *= windspeed;
- wind.pertubation(30); // Can do better later
+
+ if (usingFluidDynamics)
+ {
+ wind.navierStokes(20, 0.1, 0.0, 0.0);
+ }
+ else
+ {
+ wind.pertubation(30); // Can do better later
+ }
for (i = 0; i < rounds; i++)
{
@@ -115,10 +123,19 @@ namespace libTerrain
}
}
}
- sediment.pertubation(10); // Sediment is blown around a bit
- sediment.seed++;
- wind.pertubation(15); // So is the wind
- wind.seed++;
+
+ if (usingFluidDynamics)
+ {
+ sediment.navierStokes(7, 0.1, 0.0, 0.1);
+ wind.navierStokes(10, 0.1, 0.0, 0.0);
+ }
+ else
+ {
+ wind.pertubation(15); // Can do better later
+ wind.seed++;
+ sediment.pertubation(10); // Sediment is blown around a bit
+ sediment.seed++;
+ }
// Convert some sand to rock
for (x = 1; x < w - 1; x++)
diff --git a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs
index f01b2860..43987d4 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs
@@ -248,9 +248,9 @@ namespace libTerrain
/// Performs computational fluid dynamics on a channel
///
/// The number of steps to perform (Recommended: 20)
- /// Delta Time - The time between steps
- /// Fluid diffusion rate
- /// Fluid viscosity
+ /// Delta Time - The time between steps (Recommended: 0.1)
+ /// Fluid diffusion rate (Recommended: 0.0)
+ /// Fluid viscosity (Recommended: 0.0)
public void navierStokes(int rounds, double dt, double diff, double visc)
{
nsSimulate(this.h, rounds, dt, diff, visc);
--
cgit v1.1