 # Delivered to the U.S. Government in Accordance with Contract FA8650-10-C-7080.
 #
 # EXPORT CONTROLLED
 # ECCN#   EAR99  
 # Warning:  This document contains technical data which is controlled under the
 # Bureau of Industry & Security’s Export Administration Regulations and may not be
 # exported or re-exported without authorization by the Bureau of Industry & Security.
 # Diversion contrary to US law is prohibited.
 #
 # (c) 2011 United Technologies Corp.
 # Developed with the sponsorship of the Defense Advanced Research Projects Agency (DARPA).
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy of this data,
 # including any software or models in source or binary form, as well as any drawings, 
 # specifications, and documentation (collectively "the Data"), to deal in the Data without 
 # restriction, including without limitation the rights to use, copy, modify, merge, publish,
 # distribute, sublicense, and/or sell copies of the Data, and to permit persons to whom the Data
 # is furnished to do so, subject to the following conditions:
 #  
 # The above copyright notice and this permission notice shall be included in all copies or
 # substantial portions of the Data.
 #  
 # THE DATA IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
 # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS, SPONSORS, DEVELOPERS, CONTRIBUTORS, OR
 # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE DATA OR THE
 # USE OR OTHER DEALINGS IN THE DATA.


###### Core_Nozzle$_g:						# Core Nozzle 
var A$_g>=0.01;								# Nozzle Area (meter^2)
var m$_g>=0.1;								# Mass Flow (kg/s)
var T$_g >=1;								# Temperature at nozzle exit (Kelvin)
var P$_g >=1;								# Pressure at nozzle exit (Pascal)
var V$_g>=50;								# Exit Velocity (m/s)

subject to conT$_g: T$_g = To%_g*(Pac/Po%_g)^((gam%_g-1)/gam%_g);	# Exit Temperature Calculation Assuming isentorpic expansion to atmospheric pressure (Anderson, Fundamentals of Aerodynamics)
subject to conP$_g: P$_g = Pac;										# Exit Pressure is equal to atmospheric (Anderson, Fundamentals of Aerodynamics)
subject to conV_core$_g: V$_g = sqrt(2*cp%_g*(To%_g-T$_g));			# Exit Velocity (Anderson, Fundamentals of Aerodynamics)
subject to acon_core_nozzle$_g: A$_g = m$_g/((Pac/(R*T$_g)))/V$_g;	# Area Calculation (Anderson, Fundamentals of Aerodynamics)

subject to conchangeT$_g: T$_g-To%_g<=-0.0001;						# Temperature Out is Less than Temperature In
subject to conchangeminPac$_g: Po%_g/Pac>=1.1;						# Pressure Ratio Across the Nozzle is Such that choking does not occur (Anderson, Fundamentals of Aerodynamics)
subject to conchangemaxPac$_g: Po%_g/Pac<=1.89;						# Pressure Ratio Across the Nozzle is Such that choking does not occur (Anderson, Fundamentals of Aerodynamics)
subject to conthrust$_g: thrust[$_g] = m$_g*(V$_g-Vac);				# Thrust Calculation Based on Conservation of Momentum

# Output Design Data:
var D_$_g_1>=0.01;
subject to conD_$_g_1:	D_$_g_1 = A$_g;
				