]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/UIUCModel/uiuc_ice.cpp
Fix for bug 1304 - crash loading XML route
[flightgear.git] / src / FDM / UIUCModel / uiuc_ice.cpp
index ec3cfeec5af2eb2adb97c7db92ed094c73e141f3..148ff35ba84cea0fe5d5cd6ba4972a5f6d47d127 100644 (file)
@@ -18,6 +18,8 @@
 ----------------------------------------------------------------------
 
  HISTORY:      02/22/2000   initial release
+               04/25/2000   (JS) added uiuc_ice_eta function
+                            (removed from uiuc_coefficients)
 
 ----------------------------------------------------------------------
 
 
  VARIABLES:
 
-------------------------------------------------string ----------------------
+----------------------------------------------------------------------
+
+ INPUTS:       uiuc_ice_eta:
+               -Simtime
+               -icing times
+               -final icing severity (eta_ice_final)
 
- INPUTS:       -clean aero coefficient
+               uiuc_ice_filter:
+               -clean aero coefficient
                -icing parameter for that coefficient (kC)
-               -icing severity (eta)
+               -icing severity (eta_ice)
 
 ----------------------------------------------------------------------
 
- OUTPUTS:      -iced aero coefficient
+ OUTPUTS:      uiuc_ice_eta:
+               -icing severity (eta_ice)
+
+               uiuc_ice_filter:
+               -iced aero coefficient
 
 ----------------------------------------------------------------------
 
- CALLED BY:    uiuc_coefficients.cpp
+ CALLED BY:    uiuc_coefficients
+               uiuc_coef_drag
+              uiuc_coef_lift
+              uiuc_coef_pitch
+              uiuc_coef_sideforce
+              uiuc_coef_roll
+              uiuc_coef_yaw
 
 ----------------------------------------------------------------------
 
 
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA or view http://www.gnu.org/copyleft/gpl.html.
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 **********************************************************************/
 
 #include "uiuc_ice.h"
 
 
-double uiuc_ice( double Ca_clean, double kCa, double eta_temp )
+void uiuc_ice_eta()
+{
+  double slope = 0;
+
+  if (Simtime >= iceTime)
+    {
+      // set ice_on flag
+      ice_on = true;
+
+      // slowly increase icing severity over period of transientTime
+      if (Simtime < (iceTime + transientTime))
+       {
+         slope = eta_ice_final / transientTime;
+         eta_ice = slope * (Simtime - iceTime);
+       }
+      else
+       {
+         eta_ice = eta_ice_final;
+       }
+    }
+  return;
+}
+
+
+double uiuc_ice_filter( double Ca_clean, double kCa )
 {
   double Ca_iced = 0;
 
   //cout << "Ice Model Engaged" << endl;
 
-  Ca_iced = Ca_clean * (1 + kCa * eta_temp);
+  Ca_iced = Ca_clean * (1 + kCa * eta_ice);
 
   return Ca_iced;
 }