示例#1
0
        public void MakeAir()
        {
            MakeEmpty();

            atmosContainer.AddGas(AtmosGasses.Oxygen, 20.79f);
            atmosContainer.AddGas(AtmosGasses.Nitrogen, 83.17f);
            atmosContainer.SetTemperature(293f);;
        }
示例#2
0
文件: PipeObject.cs 项目: soyboi/SS3D
        public void SimulateFlux()
        {
            if (state == AtmosStates.Active)
            {
                float pressure = GetPressure();

                for (int i = 0; i < Gas.numOfGases; i++)
                {
                    if (atmosContainer.GetGasses()[i] > 0f)
                    {
                        int k = 0;
                        foreach (PipeObject pipe in atmosNeighbours)
                        {
                            if (tileFlux[k] > 0f)
                            {
                                float factor = atmosContainer.GetGasses()[i] * (tileFlux[k] / pressure);
                                if (pipe.state != AtmosStates.Vacuum)
                                {
                                    pipe.atmosContainer.AddGas(i, factor);
                                    pipe.state = AtmosStates.Active;
                                }
                                else
                                {
                                    activeDirection[k] = false;
                                }
                                atmosContainer.RemoveGas(i, factor);
                            }
                            k++;
                        }
                    }
                }

                float difference;
                int   j = 0;
                foreach (PipeObject pipe in atmosNeighbours)
                {
                    if (activeDirection[j] == true)
                    {
                        difference = (atmosContainer.GetTemperature() - pipe.atmosContainer.GetTemperature()) * Gas.thermalBase * atmosContainer.Volume;

                        if (difference > Gas.thermalEpsilon)
                        {
                            pipe.atmosContainer.SetTemperature(pipe.atmosContainer.GetTemperature() + difference);
                            atmosContainer.SetTemperature(atmosContainer.GetTemperature() - difference);
                            tempSetting = true;
                        }
                    }
                    j++;
                }
            }
            else if (state == AtmosStates.Semiactive)
            {
                SimulateMixing();
            }
        }