Resource for FDTD "Newbie" Questions? - Page 1
Forum section: electronics / rf-microwave

author: davethomaspilot
author_rank: Contributor
timestamp: November 05, 2022, 03:07:45 pm
content: I have a created openEMS models for printed pcb antennas. They run quickly and I get results that correlate well with published application notes.The models are simplistic--rectangular pcbs and ground planes and geometry for the pcb antenna.I'm now making modifications to the model to more closely approximate my actual pcb design. I'm not sure whether I need to add additional mesh detail for things like vias, if I'm not interested in the E/M fields around those objects.For example, I have a top and bottom ground plane. When I added the top ground plane, I did see a slight difference in the simulation results, even before connecting the top and bottom planes with PMC rectangular solids. (The rectangular solids were to model the vias).Adding the vias did NOT change the simulation results, so I ran the code to automatically add mesh lines around them. As expected, the simulation runs much slower (still running after hours).I've concluded that if it really DOES require a detailed mesh around small geometries, it might not be practical to include vias in the simulation.But, I think there DOES need to be an electrical connection between the top and bottom ground planes. I just don't care about the fields around the vias, except as it might significantly impact the far fieldsThe openEMS forum is not very active and I suspect questions like this seem too obvious for that crowd. Is this a good place for questions like this? If not, a suggestion for a better resource would be appreciated!

author: Marsupilami
author_rank: Frequent Contributor
timestamp: November 06, 2022, 05:37:08 am
content: I've looked at OpenEMS before but never actually used it so I can only comment from experience with other FDTD software.I don't know what's your frequency range, but guessing 2.4GHz or even 5, likely the individual vias won't matter. However the connection and the current path distances between the two sides of the PCB probably does a lot.You can approximate your setup with the PCB being one solid block of conductor, except under the feed line. Or just group a bunch of vias together and model them as a single solid rectangle.It also might be fine if you make individual, vertical edges of the mesh conductive.Can you visualize the mesh in OpenEMS? Can you post a screenshot of it?

author: davethomaspilot
author_rank: Contributor
timestamp: November 07, 2022, 11:50:18 am
content: Thanks,Yes, here are some screen shots.The first is with the grid turned off so you can see the pcb better. At the top is antenna trace, below that are the ground planes, you can only see one in this view since they are stacked 1.6 mm apart.There are many vias spaced 30 mils apart that stitch the top and bottom ground planes together. They are right below the top edge of the ground plane. The simulation results are significantly different if those vias are not included.The rectangle inside the ground plane represents a transceiver module with a metal rf shield. There are four ground pins from the top (and bottom) ground planes up to the transceiver.You can see the via and pin metal better in the xz and yz views.

author: davethomaspilot
author_rank: Contributor
timestamp: November 07, 2022, 12:01:17 pm
content: Sim results are attached.Adding the vias in the simulation moved the resonance from about 2.43 Ghz to under 2.4. I guess that makes sense, since without the vias, the opposite ground plane is floating and with them it adds capacitance to the antenna?I figure I can shorten the antenna to get it up to around to my target of 2.5 Ghz.Creating the mesh is problematic. Just changing the pcb and ground outlines from rectangular to their actual shape causes a function that creates smooth mesh lines to hang forever. So, I have to model them as rectangular. Hopefully, that's not a big impact to accuracy.Here's the actual outline of the pcb:

author: MartinL
author_rank: Regular Contributor
timestamp: November 07, 2022, 12:58:29 pm
content: I don't have any OpenEMS-specific advice, but as a general point, if you're creating a whole fence of vias can you just model it as a single solid wall of metal instead? Given that the gaps between vias are so small relative to the wavelength, the difference between a via fence and a solid wall should be pretty negligible in practice.

author: davethomaspilot
author_rank: Contributor
timestamp: November 07, 2022, 08:51:28 pm
content: I think you are probably right.I can get the simulation to finish--I'll see if there is any significant difference in results or time to simulate.

author: Marsupilami
author_rank: Frequent Contributor
timestamp: November 07, 2022, 10:14:27 pm
content: Yeah, the detail for those vias looks excessive. As Martin said do a solid wall. It can be just a face, doesn't even have to have volume, thus the only thing needed is to have a grid point on the y axis at the centerline of the via fence.That is btw another good practice if you haven't done that yet, is to define fixed points in the grid aligned to the features you care about and let the algorithm figure out the rest. I presume OpenEMS has a way of doing it. This way you don't need much finer resolution than the trace width. (For accurate edge effects you do, but I think that matters less for far field.)

author: Marsupilami
author_rank: Frequent Contributor
timestamp: November 07, 2022, 10:36:31 pm
content: Here's an oversimplified example for you:Note how the grid is driven by the exact shape of the trace and the via just becomes an X through whichever grid point happens to be the closest.(Ignore the messed up looking meander, that's just an artifact of the E field being only defined for edges not faces of the cells.)

author: davethomaspilot
author_rank: Contributor
timestamp: November 08, 2022, 01:19:32 am
content: if a grid line didn't go through a via, would the simulator still know the top plane was connected to the bottom plane?If the vias a are modeled with 0 thickness, will there be additional inductance so that the top and bottom planes aren't so tightly "coupled"?

