Question regarding getting started tutorial

How to use openEMS. Discussion on examples, tutorials etc

Moderator: thorsten

Post Reply
thinkless
Posts: 11
Joined: Wed 22 Sep 2021, 04:27

Question regarding getting started tutorial

Post by thinkless » Wed 22 Sep 2021, 07:33

Hello, everyone.

I am trying out the getting started tutorials, "Parallel Plate Waveguide", but the CSXCAD doesn't seem to draw the correct picture, as in the attachment. How to figure this?

Another question, does openEMS automatically create FDTD mesh according to the CAD format file (*.stl), or do I have to manually create mesh myself?
Attachments
CSXCAD.png
CSXCAD.png (28.39 KiB) Viewed 937 times

MPCEngineer
Posts: 31
Joined: Thu 02 Sep 2021, 18:29

Re: Question regarding getting started tutorial

Post by MPCEngineer » Wed 22 Sep 2021, 11:20

Hi,

I am also new to OpenEMS but from my experience you must create the mesh lines manually and they are critical. You need to spend time ensuring you have the mesh setup correctly.

Its a good idea to include the script file you are using so it can be scrutinised.

MPC.

thinkless
Posts: 11
Joined: Wed 22 Sep 2021, 04:27

Re: Question regarding getting started tutorial

Post by thinkless » Wed 22 Sep 2021, 12:47

Code: Select all

%
% Tutorials / Parallel_Plate_Waveguide
%
% Describtion at:
% http://openems.de/index.php/Tutorial:_Parallel_Plate_Waveguide
%
% Tested with
%  - Matlab 2011a / Octave 4.0
%  - openEMS v0.0.33
%
% (C) 2011,2012 Sebastian Held <sebastian.held@gmx.de>
% (C) 2011-2015 Thorsten Liebig <thorsten.liebig@gmx.de>

close all
clear
clc

% init and define FDTD parameter
FDTD = InitFDTD(100,0,'OverSampling',50);
FDTD = SetSinusExcite(FDTD,10e6);
BC = {'PMC' 'PMC' 'PEC' 'PEC' 'MUR' 'MUR'};
FDTD = SetBoundaryCond(FDTD,BC);

% init and define FDTD mesh
CSX = InitCSX();
mesh.x = -10:10;
mesh.y = -10:10;
mesh.z = -10:30;
CSX = DefineRectGrid(CSX, 1, mesh);

% define the excitation
CSX = AddExcitation(CSX,'excitation',0,[0 1 0]);
CSX = AddBox(CSX,'excitation',0,[-10 -10 0],[10 10 0]);

% define a time domain e-field dump box
CSX = AddDump(CSX,'Et','DumpMode',0);
CSX = AddBox(CSX,'Et',0,[-10 0 -10],[10 0 30]);

% remove old simulation results (if exist)
rmdir('tmp','s');mkdir('tmp');

% write openEMS xml data file
WriteOpenEMS('tmp/tmp.xml',FDTD,CSX);

% view defined structure
CSXGeomPlot( 'tmp/tmp.xml' );

% run openEMS simulation
RunOpenEMS('tmp','tmp.xml','');

disp('use Paraview to visualize the FDTD result...');

thinkless
Posts: 11
Joined: Wed 22 Sep 2021, 04:27

Re: Question regarding getting started tutorial

Post by thinkless » Wed 22 Sep 2021, 12:49

MPCEngineer wrote:
Wed 22 Sep 2021, 11:20
Hi,

I am also new to OpenEMS but from my experience you must create the mesh lines manually and they are critical. You need to spend time ensuring you have the mesh setup correctly.

Its a good idea to include the script file you are using so it can be scrutinised.

MPC.
I posted the MATLAB script that I executed above, please check.

thinkless
Posts: 11
Joined: Wed 22 Sep 2021, 04:27

Re: Question regarding getting started tutorial

Post by thinkless » Wed 22 Sep 2021, 13:03

Now I found a working script. It's in the matlab\Tutorials folder named "Rect_Waveguide.m". It's tested on
openEMS 64bit -- version v0.0.35-74-g0e54fbf
MATLAB R2021a student version.
Thanks for the above reply.

Post Reply