diff options
Diffstat (limited to 'src/simulation/Air.cpp')
| -rw-r--r-- | src/simulation/Air.cpp | 23 |
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. |
