summaryrefslogtreecommitdiff
path: root/src/simulation/Simulation.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-18 14:14:40 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-18 14:14:40 (GMT)
commit6f3954b9263050a8f4fe0e778b214a6d117f85a9 (patch)
tree3f435a3b19aafbdf2f67bb6ff8c9c4e4ab20d78e /src/simulation/Simulation.cpp
parentadd4ccb0343901dad732ee084359134e20a29810 (diff)
downloadpowder-6f3954b9263050a8f4fe0e778b214a6d117f85a9.zip
powder-6f3954b9263050a8f4fe0e778b214a6d117f85a9.tar.gz
TPT: (REALISTIC) Better air<->body heat conduction. Air density now influences on it (things don't heat vacuum). 71acd578b6
Diffstat (limited to 'src/simulation/Simulation.cpp')
-rw-r--r--src/simulation/Simulation.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index d466dc4..d85866a 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -2618,16 +2618,24 @@ void Simulation::update_particles_i(int start, int inc)
#endif
if (aheat_enable)
{
+#ifdef REALISTIC
+ c_heat = parts[i].temp*96.645/ptypes[t].hconduct*fabs(ptypes[t].weight) + hv[y/CELL][x/CELL]*100*(pv[y/CELL][x/CELL]+273.15f)/256;
+ c_Cm = 96.645/ptypes[t].hconduct*fabs(ptypes[t].weight) + 100*(pv[y/CELL][x/CELL]+273.15f)/256;
+ pt = c_heat/c_Cm;
+ pt = restrict_flt(pt, -MAX_TEMP+MIN_TEMP, MAX_TEMP-MIN_TEMP);
+ parts[i].temp = pt;
+ //Pressure increase from heat (temporary)
+ pv[y/CELL][x/CELL] += (pt-hv[y/CELL][x/CELL])*0.004;
+ hv[y/CELL][x/CELL] = pt;
+#else
c_heat = (hv[y/CELL][x/CELL]-parts[i].temp)*0.04;
c_heat = restrict_flt(c_heat, -MAX_TEMP+MIN_TEMP, MAX_TEMP-MIN_TEMP);
parts[i].temp += c_heat;
hv[y/CELL][x/CELL] -= c_heat;
-#ifdef REALISTIC
- //Volume increase from heat (temporary)
- pv[y/CELL][x/CELL] -= c_heat*0.004;
#endif
}
c_heat = 0.0f;
+ c_Cm = 0.0f;
for (j=0; j<8; j++)
{
surround_hconduct[j] = i;