harmonic analasis

3
!-------------------------------------------------- ! Harmonic analysis script ! (Assumes inlet and outlet for pipe) ! Named Selection "N_INLET" is surface(s) of inlet ! Named Selection "N_OUTLET" is surface(s) of outlet ! ! ARG1 = area ! ARG2 = pressure ! ARG3 = density ! ARG4 = speed of sound ! ARG5 = frequency ! ARG6 = # of steps !-------------------------------------------------- !-------------------------------------------------- ! Couple nodes at inlet (plane wave) !-------------------------------------------------- /prep7 cmsel,s,N_INLET cp,next,pres,all MY_INLET=ndnext(0) !-------------------------------------------------- ! Get 6 nodes from outlet for postprocessing !-------------------------------------------------- cmsel,s,N_OUTLET *get,NODECOUNT,node,,count NEXTNODE=0 AR98=1 AR97=1 MY_OUTLET1=ndnext(NEXTNODE) *do,AR99,1,NODECOUNT NEXTNODE=ndnext(NEXTNODE) AR98=AR98+1 *if,AR98,eq,nint(NODECOUNT/7),then MY_OUTLET%AR97%=NEXTNODE AR97=AR97+1 AR98=0 *endif *enddo allsel,all cmsel,all !-------------------------------------------------- ! Add impedance (plane wave) !-------------------------------------------------- sf,N_OUTLET,impd,1 sf,N_INLET,impd,1 finish !-------------------------------------------------- ! Specify harmonic analysis options !-------------------------------------------------- /solu antype,harmic hropt,full outres,erase outres,all,none outres,nsol,all nsubst,1

Upload: amitu2bmine

Post on 10-Apr-2016

1 views

Category:

Documents


0 download

DESCRIPTION

harmonic analysis

TRANSCRIPT

!--------------------------------------------------! Harmonic analysis script! (Assumes inlet and outlet for pipe)! Named Selection "N_INLET" is surface(s) of inlet! Named Selection "N_OUTLET" is surface(s) of outlet!! ARG1 = area! ARG2 = pressure! ARG3 = density! ARG4 = speed of sound! ARG5 = frequency! ARG6 = # of steps!--------------------------------------------------

!--------------------------------------------------! Couple nodes at inlet (plane wave)!--------------------------------------------------/prep7cmsel,s,N_INLETcp,next,pres,allMY_INLET=ndnext(0)!--------------------------------------------------! Get 6 nodes from outlet for postprocessing!--------------------------------------------------cmsel,s,N_OUTLET*get,NODECOUNT,node,,countNEXTNODE=0AR98=1AR97=1MY_OUTLET1=ndnext(NEXTNODE)*do,AR99,1,NODECOUNT NEXTNODE=ndnext(NEXTNODE) AR98=AR98+1 *if,AR98,eq,nint(NODECOUNT/7),then MY_OUTLET%AR97%=NEXTNODE AR97=AR97+1 AR98=0 *endif*enddo

allsel,allcmsel,all

!--------------------------------------------------! Add impedance (plane wave)!--------------------------------------------------sf,N_OUTLET,impd,1sf,N_INLET,impd,1finish

!--------------------------------------------------! Specify harmonic analysis options!--------------------------------------------------/soluantype,harmichropt,fulloutres,eraseoutres,all,noneoutres,nsol,allnsubst,1

kbc,1

!--------------------------------------------------! Specify harmonic analysis options!--------------------------------------------------MY_STEPS=ARG6*do,AR99,1,MY_STEPS MY_FREQ=AR99*ARG5/MY_STEPS MY_AREA=ARG1 MY_PRES=ARG2 MY_SONC=ARG4 MY_DENS=ARG3

harfrq,,MY_FREQ f,MY_INLET,flow,,2*acos(-1)*MY_FREQ*2*MY_AREA*MY_PRES/MY_SONC solve*enddofinishsave

!--------------------------------------------------! Postprocess values!--------------------------------------------------/show,png/post26numvar,200nsol,2,MY_INLET,pres,,PIN_Tfilldata,3,,,,ARG2,0varnam,3,PIN_Iadd,4,2,3,,PIN_R,,,1,-1nsol,11,MY_OUTLET1,pres,,POUT_T1nsol,12,MY_OUTLET2,pres,,POUT_T2nsol,13,MY_OUTLET3,pres,,POUT_T3nsol,14,MY_OUTLET4,pres,,POUT_T4nsol,15,MY_OUTLET5,pres,,POUT_T5nsol,16,MY_OUTLET6,pres,,POUT_T6/title,Pressure at inlet and outletplvar,2,3,4,11,13,15/title,Pressure at outletplvar,11,12,13,14,15,16

prod,20, 3, 3prod,21,11,11prod,22,12,12prod,23,13,13prod,24,14,14prod,25,15,15prod,26,16,16quot,31,21,20,,InverseT1quot,32,22,20,,InverseT2quot,33,23,20,,InverseT3quot,34,24,20,,InverseT4quot,35,25,20,,InverseT5quot,36,26,20,,InverseT6quot,41,20,21,,TranCoef1quot,42,20,22,,TranCoef2quot,43,20,23,,TranCoef3quot,44,20,24,,TranCoef4quot,45,20,25,,TranCoef5

quot,46,20,26,,TranCoef6clog,51,31,,,TL_1,,,1,10clog,52,32,,,TL_2,,,1,10clog,53,33,,,TL_3,,,1,10clog,54,34,,,TL_4,,,1,10clog,55,35,,,TL_5,,,1,10clog,56,36,,,TL_6,,,1,10

plvar,41,42,43,44,45,46plvar,51,52,53,54,55,56

prcplx,1lines,1e6prvar,11,12,13,14,15,16prvar,41,42,43,44,45,46prvar,51,52,53,54,55,56

finish/show,close/eof