ADDED mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_cr.r Index: mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_cr.r ================================================================== --- /dev/null +++ mttroot/mtt/lib/comp/compound/GasDynamics/CG/CG_cr.r @@ -0,0 +1,40 @@ +%SUMMARY CG CR two-port C thermal pseudo Bond Graph for gas dynamics + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +OPERATOR CG; + +% Port 1 : temperature +FOR ALL c_v,r,Enthalpy,Stored_Mass,Volume +LET CG(c_v,r, effort, 1, + Enthalpy,state,1, + Stored_Mass,state,2, + Volume,state,3) + = Enthalpy/(c_v*Stored_Mass); + +% Port 2 : Pressure +FOR ALL c_v,r,Enthalpy,Stored_Mass,Volume +LET CG(c_v,r, effort, 2, + Enthalpy,state,1, + Stored_Mass,state,2, + Volume,state,3) + = (R/c_v)*(Enthalpy/Volume); + +% Port 3 : (Also) Pressure +FOR ALL c_v,r,Enthalpy,Stored_Mass,Volume +LET CG(c_v,r, effort, 3, + Enthalpy,state,1, + Stored_Mass,state,2, + Volume,state,3) + = (R/c_v)*(Enthalpy/Volume); + +END;; + ADDED mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_cr.r Index: mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_cr.r ================================================================== --- /dev/null +++ mttroot/mtt/lib/comp/compound/GasDynamics/RG/RG_cr.r @@ -0,0 +1,63 @@ +%SUMMARY RG CR for 2 port gas dymanics R: isentropic nozzle + + +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % Version control history +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % $Id$ +% % $Log$ +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +OPERATOR RG; + +% Port 1 : Enthalpy flow +FOR ALL gamma,R,A,T_u,P_u,T_d,P_d +LET RG(gamma,R,A, flow, 1, + T_u,effort,1, + P_u,effort,2, + T_d,effort,3, + P_d,effort,4) + = A*( P_u/sqrt(T_u) ) + *sqrt( (2*gamma)/(R*(gamma-1)) ) + *sqrt( (P_d/P_u)^(2/gamma) - (P_d/P_u)^((1+gamma)/gamma) ) + *(gamma/(gamma-1))*R*T_u; + +% Port 2 : Mass flow +FOR ALL gamma,R,A,T_u,P_u,T_d,P_d +LET RG(gamma,R,A, flow, 2, + T_u,effort,1, + P_u,effort,2, + T_d,effort,3, + P_d,effort,4) + = A*( P_u/sqrt(T_u) ) + *sqrt( (2*gamma)/(R*(gamma-1)) ) + *sqrt( (P_d/P_u)^(2/gamma) - (P_d/P_u)^((1+gamma)/gamma) ); + +% Port 3 : Enthalpy flow +FOR ALL gamma,R,A,T_u,P_u,T_d,P_d +LET RG(gamma,R,A, flow, 3, + T_u,effort,1, + P_u,effort,2, + T_d,effort,3, + P_d,effort,4) + = A*( P_u/sqrt(T_u) ) + *sqrt( (2*gamma)/(R*(gamma-1)) ) + *sqrt( (P_d/P_u)^(2/gamma) - (P_d/P_u)^((1+gamma)/gamma) ) + *(gamma/(gamma-1))*R*T_u; + +% Port 4 : Mass flow +FOR ALL gamma,R,A,T_u,P_u,T_d,P_d +LET RG(gamma,R,A, flow, 4, + T_u,effort,1, + P_u,effort,2, + T_d,effort,3, + P_d,effort,4) + = A*( P_u/sqrt(T_u) ) + *sqrt( (2*gamma)/(R*(gamma-1)) ) + *sqrt( (P_d/P_u)^(2/gamma) - (P_d/P_u)^((1+gamma)/gamma) ); + + +END;; +