summaryrefslogtreecommitdiff
path: root/src/simulation/Air.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-05-31 02:28:42 (GMT)
committer jacob1 <jfu614@gmail.com>2013-05-31 02:28:42 (GMT)
commit80380bbaa39735e08d42f599bcb3968b5a1a1cd4 (patch)
tree2e77e5cc2e4487eccb3e84c56b42234b38307d19 /src/simulation/Air.cpp
parent79e5b56c36e3b052d4eea76bb044e32837d0eff7 (diff)
downloadpowder-80380bbaa39735e08d42f599bcb3968b5a1a1cd4.zip
powder-80380bbaa39735e08d42f599bcb3968b5a1a1cd4.tar.gz
even more lua simulation api functions
Diffstat (limited to 'src/simulation/Air.cpp')
-rw-r--r--src/simulation/Air.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/simulation/Air.cpp b/src/simulation/Air.cpp
index b992388..59a5a9e 100644
--- a/src/simulation/Air.cpp
+++ b/src/simulation/Air.cpp
@@ -48,7 +48,7 @@ void Air::Clear()
void Air::ClearAirH()
{
- std::fill(&hv[0][0], &hv[0][0]+((XRES/CELL)*(YRES/CELL)), 273.15f + 22.0f);
+ std::fill(&hv[0][0], &hv[0][0]+((XRES/CELL)*(YRES/CELL)), ambientAirTemp);
}
void Air::update_airh(void)
@@ -57,19 +57,19 @@ void Air::update_airh(void)
float odh, dh, dx, dy, f, tx, ty;
for (i=0; i<YRES/CELL; i++) //reduces pressure/velocity on the edges every frame
{
- hv[i][0] = 295.15f;
- hv[i][1] = 295.15f;
- hv[i][XRES/CELL-3] = 295.15f;
- hv[i][XRES/CELL-2] = 295.15f;
- hv[i][XRES/CELL-1] = 295.15f;
+ hv[i][0] = ambientAirTemp;
+ hv[i][1] = ambientAirTemp;
+ hv[i][XRES/CELL-3] = ambientAirTemp;
+ hv[i][XRES/CELL-2] = ambientAirTemp;
+ hv[i][XRES/CELL-1] = ambientAirTemp;
}
for (i=0; i<XRES/CELL; i++) //reduces pressure/velocity on the edges every frame
{
- hv[0][i] = 295.15f;
- hv[1][i] = 295.15f;
- hv[YRES/CELL-3][i] = 295.15f;
- hv[YRES/CELL-2][i] = 295.15f;
- hv[YRES/CELL-1][i] = 295.15f;
+ hv[0][i] = ambientAirTemp;
+ hv[1][i] = ambientAirTemp;
+ hv[YRES/CELL-3][i] = ambientAirTemp;
+ hv[YRES/CELL-2][i] = ambientAirTemp;
+ hv[YRES/CELL-1][i] = ambientAirTemp;
}
for (y=0; y<YRES/CELL; y++) //update velocity and pressure
{
@@ -316,6 +316,7 @@ void Air::Invert()
Air::Air(Simulation & simulation):
airMode(0),
+ ambientAirTemp(295.15f),
sim(simulation)
{
//Simulation should do this.