summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-07-01 10:32:10 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-07-01 10:32:10 (GMT)
commit25a2b52b64a3cbe52f4d9d1b2f39360a29b92c62 (patch)
treefc6a05e396b73e196c9826401bcfd9ea59d8a4d0 /src
parent00ed0f559abd509812c38dde0eb7b265f806e894 (diff)
downloadpowder-25a2b52b64a3cbe52f4d9d1b2f39360a29b92c62.zip
powder-25a2b52b64a3cbe52f4d9d1b2f39360a29b92c62.tar.gz
Savask experimental heat transfer
Diffstat (limited to 'src')
-rw-r--r--src/powder.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/powder.c b/src/powder.c
index 5b81890..3acad8e 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1684,8 +1684,15 @@ void update_particles_i(pixel *vid, int start, int inc)
//heat transfer code
h_count = 0;
+#ifdef REALHEAT
+ if (t&&(t!=PT_HSWC||parts[i].life==10))
+ {
+ float c_Cm = 0.0f;
+#else
if (t&&(t!=PT_HSWC||parts[i].life==10)&&ptypes[t].hconduct>(rand()%250))
{
+ float c_Cm = 0.0f;
+#endif
if (aheat_enable)
{
c_heat = (hv[y/CELL][x/CELL]-parts[i].temp)*0.04;
@@ -1705,12 +1712,24 @@ void update_particles_i(pixel *vid, int start, int inc)
&&(rt!=PT_FILT||(t!=PT_BRAY&&t!=PT_PHOT&&t!=PT_BIZR&&t!=PT_BIZRG)))
{
surround_hconduct[j] = r>>8;
+#ifdef REALHEAT
+ c_heat += parts[r>>8].temp*96.645/ptypes[rt].hconduct*fabs(ptypes[rt].weight);
+ c_Cm += 96.645/ptypes[rt].hconduct*fabs(ptypes[rt].weight);
+#else
c_heat += parts[r>>8].temp;
+#endif
h_count++;
}
}
-
+#ifdef REALHEAT
+ if (t == PT_PHOT)
+ pt = (c_heat+parts[i].temp*96.645)/(c_Cm+96.645);
+ else
+ pt = (c_heat+parts[i].temp*96.645/ptypes[t].hconduct*fabs(ptypes[t].weight))/(c_Cm+96.645/ptypes[t].hconduct*fabs(ptypes[t].weight));
+
+#else
pt = parts[i].temp = (c_heat+parts[i].temp)/(h_count+1);
+#endif
for (j=0; j<8; j++)
{
parts[surround_hconduct[j]].temp = pt;