FLUENT UDF宏 Data_Valid_P FLUID_THREAD_P

FLUENT UDF宏 Data_Valid_P FLUID_THREAD_P

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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信