声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 6318|回复: 10

[UDF专题] udf中常用的macro和utilities

[复制链接]
发表于 2008-9-14 14:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
#define DEFINE_ADJUST(name, domain) \
        void name(Domain *domain)
#define DEFINE_INIT(name, domain) \
       void name(Domain *domain)
#define DEFINE_ON_DEMAND(name) \
void name(void)
#define DEFINE_RW_FILE(name, fp) \
void name(FILE *fp)
#define DEFINE_CG_MOTION(name, dt, vel, omega, time, dtime) \
void name(void *dt, real vel[], real omega[], real time, real dtime)
#define DEFINE_DIFFUSIVITY(name, c, t, i)
real name(cell_t c, Thread *t, int i)
#define DEFINE_GEOM(name, d, dt, position) \
void name(Domain *d, void *dt, real *position)
#define DEFINE_GRID_MOTION(name, d, dt, time, dtime) \
void name(Domain *d, void *dt, real time, real dtime)
#define DEFINE_HEAT_FLUX(name, f, t, c0, t0, cid, cir) \
void name(face_t f, Thread *t, cell_t c0, \
Thread *t0, real cid[], real cir[])
#define DEFINE_NOX_RATE(name, c, t, NOx) \
void name(cell_t c, Thread *t, NOx_Parameter *NOx)
#define DEFINE_PROFILE(name, t, i) \
void name(Thread *t, int i)
#define DEFINE_PROPERTY(name, c, t) \
real name(cell_t c, Thread *t)
#define DEFINE_SCAT_PHASE_FUNC(name, c, f) \
real name(real c, real *f)
#define DEFINE_SOURCE(name, c, t, dS, i) \
real name(cell_t c, Thread *t, real dS[], int i)
#define DEFINE_SR_RATE(name, f, t, r, mw, yi, rr) \
void name(face_t c, Thread *t, \
Reaction *r, real *mw, real *yi, real *rr)
#define DEFINE_TURB_PREMIX_SOURCE(name, c, t, turbulent_flame_speed, source) \
void name(cell_t c, Thread *t, real *turbulent_flame_speed, real *source)
#define DEFINE_TURBULENT_VISCOSITY(name, c, t) real name(cell_t c, Thread *t)
#define DEFINE_UDS_FLUX(name, f, t, i) \
real name(face_t f, Thread *t, int i)
#define DEFINE_UDS_UNSTEADY(name, c, t, i, apu, su) \
void name(cell_t c, Thread *t, int i, real *apu, real *su)
#define DEFINE_VR_RATE(name, c, t, r, mw, yi, rr, rr_t) \
void name(cell_t c, Thread *t, \
Reaction *r, real *mw, real *yi, \
real *rr, real *rr_t)
A-2 c
Fluent Inc. November 29, 2001
#define DEFINE_CAVITATION_RATE(name, c, t, p, rhoV, rhoL, vofV, p_v, n_b, m_dot) \
void name(cell_t c, Thread *t, real *p, real *rhoV, real *rhoL, real *vofV, \
real *p_v, real *n_b, real *m_dot)
#define DEFINE_DRIFT_DIAM(name, c, t) \
real name(cell_t c, Thread *t)
#define DEFINE_EXCHANGE_PROPERTY(name, c, mixture_thread, \
second_column_phase_index, first_column_phase_index) \
real name(cell_t c, Thread *mixture_thread, int second_column_phase_index,\
int first_column_phase_index)
#define DEFINE_VECTOR_EXCHANGE_PROPERTY(name, c, mixture_thread, \
second_column_phase_index, first_column_phase_index, vector_result) \
void name(cell_t c, Thread *mixture_thread, int second_column_phase_index,\
int first_column_phase_index, real *vector_resu
#define DEFINE_DPM_BODY_FORCE(name, p, i) \
real name(Tracked_Particle *p, int i)
#define DEFINE_DPM_DRAG(name, Re) \
real name(real Re)
#define DEFINE_DPM_SOURCE(name, c, t, S, strength, p) \
void name(cell_t c, Thread *t, dpms_t *S, \
real strength, Tracked_Particle *p)
#define DEFINE_DPM_PROPERTY(name, c, t, p) \
real name(cell_t c, Thread *t, Tracked_Particle *p)
#define DEFINE_DPM_OUTPUT(name, header, fp, p, t, plane) \
void name(int header, FILE *fp, \
Tracked_Particle *p, Thread *t, Plane *plane)
#define DEFINE_DPM_EROSION(name, p, t, f, normal, alpha, Vmag, mdot) \
void name(Tracked_Particle *p, Thread *t, \
face_t f, real normal[], real alpha, \
real Vmag, real mdot)
#define DEFINE_DPM_SCALAR_UPDATE(name, c, t, initialize, p) \
void name(cell_t c, Thread *t, int initialize, \
Tracked_Particle *p)
c
Fluent Inc. November 29, 2001 A-3
#define DEFINE_DPM_LAW(name, p, ci)
void name(Tracked_Particle *p, int ci)
#define DEFINE_DPM_SWITCH(name, p, ci) \
void name(Tracked_Particle *p, int ci)
#define DEFINE_DPM_INJECTION_INIT(name, I) \
void name(Injection *I)
回复
分享到:

使用道具 举报

 楼主| 发表于 2008-9-14 14:29 | 显示全部楼层
Table 3.11.1: DEFINE Macro Usage for the VOF Model
Variable                           Macro            Phase Specied On
volume fraction                 DEFINE_PROFILE      secondary phase(s)
velocity at a boundary           DEFINE_PROFILE          mixture
pressure at a boundary            DEFINE_PROFILE          mixture
boundary temperature               DEFINE_PROFILE         mixture
turbulent kinetic energy          DEFINE_PROFILE          mixture
turbulent dissipation rate         DEFINE_PROFILE         mixture
mass source                       DEFINE_SOURCE         primary and
                                                     secondary phase(s)
momentum source                   DEFINE_SOURCE            mixture
energy source                     DEFINE_SOURCE            mixture
turbulent kinetic energy source    DEFINE_SOURCE            mixture
turbulent dissipation rate source   DEFINE_SOURCE           mixture
density                            DEFINE_PROPERTY        primary and
                                                        secondary phase(s)
viscosity                          DEFINE_PROPERTY            primary and
                                                          secondary phase(s)




Table 3.11.2: DEFINE Macro Usage for the Mixture Model
Variable                              Macro                 Phase Specied On
volume fraction                    DEFINE_PROFILE            secondary phase(s)
velocity at a boundary             DEFINE_PROFILE             primary and
                                                            secondary phase(s)
pressure at a boundary             DEFINE_PROFILE              mixture
boundary temperature               DEFINE_PROFILE              mixture
turbulent kinetic energy           DEFINE_PROFILE              mixture
turbulent dissipation rate         DEFINE_PROFILE              mixture
mass source                        DEFINE_SOURCE               primary and
                                                           secondary phase(s)
momentum source                    DEFINE_SOURCE                 mixture
energy source                      DEFINE_SOURCE                 mixture
turbulent kinetic energy source    DEFINE_SOURCE                  mixture
turbulent dissipation rate source   DEFINE_SOURCE                mixture
density                            DEFINE_PROPERTY              primary and
                                                              secondary phase
viscosity                           DEFINE_PROPERTY              primary and
                                                             secondary phase(s)
diameter                             DEFINE_PROPERTY           secondary phase(s)
slip velocity                       DEFINE_VECTOR_                phase interaction
                                   EXCHANGE_PROPERTY





Table 3.11.3: DEFINE Macro Usage for the Eulerian Model (Laminar Flow)
Variable                                      Macro                    Phase Specied On
volume fraction                             DEFINE_PROFILE              secondary phase(s)
velocity at a boundary                      DEFINE_PROFILE                primary and
                                                                        secondary phase(s)
pressure at a boundary                       DEFINE_PROFILE                 mixture
granular temperature                         DEFINE_PROFILE               secondary phase(s)
mass source                                 DEFINE_SOURCE                   primary and
                                                                         secondary phase(s)
momentum source                               DEFINE_SOURCE                 primary and
                                                                         secondary phase(s)
density                                       DEFINE_PROPERTY               primary and
                                                                          secondary phase(s)
viscosity                                       DEFINE_PROPERTY             primary and
                                                                             secondary phase(s)
granular diameter                              DEFINE_PROPERTY              secondary phase(s)
granular viscosity                            DEFINE_PROPERTY                secondary phase(s)
granular bulk viscosity                        DEFINE_PROPERTY               secondary phase(s)
granular frictional viscosity                    DEFINE_PROPERTY               secondary phase(s)
drag coeffcient                               DEFINE_EXCHANGE_PROPERTY          phase interaction
lift coeffcient                                  DEFINE_EXCHANGE_PROPERTY       phase interaction




Table 3.11.4: DEFINE Macro Usage for the Eulerian Model (Mixture Turbulence Model)
Variable                                 Macro                                     Phase Specied On
volume fraction                      DEFINE_PROFILE                                secondary phase(s)
velocity at a boundary               DEFINE_PROFILE                                   primary and
                                                                                   secondary phase(s)
pressure at a boundary                DEFINE_PROFILE                                      mixture
granular temperature                  DEFINE_PROFILE                                 secondary phase(s)
turbulent kinetic energy              DEFINE_PROFILE                                      mixture
turbulent dissipation rate             DEFINE_PROFILE                                      mixture
mass source                          DEFINE_SOURCE                                         primary and
                                                                                      secondary phase(s)
momentum source                       DEFINE_SOURCE                                       primary and
                                                                                         secondary phase(s)
turbulent kinetic energy source          DEFINE_SOURCE                                      mixture
turbulent dissip. rate source            DEFINE_SOURCE                                      mixture
density                                DEFINE_PROPERTY                                     primary and
                                                                                         secondary phase(s)
viscosity                               DEFINE_PROPERTY                                      primary and
                                                                                            secondary phase(s)
granular diameter                        DEFINE_PROPERTY                                    secondary phase(s)
granular viscosity                     DEFINE_PROPERTY                                      secondary phase(s)
granular bulk viscosity                DEFINE_PROPERTY                                    secondary phase(s)
granular frictional viscosity           DEFINE_PROPERTY                                      secondary phase(s)
drag coeffcient                    DEFINE_EXCHANGE_PROPERTY                                 phase interaction
lift coeffcient                     DEFINE_EXCHANGE_PROPERTY                                  phase interaction
 楼主| 发表于 2008-9-14 14:29 | 显示全部楼层
Table 3.11.5: DEFINE Macro Usage for the Eulerian Model (Dispersed Turbulence Model)
Variable                                      Macro                                              Phase Specied On
volume fraction                           DEFINE_PROFILE                                       secondary phase(s)
velocity at a boundary                     DEFINE_PROFILE                                         primary and
                                                                                                secondary phase(s)
pressure at a boundary                   DEFINE_PROFILE                                            mixture
granular temperature                      DEFINE_PROFILE                                         secondary phase(s)
turbulent kinetic energy                  DEFINE_PROFILE                                             primary phase
turbulent dissipation rate                 DEFINE_PROFILE                                          primary phase
mass source                                 DEFINE_SOURCE                                            primary and
                                                                                                    secondary phase(s)
momentum source                               DEFINE_SOURCE                                          primary and
                                                                                                      secondary phase(s)
turbulent kinetic energy source              DEFINE_SOURCE                                              primary phase
turbulent dissip. rate source                 DEFINE_SOURCE                                             primary phase
density                                    DEFINE_PROPERTY                                             primary and
                                                                                                    secondary phase(s)
viscosity                                   DEFINE_PROPERTY                                             primary and
                                                                                                    secondary phase(s)
granular diameter                           DEFINE_PROPERTY                                           secondary phase(s)
granular viscosity                           DEFINE_PROPERTY                                           secondary phase(s)
granular bulk viscosity                        DEFINE_PROPERTY                                         secondary phase(s)
granular frictional viscosity                DEFINE_PROPERTY                                           secondary phase(s)
drag coeffcient                         DEFINE_EXCHANGE_PROPERTY                                       phase interaction
lift coeffcient                         DEFINE_EXCHANGE_PROPERTY                                      phase interaction





Table 3.11.6: DEFINE Macro Usage for the Eulerian Model (Per-Phase Turbulence Model)
Variable                                      Macro                                  Phase Specied On
volume fraction                          DEFINE_PROFILE                               secondary phase(s)
velocity at a boundary                    DEFINE_PROFILE                             primary and
                                                                                   secondary phase(s)
pressure at a boundary                       DEFINE_PROFILE                            mixture
granular temperature                       DEFINE_PROFILE                           secondary phase(s)
turbulent kinetic energy                   DEFINE_PROFILE                              primary and
                                                                                   secondary phase(s)
turbulent dissipation rate                 DEFINE_PROFILE                             primary and
                                                                                   secondary phase(s)
mass source                                DEFINE_SOURCE                              primary and
                                                                                  secondary phase(s)
momentum source                              DEFINE_SOURCE                             primary and
                                                                                    secondary phase(s)
turbulent kinetic energy source              DEFINE_SOURCE                            primary and
                                                                                    secondary phase(s)
turbulent dissip. rate source                 DEFINE_SOURCE                           primary and
                                                                                  secondary phase(s)
density                                       DEFINE_PROPERTY                           primary and
                                                                                    secondary phase(s)
viscosity                                     DEFINE_PROPERTY                              primary and
                                                                                      secondary phase(s)
granular diameter                             DEFINE_PROPERTY                           secondary phase(s)
granular viscosity                            DEFINE_PROPERTY                           secondary phase(s)
granular bulk viscosity                      DEFINE_PROPERTY                                secondary phase(s)
granular frictional viscosity                DEFINE_PROPERTY                            secondary phase(s)
drag coeffcient                           DEFINE_EXCHANGE_PROPERTY                      phase interaction
lift coeffcient                             DEFINE_EXCHANGE_PROPERTY                    phase interaction
 楼主| 发表于 2008-9-14 14:29 | 显示全部楼层
Table 4.2.1: Quick Reference Guide for General Solver DEFINE Macros
Function                     DEFINE Macro                    Panel Activated In
manipulates variables           DEFINE_ADJUST               User-Defined Function Hooks
initializes variables          DEFINE_INIT                 User-Defined Function Hooks
executes asynchronously       DEFINE_ON_DEMAND               Execute On Demand
reads/writes variables to     DEFINE_RW_FILE               User-Defined Function Hooks
case and data  files



Table 4.3.1: Quick Reference Guide for Model-Specific DEFINE Macros
Variable                        DEFINE Macro                      Panel Activated In
species mass fraction         DEFINE_PROFILE                      boundary condition
                                                                (e.g., Velocity Inlet)
velocity at a boundary         DEFINE_PROFILE                     boundary condition
pressure at a boundary          DEFINE_PROFILE                     boundary condition
boundary temperature           DEFINE_PROFILE                     boundary condition
turbulent kinetic energy       DEFINE_PROFILE                      boundary condition
turbulent dissipation rate      DEFINE_PROFILE                    boundary condition
mass source                     DEFINE_SOURCE                      boundary condition
momentum source                DEFINE_SOURCE                       boundary condition
energy source                  DEFINE_SOURCE                       boundary condition
turbulent k.e. source           DEFINE_SOURCE                     boundary condition
turb. dissipation rate source   DEFINE_SOURCE                       boundary condition
UDS or species mass diffusivity DEFINE_DIFFUSIVITY                    Materials
turbulent viscosity              DEFINE_TURBULENT_VISCOSITY           Viscous Model
heat flux                        DEFINE_HEAT_FLUX                   boundary condition
density                          DEFINE_PROPERTY                        Materials
viscosity                       DEFINE_PROPERTY                         Materials
mass diffusivity                 DEFINE_PROPERTY                        Materials
thermal conductivity             DEFINE_PROPERTY                        Materials
absorption coeffcient            DEFINE_PROPERTY                          Materials
scattering coeffcient              DEFINE_PROPERTY                      Materials
laminar flow speed              DEFINE_PROPERTY                        Materials
rate of strain                  DEFINE_PROPERTY                        Materials
scattering phase function        DEFINE_SCAT_PHASE_FUNC               Materials
surface reaction rate           DEFINE_SR_RATE                    User-Defined Function
                                                                    Hooks
volume reaction rate              DEFINE_VR_RATE                 User-Defined Function
                                                                       Hooks
turbulent premixed source        DEFINE_TURB_PREMIX_SOURCE       User-Defined Function
                                                                        Hooks
scalar flux function                DEFINE_UDS_FLUX                User-Defined Scalars
scalar unsteady function          DEFINE_UDS_UNSTEADY            User-Defined Scalars
center of gravity motion         DEFINE_CG_MOTION                   Dynamic Zones
grid motion                      DEFINE_GRID_MOTION                  Dynamic Zones
geometry deformation              DEFINE_GEOM                        Dynamic Zones
NOx formation rate               DEFINE_NOX_RATE                      NOx Model
time step (for time               DEFINE_DELTAT                       Iterate
dependent solutions)
 楼主| 发表于 2008-9-14 14:30 | 显示全部楼层
Table 5.2.1: Flow Variable Macros in mem.h
Name(Arguments)              Argument Types                       Returns
C_T(c,t)                    cell_t c, Thread *t                   temperature
C_T_G(c,t)                  cell_t c, Thread *t               temperature gradient vector
C_T_G(c,t)               cell_t c, Thread *t, int i             temperature gradient
                                                                     component
C_T_RG(c,t)                 cell_t c, Thread *t                  temperature reconstruction
                                                                 gradient vector
C_T_RG(c,t)               cell t c, Thread *t, int i          temperature reconstruction
                                                                  gradient vector component
C_T_M1(c,t)                  cell_t c, Thread *t                    temperature, previous
                                                                      time step
C_T_M2(c,t)                   cell_t c, Thread *t                    temperature, 2nd previous
                                                                     time step
C_P(c,t)                       cell_t c, Thread *t                       pressure
** C DP in sg mem.h
C_DP(c,t)                      cell_t c, Thread *t                  pressure gradient vector
C_DP(c,t)                   cell_t c, Thread *t, int i           pressure gradient component
C_U(c,t)                        cell_t c, Thread *t                     u velocity
C_V(c,t)                         cell_t c, Thread *t                     v velocity
C_W(c,t)                          cell_t c, Thread *t                      w velocity
C_H(c,t)                           cell_t c, Thread *t                     enthalpy
C_YI(c,t,i)                     cell_t c, Thread *t, int i               species mass fraction
C_K(c,t)                         cell_t c, Thread *t                    turb. kinetic energy
C_D(c,t)                      cell_t c, Thread *t                       turb. kinetic energy
                                                                         dissipation rate
C_O(c,t)                         cell_t c, Thread *t                     specific dissipation rate




Table 5.2.2: Derivative Macros in mem.h
Name(Arguments)            Argument Types               Returns
C_DUDX(c,t)              cell_t c, Thread *t            velocity derivative
C_DUDY(c,t)              cell_t c, Thread *t            velocity derivative
C_DUDZ(c,t)              cell_t c, Thread *t              velocity derivative
C_DVDX(c,t)              cell_t c, Thread *t             velocity derivative
C_DVDY(c,t)              cell_t c, Thread *t             velocity derivative
C_DVDZ(c,t)              cell_t c, Thread *t            velocity derivative
C_DWDX(c,t)              cell_t c, Thread *t              velocity derivative
C_DWDY(c,t)              cell_t c, Thread *t            velocity derivative
C_DWDZ(c,t)              cell_t c, Thread *t             velocity derivative



Table 5.2.3: Material Property Macros in mem.h
Name(Arguments)                Argument Types                      Returns
C_FMEAN(c,t)                cell_t c, Thread *t                    primary mean
                                                                  mixture fraction
C_FMEAN2(c,t)                cell_t c, Thread *t                    secondary mean
                                                                    mixture fraction
C_FVAR(c,t)                  cell_t c, Thread *t                      primary mixture
                                                                   fraction variance
C_FVAR2(c,t)                  cell_t c, Thread *t                     secondary mixture
                                                                    fraction variance
C_PREMIXC(c,t)               cell_t c, Thread *t                        reaction progress
                                                                        variable
C_LAM_FLAME_SPEED(c,t)        cell_t c, Thread *t                         laminar flame speed
C CRITICAL_STRAIN            cell_t c, Thread *t                       critical strain rate
                                                                         RATE(c,t)
C_POLLUT(c,t,i)               cell_t c, Thread *t, int i                ith pollutant species
                                                                       mass fraction
C_R(c,t)                     cell_t c, Thread *t                           density
C_MU_L(c,t)                  cell_t c, Thread *t                         laminar viscosity
C_MU_T(c,t)                 cell_t c, Thread *t                        turbulent viscosity
C_MU_EFF(c,t)               cell_t c, Thread *t                           effective viscosity
C_K_L(c,t)                   cell_t c, Thread *t                         thermal conductivity
C_K_T(c,t)                  cell_t c, Thread *t                           turbulent thermal
                                                                           conductivity
C_K_EFF(c,t)                  cell_t c, Thread *t                       effective thermal
                                                                         conductivity
C_CP(c,t)                   cell_t c, Thread *t                         specific heat
C_RGAS(c,t)                  cell_t c, Thread *t                            gas constant
C_DIFF_L(c,t,i,j)            cell_t c, Thread *t, int i,                  laminar species
                             int j                                         diffusivity
C_DIFF_EFF(c,t,i)          cell_t c, Thread *t, int i                     effective species
                                                                         diffusivity
C_ABS_COEFF(c,t)           cell_t c, Thread *t                       absorption coeffcient
C_SCAT_COEFF(c,t)          cell_t c, Thread *t                       scattering coeffcient
C_NUT(c,t)                 cell_t c, Thread *t                          turbulent viscosity
                                                                        for Spalart-Allmaras





Table 5.2.4: User-Defined Scalar and Memory Macros for Cells in mem.h
Name(Arguments)                Argument Types                        Returns
C_UDSI(c,t,i)                   cell_t c, Thread *t, int i       user-defined scalar (cell)
C_UDSI_M(c,t,i)                 cell_t c, Thread *t, int i        user-defined scalar
                                                                previous time step (cell)
C_UDSI_DIFF(c,t,i)              cell_t c, Thread *t, int i         user-defined scalar
                                                                diffusivity (cell)
C_UDMI(c,t,i)                     cell_t c, Thread *t, int i         user-defined memory (cell)



Table 5.2.5: RSM Macros in metric.h
Name(Arguments)                     Argument Types                   Returns
C_RUU(c,t)                       cell_t c, Thread *t               uu Reynolds stress
C_RVV(c,t)                       cell_t c, Thread *t               vv Reynolds stress
C_RWW(c,t)                        cell_t c, Thread *t               ww Reynolds stress
C_RUV(c,t)                       cell_t c, Thread *t               uv Reynolds stress
C_RVW(c,t)                        cell_t c, Thread *t              vw Reynolds stress
C_RUW(c,t)                       cell_t c, Thread *t                 uw Reynolds stress
 楼主| 发表于 2008-9-14 14:30 | 显示全部楼层
Table 5.3.1: Macros for Accessing Flow Variables in mem.h
Name(Arguments)                 Argument Types                          Returns
F_R(f,t)                      face_t f, Thread *t,                      density
F_P(f,t)                      face_t f, Thread *t,                      pressure
F_U(f,t)                     face_t f, Thread *t,                        u velocity
F_V(f,t)                     face_t f, Thread *t,                       v velocity
F_W(f,t)                     face_t f, Thread *t,                       w velocity
F_T(f,t)                       face_t f, Thread *t,                       temperature
F_H(f,t)                    face_t f, Thread *t,                          enthalpy
F_K(f t)                    face_t f, Thread *t,                      turbulent kinetic energy
F_D(f,t)                     face_t f, Thread *t,                  turbulent kinetic energy
                                                                     dissipation rate
F_YI(f,t,i)                   face_t f, Thread *t, int i               species mass fraction
F_FLUX(f,t)                    face_t f, Thread *t                   mass flow rate through
                                                                   a boundary face



Table 5.3.2: User-Defined Scalar and Memory Macros in mem.h
Name(Arguments)                Argument Types                     Returns
F_UDSI(f,t,i)              face_t f, Thread *t, int i       user-defined scalar (face)
F_UDMI(f,t,i)              face_t f, Thread *t, int i       user-defined memory (face)



Table 5.3.3: Miscellaneous Face Variable Macros
Name(Arguments)             Argument Types                   Returns
F_C0(f,t)                   face_t f, Thread *t        cell_t for cell on "0"
                                                       side of face
F_C0_THREAD(f,t)            face_t f, Thread *t         Thread *t for cell thread
                                                     on "0" side of face
F_C1(f,t)                   face_t f, Thread *t          cell_t for cell on
                                                      "1" side of face
F_C1_THREAD(f,t)            face_t f, Thread *t         Thread *t for cell thread
                                                       on"1" side of face



Table 5.4.1: Node and Face Variable Macros in mem.h
Name(Arguments)             Argument Types                   Returns
C_NNODES(c,t)            cell_t c, Thread *t              number of nodes in a cell
C_NFACES(c,t)            cell_t c, Thread *t              number of faces in a cell
F_NNODES(f,t)            face_t f, Thread *t              number of nodes in a face



Table 5.4.2: Centroid Variable Macros in metric.h
Name(Arguments)               Argument Types                        Returns
C_CENTROID(x,c,t)      real x[ND_ND], cell_t c, Thread * t       x (cell centroid)
F_CENTROID(x,f,t)      real x[ND_ND], face_t f, Thread *t        x (face centroid)



Table 5.4.3: Face Area Macros in metric.h
Name(Arguments)              Argument Types                       Returns
F_AREA(A,f,t)            A[ND_ND], face t f, Thread *t            A (area vector)



Table 5.4.4: Cell Volume Macros in mem.h
Name(Arguments)            Argument Types                   Returns
C_VOLUME(c,t)         cell_t c, Thread *t            cell volume for 2D or 3D,
                                                  cell volume/2(pi) for axisymmetric



Table 5.5.1: Node Coordinate Variable Macros in metric.h
Name(Arguments)            Argument Types                    Returns
NODE_X(node)             Node *node                     x coordinate of node
NODE_Y(node)             Node *node                     y coordinate of node
NODE_Z(node)             Node *node                     z coordinate of node


Table 5.5.2: Node Velocity Variable Macros in mem.h
Name(Arguments)           Argument Types                   Returns
NODE_GX(node)            Node *node               x component of node velocity
NODE_GY(node)            Node *node                y component of node velocity
NODE_GZ(node)            Node *node               z component of node velocity
 楼主| 发表于 2008-9-14 14:30 | 显示全部楼层
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]);


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


