Poppet valve code in AmesimWord下载.docx
《Poppet valve code in AmesimWord下载.docx》由会员分享,可在线阅读,更多相关《Poppet valve code in AmesimWord下载.docx(15页珍藏版)》请在冰豆网上搜索。
enterthenameofafileinASCIIformat.
Thepressureatport2isassumedtoactonanactiveareaadjacenttothe
orificeandtendstoopentheorifice.Alinearpressuregradient(between
pressureatport2andpressureatport1)actsontheremainingflapper
seatarea.Theseassumptionsgivesapressureforceactingontheflapper.
Thedisplacementandvelocityoftheflapperaresuppliedbythe
submodelattachedtoport3.Therearenorestrictiononthe
displacementwithinPNAP031andsuchrestrictionsmaybeappliedby
anothersubmodelemployingendstops,suchasPNAI021.
Theliftisavariablerelatedtothisdisplacementbyanoffset.
Theorificeareaisneverallowedtoexceedtheareaofthethroat
specifiedbytheinternaldiameterofthenozzleandtheroddiameter
(nozzleside).
However,sometimesitisusefultorestricttheorificeareawith
anadditionalminimumand/ormaximumvalue.Theminimumarea
canbeusedtosimulatealeakageoraspecialorificepassingflow
evenwhenthenozzleisincontactwiththeflapper.Themaximumarea
canbeusedtosimulateaflowarea,forexampleatport2.These
minimumandmaximumareasarespecifiedbythecorrespondinglift
positions.Thedefaultvaluesimplythatthereisnoadditional
restrictionsonthearea.
Notethatthederivativeofvolumeduetothemovementoftheflapper
issentatport1andport2totheadjacentpneumaticchamber.
USAGE:
Usethissubmodelforapneumaticnozzlevalveactingonaflat
flapperseatbutnotethatresultswillbelessaccurateifthelift
exceeds20%oftheseatdiameter.
PNAP031differsfromPNAP032onlyinthatthevariablesassociated
withports3and4areinterchanged.
ThesubmodelsPNGD001orPNGD002shouldbeincludedinyourcircuitto
definethecharacteristicsofthegas.
PARAMETERSETTINGS:
Thediameteroftheflapperseatmustbegreaterthantheinternal
diameterofthenozzle
Theroddiameteratnozzlesidehasadefaultvaluewhichiszero
implyingthattherodisnotthere.
Thevolumesattheportsarenormallyonlysignificantwhentheport
isconnectedtothepneumaticchambersubmodelsPNCH011orPNCH012.If
thisisthecase,itisimportanttosetvolumesatzeroliftso
thatthevolumeoutputsarenevernegative.
ThefilenameorexpressionforCq=f(Pr,x)isastringlike:
0.72+0.12*cos(pi*Pr)asanexpressionor
./curves/orif.datasafilename
Thefilemustprovidethedatainthefollowingformat:
NM
Pr1Pr2...PrN
x1x2...xM
Cq11Cq21...CqN1
Cq12Cq22...CqN2
...
Cq1MCq2M...CqNM
where
NisthenumberofpressureratioMisthenumberofopeningpositions
Priarethevaluesofthepressureratioxjarethevaluesofopenings[m]
CqijarethevaluesoftheflowcoefficientcorrespondingtoPriandxj.
Inthisfile,datacanbeseparatedbyanynumberofspace,TABorRETURNcharacters.
DATEOFCREATION/AUTHOR:
2002byFSfromPNAP31(SN)
INDEXOFREVISIONS:
15/02/2004:
Alinearpressuregradient(betweenpressureatport2andpressure
atport1)actsontheremainingflapperseatarea.(CR)
05/01/2012:
Addpressureforcecontributionwhentheflapperisatcontact(VBD)
LISTOFFUNCTIONSUSED:
InterpretExpression():
interpretsastringasafilename
ComputeExpression():
computesthevalueinthetable
aanulsp_():
orificeareaofanannularspoolvalve.
pn2rcqfix_():
evaluatemassflowandenthalpyflow
pn2getatp_():
getatmosphericpressure
SOURCE:
LMSImagine
7,placedesMinimes
42300ROANNEtel:
(33).04.77.23.60.30
FRANCEfax:
(33).04.77.23.60.31
********************************************************************************/
#define_SUBMODELNAME_"
PNAP031"
/*>
>
InsertPrivateCodeHere.*/
/*<
<
EndofPrivateCode.*/
/*Thereare9realparameters:
diinternaldiameterofthenozzle(hole)[mm->
m]
drroddiameter(nozzleside)[mm->
dfdiameteroftheflapper[mm->
xlift0opening(underlap)correspondingtozerodisplacement[mm->
xminopeningforminimumarea[mm->
xmaxopeningformaximumarea[mm->
xlimtransitionopeningforpressureforceontheflapperseat[mm->
vol10volumeatport1correspondingtozerolift[cm**3->
m**3]
vol20volumeatport2correspondingtozerolift[cm**3->
*/
/*Thereare3integerparameters:
gigastypeindex
forcemodepressureactingintheflapperseatarea
forcecontactpressureforcecontributionontheflapperseatatzerolift
/*Thereis1textparameter:
flowcoefffilenameorexpressionforflowcoefficientCq=f(Pr,x)
voidpnap031in_(int*n,doublerp[9],intip[3],char*tp[1]
doublec[3],intic[3])
{
intloop,error;
ExtraInitializationFunctionDeclarationsHere.*/
staticchar*var[]={"
Pr"
"
x"
};
EndofExtraInitializationdeclarations.*/
intgi,forcemode,forcecontact;
doubledi,dr,df,xlift0,xmin,xmax,xlim,vol10,vol20;
char*flowcoeff;
gi=ip[0];
forcemode=ip[1];
forcecontact=ip[2];
di=rp[0];
dr=rp[1];
df=rp[2];
xlift0=rp[3];
xmin=rp[4];
xmax=rp[5];
xlim=rp[6];
vol10=rp[7];
vol20=rp[8];
flowcoeff=tp[0];
loop=0;
error=0;
/*
Ifnecessary,checkvaluesofthefollowing:
rp[0..8]
InitializationFunctionCheckStatements.*/
if(xmin<
0.0)
error=2;
amefprintf(stderr,"
\nLowerliftlimitmustbehigherthanzero."
);
}
if(xmax<
=0.0)
\nUpperliftlimitmustbehigherthanzero."
if(xmin>
xmax)
\nLowerliftlimitmustbesmallerthanhigherliftlimit"
if(xlim<
\nTransitionopeningforpressureforceontheflapperseatmustbe>
0"
if(di<
\nInternaldiameterofthenozzlemustbe>
if(df<
\nFlapperseatdiametermustbe>
=di)
\nFlapperseatdiametermustbegreater"
\nthaninternaldiameterofthenozzle"
if(dr<
\nRoddiameter(nozzleside)mustbe>
=0"
if(dr>
di)
\nRoddiameter(nozzleside)mustbelower"
if((M_PI*(di*di-dr*dr)/4.0<
(M_PI*di*xmax))&
&
(xmax!
=1.e30))
if(error!
=2)
error=1;
\nBecarefultheflowareaislimitedby"
\n(PI/4)*(dinternal^2-drod^2)andnotbyPI*dinternal*xmax.\n"
if(vol10<
\nVolumeatport1correspondingtozeroliftmustbe>
=0\n"
if(vol20<
\nVolumeatport2correspondingtozeroliftmustbe>
EndofInitializationCheckStatements.*/
/*Integerparameterchecking:
*/
if(gi<
1||gi>
99)
\ngastypeindexmustbeinrange[1..99].\n"
if(forcemode<
1||forcemode>
2)
\npressureactingintheflapperseatareamustbeinrange[1..2].\n"
if(forcecontact<
1||forcecontact>
\npressureforcecontributionontheflapperseatatzeroliftmustbeinrange[1..2].\n"
if(error==1)
\nWarningin%sinstance%d.\n"
_SUBMODELNAME_,*n);
elseif(error==2)
\nFatalerrorin%sinstance%d.\n"
Terminatingtheprogram.\n"
AmeExit
(1);
/*Common->
SIunitsconversions.*/
rp[0]*=1.00000000000000e-003;
rp[1]*=1.00000000000000e-003;
rp[2]*=1.00000000000000e-003;
rp[3]*=1.00000000000000e-003;
rp[4]*=1.00000000000000e-003;
rp[5]*=1.00000000000000e-003;
rp[6]*=1.00000000000000e-003;
rp[7]*=1.00000000000000e-006;
rp[8]*=1.00000000000000e-006;
InitializationFunctionExecutableStatements.*/
ic[2]=InterpretExpression(tp[0],2,var,1,1,1,1);
if(ic[2]==-1)
Invalidexpression/filename%s\n"
tp[0]);
/*Calculatetheannularareaatnozzleside.*/
c[0]=M_PI*(di*di-dr*dr)*0.25;
/*Calculatetheremainingannularareaontheflapper.*/
c[1]=M_PI*(d