/// <summary> /// Transfers heat between an Open tile and a Solid tile /// Uses data from MetaDataNode for SolidNode and GasMix values for Open node /// </summary> private void ConductFromOpenToSolid(MetaDataNode solidNode, GasMix meanGasMix) { var tempDelta = solidNode.ConductivityTemperature - meanGasMix.Temperature; if (Mathf.Abs(tempDelta) <= AtmosDefines.MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER) { return; } if (meanGasMix.WholeHeatCapacity <= AtmosConstants.MINIMUM_HEAT_CAPACITY) { return; } if (solidNode.HeatCapacity <= AtmosConstants.MINIMUM_HEAT_CAPACITY) { return; } //The larger the combined capacity the less is shared var heat = solidNode.ThermalConductivity * tempDelta * (solidNode.HeatCapacity * meanGasMix.WholeHeatCapacity / (solidNode.HeatCapacity + meanGasMix.WholeHeatCapacity)); solidNode.ConductivityTemperature = Mathf.Max( solidNode.ConductivityTemperature - (heat / solidNode.HeatCapacity), AtmosDefines.SPACE_TEMPERATURE); meanGasMix.SetTemperature(Mathf.Max( meanGasMix.Temperature + (heat / meanGasMix.WholeHeatCapacity), AtmosDefines.SPACE_TEMPERATURE)); //Do atmos update for the Solid node if temperature is allowed so it can do conduction //This is checking for the start temperature as this is how the cycle will begin if (solidNode.ConductivityTemperature < AtmosDefines.MINIMUM_TEMPERATURE_START_SUPERCONDUCTION) { return; } if (solidNode.AllowedToSuperConduct == false) { solidNode.AllowedToSuperConduct = true; //Allow this node to trigger other tiles super conduction solidNode.StartingSuperConduct = true; } AtmosManager.Update(solidNode); }
/// <summary> /// Used to transfer heat between an Solid tile and Solid tile /// Uses data from MetaDataNode for the current solid node and MetaDataNode date for the other Solid node /// </summary> private void ConductFromSolidToSolid(MetaDataNode currentNode, MetaDataNode solidNode, float tempDelta) { if (Mathf.Abs(tempDelta) <= AtmosDefines.MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER) { return; } //The larger the combined capacity the less is shared var heat = solidNode.ThermalConductivity * tempDelta * (currentNode.HeatCapacity * solidNode.HeatCapacity / (currentNode.HeatCapacity + solidNode.HeatCapacity)); //The higher your own heat cap the less heat you get from this arrangement currentNode.ConductivityTemperature -= heat / currentNode.HeatCapacity; solidNode.ConductivityTemperature += heat / solidNode.HeatCapacity; //Do atmos update for the next solid node if temperature is allowed so it can do conduction if (solidNode.ConductivityTemperature < AtmosDefines.MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION) { return; } solidNode.AllowedToSuperConduct = true; AtmosManager.Update(solidNode); }