Exemplo n.º 1
0
    private void Calculate()
    {
        // REFERENCJE OBIEKTÓW
        wind   = FindObjectOfType <MenuController.WindSpeedController>();
        ground = FindObjectOfType <MenuController.GroundAngleController>();

        // OBLICZENIE POBOCZNYCH WZORÓW
        wind.CalculateSecondaryVariables();


        Beta_op = 3.348f * Mathf.Pow(ground.surfaceToVolumeRatio, -0.8189f);
        ro_b    = (float)ground.W_o / ground.fuelDepth;
        //Beta = (float)ro_b / MenuController.GroundAngleController.ro_p;
        //Beta = 0.036f;
        Beta = 0.07f;
        Q_ig = 250f + 1116f * ground.M_f;
        W_n  = ground.W_o * (1f - MenuController.GroundAngleController.S_t);
        A    = 133 * Mathf.Pow(ground.surfaceToVolumeRatio, -0.7913f);//1f / ((4.774f * Mathf.Pow(ground.surfaceToVolumeRatio, 0.1f)) - 7.27f);
        e    = Mathf.Exp(-138f / ground.surfaceToVolumeRatio);


        // WZORY Z GŁÓWNEGO WZORU
        Epsilon   = Mathf.Pow((192f + 0.2595f * ground.surfaceToVolumeRatio), -1f) * Mathf.Exp((0.792f + 0.681f * Mathf.Pow(ground.surfaceToVolumeRatio, 0.5f)) * (Beta + 0.1f));
        delta_w   = wind.C * Mathf.Pow(wind.U, wind.B) * Mathf.Pow((Beta / Beta_op), -1f * wind.E);
        delta_s   = 5.275f * Mathf.Pow(Beta, -0.3f) * Mathf.Pow((Mathf.Tan(Mathf.Deg2Rad * ground.groundAngle)), 2f);
        Gamma_max = Mathf.Pow(ground.surfaceToVolumeRatio, 1.5f) * Mathf.Pow(495f + 0.0594f * Mathf.Pow(ground.surfaceToVolumeRatio, 1.5f), -1f);
        Gamma     = Gamma_max * Mathf.Pow((Beta / Beta_op), A) * Mathf.Exp(A * (1 - (Beta / Beta_op)));

        float rM = ground.M_f / MenuController.GroundAngleController.M_x;

        if (rM > 1.0f)
        {
            rM = 1.0f;
        }

        n_m = 1f - 2.59f * (rM) + 5.11f * Mathf.Pow((rM), 2) - 3.52f * Mathf.Pow((rM), 3);
        n_s = 0.174f * Mathf.Pow(MenuController.GroundAngleController.S_e, -0.19f);
        if (n_s > 1.0f)
        {
            n_s = 1.0f;
        }

        I_R = Gamma * W_n * MenuController.GroundAngleController.h * n_m * n_s;

        nominator   = I_R * Epsilon * (1f + delta_w + delta_s);
        denominator = ro_b * e * Q_ig;

        // FINAL RESULT
        R    = nominator / denominator;
        Rkmh = R * 0.0003048f * 60f;
        Rms  = R * 0.3048f / 60f;

        resultText.text  = "R = " + R;
        resultText.color = Color.Lerp(Color.white, Color.red, R / 2300f);

        resultKmHText.text  = "R = " + Rkmh;
        resultKmHText.color = Color.Lerp(Color.white, Color.red, R / 2300f);

        resultmsText.text  = "R = " + Rms;
        resultmsText.color = Color.Lerp(Color.white, Color.red, R / 2300f);
    }
Exemplo n.º 2
0
 void Start()
 {
     ground = FindObjectOfType <MenuController.GroundAngleController>();
     fire   = FindObjectOfType <Wildfire>();
 }