# Voltage source mesh and plan wave polarisation

**URL:** <https://nullspaceusers.discourse.group/t/voltage-source-mesh-and-plan-wave-polarisation/83>\
**Category:** Electrostatics\
**Created:** [February 24, 2025, 1:01pm UTC](https://nullspaceusers.discourse.group/t/voltage-source-mesh-and-plan-wave-polarisation/83 "2025-02-24T13:01:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Michael](https://nullspaceusers.discourse.group/u/Michael)\
**Post date:** [February 24, 2025, 1:01pm UTC](https://nullspaceusers.discourse.group/t/voltage-source-mesh-and-plan-wave-polarisation/83/1 "2025-02-24T13:01:59Z")

</div>

Dear all,

My next question is about the EM-Sources.  
(Don’t worry, the antenna issue has not been forgotten, but it still needs some time.)

1. My professor and I are interested in what happens if the voltage source is meshed with more than one cell at the corner between the ‘pos’ and ‘neg’ cells.  
To my knowledge, the excitation has to be very precise meshed, because in this region the highest amount of field changing is there. In the online tutorial for the patch antenna, excited by a coax cable with the voltage source/gap as excitation, the voltage source has the same size as the coax pin and is so several times bigger than lambda. Also the mesh.  
So what happens at NSEM if the source is meshed by more than two cells in total?  
By trying it out I got some results (see picture), but how correct are there? For S11 and Z\_in it doesn’t look realistic. The rest is similar to the original meshing interval.

> **\*\*Result intervall = 4 cells\*\***
>
> ![Voltage_source_Interval_4](https://canada1.discourse-cdn.com/flex010/uploads/nullspaceusers/original/1X/131bf92e6bb09299c03007aac4838a490b878937.jpeg)

> **\*\*Result intervall = 1 cell\*\***
>
> ![Plot_tutorial3_Edit](https://canada1.discourse-cdn.com/flex010/uploads/nullspaceusers/original/1X/c57f4e15ffd5a2fb7fe779211dff33aea47d6ea3.jpeg)

> **\*\*JOU\*\***
>
> reset
> 
> reset aprepro
> 
> ## Parameter, all definitions in mil
> 
> #{sub\_h=31}
> 
> #{sub\_w=787}
> 
> #{patch\_w = 187}
> 
> #{coax\_l = 100}
> 
> #{coax\_r = 20}
> 
> #{pin\_r = 6}
> 
> #{vs\_w = 2\*pin\_r}
> 
> #{pin\_l = sub\_h+coax\_l-vs\_w}
> 
> #{feed\_offset = 0.68}
> 
> #{mesh\_size = (0.3/17_1000/25.4_1000)/10}
> 
> #{freq = 16e9}
> 
> #{co = 3e8}
> 
> #{lambda = co/freq}
> 
> brick x {sub\_h} y {sub\_w} z {sub\_w}
> 
> volume 1 rename “substrate”
> 
> move Volume substrate x {-sub\_h/2} include\_merged
> 
> create surface rectangle width {patch\_w} xplane
> 
> volume 2 rename “patch\_vol”
> 
> create surface rectangle width {sub\_w} xplane
> 
> volume 3 rename “gnd”
> 
> move Surface in volume gnd x {-sub\_h} include\_merged
> 
> create Prism height {pin\_l} sides 6 radius {pin\_r}
> 
> volume 4 rename “pin”
> 
> rotate Volume 4 angle 90 about Y include\_merged
> 
> move Volume 4 x {-pin\_l/2} z {-patch\_w/2+feed\_offset\*patch\_w/2} include\_merged
> 
> create Prism height {coax\_l} sides 6 radius {coax\_r}
> 
> rotate Volume 5 angle 90 about Y include\_merged
> 
> move Volume 5 x {-sub\_h-coax\_l/2} z {-patch\_w/2+feed\_offset\*patch\_w/2} include\_merged
> 
> volume 5 rename “coax”
> 
> create surface rectangle width {vs\_w} zplane
> 
> volume 6 rename “feed”
> 
> move Surface 25 x {-sub\_h-coax\_l+vs\_w/2} z {-patch\_w/2+feed\_offset\*patch\_w/2} include\_merged
> 
> split surface 25 direction curve 60
> 
> project surface 10 onto surface 18 imprint
> 
> subtract volume coax from volume gnd keep\_tool
> 
> subtract volume pin from volume substrate keep\_tool
> 
> subtract volume pin from volume coax keep\_tool
> 
> subtract volume feed from volume coax keep\_tool
> 
> imprint volume all
> 
> merge volume all
> 
> block 1 add surface all
> 
> nsem load material library “E:\Michael\Nullspace\_workspace\Material\materials.h5”
> 
> nsem assign volume substrate material ‘RO3003’
> 
> nsem assign volume coax material ‘Teflon’
> 
> nsem assign volume patch\_vol material ‘PEC’
> 
> nsem assign volume gnd material ‘PEC’
> 
> nsem assign volume pin material ‘PEC’
> 
> nsem assign Surface 19 20 21 22 23 24 28 49 52 material ‘PEC’
> 
> nsem voltage source ‘port1’ pos surface 27 neg surface 26 impedance 50
> 
> surface all scheme pave
> 
> curve 60 61 58 interval 4
> 
> curve 60 61 58 scheme equal
> 
> surface in volume feed size
> 
> mesh surface in volume feed
> 
> surface not is\_meshed in volume coax size {coax\_r/2}
> 
> mesh surface not is\_meshed in volume coax
> 
> surface in volume patch\_vol size {mesh\_size/3}
> 
> mesh surface in volume patch\_vol
> 
> surface not is\_meshed size {mesh\_size}
> 
> mesh surface not is\_meshed
> 
> nsem print status

> **\*\*short Log file/ sim overview\*\***
>
> ```
> system : DENSE
> 
> fill tolerance : 0.0001
> 
> solve tolerance : 0.0001
> 
> element type = QUAD_4
> 
> gqCache beg
> 
> sizeof(P) (Bytes) : 8.0e+00
> 
> sizeof(Vector3<P>) (Bytes) : 2.4e+01
> 
> sizeof(Jacobian<P>) (Bytes) : 5.6e+01
> 
> gqCache (GB) : 9.9e-03
> 
> ```
> 
> Nn : 797
> 
> Nb : 2968
> 
> Ne : 809
> 
> Nsb : 10
> 
> Ned : 1604
> 
> Nbe : 4
> 
> Nrhs : 1
> 
> process memory (GB) : -9.536743e-07 : -9.536743e-07
> 
> Sim time: 5.25min  
> 10\_GHz  
> RAM: GB

1. The plane wave excitation: To define the incidence angle of the plane wave in response to the origin I choose theta (t) and phi (p). So far so clear, but how I can determine the polarisation of the incoming plane wave?  
I understand that for the result I can choose the observation angle and get the different polarisation pp, pt, tp, tt. And that the excitation is automatically computes two linear polarisations, shifted by 90 °.  
So for example for a plane wave by t = 90° and p= 0° the polarisations are co and cross-polarised (or linear polarisation in horizontal (co) and vertical (cross) polarisation). But also for that, how do I know concerning Paraview results which polarization is which regarding the given theta and phi angle?  
In Para view the sheds called 0\_0\_Jp\_Abs for positive current density and 0\_1\_Abs for negative current density. (0\_2\_, 0\_3\_,…,0\_10\_,0\_11\_, depends on the amount of excitation position).  
For some significant points and well-known geometries like a sphere, you can try to imagine how the polarization is by take a view of the surface current, but not for more complex chosen incidence angles and geometries. **Or I’m wrong** and it’s an easy thing but only my knowledge is not high enough, so please, could you explain how I get the polarization by looking at the results?  
I add an example from Parawiev with the chosen angle of incidence of the plane wave.

> **\*\*surface current @ Paraview\*\***
>
> **Incidence angle choosing by theta = 45° and phi = 90°**
> 
> **positive current density**  
> Camera view @ Paraview Adjust Camera - Camera Paremeters - 0, 0.707, 0.707
> 
> ![View_t_45_p_90](https://canada1.discourse-cdn.com/flex010/uploads/nullspaceusers/original/1X/4b41e835dcf3f8c98bc2f364db55efbd6f30f33f.jpeg)
> 
> **positive current density by choose the second polarisation**  
> ( angle in respect to the origin unknown)  
> Camera view @ Paraview Adjust Camera - Camera Paremeters - 0, 0.707, 0.707
> 
> ![View_t_45_p_90_pol2](https://canada1.discourse-cdn.com/flex010/uploads/nullspaceusers/original/1X/edcd3473b4a6bccf7e187afbde2ffdea5f67abf8.jpeg)
> 
> **first plot by alignment of the coordinate axes x,y,z**
> 
> ![View_t_45_p_90_z](https://canada1.discourse-cdn.com/flex010/uploads/nullspaceusers/original/1X/2237ac3f768f4781579718dec4394996272425b9.jpeg)

> **\*\*JOU\*\***
>
> reset
> 
> reset aprepro
> 
> #{f =10e9}
> 
> #{c=3e8}
> 
> #{lambda=c/f}
> 
> #{r=4\*lambda}
> 
> create sphere radius {r}
> 
> nsem assign volume 1 material ‘PEC’
> 
> imprint all
> 
> merge all
> 
> set duplicate block elements off
> 
> block 1 add surface all
> 
> block all element type quad9
> 
> surface 1 size {lambda/5}
> 
> mesh surface 1

> **\*\*short Log file/ sim overview\*\***
>
> ```
> system : DENSE
> 
> fill tolerance : 0.0001
> 
> solve tolerance : 0.0001
> 
> element type = QUAD_9
> 
> gqCache beg
> 
> sizeof(P) (Bytes) : 8.0e+00
> 
> sizeof(Vector3<P>) (Bytes) : 2.4e+01
> 
> sizeof(Jacobian<P>) (Bytes) : 5.6e+01
> 
> gqCache (GB) : 1.5e-01
> 
> ```
> 
> Nn : 22206
> 
> Nb : 44408
> 
> Ne : 5551
> 
> Nsb : 1
> 
> Ned : 11102
> 
> Nbe : 12
> 
> Nrhs : 2
> 
> process memory (GB) : -9.536743e-07 : -9.536743e-07
> 
> simulation time: 6.26 min  
> 10\_GHz  
> using peak RAM: 59.42293167114258 GB

---

<div class="post-metadata">

**Author:** ![masha.petrova](https://yyz2.discourse-cdn.com/flex010/user_avatar/nullspaceusers.discourse.group/masha.petrova/32/19_2.png) [@masha.petrova](https://nullspaceusers.discourse.group/u/masha.petrova)\
**Post date:** [February 25, 2025, 12:50am UTC](https://nullspaceusers.discourse.group/t/voltage-source-mesh-and-plan-wave-polarisation/83/2 "2025-02-25T00:50:45Z")

</div>

@Michael Thanks for another great question.

The positive/negative surface intersection needs to be a single edge at the intersection of no more than two pavers. If the voltage source is applied to an edge connected to more than two pavers the result will be wrong.

Does that help?

---

<div class="post-metadata">

**Author:** ![Michael](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Michael](https://nullspaceusers.discourse.group/u/Michael)\
**Post date:** [March 3, 2025, 10:05am UTC](https://nullspaceusers.discourse.group/t/voltage-source-mesh-and-plan-wave-polarisation/83/3 "2025-03-03T10:05:54Z")

</div>

Thank you for your answer!

Yes, it helps. Two the second point, how is the polarisation of a plane wave in request to the origin defined? Is there a dependency between the polarisation and the phi and theta coordinates?

---

<div class="post-metadata">

**Author:** ![daniel.faircloth](https://yyz2.discourse-cdn.com/flex010/user_avatar/nullspaceusers.discourse.group/daniel.faircloth/32/37_2.png) [@daniel.faircloth](https://nullspaceusers.discourse.group/u/daniel.faircloth)\
**Post date:** [March 3, 2025, 12:57pm UTC](https://nullspaceusers.discourse.group/t/voltage-source-mesh-and-plan-wave-polarisation/83/4 "2025-03-03T12:57:27Z")

</div>

Hi Michael,

When you request a plane wave angle, you actually get two excitations, Etheta and Ephi. The result in the far field dataset is the full four-polarization scattering matrix. Here is a clip from the rain drop example to help explain:

 ![image](https://canada1.discourse-cdn.com/flex010/uploads/nullspaceusers/original/1X/ca3846697fbd48107245a00131207d8b8ed7efb1.png)

If you’re doing a monostatic plane wave case, the resulting far field or RCS data array will be 4D as shown above. The four polarizations for the plane wave are listed in the paragraph in the order they are stored in the data arrays. So in the plot example above, we’re plotting theta-theta polarization followed by phi-phi.

For Paraview, the data extraction is a little tricky. Since the 2023R3 release, we found an issue with the documentation. Apologies if that has led to some of the confusion.

Since Paraview is a separate software package, we have to reference the data in a method that Paraview can understand. In this case, we have to refer to the frequencies, theta, and phi angles by their index in the data arrays. As an example, I modified the simple\_pec\_sphere example discussed in the Getting Started section of the user guide. You can think of it this way, you have two incident polarizations, Nfq frequencies, Nth theta angles, and Nph phi angles. For the modified example, I left a single frequency but modified the incidence angles to have 2 angles in theta and 2 in phi. So there are a total of 4 incidence angles, which leads to 8 total excitations.

 ![image](https://canada1.discourse-cdn.com/flex010/uploads/nullspaceusers/original/1X/6bb6d3369f93a3c4d37fdbbe2663a22624090127.png)

In Paraview, the first index is the frequency index, so it’s just index 0 in my example since there is only 1 frequency. See the screenshot from Paraview below. The second index lists the excitations in the order in which they are processed in the solver. So you can compute the index like:  
index = iTh \* Nph \* 2 + iPh\*2 + iPol

In my example, if you want to plot the surface currents at theta = 90, phi = 90, and the phi-polarization, this corresponds to  
index = 0 \* 2 \* 2 + 1\*2 + 1 = 3

 ![image](https://canada1.discourse-cdn.com/flex010/uploads/nullspaceusers/original/1X/6fc97311c4f75c571cad453c104e127ffd4c0b58.png)

Hope this helps. Please let me know if you have any further questions.

---

<div class="post-metadata">

**Author:** ![Michael](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Michael](https://nullspaceusers.discourse.group/u/Michael)\
**Post date:** [March 3, 2025, 1:52pm UTC](https://nullspaceusers.discourse.group/t/voltage-source-mesh-and-plan-wave-polarisation/83/5 "2025-03-03T13:52:39Z")

</div>

Thank you for your explanation!

It helps 🙂

---

<div class="post-metadata">

**Author:** ![daniel.faircloth](https://yyz2.discourse-cdn.com/flex010/user_avatar/nullspaceusers.discourse.group/daniel.faircloth/32/37_2.png) [@daniel.faircloth](https://nullspaceusers.discourse.group/u/daniel.faircloth)\
**Post date:** [March 3, 2025, 2:05pm UTC](https://nullspaceusers.discourse.group/t/voltage-source-mesh-and-plan-wave-polarisation/83/6 "2025-03-03T14:05:46Z")

</div>

Michael, I realized after I replied that I didn’t properly explain. Please see my edited comment above.

---

<div class="post-metadata">

**Author:** ![Michael](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Michael](https://nullspaceusers.discourse.group/u/Michael)\
**Post date:** [March 5, 2025, 9:28am UTC](https://nullspaceusers.discourse.group/t/voltage-source-mesh-and-plan-wave-polarisation/83/7 "2025-03-05T09:28:18Z")

</div>

Still thanks, that helps realy for understanding how it works in NSEM.

Two things could help in future,  
to add the information that all indices start with 0 (if not mentioned)  
(Not everyone is so familiar with python and how the indices are)

"model.set\_plane\_wave\_grid([iTh = 0, iTh = 1], [iPh = 0, iPh = 1]) " (Also for Paraview where the first frequency point is zero  
i.e. Range 3 to 20GHz → 0\_0\_Jp =\> f = 3GHz  
It was not so obvious to me.

and second if possible, at the paraview method to fill up the first three positions with 0 so that you have 000\_1\_JP, 001\_1\_JP …  
With the filter at properties, you can sort it of course but it’s not so good readable as the example below.

However, this is not necessary. The description of how the indices are compiled was very helpful!

 ![paraview_properties](https://canada1.discourse-cdn.com/flex010/uploads/nullspaceusers/original/1X/fe5a2ba64ae4c8e2a2961617dc4e79936bb4326f.png)

---

<div class="post-metadata">

**Author:** ![daniel.faircloth](https://yyz2.discourse-cdn.com/flex010/user_avatar/nullspaceusers.discourse.group/daniel.faircloth/32/37_2.png) [@daniel.faircloth](https://nullspaceusers.discourse.group/u/daniel.faircloth)\
**Post date:** [March 5, 2025, 10:38am UTC](https://nullspaceusers.discourse.group/t/voltage-source-mesh-and-plan-wave-polarisation/83/8 "2025-03-05T10:38:33Z")

</div>

Thank you for the suggestions. As we continue to improve our products, these kind of suggestions are really helpful.

---

<div class="post-metadata">

**Author:** ![masha.petrova](https://yyz2.discourse-cdn.com/flex010/user_avatar/nullspaceusers.discourse.group/masha.petrova/32/19_2.png) [@masha.petrova](https://nullspaceusers.discourse.group/u/masha.petrova)\
**Post date:** [March 5, 2025, 1:36pm UTC](https://nullspaceusers.discourse.group/t/voltage-source-mesh-and-plan-wave-polarisation/83/9 "2025-03-05T13:36:59Z")

</div>

> [@Michael](#):
>
> mation that all indices start with 0 (if not mentioned)  
> (Not everyone is so familiar with python and how the indices are)
> 
> "model.set\_plane\_wave\_grid([iTh = 0, iTh = 1], [iPh = 0, iPh = 1]) " (Also for Paraview where the first frequency point is zero

Thank you, Michael! Really appreciate your questions and comments here.

All of your suggestions will help us to continue to improve our software and deliver great simulation tools for engineers.

Thanks for helping this whole Nullspace user community.
