You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an interest in magnetic levitation, and for a while I have been studying and becoming familiar with openEMS to try and see if it is possible to simulate the magnetic field created by electromagnets (starting off with wires) driven by a constant current source. openEMS is generally not intended to be used for such applications, but it seems like a good option when compared to the often pricy proprietary programs used in such simulations. Something similar was discussed in #231.
I've been trying to emulate a current source by using a 50 ohm lumped port with a step-excitation in the middle of a rectangular strip with the same conductivity as copper. This strip is connected to a ground plane though the use of tiny conductors at each end of the strip.
When simulated and visualized with paraview it shows there is no current density while there is an electric field throughout the structure. This surprises me because current density is calculated as the product of the electric field (which exists) and the conductivity of the material (which it has). Maybe someone can tell me what I am doing wrong?
Perhaps the idea I have for the creation of a current source is wrong. Is a voltage applied by use of an electric field over a resistance the same as a voltage source in series with a resistor? The electric field in the excitation box should be exerting a force on the electrons causing them to move. But if we look al classical circuit theory it looks like there is a shorted voltage source. I'll put the code I used below.
---beginning code---
close all
clear
clc
%% setup the simulation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
physical_constants;
unit = 1e-3; % specify everything in mm
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I have an interest in magnetic levitation, and for a while I have been studying and becoming familiar with openEMS to try and see if it is possible to simulate the magnetic field created by electromagnets (starting off with wires) driven by a constant current source. openEMS is generally not intended to be used for such applications, but it seems like a good option when compared to the often pricy proprietary programs used in such simulations. Something similar was discussed in #231.
I've been trying to emulate a current source by using a 50 ohm lumped port with a step-excitation in the middle of a rectangular strip with the same conductivity as copper. This strip is connected to a ground plane though the use of tiny conductors at each end of the strip.
When simulated and visualized with paraview it shows there is no current density while there is an electric field throughout the structure. This surprises me because current density is calculated as the product of the electric field (which exists) and the conductivity of the material (which it has). Maybe someone can tell me what I am doing wrong?
Perhaps the idea I have for the creation of a current source is wrong. Is a voltage applied by use of an electric field over a resistance the same as a voltage source in series with a resistor? The electric field in the excitation box should be exerting a force on the electrons causing them to move. But if we look al classical circuit theory it looks like there is a shorted voltage source. I'll put the code I used below.
---beginning code---
close all
clear
clc
%% setup the simulation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
physical_constants;
unit = 1e-3; % specify everything in mm
t_length = 3000;
t_width = 100;
t_height = 2;
m_length = t_length+500;
m_width = t_width+500;
m_height = t_height+500;
%% setup FDTD parameters & excitation function %%%%%%%%%%%%%%%%%%%%%%%%%%%%
FDTD = InitFDTD('NrTS', 5000);
F0 = 10e8;
lambda = c0/F0;
res_global = 10;
res_local = 30;
%resolution around 3mm
resolution_global = lambda/res_global/unit;
resolution_local = lambda/res_local/unit;
FDTD = SetStepExcite(FDTD);
BC = {'MUR' 'PEC' 'MUR' 'MUR' 'MUR' 'MUR'};
FDTD = SetBoundaryCond( FDTD, BC );
%% setup CSXCAD geometry & mesh %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CSX = InitCSX();
mesh.x = SmoothMeshLines([-t_length/2 t_length/2], resolution_local, 1.3);
mesh.x = SmoothMeshLines([-m_length/2 -mesh.x mesh.x (m_length/2)], resolution_global, 1.3);
mesh.y = SmoothMeshLines([-t_width/2 t_width/2], resolution_local, 1.3);
mesh.y = SmoothMeshLines([-m_width/2 mesh.y m_width/2], resolution_global, 1.3);
mesh.z = SmoothMeshLines([-t_height/2 t_height/2], resolution_local, 1.3);
mesh.z = SmoothMeshLines([-m_height/2 mesh.z m_height/2], resolution_global, 1.3);
CSX = DefineRectGrid( CSX, unit, mesh );
%% Define port
start = [-10 -50 -5];
stop = [10 50 5];
[CSX,port{1}] = AddLumpedPort( CSX, 250, 1, 50, start, stop, [1 0 0], true);
%% Model ground plane, and connectors
copper_c = 56e6;
%ground plane
CSX = AddMaterial(CSX,'copper', 'kappa',copper_c);
CSX = AddBox(CSX,'copper',10,[-1000 -50 -5],[1000 50 5]);
%ground plane
CSX = AddBox(CSX,'copper',10,[-1500 -200 -11],[1500 200 -6]);
%connector 1
CSX = AddBox(CSX,'copper',10,[-999 -10 -11],[-989 10 1]);
%connector 2
CSX = AddBox(CSX,'copper',10,[999 -10 -11],[989 10 1]);
%% Dump box horizontal
boxStart = [mesh.x(1), mesh.y(1), 0];
boxStop = [mesh.x(end), mesh.y(end), 0];
CSX = AddDump(CSX,'At','DumpType',2,'FileType',0,'SubSampling','1,1,1');
CSX = AddBox(CSX,'At',0 , boxStart,boxStop);
%% write/show/run the openEMS compatible xml-file
Sim_Path = 'wire_port_test';
Sim_CSX = 'msl.xml';
[status, message, messageid] = rmdir( Sim_Path, 's' ); % clear previous directory
[status, message, messageid] = mkdir( Sim_Path ); % create empty simulation folder
WriteOpenEMS( [Sim_Path '/' Sim_CSX], FDTD, CSX );
CSXGeomPlot( [Sim_Path '/' Sim_CSX] );
RunOpenEMS( Sim_Path, Sim_CSX );
Beta Was this translation helpful? Give feedback.
All reactions