ND_SUM(x, y, z)
2D: x + y;
3D: x + y + z;


ND_SET(u, v, w, C_U(c, t), C_V(c, t), C_W(c, t))
u = C_U(c, t);
v = C_V(c, t);
if 3D:
w = C_W(c, t);


NV_V(a, =, x);
a[0] = x[0]; a[1] = x[1]; etc.



NV_VV(a, =, x, +, y)
2D: a[0] = x[0] + y[0], a[1] = x[1] + y[1];


NV_V_VS(a, =, x, +, y, *, 0.5);
2D: a[0] = x[0] + (y[0]*0.5), a[1] = x[1] +(y[1]*0.5);


NV_VS_VS(a, =, x, *, 2.0, +, y, *, 0.5);
2D: a[0] = (x[0]*2.0) + (y[0]*0.5), a[1] = (x[1]*2.0) + (y[1]*0.5);


ND_DOT(x, y, z, u, v, w)
2D: (x*u + y*v);
3D: (x*u + y*v + z*w);


NV_DOT(x, u)
2D: (x[0]*u[0] + x[1]*u[1]);
3D: (x[0]*u[0] + x[1]*u[1] + x[2]*u[2]);


NVD_DOT(x, u, v, w)
2D: (x[0]*u + x[1]*v);
3D: (x[0]*u + x[1]*v + x[2]*w);



