内容发布更新时间 : 2025/2/8 13:09:43星期一 下面是文章的全部内容请认真阅读。
#include \#define Pm 0.03 #define Pmx 0.9 #define Et 20
DEFINE_SOURCE(xmom_source,c,t,dS,eqn) {
real xc[ND_ND]; real force; cell_t cell;
Thread*cell_thread; Domain*subdomain; real A,B,C,source;
begin_c_loop_all(cell,cell_thread) {
C_CENTROID(xc,cell,cell_thread); if(xc[0]>=-25 && xc[0]<=-12 ) {
if(xc[1]>=7 && xc[1]<=12)
force=3200*pow(10,-275*fabs(xc[0])-275*fabs(xc[1])); A=1/(C_R(c,t)*force);
B=2*Pm*Pmx*Et/C_R(c,t);
source=C_R(c,t)*(sqrt(A*C_U(c,t)*C_U(c,t)+B)-C_U(c,t)); dS[eqn]=A*C*pow((A*C_U(c,t)*C_U(c,t)+B),3/2)-C; return source; }
end_c_loop_all(cell,cell_thread) } }