微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 电磁仿真讨论 > Need Help About 2nd Order ABC

Need Help About 2nd Order ABC

时间:03-22 整理:3721RD 点击:
My friends I have coppied Fortran code of 2nd order derivation of Mur's ABCs( in Kunz book on page 406) and written it as C code but it does not exactly absorb the waves can anyone help me what should I do, for , the code for the first face is as follows please could you suggest me something or a better book in C not Dennis Sullivans because He uses PML thank for your interest.

void Apply_Absorbing_Boundary_Conditons_On_XY_Plane_1st _Face_(void)
{
/* for( k = 1; k < KE-1; k++ )
{
j = 2;
ez[1][j][k] = ezsx1[2][j][k] + cxd*( ez[2][j][k] - ezsx1[1][j][k] );
ez[IE][j][k] = ezsx1[3][j][k] + cxu*( ez[IE - 1][j][k] - ezsx1[4][j][k] );

j = JE - 1;
ez[1][j][k] = ezsx1[2][j][k] + cxd*(ez[2][j][k]- ezsx1[1][j][k]);
ez[IE][j][k] = ezsx1[3][j][k] + cxu*( ez[IE - 1][j][k]- ezsx1[4][j][k] );
}

for( j = 3; j <= JE - 2; j++ )
{
k = 1;
ez[1][j][k] = ezsx1[2][j][k] + cxd*( ez[2][j][k] - ezsx1[1][j][k]);
ez[IE][j][k] = ezsx1[3][j][k] + cxu*( ez[IE - 1][j][k] - ezsx1[4][j][k]);

k = KE - 1;
ez[1][j][k] = ezsx1[2][j][k] + cxd*( ez[2][j][k] - ezsx1[1][j][k] );
ez[IE][j][k] = ezsx1[3][j][k] + cxu*( ez[IE - 1][j][k] - ezsx1[4][j][k] );
}
*/
for( k = 2; k < KE -1 ; k++ )
for( j = 3; j <= JE - 1; j++ )
{
ez[1][j][k] = -ezsx2[2][j][k] + cxd*( ez[2][j][k] + ezsx2[1][j][k] )
+ cxx*( ezsx1[1][j][k] + ezsx1[2][j][k] )
+ cxfyd*( ezsx1[1][j + 1][k] - 2.*ezsx1[1][j][k] + ezsx1[1][j-1][k]
+ ezsx1[2][j+1][k] - 2.*ezsx1[2][j][k] + ezsx1[2][j-1][k] )
+ cxfzd*( ezsx1[1][j][k+1] - 2.*ezsx1[1][j][k] + ezsx1[1][j][k - 1]
+ ezsx1[2][j][k+1] - 2.*ezsx1[2][j][k] + ezsx1[2][j][k - 1] );

ez[IE][j][k] = -ezsx2[3][j][k] + cxd*( ez[IE-1][j][k] + ezsx2[4][j][k] )
+ cxx*( ezsx1[4][j][k] + ezsx1[3][j][k] )
+ cxfyd*( ezsx1[4][j+1][k] - 2.*ezsx1[4][j][k] + ezsx1[4][j-1][k]
+ ezsx1[3][j+1][k] - 2.*ezsx1[3][j][k] + ezsx1[3][j-1][k] )
+ cxfzd*( ezsx1[4][j][k+1] - 2.*ezsx1[4][j][k] + ezsx1[4][j][k-1]
+ ezsx1[3][j][k+1] - 2.*ezsx1[3][j][k] + ezsx1[3][j][k-1] );
}

for( k = 1; k < KE - 1; k++ )
for( j = 2; j <= JE - 1; j++ )
{
ezsx2[1][j][k] = ezsx1[1][j][k];
ezsx2[2][j][k] = ezsx1[2][j][k];
ezsx2[3][j][k] = ezsx1[3][j][k];
ezsx2[4][j][k] = ezsx1[4][j][k];
ezsx1[1][j][k] = ez[1][j][k];
ezsx1[2][j][k] = ez[2][j][k];
ezsx1[3][j][k] = ez[IE-1][j][k];
ezsx1[4][j][k] = ez[IE][j][k];
}
}
上一篇:please solve a question?
下一篇:最后一页

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top