RP_Get_Real("flow-time")                Returns current simulation time (in seconds)
RP_Get_Real("physical-time-step")       Returns current time step size (in seconds)
RP_Get_ Integer("time-step")               Returns integer number of time steps
                                         that have been run



boolean Data_Valid_P()


You can use the FLUID_THREAD_P function to check whether a thread is a fluid thread.
The function returns 1 (true) if the thread you specify is valid, and 0 (false) if it is not.
boolean FLUID_THREAD_P()

NULLP(T_STORAGE_R_NV(t0, SV_UDSI_G(p1)))    NULLP returns TRUE if storage is not allocated foruser-defined storage variable
NNULLP(T_STORAGE_R_NV(t0, SV_UDSI_G(p1)))NNULLP returns TRUE if storage is allocated for  user-defined storage variable

BOUNDARY_FACE_THREAD_P(t)
This macro returns TRUE if Thread *t is a boundary face thread.

C_FACE_THREAD(c,t,i)
This macro returns the Thread *t of the face t f that is returned by C FACE. Note that
the integer index i can also be accessed by c face loop.

C_FACE(c,t,i)
This macro returns the face face t f for the given cell t c and Thread *t. Note that
the integer index i can also be accessed by c face loop.


M_PI
The macro M PI returns the value of (pi)

UNIVERSAL_GAS_CONSTANT
The macro UNIVERSAL_GAS_CONSTANT returns the value of the universal gas constant
(8314:34), which is expressed in SI units of J=Kmol-K.

SQR(k) and SQRT(k)
SQR(k) returns the square of the given variable k, or k * k.
SQRT(k) returns the square root of the given variable k, or 根号k.

Message ("Volume integral of turbulent dissipation: %g\n", sum_diss);
发表于 2008-9-25 10:12 | 显示全部楼层
这个很好,很全面啊。
发表于 2008-10-8 15:21 | 显示全部楼层
楼主这些是从哪儿搞到的,很厉害!
发表于 2008-10-17 19:36 | 显示全部楼层
:@) :@) :@)
发表于 2008-10-18 10:27 | 显示全部楼层
太多了:lol
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-2 09:57 , Processed in 0.318852 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表