2D hertzian dipole Implementation in GPRMax

50 views
Skip to first unread message

Hamed Ghorbani

unread,
Apr 30, 2025, 5:59:06 AMApr 30
to gprMax-users
Dear GPRMax Team,  

I hope this email finds you well. Thank you for your work on this powerful open-source tool—it has been invaluable to my research.  

I have a question regarding 2D simulations with Hertzian dipoles, as described in the documentation: When converting a point dipole to a line source (*z*-direction), could you kindly direct me to:  
1. The analytical relationships used for field calculations (and their code implementation)?  
2. The specific code section(s) handling this conversion and  the relationships?  

Any guidance would help me better interpret my results.  

Thank you for your time.

Antonis Giannopoulos

unread,
Apr 30, 2025, 7:22:15 AMApr 30
to gprMax-users
There are not any analytical relationships that are used directly in an FDTD numerical code to simulate sources. gprMax does not use an analytical formula to calculate the fields of a line source in 2D or of a dipole in 3D. When you have a 2D model your source is a line source as it is infinite in the invariance direction. The same implementation in 3D will give you a dipole. It is the dimensionality of your code that produces a line source or a dipole.  If not he other hand  you want to check how the gprMax response  compares with an analytical solution then there is a formula that allows you to do this - for simple cases - as the solution of a line source in a homogenous medium is available analytically. 

The formula to use for that can easily be found in the literature. For example,  it is in the book by W.C. Chew (1990) "Wave and Fields in inhomogeneous media"  and other places. If you cannot find this reference or the formula it is also in my thesis which is available as a PDF (link from the gprMax website). (equation 4.115, page 107). This formula is the Green's function of a line source in free space. You can convolve this with your suitable excitation as used in FDTD (gprMax) and compare the results to see how accurate your FDTD model is. 

There are no code sections that handle analytically the source but there is code that implements sources in FDTD and this is easy to find in the "sources.py"

Hope this helps

Antonis

Hamed Ghorbani

unread,
Apr 30, 2025, 12:38:53 PMApr 30
to gprMax-users

Dear Antonis,

Thank you for your previous explanation regarding the source implementation in gprMax.

After reviewing the gprMax documentation and the sources.py file, I understand that in 2D simulations, the source is modeled as a line source due to the invariance in the z-direction. I also recognize that gprMax does not directly use analytical field expressions but relies on the numerical approximation inherent in the FDTD method.

To deepen my understanding, I have a few specific questions:

  1. Numerical Representation of the Source: How is the z-directed line source (Hertzian dipole) numerically implemented in the FDTD update equations within gprMax? Specifically, is it introduced as a current density term added to Maxwell’s equations?

  2. Code Implementation Details: Could you point me to the specific sections in sources.py or other relevant files where this source injection is handled? Understanding the exact implementation will help me relate the numerical model to the physical source.

  3. Analytical Comparison: I plan to compute the analytical solution for a line source in a homogeneous medium (e.g., using the Green's function from Chew's book or your thesis) and compare it with gprMax simulation results. To ensure a valid comparison, could you advise on any considerations or adjustments needed when aligning the analytical model with the numerical implementation in gprMax?

I appreciate your guidance in helping me bridge the gap between the numerical implementation in gprMax and the underlying physical models.

Best regards,
Hamed.

Antonis Giannopoulos

unread,
Apr 30, 2025, 12:49:26 PMApr 30
to gprMax-users
Hi Hamed,

1. The sources.py in the current master branch contains the implementation of the various sources. The "class HertzianDipole(Source)" is what is used in both 3D and 2D. The line source is an automatic result from the model being 2D. The source module is to introduce a J term in Maxwell's equations. What you specify for these sources is the current waveform on the source. 

2. (see point 1 above)

3. J sources in FDTD are applied half a time step away from the E field. This is a result of balancing the discrete equation in both time instance and space. When you convolving a source function with the analytical impulse response small time misalignments might result in small discrepancies between the responses. I think we do provide some comparisons with an analytical Hertzian dipole source in the docs and these can be found in the "tests" sub package.

Good luck with your tests and your work.

Antonis
Reply all
Reply to author
Forward
0 new messages