2023年6月24日发(作者:)
_Valid_P
YoucancheckthatthecellvaluesofthevariablesthatappearinyourfunctionareaccessiblebeforeyoucomputethefunctionbyusingtheData_Valid_Pmacro.
booleanData_Valid_P()
Data_Valid_rfile,ctionreturns1(true)ifthedataisvalid,and0(false)ifitisnot.
Example
if(!Data_Valid_P())return;
Forexample,supposeyoureadacasefileand,intheprocess,functionperformsacalculationusingvariablesthathavenotyetbeeninitialized,suchasthevelocityatinteriorcells,dthiskindoferror,(if)thedataareavailable,(else),no(orsometrivial)eflowfieldhasbeeninitialized,thefunctioncanbereinvokedsothatthecorrectcalculationcanbeperformed.
_THREAD_P
YoucanusetheFLUID_THREAD_ctionreturns1(true)ifthethreadyouspecifyisvalid,and0(false)ifitisnot.
booleanFLUID_THREAD_P()
Example
FLUID_THREAD_P(t0)
_MAG
TheutilityNV_takenasthesquarerootofthesumofthesquaresofthevectorcomponents.
NV_MAG(x)
2D:sqrt(x[0]*x[0]+x[1]*x[1]);
3D:sqrt(x[0]*x[0]+x[1]*x[1]+x[2]*x[2]);
_MAG2
TheutilityNV_MAG2computesthesumofsquaresofvectorcomponents. NV_MAG2(x)
2D:(x[0]*x[0]+x[1]*x[1]);
3D:(x[0]*x[0]+x[1]*x[1]+x[2]*x[2]);
5.F_PROFILE
F_PROFILEcanbeusedtostoreaboundaryconditioninmemoryforagivenfaceandthread,ecompletemacrodefinitionforF_PROFILE.
F_PROFILEistypicallyusedalongwithDEFINE_PROFILE;theindexithatisanargumenttoDEFINE_PROFILEisthesamevariableinF_PROFILE.
Macro:F_PROFILE(f,t,i)
Argumenttypes:face_tf
Thread*t
inti
Functionreturns:void
TheargumentsofF_PROFILEaref,theindexofthefaceface_t;t,apointertotheface'sthreadt;ariablesarepassedbytheFLUENTsolvertoyourUDF.
imple,aninletboundarymayhaveatotalpressureandatotaltemperatureassociatedwithit(bothofwhichcanbedescribedbyuser-definedfunctions).OneoftheinletboundaryvariableswillbeidentifiedinFLUENTbytheinteger0,uesoftheseintegersaresetbythesolverwhenyoudefineyourboundaryconditionsusingtheBoundaryConditionspanelinaFLUENTsession.
Sample
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
y=x[1];
F_PROFILE(f,t,i)=1.1e5-y*y/(.0745*.0745)*0.1e5;
}
end_f_loop(f,t)
发布者:admin,转转请注明出处:http://www.yc00.com/news/1687607022a24158.html
评论列表(0条)