summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-06-14 16:11:24 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-06-14 16:11:24 (GMT)
commit304a2fa8194421b95fc51c5fabd795a438fb0868 (patch)
tree006f26f6be9ac1f3282f2562c5ff2a746ff6e5cf /src
parent4fcaadd565d5d7391dd9aa741ac41760681b2bad (diff)
downloadpowder-304a2fa8194421b95fc51c5fabd795a438fb0868.zip
powder-304a2fa8194421b95fc51c5fabd795a438fb0868.tar.gz
Revert "Better heat treatment."
This reverts commit 37df2abe90731f2da814a4463f406b0afe9308f9.
Diffstat (limited to 'src')
-rw-r--r--src/powder.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/powder.c b/src/powder.c
index 7d55473..adb5cb7 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1629,7 +1629,7 @@ void update_particles_i(pixel *vid, int start, int inc)
//heat transfer code
h_count = 0;
- if (t&&(t!=PT_HSWC||parts[i].life==10)&&ptypes[t].hconduct)
+ if (t&&(t!=PT_HSWC||parts[i].life==10)&&ptypes[t].hconduct>(rand()%250))
{
if (aheat_enable)
{
@@ -1640,25 +1640,27 @@ void update_particles_i(pixel *vid, int start, int inc)
c_heat = 0.0f;
for (j=0; j<8; j++)
{
+ surround_hconduct[j] = i;
r = surround[j];
if ((r>>8)>=NPART || !r)
continue;
rt = r&0xFF;
- if ((parts[r>>8].temp < parts[i].temp)&&rt&&ptypes[rt].hconduct&&(rt!=PT_HSWC||parts[r>>8].life==10)
+ if (rt&&ptypes[rt].hconduct&&(rt!=PT_HSWC||parts[r>>8].life==10)
&&(t!=PT_FILT||(rt!=PT_BRAY&&rt!=PT_BIZR&&rt!=PT_BIZRG))
&&(rt!=PT_FILT||(t!=PT_BRAY&&t!=PT_PHOT&&t!=PT_BIZR&&t!=PT_BIZRG)))
{
- float dq, dt;
-
- dt = parts[i].temp - parts[r>>8].temp;
- dq = 0.347*ptypes[t].weight*dt; //It's constant for now
-
- parts[i].temp -= dq*ptypes[t].hconduct/(96.635*ptypes[t].weight);
- parts[r>>8].temp += dq*ptypes[rt].hconduct/(96.635*ptypes[rt].weight);
+ surround_hconduct[j] = r>>8;
+ c_heat += parts[r>>8].temp;
+ h_count++;
}
}
- pt = parts[i].temp;
+ pt = parts[i].temp = (c_heat+parts[i].temp)/(h_count+1);
+ for (j=0; j<8; j++)
+ {
+ parts[surround_hconduct[j]].temp = pt;
+ }
+
ctemph = ctempl = pt;
// change boiling point with pressure
if ((ptypes[t].state==ST_LIQUID && ptransitions[t].tht>-1 && ptransitions[t].tht<PT_NUM && ptypes[ptransitions[t].tht].state==ST_GAS)