Adds a max temperature to fusion (#47073)

This commit is contained in:
skoglol
2019-10-16 22:06:59 +02:00
committed by 81Denton
parent 08c79fddf3
commit c214712880
2 changed files with 4 additions and 1 deletions

View File

@@ -48,3 +48,4 @@
#define FUSION_RAD_MAX 2000
#define FUSION_RAD_COEFFICIENT (-1000)
#define FUSION_INSTABILITY_ENDOTHERMALITY 2
#define FUSION_MAXIMUM_TEMPERATURE 1e8

View File

@@ -302,7 +302,9 @@
reaction_energy += delta_plasma*PLASMA_BINDING_ENERGY //Energy is gained or lost corresponding to the creation or destruction of mass.
if(instability < FUSION_INSTABILITY_ENDOTHERMALITY)
reaction_energy = max(reaction_energy,0) //Stable reactions don't end up endothermic.
reaction_energy = max(reaction_energy,0) //Stable reactions don't end up exothermic.
else if(air.temperature > FUSION_MAXIMUM_TEMPERATURE && reaction_energy > 0) //Makes the reaction neutral if above max temp.
reaction_energy = 0
else if (reaction_energy < 0)
reaction_energy *= (instability-FUSION_INSTABILITY_ENDOTHERMALITY)**0.5