examples update, graded mesh for the helix
This commit is contained in:
parent
8dc89ecac2
commit
329228e840
@ -17,11 +17,11 @@ ylabel('ut_1 \rightarrow');
|
|||||||
grid on;
|
grid on;
|
||||||
|
|
||||||
dt=t(2)-t(1);
|
dt=t(2)-t(1);
|
||||||
u= [u ; zeros(size(u))];
|
u= [u ; zeros(5000,1)];
|
||||||
L=numel(u);
|
L=numel(u);
|
||||||
t = (1:L)*dt;
|
t = (1:L)*dt;
|
||||||
|
|
||||||
f = (1:L)/L/dt;
|
f = (0:L-1)/L/dt;
|
||||||
fu = fft(u)/L;
|
fu = fft(u)/L;
|
||||||
subplot(2,2,2);
|
subplot(2,2,2);
|
||||||
title('u_1 FD');
|
title('u_1 FD');
|
||||||
@ -42,10 +42,10 @@ ylabel('it_1 \rightarrow');
|
|||||||
grid on;
|
grid on;
|
||||||
|
|
||||||
dt=t(2)-t(1);
|
dt=t(2)-t(1);
|
||||||
i = [i; zeros(size(t))];
|
i = [i; zeros(5000,1)];
|
||||||
L=numel(i);
|
L=numel(i);
|
||||||
t = (1:L)*dt;
|
t = (1:L)*dt;
|
||||||
f = (1:L)/L/dt;
|
f = (0:L-1)/L/dt;
|
||||||
|
|
||||||
fi = fft(i)/L;
|
fi = fft(i)/L;
|
||||||
subplot(2,2,4);
|
subplot(2,2,4);
|
||||||
@ -56,8 +56,13 @@ ylabel('|if_1| \rightarrow');
|
|||||||
grid on;
|
grid on;
|
||||||
|
|
||||||
figure(2);
|
figure(2);
|
||||||
|
subplot(2,1,1);
|
||||||
plot(f,real(fu./fi));
|
plot(f,real(fu./fi));
|
||||||
xlim([0 1e9]);
|
xlim([0 1e9]);
|
||||||
grid on;
|
grid on;
|
||||||
|
subplot(2,1,2);
|
||||||
|
plot(f,imag(fu./fi));
|
||||||
|
xlim([0 1e9]);
|
||||||
|
grid on;
|
||||||
|
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ void BuildPlaneWave(const char* filename)
|
|||||||
|
|
||||||
void BuildMSL(const char* filename)
|
void BuildMSL(const char* filename)
|
||||||
{
|
{
|
||||||
int maxIter = 1000;
|
int maxIter = 10000;
|
||||||
double f0=0.5e9;
|
double f0=0.5e9;
|
||||||
double fc=0.5e9;
|
double fc=0.5e9;
|
||||||
int Excit_Type=0;
|
int Excit_Type=0;
|
||||||
@ -599,7 +599,7 @@ void BuildCoaxial_Cartesian(const char* filename)
|
|||||||
|
|
||||||
void BuildHelix(const char* filename)
|
void BuildHelix(const char* filename)
|
||||||
{
|
{
|
||||||
int maxIter = 1e5;
|
int maxIter = 5e5;
|
||||||
double f0=0.5e9;
|
double f0=0.5e9;
|
||||||
double fc=0.5e9;
|
double fc=0.5e9;
|
||||||
int Excit_Type=0;
|
int Excit_Type=0;
|
||||||
@ -614,7 +614,6 @@ void BuildHelix(const char* filename)
|
|||||||
double coil_length = 50;
|
double coil_length = 50;
|
||||||
double delta[] = {0.5,0.5,0.5};
|
double delta[] = {0.5,0.5,0.5};
|
||||||
|
|
||||||
//MSL
|
|
||||||
CSPropMaterial* copper = new CSPropMaterial(CSX.GetParameterSet());
|
CSPropMaterial* copper = new CSPropMaterial(CSX.GetParameterSet());
|
||||||
copper->SetKappa(56e6);
|
copper->SetKappa(56e6);
|
||||||
copper->SetName("copper");
|
copper->SetName("copper");
|
||||||
@ -622,7 +621,7 @@ void BuildHelix(const char* filename)
|
|||||||
|
|
||||||
CSPrimUserDefined* helix = new CSPrimUserDefined(CSX.GetParameterSet(),copper);
|
CSPrimUserDefined* helix = new CSPrimUserDefined(CSX.GetParameterSet(),copper);
|
||||||
helix->SetCoordSystem(CSPrimUserDefined::CYLINDER_SYSTEM);
|
helix->SetCoordSystem(CSPrimUserDefined::CYLINDER_SYSTEM);
|
||||||
helix->SetFunction("(r>9)&(r<11)&(sqrt(pow(x-r*cos(2*pi*z/6.25),2)+pow(y-r*sin(2*pi*z/6.25),2))<2)&(z>0)&(z<50)");
|
helix->SetFunction("(r>9.3)&(r<10.7)&(sqrt(pow(x-r*cos(2*pi*z/6.25),2)+pow(y-r*sin(2*pi*z/6.25),2))<1.4)&(z>0)&(z<50)");
|
||||||
CSX.AddPrimitive(helix);
|
CSX.AddPrimitive(helix);
|
||||||
CSPrimCylinder* cyl = new CSPrimCylinder(CSX.GetParameterSet(),copper);
|
CSPrimCylinder* cyl = new CSPrimCylinder(CSX.GetParameterSet(),copper);
|
||||||
cyl->SetRadius(wire_rad);
|
cyl->SetRadius(wire_rad);
|
||||||
@ -670,15 +669,15 @@ void BuildHelix(const char* filename)
|
|||||||
CSPropDumpBox* Edump = NULL;
|
CSPropDumpBox* Edump = NULL;
|
||||||
CSPrimBox* box = NULL;
|
CSPrimBox* box = NULL;
|
||||||
//E-field dump xz
|
//E-field dump xz
|
||||||
// Edump = new CSPropDumpBox(CSX.GetParameterSet());
|
Edump = new CSPropDumpBox(CSX.GetParameterSet());
|
||||||
// Edump->SetDumpType(0);
|
Edump->SetDumpType(0);
|
||||||
// Edump->SetName("Et_xz_");
|
Edump->SetName("Et_xz_");
|
||||||
// CSX.AddProperty(Edump);
|
CSX.AddProperty(Edump);
|
||||||
// box = new CSPrimBox(CSX.GetParameterSet(),Edump);
|
box = new CSPrimBox(CSX.GetParameterSet(),Edump);
|
||||||
// box->SetCoord(0,coil_rad/-2.0-25.0);box->SetCoord(1,coil_rad/2.0+25.0+feed_length);
|
box->SetCoord(0,coil_rad/-1.0-25.0);box->SetCoord(1,coil_rad/1.0+25.0+feed_length);
|
||||||
// box->SetCoord(2,0.0);box->SetCoord(3,0.0);
|
box->SetCoord(2,0.0);box->SetCoord(3,0.0);
|
||||||
// box->SetCoord(4,-25.0);box->SetCoord(5,coil_length+25.0);
|
box->SetCoord(4,-25.0);box->SetCoord(5,coil_length+25.0);
|
||||||
// CSX.AddPrimitive(box);
|
CSX.AddPrimitive(box);
|
||||||
//
|
//
|
||||||
// //E-field dump xy
|
// //E-field dump xy
|
||||||
// Edump = new CSPropDumpBox(CSX.GetParameterSet());
|
// Edump = new CSPropDumpBox(CSX.GetParameterSet());
|
||||||
@ -728,13 +727,50 @@ void BuildHelix(const char* filename)
|
|||||||
|
|
||||||
CSRectGrid* grid = CSX.GetGrid();
|
CSRectGrid* grid = CSX.GetGrid();
|
||||||
|
|
||||||
for (double n=coil_rad/-2.0-25.0;n<=coil_rad/2.0+25.0+feed_length;n+=delta[0])
|
double offset[]={coil_rad/-1.0,coil_rad/-1.0,0.0};
|
||||||
|
//graded mesh
|
||||||
|
for (int n=0;n<3;++n)
|
||||||
|
{
|
||||||
|
grid->AddDiscLine(n,offset[n] - 25.0);
|
||||||
|
grid->AddDiscLine(n,offset[n] - 15.0);
|
||||||
|
grid->AddDiscLine(n,offset[n] - 10.0);
|
||||||
|
grid->AddDiscLine(n,offset[n] - 5.0);
|
||||||
|
grid->AddDiscLine(n,offset[n] - 2.0);
|
||||||
|
grid->AddDiscLine(n,offset[n] - 1.0);
|
||||||
|
grid->AddDiscLine(n,offset[n] - 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (double n=coil_rad/-1.0;n<=coil_rad;n+=delta[0])
|
||||||
grid->AddDiscLine(0,n);
|
grid->AddDiscLine(0,n);
|
||||||
for (double n=coil_rad/-2.0-25.0;n<=coil_rad/2.0+25.0;n+=delta[1])
|
//feeding mesh
|
||||||
|
grid->AddDiscLine(0,coil_rad+0.5);
|
||||||
|
grid->AddDiscLine(0,coil_rad+1);
|
||||||
|
grid->AddDiscLine(0,coil_rad+2);
|
||||||
|
grid->AddDiscLine(0,coil_rad+5);
|
||||||
|
grid->AddDiscLine(0,coil_rad+7);
|
||||||
|
grid->AddDiscLine(0,coil_rad+9);
|
||||||
|
grid->AddDiscLine(0,coil_rad+9.5);
|
||||||
|
grid->AddDiscLine(0,coil_rad+10);
|
||||||
|
for (double n=coil_rad/-1.0;n<=coil_rad;n+=delta[1])
|
||||||
grid->AddDiscLine(1,n);
|
grid->AddDiscLine(1,n);
|
||||||
for (double n=-25.0;n<=coil_length+25.0;n+=delta[2])
|
for (double n=0.0;n<=coil_length;n+=delta[2])
|
||||||
grid->AddDiscLine(2,n);
|
grid->AddDiscLine(2,n);
|
||||||
|
|
||||||
|
offset[0]=coil_rad+feed_length;
|
||||||
|
offset[1]=coil_rad;
|
||||||
|
offset[2]=coil_length;
|
||||||
|
for (int n=0;n<3;++n)
|
||||||
|
{
|
||||||
|
grid->AddDiscLine(n,offset[n] + 0.5);
|
||||||
|
grid->AddDiscLine(n,offset[n] + 1.0);
|
||||||
|
grid->AddDiscLine(n,offset[n] + 2.0);
|
||||||
|
grid->AddDiscLine(n,offset[n] + 5.0);
|
||||||
|
grid->AddDiscLine(n,offset[n] + 10.0);
|
||||||
|
grid->AddDiscLine(n,offset[n] + 15.0);
|
||||||
|
grid->AddDiscLine(n,offset[n] + 25.0);
|
||||||
|
grid->Sort(n);
|
||||||
|
}
|
||||||
|
|
||||||
grid->SetDeltaUnit(1e-3);
|
grid->SetDeltaUnit(1e-3);
|
||||||
|
|
||||||
//*************** Create XML file **********************
|
//*************** Create XML file **********************
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
|
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
|
||||||
<openEMS>
|
<openEMS>
|
||||||
<FDTD NumberOfTimesteps="100000">
|
<FDTD NumberOfTimesteps="500000">
|
||||||
<Excitation Type="0" f0="500000000" fc="500000000" />
|
<Excitation Type="0" f0="500000000" fc="500000000" />
|
||||||
<BoundaryCond xmin="1" xmax="1" ymin="1" ymax="1" zmin="1" zmax="1" />
|
<BoundaryCond xmin="1" xmax="1" ymin="1" ymax="1" zmin="1" zmax="1" />
|
||||||
</FDTD>
|
</FDTD>
|
||||||
<ContinuousStructure>
|
<ContinuousStructure>
|
||||||
<RectilinearGrid DeltaUnit="0.001000">
|
<RectilinearGrid DeltaUnit="0.001000">
|
||||||
<XLines Qty="141">-30,-29.5,-29,-28.5,-28,-27.5,-27,-26.5,-26,-25.5,-25,-24.5,-24,-23.5,-23,-22.5,-22,-21.5,-21,-20.5,-20,-19.5,-19,-18.5,-18,-17.5,-17,-16.5,-16,-15.5,-15,-14.5,-14,-13.5,-13,-12.5,-12,-11.5,-11,-10.5,-10,-9.5,-9,-8.5,-8,-7.5,-7,-6.5,-6,-5.5,-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.5,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5,23,23.5,24,24.5,25,25.5,26,26.5,27,27.5,28,28.5,29,29.5,30,30.5,31,31.5,32,32.5,33,33.5,34,34.5,35,35.5,36,36.5,37,37.5,38,38.5,39,39.5,40</XLines>
|
<XLines Qty="63">-35,-25,-20,-15,-12,-11,-10.5,-10,-9.5,-9,-8.5,-8,-7.5,-7,-6.5,-6,-5.5,-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,12,15,17,19,19.5,20,20.5,21,22,25,30,35,45</XLines>
|
||||||
<YLines Qty="121">-30,-29.5,-29,-28.5,-28,-27.5,-27,-26.5,-26,-25.5,-25,-24.5,-24,-23.5,-23,-22.5,-22,-21.5,-21,-20.5,-20,-19.5,-19,-18.5,-18,-17.5,-17,-16.5,-16,-15.5,-15,-14.5,-14,-13.5,-13,-12.5,-12,-11.5,-11,-10.5,-10,-9.5,-9,-8.5,-8,-7.5,-7,-6.5,-6,-5.5,-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.5,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5,23,23.5,24,24.5,25,25.5,26,26.5,27,27.5,28,28.5,29,29.5,30</YLines>
|
<YLines Qty="55">-35,-25,-20,-15,-12,-11,-10.5,-10,-9.5,-9,-8.5,-8,-7.5,-7,-6.5,-6,-5.5,-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,12,15,20,25,35</YLines>
|
||||||
<ZLines Qty="201">-25,-24.5,-24,-23.5,-23,-22.5,-22,-21.5,-21,-20.5,-20,-19.5,-19,-18.5,-18,-17.5,-17,-16.5,-16,-15.5,-15,-14.5,-14,-13.5,-13,-12.5,-12,-11.5,-11,-10.5,-10,-9.5,-9,-8.5,-8,-7.5,-7,-6.5,-6,-5.5,-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.5,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5,23,23.5,24,24.5,25,25.5,26,26.5,27,27.5,28,28.5,29,29.5,30,30.5,31,31.5,32,32.5,33,33.5,34,34.5,35,35.5,36,36.5,37,37.5,38,38.5,39,39.5,40,40.5,41,41.5,42,42.5,43,43.5,44,44.5,45,45.5,46,46.5,47,47.5,48,48.5,49,49.5,50,50.5,51,51.5,52,52.5,53,53.5,54,54.5,55,55.5,56,56.5,57,57.5,58,58.5,59,59.5,60,60.5,61,61.5,62,62.5,63,63.5,64,64.5,65,65.5,66,66.5,67,67.5,68,68.5,69,69.5,70,70.5,71,71.5,72,72.5,73,73.5,74,74.5,75</ZLines>
|
<ZLines Qty="115">-25,-15,-10,-5,-2,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10,10.5,11,11.5,12,12.5,13,13.5,14,14.5,15,15.5,16,16.5,17,17.5,18,18.5,19,19.5,20,20.5,21,21.5,22,22.5,23,23.5,24,24.5,25,25.5,26,26.5,27,27.5,28,28.5,29,29.5,30,30.5,31,31.5,32,32.5,33,33.5,34,34.5,35,35.5,36,36.5,37,37.5,38,38.5,39,39.5,40,40.5,41,41.5,42,42.5,43,43.5,44,44.5,45,45.5,46,46.5,47,47.5,48,48.5,49,49.5,50,50.5,51,52,55,60,65,75</ZLines>
|
||||||
</RectilinearGrid>
|
</RectilinearGrid>
|
||||||
<ParameterSet />
|
<ParameterSet />
|
||||||
<Properties>
|
<Properties>
|
||||||
@ -38,19 +38,26 @@
|
|||||||
<Excitation Type="1" Excit_X="0.000000e+00" Excit_Y="0.000000e+00" Excit_Z="1.000000e+00" />
|
<Excitation Type="1" Excit_X="0.000000e+00" Excit_Y="0.000000e+00" Excit_Z="1.000000e+00" />
|
||||||
<Weight X="1.000000e+00" Y="1.000000e+00" Z="1.000000e+00" />
|
<Weight X="1.000000e+00" Y="1.000000e+00" Z="1.000000e+00" />
|
||||||
</Electrode>
|
</Electrode>
|
||||||
<ProbeBox ID="3" Name="u1" Number="0" Type="0">
|
<DumpBox ID="3" Name="Et_xz_" GlobalSetting="1" DumpType="0" DumpMode="0">
|
||||||
<FillColor R="225" G="252" B="103" a="255" />
|
<FillColor R="225" G="252" B="103" a="255" />
|
||||||
<EdgeColor R="225" G="252" B="103" a="255" />
|
<EdgeColor R="225" G="252" B="103" a="255" />
|
||||||
</ProbeBox>
|
<ScalarDump DumpPhi="1" DumpDivE="0" DumpDivD="0" DumpDivP="0" DumpFieldW="0" DumpChargeW="0" />
|
||||||
<ProbeBox ID="4" Name="i1" Number="0" Type="1">
|
<VectorDump DumpEField="0" DumpDField="0" DumpPField="0" />
|
||||||
|
<SubGridDump SubGridDump="0" SimpleDump="0" SubGridLevel="-1" />
|
||||||
|
</DumpBox>
|
||||||
|
<ProbeBox ID="4" Name="u1" Number="0" Type="0">
|
||||||
<FillColor R="62" G="1" B="126" a="255" />
|
<FillColor R="62" G="1" B="126" a="255" />
|
||||||
<EdgeColor R="62" G="1" B="126" a="255" />
|
<EdgeColor R="62" G="1" B="126" a="255" />
|
||||||
</ProbeBox>
|
</ProbeBox>
|
||||||
|
<ProbeBox ID="5" Name="i1" Number="0" Type="1">
|
||||||
|
<FillColor R="151" G="234" B="220" a="255" />
|
||||||
|
<EdgeColor R="151" G="234" B="220" a="255" />
|
||||||
|
</ProbeBox>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Primitives>
|
<Primitives>
|
||||||
<UserDefined ID="0" PropertyID="0" Priority="0" CoordSystem="1">
|
<UserDefined ID="0" PropertyID="0" Priority="0" CoordSystem="1">
|
||||||
<CoordShift X="0.000000e+00" Y="0.000000e+00" Z="0.000000e+00" />
|
<CoordShift X="0.000000e+00" Y="0.000000e+00" Z="0.000000e+00" />
|
||||||
<Function>(r>9)&(r<11)&(sqrt(pow(x-r*cos(2*pi*z/6.25),2)+pow(y-r*sin(2*pi*z/6.25),2))<2)&(z>0)&(z<50)</Function>
|
<Function>(r>9.3)&(r<10.7)&(sqrt(pow(x-r*cos(2*pi*z/6.25),2)+pow(y-r*sin(2*pi*z/6.25),2))<1.4)&(z>0)&(z<50)</Function>
|
||||||
</UserDefined>
|
</UserDefined>
|
||||||
<Cylinder ID="1" PropertyID="0" Priority="0" Radius="7.000000e-01">
|
<Cylinder ID="1" PropertyID="0" Priority="0" Radius="7.000000e-01">
|
||||||
<P0 X="1.000000e+01" Y="0.000000e+00" Z="0.000000e+00" />
|
<P0 X="1.000000e+01" Y="0.000000e+00" Z="0.000000e+00" />
|
||||||
@ -73,10 +80,14 @@
|
|||||||
<P1 X="2.000000e+01" Y="0.000000e+00" Z="2.550000e+01" />
|
<P1 X="2.000000e+01" Y="0.000000e+00" Z="2.550000e+01" />
|
||||||
</Cylinder>
|
</Cylinder>
|
||||||
<Box ID="6" PropertyID="3" Priority="0">
|
<Box ID="6" PropertyID="3" Priority="0">
|
||||||
|
<P1 X="-3.500000e+01" Y="0.000000e+00" Z="-2.500000e+01" />
|
||||||
|
<P2 X="4.500000e+01" Y="0.000000e+00" Z="7.500000e+01" />
|
||||||
|
</Box>
|
||||||
|
<Box ID="7" PropertyID="4" Priority="0">
|
||||||
<P1 X="2.000000e+01" Y="0.000000e+00" Z="2.550000e+01" />
|
<P1 X="2.000000e+01" Y="0.000000e+00" Z="2.550000e+01" />
|
||||||
<P2 X="2.000000e+01" Y="0.000000e+00" Z="2.450000e+01" />
|
<P2 X="2.000000e+01" Y="0.000000e+00" Z="2.450000e+01" />
|
||||||
</Box>
|
</Box>
|
||||||
<Box ID="7" PropertyID="4" Priority="0">
|
<Box ID="8" PropertyID="5" Priority="0">
|
||||||
<P1 X="1.800000e+01" Y="-2.000000e+00" Z="2.500000e+01" />
|
<P1 X="1.800000e+01" Y="-2.000000e+00" Z="2.500000e+01" />
|
||||||
<P2 X="2.200000e+01" Y="2.000000e+00" Z="2.500000e+01" />
|
<P2 X="2.200000e+01" Y="2.000000e+00" Z="2.500000e+01" />
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
|
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
|
||||||
<openEMS>
|
<openEMS>
|
||||||
<FDTD NumberOfTimesteps="1000">
|
<FDTD NumberOfTimesteps="10000">
|
||||||
<Excitation Type="0" f0="500000000" fc="500000000" />
|
<Excitation Type="0" f0="500000000" fc="500000000" />
|
||||||
<BoundaryCond xmin="1" xmax="1" ymin="0" ymax="0" zmin="0" zmax="0" />
|
<BoundaryCond xmin="1" xmax="1" ymin="0" ymax="0" zmin="0" zmax="0" />
|
||||||
</FDTD>
|
</FDTD>
|
||||||
|
Loading…
Reference in New Issue
Block a user