 # 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.

######## Fan_DTC$_g:				# Fan Ducted to Core									
param Nf$_g;						# Isentropic Efficiency
param M_eff$_g;						# Axial Mach number in front of the fan for civilian turbofans (Raymer, Aircraft Design: A conceptual Approach) 
param M_tip$_g;						# Maximum Tip Mach Number
param ht$_g;						# Hub to tip ratio of fan (typical value was used)

var rf$_g>=1.1, <=2;				# Pressure Ratio																			
var W$_m<=-1;						# Power Output (Watt) 
var omega$_m>=1;					# Angular Velocity (Rad/s)
var m$_g>=0.1;						# Mass Flow (kg/s)		
var To$_g>= 1;						# Total Temperature Out (Kelvin)
var Po$_g>=1;						# Total Pressure Out(Pascal)
var cp$_g>=900,<=1400;				# Specific Heat at Constant Pressure (J/kg/Kelvin)
var gam$_g>=1.2,<=1.5;				# Ratio of Specific Heats

subject to conPo$_g: Po$_g = rf$_g*Po%_g; 																						# Pressure Calculation from (Anderson,Fundementals of Aerodynamics) 
subject to conTo$_g: To$_g = To%_g+(To%_g*rf$_g^((gam%_g-1)/gam%_g)-To%_g)/Nf$_g;												# Temperature Calculation from (Anderson,Fundementals of Aerodynamics) 
subject to conW$_g: W$_m = cp%_g*(To$_g-To%_g)*m$_g;																			# Power Calculation from (Anderson,Fundementals of Aerodynamics) 	

subject to conm$_g: m$_g<=(M_tip$_g^2-M_eff$_g^2)*gam%_g*R*To$_g*pi*(1-ht$_g^2)*Po$_g*M_eff$_g*sqrt(gam%_g*R*To$_g)/(R*To$_g*omega$_m^2);	# Maximum Mass Flow 

subject to concp$_g:cp$_g = (2.506*10^(-11)*To$_g^2+1.454*10^(-7)*To$_g^1.5
-4.246*10^(-7)*To$_g+3.162*10^(-5)*To$_g^(0.5)+1.3303-1.512*10^4*To$_g^(-1.5)
+3.063*10^5*To$_g^(-2)-2.212*10^7*To$_g^(-3))*10^3;										# Calculation of specific heat at constant pressure (R. Sonntag et al, Fundamentals of Thermodynamics)
subject to congam$_g: gam$_g = cp$_g/(cp$_g-R);											# Calculation of ratio of specific heats from (Anderson, Fundamentals of Aerodynamics)

subject to conchangeTo$_g: To$_g-To%_g>=10;											# Temperature Out is greater than temperature In
subject to conminPo$_g: Po$_g/Pac>=1.01;												# Pressure at fan exit is greater than atmospheric
subject to conmaxPo$_g: Po$_g/Pac<=1.89;

# Output Design Data:
var D_$_g_1>=50;
var D_$_g_2>=0.01;
var D_$_g_3>=1.01;
var D_$_g_4>=0.1;
var D_$_g_5>=0.7;
var D_$_g_6>=100;
var D_$_g_7>=10000;

subject to conD_$_g_1:	D_$_g_1 = omega$_m;
subject to conD_$_g_2:	D_$_g_2=m$_g;
subject to conD_$_g_3:  D_$_g_3=rf$_g;
subject to conD_$_g_4:  D_$_g_4=0.5;
subject to conD_$_g_5:  D_$_g_5=Nf$_g;
subject to conD_$_g_6:  D_$_g_6=To%_g;
subject to conD_$_g_7:  D_$_g_7=Po%_g;

subject to conThrust$_g: thrust[$_g] = 0;	