Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experimental element - extra high thermal conductivity
- Loading branch information
Simon Robertshaw
committed
Aug 6, 2016
1 parent
9a855cc
commit 30c7c91
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#include "simulation/Elements.h" | ||
#include "simulation/Air.h" | ||
//#TPT-Directive ElementClass Element_COPR PT_COPR 180 | ||
Element_COPR::Element_COPR() | ||
{ | ||
Identifier = "DEFAULT_PT_COPR"; | ||
Name = "COPR"; | ||
Colour = PIXPACK(0xCB6351); | ||
MenuVisible = 1; | ||
MenuSection = SC_SOLIDS; | ||
Enabled = 1; | ||
|
||
Advection = 0.0f; | ||
AirDrag = 0.00f * CFDS; | ||
AirLoss = 0.90f; | ||
Loss = 0.00f; | ||
Collision = 0.0f; | ||
Gravity = 0.0f; | ||
Diffusion = 0.00f; | ||
HotAir = 0.000f * CFDS; | ||
Falldown = 0; | ||
|
||
Flammable = 0; | ||
Explosive = 0; | ||
Meltable = 1; | ||
Hardness = 50; | ||
|
||
Weight = 100; | ||
|
||
Temperature = R_TEMP+0.0f +273.15f; | ||
HeatConduct = 251; | ||
Description = "Copper"; | ||
|
||
Properties = TYPE_SOLID|PROP_CONDUCTS|PROP_HOT_GLOW|PROP_LIFE_DEC; | ||
|
||
LowPressure = IPL; | ||
LowPressureTransition = NT; | ||
HighPressure = IPH; | ||
HighPressureTransition = NT; | ||
LowTemperature = ITL; | ||
LowTemperatureTransition = NT; | ||
HighTemperature = 1356.15f; | ||
HighTemperatureTransition = PT_LAVA; | ||
|
||
Update = &Element_COPR::update; | ||
} | ||
|
||
//#TPT-Directive ElementHeader Element_COPR static int update(UPDATE_FUNC_ARGS) | ||
int Element_COPR::update(UPDATE_FUNC_ARGS) | ||
{ | ||
const int rad = 4; | ||
int rx, ry, rry, rrx, r, count = 0; | ||
float tempAgg = 0; | ||
for (rx=-1; rx<2; rx++) { | ||
for (ry=-1; ry<2; ry++) { | ||
rry = ry * rad; | ||
rrx = rx * rad; | ||
if (REAL_BOUNDS_CHECK(x+rrx, y+rry)) { | ||
r = pmap[y+rry][x+rrx]; | ||
if(r && (sim->elements[r&0xFF].HeatConduct > 0 || (r&0xFF) == PT_COPR)) { | ||
count++; | ||
tempAgg += parts[r>>8].temp; | ||
} | ||
} | ||
} | ||
} | ||
|
||
if(count > 0) { | ||
parts[i].temp = tempAgg/count; | ||
|
||
for (rx=-1; rx<2; rx++) { | ||
for (ry=-1; ry<2; ry++) { | ||
rry = ry * rad; | ||
rrx = rx * rad; | ||
if (REAL_BOUNDS_CHECK(x+rrx, y+rry)) { | ||
r = pmap[y+rry][x+rrx]; | ||
if(r && (sim->elements[r&0xFF].HeatConduct > 0 || (r&0xFF) == PT_COPR)) { | ||
parts[r>>8].temp = parts[i].temp; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
|
||
Element_COPR::~Element_COPR() {} |
30c7c91
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How experimental is this? I tested it and it definitely transfers heat faster than anything else, but that's about it.
Is this related at all to #315? That pull requests adds two elements which claim to very efficiently transfer heat. I have not tested it myself yet though. But it uses pressure and other methods to control when / how to transfer heat.
This element here probably can't transfer heat because it melts so low. Maybe it could have some other properties too though?
30c7c91
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I think your elements are probably a bit better. I just want to know what prompted Simon to add this, if it was just for quick heat conduction maybe we use yours instead.
30c7c91
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the behaviour but modelling it after copper definitely makes it limited. Doesn't have to be a new element either.
HSWC doesn't conduct any faster than other elements. RFRG/RFGL looks very useful but I just think we're missing something to use for heatsinks, heatpipes, etc.