用ddpm模型 模拟气泡聚并与破碎
-
主要参考这篇文献
Cho S M , Thomas B G , Kim S H . Bubble Behavior and Size Distributions in Stopper-Rod Nozzle and Mold during Continuous Casting of Steel Slabs[J]. Isij International, 2018, 58(8):1443-1452.
现在想在DEFINE_DPM_INJECTION_INIT(init_bubbles,I) 这个宏里创建和删除颗粒实现颗粒聚并破碎效果,但是在injection里新增一个颗粒 的宏没在标准的帮助里,在dpm_*.h的文件中试了些个都不好用,想咨询下专家的建议
-
#include "udf.h" #include "dpm.h" DEFINE_DPM_SCALAR_UPDATE(ceshi, c, t, initialize, p) { Injection *I; Injection *Ilist = Get_dpm_injections(); loop(I, Ilist) { Particle *p_new; p_new = new_particle(I, FALSE); p_new->part_id = get_next_part_id(); P_INJECTION(p_new) = I; p_new->I_id = 0; ((p_new)->stream_index) = 1; P_POS(p_new)[0] = 0; P_POS(p_new)[1] = 0; P_POS(p_new)[2] = 5; P_VEL(p_new)[0] = 0; P_VEL(p_new)[1] = 0; P_VEL(p_new)[2] = 0; P_DIAM(p_new) = 0.001; p_new->n_steps = 0; p_new->next_time_step = solver_par.flow_time_step; P_TIME(p_new) = solver_par.flow_time; memcpy((char *)&(p_new->init_state), (char *)&(p_new->state), sizeof(particle_state_t)); P_FLOW_RATE(p_new) = 0.001; p_new->time_of_birth = 0.0; alloc_pvars(p_new); append_particle_to_list(p_new, &(I->p), I);/* 问题函数 */ I->n_particles++; } }
append_particle_to_list(p_new, &(I->p), I); 这个函数总是出问题,有人知道怎么用么这个函数