Mur-ABC: set a phase velocity to handle dispersive waveguides

This commit is contained in:
Thorsten Liebig 2010-08-10 07:50:53 +02:00
parent a82cd6d817
commit bac2fc22f7
4 changed files with 31 additions and 4 deletions

View File

@ -28,6 +28,8 @@ Operator_Ext_Mur_ABC::Operator_Ext_Mur_ABC(Operator* op) : Operator_Extension(op
m_LineNr = 0;
m_LineNr_Shift = 0;
m_v_phase = 0.0;
m_Mur_Coeff_nyP = NULL;
m_Mur_Coeff_nyPP = NULL;
@ -111,19 +113,28 @@ bool Operator_Ext_Mur_ABC::BuildExtension()
//nP
eps = mat->GetEpsilonWeighted(m_nyP,coord);
mue = mat->GetMueWeighted(m_nyP,coord);
c0t = __C0__ * dT / sqrt(eps*mue);
if (m_v_phase>0.0)
c0t = m_v_phase * dT;
else
c0t = __C0__ * dT / sqrt(eps*mue);
m_Mur_Coeff_nyP[pos[m_nyP]][pos[m_nyPP]] = (c0t - delta) / (c0t + delta);
//nPP
eps = mat->GetEpsilonWeighted(m_nyPP,coord);
mue = mat->GetMueWeighted(m_nyPP,coord);
c0t = __C0__ * dT / sqrt(eps*mue);
if (m_v_phase>0.0)
c0t = m_v_phase * dT;
else
c0t = __C0__ * dT / sqrt(eps*mue);
m_Mur_Coeff_nyPP[pos[m_nyP]][pos[m_nyPP]] = (c0t - delta) / (c0t + delta);
}
else
{
c0t = __C0__ * dT;
if (m_v_phase>0.0)
c0t = m_v_phase * dT;
else
c0t = __C0__ * dT;
m_Mur_Coeff_nyP[pos[m_nyP]][pos[m_nyPP]] = (c0t - delta) / (c0t + delta);
m_Mur_Coeff_nyPP[pos[m_nyP]][pos[m_nyPP]] = m_Mur_Coeff_nyP[pos[m_nyP]][pos[m_nyPP]];
}
@ -145,5 +156,7 @@ void Operator_Ext_Mur_ABC::ShowStat(ostream &ostr) const
{
Operator_Extension::ShowStat(ostr);
string XYZ[3] = {"x","y","z"};
ostr << " Active direction: " << XYZ[m_ny] << " at line: " << m_LineNr << endl;
ostr << " Active direction\t: " << XYZ[m_ny] << " at line: " << m_LineNr << endl;
if (m_v_phase>0.0)
ostr << " Used phase velocity\t: " << m_v_phase << " (" << m_v_phase/__C0__ << " * c_0)" <<endl;
}

View File

@ -31,6 +31,9 @@ public:
//! Define the direction of this ABC: \a ny=0,1,2 -> x,y,z and if at bottom_ny -> e.g. x=0 or x=end
void SetDirection(int ny, bool top_ny);
//! Set (override) the expected phase velocity of the incoming wave
void SetPhaseVelocity(double c_phase) {m_v_phase=c_phase;};
virtual bool BuildExtension();
virtual Engine_Extension* CreateEngineExtention();
@ -47,6 +50,8 @@ protected:
unsigned int m_LineNr;
int m_LineNr_Shift;
double m_v_phase;
unsigned int m_numLines[2];
FDTD_FLOAT** m_Mur_Coeff_nyP;

View File

@ -13,6 +13,12 @@ function FDTD = SetBoundaryCond(FDTD, BC, varargin)
% BC = [ 1 1 0 0 2 3 ] %using numbers or
% BC = {'PMC' 'PMC' 'PEC' 'PEC' 'MUR' 'PML_8'} %usign equivalent strings
%
% mur-abc definitions
% define a phase-velocity to be used by the mur-abc
% useful e.g. for dispersive waveguides
% FDTD = SetBoundaryCond(FDTD,BC,'MUR_PhaseVelocity',299792457.93272);
%
%
% pml definitions
% arguments: 'PML_Grading','gradFunction'
% Define the pml grading grading function.

View File

@ -204,6 +204,9 @@ bool openEMS::SetupBoundaryConditions(TiXmlElement* BC)
{
Operator_Ext_Mur_ABC* op_ext_mur = new Operator_Ext_Mur_ABC(FDTD_Op);
op_ext_mur->SetDirection(n/2,n%2);
double v_ph = 0;
if (BC->QueryDoubleAttribute("MUR_PhaseVelocity",&v_ph) == TIXML_SUCCESS)
op_ext_mur->SetPhaseVelocity(v_ph);
FDTD_Op->AddExtension(op_ext_mur);
}
}