Mercurial > hg > cfcfd3
changeset 2591:c5fedadd4bf6
app/pitot: added Pierpaolo's driver to PITOT and got CO2 acc gas working
author | Chris James <c.james4@uq.edu.au> |
---|---|
date | Tue, 16 Jul 2019 17:29:34 +1000 |
parents | 2dbf253cd13f |
children | d8e716a6fdaa |
files | app/pitot/pitot.py app/pitot/pitot_flow_functions.py app/pitot/pitot_input_utils.py app/pitot/pitot_output_utils.py |
diffstat | 4 files changed, 68 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/app/pitot/pitot.py Mon Jul 08 18:03:31 2019 +1000 +++ b/app/pitot/pitot.py Tue Jul 16 17:29:34 2019 +1000 @@ -315,7 +315,7 @@ from pitot_output_utils import * from pitot_area_ratio_check import * -VERSION_STRING = "8-Jul-2019" +VERSION_STRING = "16-Jul-2019" DEBUG_PITOT = False
--- a/app/pitot/pitot_flow_functions.py Mon Jul 08 18:03:31 2019 +1000 +++ b/app/pitot/pitot_flow_functions.py Tue Jul 16 17:29:34 2019 +1000 @@ -1135,7 +1135,14 @@ print "Acceleration tube fill state is p5 = {0} Pa, T5 = {1} K.".format(state5.p, state5.T) # do a clone of state 5 here so we don't get a lot of floating point jumping around... - state5 = state5.clone() + if 'CO2' not in state5.reactants: + state5 = state5.clone() + else: + state5.onlyList = state5.reactants + state5.with_ions = False + state5 = state5.clone() + state5.onlyList = [] + state5.with_ions = True # some extra code to try and get conditions above 19 km/s working with Pitot if cfg['custom_accelerator_gas']:
--- a/app/pitot/pitot_input_utils.py Mon Jul 08 18:03:31 2019 +1000 +++ b/app/pitot/pitot_input_utils.py Tue Jul 16 17:29:34 2019 +1000 @@ -1296,6 +1296,42 @@ M['s3s'] = 3.08 cfg['M_throat'] = M['s3s'] + elif cfg['piston'] == 'lwp-17.5-MPa-pure-argon-isentropic': + # pure argon driver condtion from Pierpaolo's thesis + # from Table 3.5 in Pierpaolo's thesis + driver_p = 49.0e3 # Pa + driver_T = 300.0 # K + states['s4i'] = primary_driver_x3[cfg['driver_gas']][0].clone() + states['s4i'].set_pT(driver_p, driver_T) + # from the caption in Table 3.4 of Pierpaolo's thesis + cfg['p4'] = 17.5e6 + cfg['T4'] = states['s4i'].T*\ + (cfg['p4']/states['s4i'].p)**(1.0-(1.0/states['s4i'].gam)) #K + states['s4'] = states['s4i'].clone() + #hard code it here... + if cfg['driver_gas'] == 'Ar:1.0': + # from Table 3.5 in Pierpaolo's thesis + M['s3s'] = 1.0 + cfg['M_throat'] = M['s3s'] + + elif cfg['piston'] == 'lwp-17.5-MPa-pure-argon-75-pc-compression': + # this one compresses to 75% of the driver rupture pressure + # from Table 3.5 in Pierpaolo's thesis + driver_p = 49.0e3 # Pa + driver_T = 300.0 # K + states['s4i'] = primary_driver_x3[cfg['driver_gas']][0].clone() + states['s4i'].set_pT(driver_p, driver_T) + # from the caption in Table 3.4 of Pierpaolo's thesis + cfg['p4'] = 17.5e6*0.75 + cfg['T4'] = states['s4i'].T*\ + (cfg['p4']/states['s4i'].p)**(1.0-(1.0/states['s4i'].gam)) #K + states['s4'] = states['s4i'].clone() + #hard code it here... + if cfg['driver_gas'] == 'Ar:1.0': + # from Table 3.5 in Pierpaolo's thesis + M['s3s'] = 1.0 + cfg['M_throat'] = M['s3s'] + elif cfg['piston'] == '280kg-piston-2mm-x3r-half-pressure': # this is just isentropic for now... driver_p = 150.0e3 # driver fill pressure, Pa @@ -1526,9 +1562,21 @@ else: # we have a custom accelerator gas, input should have made sure we have the correct stuff... states['s5'] = Gas(cfg['accelerator_gas_composition'],inputUnits=cfg['accelerator_gas_inputUnits'], outputUnits=cfg['accelerator_gas_inputUnits'], with_ions=cfg['accelerator_gas_with_ions']) + #do some special stuff is co2 is in our custom accelerator gas... + if 'CO2' in cfg['accelerator_gas_composition']: + print "As CO2 is in the custom accelerator gas, state 5 will be set using only the reactants in state 1." + print "({0})".format(states['s5'].reactants) + print "This will be turned off for other states based on this one so that they work normally." + states['s5'].onlyList = states['s5'].reactants + states['s5'].with_ions = False + # the onlyList and with_ions stuff will be turned off below after state 6 + # has been cloned from state 1... + if 'p5' not in cfg: #set atmospheric state if a pressure was not specified cfg['p5'] = cfg['p0'] + states['s5'].set_pT(float(cfg['p5']),cfg['T5']) + if cfg['solver'] == 'pg': #make perfect gas object if asked to do so, then re-set the gas state states['s5']=pg.Gas(Mmass=states['s5'].Mmass, gamma=states['s5'].gam, name='s5') @@ -1579,6 +1627,13 @@ states['s7'].onlyList = [] states['s7'].with_ions = True + if 'CO2' in cfg['accelerator_gas_composition']: + states['s5'].onlyList = [] + states['s5'].with_ions = False + + states['s6'].onlyList = [] + states['s6'].with_ions = False + if PRINT_STATUS: print '-'*60
--- a/app/pitot/pitot_output_utils.py Mon Jul 08 18:03:31 2019 +1000 +++ b/app/pitot/pitot_output_utils.py Tue Jul 16 17:29:34 2019 +1000 @@ -288,7 +288,7 @@ clone_successful = True except Exception as e: print "Error {0}".format(str(e)) - print "Failed to clone state {0} while trying to final total condition." + print "Failed to clone state {0} while trying to find total condition.".format(it_string) if isinstance(states[it_string], Gas) and states[it_string].with_ions: print "Trying again with ions turned off." try: @@ -297,7 +297,7 @@ clone_successful = True except Exception as e: print "Error {0}".format(str(e)) - print "Failed to clone state {0} again while trying to final total condition." + print "Failed to clone state {0} again while trying to find total condition.".format(it_string) print "0.0 will be added as pitot and total pressures for this state." pitot[it_string] = 0.0 p0[it_string] = 0.0 @@ -906,7 +906,7 @@ clone_successful = True except Exception as e: print "Error {0}".format(str(e)) - print "Failed to clone state {0} while trying to final total condition." + print "Failed to clone state {0} while trying to find total condition.".format(it_string) if isinstance(states[it_string], Gas) and states[it_string].with_ions: print "Trying again with ions turned off." @@ -916,7 +916,7 @@ clone_successful = True except Exception as e: print "Error {0}".format(str(e)) - print "Failed to clone state {0} again while trying to final total condition." + print "Failed to clone state {0} again while trying to find total condition.".format(it_string) print "0.0 will be added as pitot and total pressures for this state." pitot[it_string] = 0.0 p0[it_string] = 0.0