aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorAdam Frisby2007-07-22 02:48:53 +0000
committerAdam Frisby2007-07-22 02:48:53 +0000
commit98b47016473640a20abbc21177e70d83378b36b1 (patch)
treefdda0bad481c7be7b27e213fe07d06e081e4ee16 /OpenSim
parent* Added Navier Stokes computational fluid dynamics algorithms to libTerrain.C... (diff)
downloadopensim-SC_OLD-98b47016473640a20abbc21177e70d83378b36b1.zip
opensim-SC_OLD-98b47016473640a20abbc21177e70d83378b36b1.tar.gz
opensim-SC_OLD-98b47016473640a20abbc21177e70d83378b36b1.tar.bz2
opensim-SC_OLD-98b47016473640a20abbc21177e70d83378b36b1.tar.xz
* Aerobic erosion now uses Navier Stokes algorithms for wind calculations.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs2
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/AerobicErosion.cs29
-rw-r--r--OpenSim/Region/Terrain.BasicTerrain/libTerrainBSD/Channel/Manipulators/NavierStokes.cs6
3 files changed, 27 insertions, 10 deletions
diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
index 5ef2963..2e40531 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
@@ -409,7 +409,7 @@ namespace OpenSim.Region.Terrain
409 { 409 {
410 case "aerobic": 410 case "aerobic":
411 // WindSpeed, PickupMinimum,DropMinimum,Carry,Rounds,Lowest 411 // WindSpeed, PickupMinimum,DropMinimum,Carry,Rounds,Lowest
412 heightmap.AerobicErosion(Convert.ToDouble(args[2]), Convert.ToDouble(args[3]), Convert.ToDouble(args[4]), Convert.ToDouble(args[5]), Convert.ToInt32(args[6]), Convert.ToBoolean(args[7])); 412 heightmap.AerobicErosion(Convert.ToDouble(args[2]), Convert.ToDouble(args[3]), Convert.ToDouble(args[4]), Convert.ToDouble(args[5]), Convert.ToInt32(args[6]), Convert.ToBoolean(args[7]), true);
413 break; 413 break;
414 case "thermal": 414 case "thermal":
415 heightmap.thermalWeathering(Convert.ToDouble(args[2]), Convert.ToInt32(args[3]), Convert.ToDouble(args[4])); 415 heightmap.thermalWeathering(Convert.ToDouble(args[2]), Convert.ToInt32(args[3]), Convert.ToDouble(args[4]));
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
74 /// <param name="carry">The percentage of rock which can be picked up to pickup 0..1</param> 74 /// <param name="carry">The percentage of rock which can be picked up to pickup 0..1</param>
75 /// <param name="rounds">The number of erosion rounds (recommended: 25+)</param> 75 /// <param name="rounds">The number of erosion rounds (recommended: 25+)</param>
76 /// <param name="lowest">Drop sediment at the lowest point?</param> 76 /// <param name="lowest">Drop sediment at the lowest point?</param>
77 public void AerobicErosion(double windspeed, double pickup_talus_minimum, double drop_talus_minimum, double carry, int rounds, bool lowest) 77 public void AerobicErosion(double windspeed, double pickup_talus_minimum, double drop_talus_minimum, double carry, int rounds, bool lowest, bool usingFluidDynamics)
78 { 78 {
79 Channel wind = new Channel(w, h) ; 79 Channel wind = new Channel(w, h) ;
80 Channel sediment = new Channel(w, h); 80 Channel sediment = new Channel(w, h);
@@ -83,7 +83,15 @@ namespace libTerrain
83 wind = this.copy(); 83 wind = this.copy();
84 wind.normalise(); // Cheap wind calculations 84 wind.normalise(); // Cheap wind calculations
85 wind *= windspeed; 85 wind *= windspeed;
86 wind.pertubation(30); // Can do better later 86
87 if (usingFluidDynamics)
88 {
89 wind.navierStokes(20, 0.1, 0.0, 0.0);
90 }
91 else
92 {
93 wind.pertubation(30); // Can do better later
94 }
87 95
88 for (i = 0; i < rounds; i++) 96 for (i = 0; i < rounds; i++)
89 { 97 {
@@ -115,10 +123,19 @@ namespace libTerrain
115 } 123 }
116 } 124 }
117 } 125 }
118 sediment.pertubation(10); // Sediment is blown around a bit 126
119 sediment.seed++; 127 if (usingFluidDynamics)
120 wind.pertubation(15); // So is the wind 128 {
121 wind.seed++; 129 sediment.navierStokes(7, 0.1, 0.0, 0.1);
130 wind.navierStokes(10, 0.1, 0.0, 0.0);
131 }
132 else
133 {
134 wind.pertubation(15); // Can do better later
135 wind.seed++;
136 sediment.pertubation(10); // Sediment is blown around a bit
137 sediment.seed++;
138 }
122 139
123 // Convert some sand to rock 140 // Convert some sand to rock
124 for (x = 1; x < w - 1; x++) 141 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
248 /// Performs computational fluid dynamics on a channel 248 /// Performs computational fluid dynamics on a channel
249 /// </summary> 249 /// </summary>
250 /// <param name="rounds">The number of steps to perform (Recommended: 20)</param> 250 /// <param name="rounds">The number of steps to perform (Recommended: 20)</param>
251 /// <param name="dt">Delta Time - The time between steps</param> 251 /// <param name="dt">Delta Time - The time between steps (Recommended: 0.1)</param>
252 /// <param name="diff">Fluid diffusion rate</param> 252 /// <param name="diff">Fluid diffusion rate (Recommended: 0.0)</param>
253 /// <param name="visc">Fluid viscosity</param> 253 /// <param name="visc">Fluid viscosity (Recommended: 0.0)</param>
254 public void navierStokes(int rounds, double dt, double diff, double visc) 254 public void navierStokes(int rounds, double dt, double diff, double visc)
255 { 255 {
256 nsSimulate(this.h, rounds, dt, diff, visc); 256 nsSimulate(this.h, rounds, dt, diff, visc);