各种宏的定义及作用

“MPPIC方法采用了时间算子分裂算法PISO,将每一个时间步下引起颗粒速度、位置变化的因素分裂为三个独立部分:第一部分包括了曳力、气相压力梯度力、重力以及各向同性力;第二部分为固相应力梯度力;第三部分则是碰撞阻尼力。

由于各向同性力与碰撞阻尼力在平均固相体积分数较大的气固流态化中一般可忽略,因此FOAM-PIC仅考虑前两部分的颗粒速度、速度变化。 ”

姜勇. 基于 MP-PIC 方法的流态化反应器快速模拟研究[D]. 中国科学院大学 (中国科学院过程工程研究所), 2020.

#define __INSERT_PARCEL__

@note macro __INSERT_PARCEL__ means using inserting method for parcels

在mppic_main.cpp里面的mppic_update_one_step函数中

#ifdef __INSERT_PARCEL__
        /* 0. Insert parcels. */
        insert_parcel();
#endif

insert.cpp文件中出现insert_parcel()函数,是用不同的方法在不同的位置的插入不同颗粒数,需要人为决定手动调整。

#define __FOAM_PGF__

@note macro __FOAM_PGF__ means calculate pressure gradient force in OpenFOAM fluid program part.

在calc_pgf.cpp的calc_pgf()函数中,如果没定义这个就运行这个pgf,否则就是用openfoam自身流体的pgf求解

#ifndef __FOAM_PGF__
    reset_cell_pgf();

    calc_cell_pgf();

    correct_boundary_cell_pgf();

    reset_grid_pgf();

    calc_grid_pgf();

    correct_boundary_grid_pgf();
#endif


#define __USE_EMMS_DRAG__

@note macro __USE_EMMS_DRAG__ means that calculate drag force by using EMMS drag model.

在calc_drag.cpp里面的计算parcel的cd一步中。
 

#define __USE_XXXX_STRESS__

@note macro __USE_XXXX_STRESS__ means that calculate solid stress by using homogeneous/KTGF/EMMS solid stress model.

#define __USE_HOMO_STRESS__

#define __USE_KTGF_STRESS__

#define __USE_EMMS_STRESS__
在calc_sgf.cpp,variables.h中

#define __PERIODIC__

@note macro __PERIODIC__ means using periodic boundary condition.

在mppic_main.cpp,walls.cpp中

read_reins(),读init/reinsert.ini文件, Read parameters for reinserting operation. 

walls.cpp中,

#ifdef __PERIODIC__
                    ps[id].in = 0;
#else

没看到别的用处...

看到一句话,估计是这一版1.5.s代码中没有periodic了,直接都是采用insert.cpp文件来插入parcel的了。留着一点代码在里面,难道是为了留标签来区分颗粒是哪种类型啊?有可能吧

 * @version 1.5.s
 * @note    1. Remove __GEO_WALL__ related functions after version 1.4.s, and
 *          remove __STL_WALL__ macro subsequently.
 * @note    2. Remove through_periodic_boundary() function and refresh_parcel()
 *          function after version 1.4.s.

在并行中有用到它,在update.cpp里面的mpi_data_trans_for_parcels()函数中,就是将最上面出来的颗粒都回收到下面的入口。

知道串行在哪里用了,在inter-phase/periodicReinsert.H文件中用到,但是这个代码把它给屏蔽了,所以没用到它。等我试试用它会跑出什么来。

#define __DAMPING__

@note macro __DAMPING__ means using collision damping model. 就是碰撞阻尼力,通常在平均固相体积分数较大的气固流态化中一般可忽略。

在mppic_main.cpp里面,calc_cdf()

#ifdef __DAMPING__
        /* New.1. Calculate collision damping force */
        calc_cdf();

        /* New.2. Update particle position, velocity */
        update_3rd();

        /* New.3. Refresh cell and grid variables. */
        interpolation_3rd();
#endif

公式来源文献:

 * @note    References:
 *          [1]. O’Rourke P J, Snider D M. An improved collision damping time
 *          for MP-PIC calculations of dense particle flows with applications to
 *          polydisperse sedimenting beds and colliding particle jets[J].
 *          Chemical Engineering Science, 2010, 65(22):6014-6028.
 *          [2]. O'Rourke P J, Snider D M. A new blended acceleration model for
 *          the particle contact forces induced by an interstitial fluid in
 *          dense particle/fluid flows[J]. Powder Technology, 2014,
 *          256(256):39-51.

gcc宏定义在makefile中进行定义

关键词: Make宏定义 Make传递宏定义 Makefile中添加宏定义 Makefile -D

在Makefile中我们可以通过宏定义来控制源程序的编译。只要在Makefile中的CFLAGS中通过选项-D来指定你于定义的宏即可。

如:
CFLAGS += -D _YUQIANG
在编译的时候加上此选项就可以了: $(CC) $(CFLAGS) $^ -o $@

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值