changeset 2566:ef8989d00f86

app/pitot: added ability set acc tube lower limit to Vs1 currently, the code would set the minimum Vs2 guess to a value slightly above Vs1. This can be an issue for conditions which don't have a large increase in shock speed from the shock to acceleration tubes. The lower limit can be manually set lower, but it used to require a value, which wouldn't work with situations like the condition builder, which may do many different runs. Iadded the ability make Vs2_lower = 'Vs1' (a string) and then the code will pull out the Vs1 value from that simulation for the lower limit. Also a small change to pitot_condition_builder.py to make it work well with the condition builder.
author Chris James <c.james4@uq.edu.au>
date Fri, 02 Mar 2018 12:30:16 +1000
parents 3805e549f120
children 83cbfc91198a
files app/pitot/pitot.py app/pitot/pitot_condition_builder.py app/pitot/pitot_flow_functions.py
diffstat 3 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/app/pitot/pitot.py	Wed Feb 28 12:50:06 2018 +1000
+++ b/app/pitot/pitot.py	Fri Mar 02 12:30:16 2018 +1000
@@ -314,7 +314,7 @@
 from pitot_output_utils import *
 from pitot_area_ratio_check import *
 
-VERSION_STRING = "28-Feb-2018"
+VERSION_STRING = "2-Mar-2018"
 
 DEBUG_PITOT = False
 
--- a/app/pitot/pitot_condition_builder.py	Wed Feb 28 12:50:06 2018 +1000
+++ b/app/pitot/pitot_condition_builder.py	Fri Mar 02 12:30:16 2018 +1000
@@ -10,7 +10,7 @@
 
 """
 
-VERSION_STRING = "17-Jan-2017"
+VERSION_STRING = "2-Mar-2018"
 
 import sys
 
@@ -575,6 +575,10 @@
         # and were added by the last run, so we remove them
         if variable not in cfg['cfg_original']:
             if variable in cfg: cfg.pop(variable)
+        # we also need a second check here for when Vs2_lower is set to 'Vs1' a string input
+        # which makes the code use the found Vs1 value as the Vs2_lower_limit
+        if cfg['cfg_original']['Vs2_lower'] == 'Vs1':
+            cfg['Vs2_lower'] = 'Vs1'
         # if the run failed, the guesses may have gone stupid, so reset them if the user had intial values...
         if not cfg['last_run_successful'] and variable in cfg['cfg_original']:
             cfg[variable] = cfg['cfg_original'][variable]
--- a/app/pitot/pitot_flow_functions.py	Wed Feb 28 12:50:06 2018 +1000
+++ b/app/pitot/pitot_flow_functions.py	Fri Mar 02 12:30:16 2018 +1000
@@ -1245,6 +1245,11 @@
             cfg['Vs2_lower'] = cfg['Vs1'] + 500.0; cfg['Vs2_upper'] = 34750.0
         else:
             print "Using custom limits for Vs2 secant solver."
+
+            # there is a new setting here so Vs2_lower can be set to 'Vs1' as a string
+            if cfg['Vs2_lower'] == 'Vs1':
+                print "Setting 'Vs2_lower' to the found Vs1 value ({0} m/s) as the user has asked for this.".format(cfg['Vs1'])
+                cfg['Vs2_lower'] = cfg['Vs1']
             print "('Vs2_lower' = {0} m/s and 'Vs2_upper' = {1} m/s)".\
                       format(cfg['Vs2_lower'], cfg['Vs2_upper'])