author: davethomaspilot
author_rank: Contributor
timestamp: November 08, 2022, 02:22:52 pm
content: Defining a "strip" instead of individual vias does speed up the simulation, but not dramatically.With individual vias, simulation time is about 6.5 hours. I didn't let the sim with the vias modelled as a strip run to completion, but based on progression of time steps, I'd guess the sim time would be around five hours.I think the bigger problem is the creation of mesh. For example, when I use DetectEdges and SmoothMesh on the metal box created for the shield of the transceiver, a fine mesh is created over the entire area of the shield.But, when I omit those functions for the "shield box", the simulation runs fast (11 minutes), but results are drastically different. The mesh still looks "fine" (see attachment). So I conclude that it's necessary not only to have a "fine enough" mesh, but that it also must be "smoothed"?I've been using two matlab functions to create the mesh, DetectEdges and SmoothMeshLines. Often, SmoothMeshLines just hangs, so I've simply been experimenting to determine which mesh subsets can be "smoothed" successfully. But since results can differ so much when mesh is NOT smoothed, I don't have confidence that my simulations are reasonably accurate.The information about how to go about creating a mesh seems to be scattered about the openEMS site. Here's the main source:http://openems.de/index.php/FDTD_MeshThe best I could find on how to go about creating a mesh was posted by a user in the forum:QuoteDoes that approach make sense?What's the minimum required for a mesh for something like a metal box (the aluminum shield around the transceiver). Should it suffice to have the 1/3 2/3 lines as discussed in the openEMS web page?

author: davethomaspilot
author_rank: Contributor
timestamp: November 08, 2022, 03:04:19 pm
content: Also, from the same user's post, Thorsten (forum moderator and author of openEMS saidQuoteDoes this mean the only mesh lines that matter for a metal solid are those that are coincident with that solid's edges? Or, what does that statement imply for mesh creation?Sorry for all the newbie questions, but I don't know where else to ask.

author: Marsupilami
author_rank: Frequent Contributor
timestamp: November 08, 2022, 03:28:20 pm
content: This means if you have metal that is not a solid with volume but a sheet, it has to be sitting exactly on a grid line in order to be captured. I didn't really get your comment about the hollow vias in your previous post, this might have something to do with it. Also I can't really see from your pics (which btw I think still have unnecessarily detailed grid) how your model got meshed. I see the grid but look at my 2nd picture that show the resulting meshed model that's aligned to the grid. I'm wondering if OpenEMS can do that so you actually see which edges and faces are assigned which material. It's very hard to understand otherwise what's going on.

author: davethomaspilot
author_rank: Contributor
timestamp: November 08, 2022, 04:42:45 pm
content: Thanks for the explanation.Yes, I'm sure the grid is much finer than required.I don't think there's a way to graphically show which mesh lines are associated with each property of material. But, I can show the mesh after each addition of each new geometry. E.g., add ground planes, show mesh. Add substrate, show mesh. Add shield, show mesh, etc.So, I could post a sequence of screen shots showing that, but maybe it's better to show what I'm doing after each geometry addition. For example after adding vias:Code:% Try single "strip" instead of many vias (maybe faster sim)start = [-substrate.width/2+edge_space substrate.length/2-ifa.e-via_length-edge_space 0];stop = start + [ substrate.width-2*edge_space, via_length, substrate.thickness ]CSX = AddBox(CSX, 'vias', 10,start, stop);vias_mesh = DetectEdges(CSX, [], 'SetProperty',{'vias'});mesh.x = [mesh.x SmoothMeshLines(vias_mesh.x, 0.5)];mesh.y = [mesh.y SmoothMeshLines(vias_mesh.y, 0.5)]fprintf("vias meshed\n");showmeshThe DetectEdges call returns edges of the geometry. The SmoothMeshLines creates mesh lines from the DetectEdges lines, so that the spaces between mesh lines changes gradually. The .5 parameter says create the mesh with no more than .5mm between lines.An inverted F antenna example at 3.45 Ghz used .5mm. Recommendation is for 1/10 lambda or 1/20 lambda "better". 1/20 lambda would be about .6 mm. Can I go coarser for some geometries? If so, what are the guidelines for relaxing 1/10 (or 1/20) lambda?Once all the geometry and mesh has been added, another DetectEdges and SmoothMesh is done on the entire model. It's this SmoothMesh that often never returns. It will NOT return if I don't exclude some of the structure, but it's not necessarily the structure with the most mesh detail that causes issues. So, I just play with excluding various geometries from that final DetectEdges/SmoothMesh call until I can get past the SmoothMesh (sigh).And, what happens if the mesh isn't "smoothed"? Failure to simulate, or degradation in accuracy?I'm doing a simulation now that just omits this final step. It's running more quickly (probably 1 - 2 hours). I'll see how the results compare.

author: davethomaspilot
author_rank: Contributor
timestamp: November 08, 2022, 05:11:40 pm
content: After I posted that, I realized that .5 mm is less than 1/200, not 1/20 of 4.5 Ghz wavelength.The inverted_f example only used the .5 mm for the actual antenna geometry. On the final "SmoothMesh" call of the entire structure it used 1/20 of the highest frequency of interest, in my case 3 Ghz.Originally, that's what I did, but couldn't get that final SmoothMesh to complete. So, I added meshing after addition of each geometry.But, I don't think I need the .5 mm resolution except maybe for the antenna trace. So, I'll back off to 5 mm instead of .5. I suspect that I still won't be able to run the final DetectEdges/SmoothMesh--if not I'll try the sim without it (like the one now running).

author: davethomaspilot
author_rank: Contributor
timestamp: November 08, 2022, 05:32:54 pm
content: QuoteSo, what does it mean to be "sitting exactly on a grid line"?Does that mean that one edge needs to be coincident with a grid line? Only one?For a non-rectangular object, should I make sure I have a grid line coincident with all orthogonal edges? I asked what I think is a similar question on the openEMS forum:Quotehttps://openems.de/forum/viewtopic.php?f=3&t=1206