RCS calculation in very high frequencies

How to use openEMS. Discussion on examples, tutorials etc

Moderator: thorsten

Post Reply
khashabri
Posts: 4
Joined: Wed 13 Nov 2019, 12:45

RCS calculation in very high frequencies

Post by khashabri » Wed 13 Nov 2019, 18:00

Hi guys,
I'm currently trying to analyze the reflection characteristics of different 3D shapes using OpenEMS in python interface. In the following, let's consider a simple sphere as the shape (I am aware of the trivial solution. This is just a simple choice to demonstrate my problem).
The structure of the simulation is very similar to calculating the RCS as it is described in the RCS_sphere.py tutorial (https://github.com/thliebig/openEMS/blo ... _Sphere.py), and my code is inspired by it, with the simple difference that here I rotate the source and the Farfield position around the shape and catch the normalized reflection values.

Code: Select all

### Import Libraries
import os, tempfile
from math import *

import CSXCAD
from openEMS import openEMS
from openEMS.physical_constants import *
from openEMS.ports import UI_data
import numpy as np
import matplotlib.pyplot as plt
from numpy import linalg as LA


def dihedral_reflector(inc_angle, getFrequencies):
    ### Setup the simulation
    Sim_Path = os.path.join(tempfile.gettempdir(), os.path.basename(__file__)[:-3])

    unit = 1e-3  # all length in mm

    # size of the simulation box
    SimBox = 1550
    PW_Box = 1200

    # Setup FDTD parameters & excitation function
    FDTD = openEMS(EndCriteria=1e-5)

    f_start = 50e6  # start frequency
    f_stop = 1010e6  # stop  frequency
    f0 = 500e6

    FDTD.SetGaussExcite(0.5 * (f_start + f_stop), 0.5 * (f_stop - f_start))

    FDTD.SetBoundaryCond(['PML_8', 'PML_8', 'PML_8', 'PML_8', 'PML_8', 'PML_8'])

    # Setup Geometry & Mesh
    CSX = CSXCAD.ContinuousStructure()
    FDTD.SetCSX(CSX)
    mesh = CSX.GetGrid()
    mesh.SetDeltaUnit(unit)

    # create mesh
    mesh.SetLines('x', [-SimBox / 2, 0, SimBox / 2])
    mesh.SmoothMeshLines('x', C0 / f_stop / unit / 20)  # cell size: lambda/20
    mesh.SetLines('y', mesh.GetLines('x'))
    mesh.SetLines('z', mesh.GetLines('x'))

    ### Create a metal sphere and plane wave source
    sphere_metal = CSX.AddMetal('sphere')  # create a perfect electric conductor (PEC)
    sphere_metal.AddSphere(priority=10, center=[0, 0, 0], radius=200)

    # plane wave excitation beginning from theta = 0 degree
    k_dir = [0, -cos(np.deg2rad(inc_angle)), -sin(np.deg2rad(inc_angle))]
    E_dir = [1, 0, 0]  # plane wave polarization --> E_z

    pw_exc = CSX.AddExcitation('plane_wave', exc_type=10, exc_val=E_dir)
    pw_exc.SetPropagationDir(k_dir)
    pw_exc.SetFrequency(f0)

    start = np.array([-PW_Box / 2, -PW_Box / 2, -PW_Box / 2])
    stop = -start
    pw_exc.AddBox(start, stop)

    # nf2ff calc
    nf2ff = FDTD.CreateNF2FFBox()

    CSX_file = os.path.join(Sim_Path, 'sphere.xml')
    if not os.path.exists(Sim_Path):
        os.mkdir(Sim_Path)
    CSX.Write2XML(CSX_file)

    # Run the simulation
    FDTD.Run(Sim_Path, verbose=3, cleanup=True)

    get_data_at_f0_and_phi0 = UI_data('et', Sim_Path, freq=getFrequencies)
    Pin = 0.5 * LA.norm(E_dir) ** 2 / Z0 * abs(np.array(get_data_at_f0_and_phi0.ui_f_val[0])) ** 2  # Et = ui_f_val[0]
    far_data_at_f0_phi0 = nf2ff.CalcNF2FF(Sim_Path, getFrequencies, 90 - inc_angle, 90)
    powerRCS_at_f0_phi0 = np.array([4*pi/Pin[fn]*far_data_at_f0_phi0.P_rad[fn][0][0] for fn in range(len(getFrequencies))])

    return np.rad2deg(far_data_at_f0_phi0.theta)%360, powerRCS_at_f0_phi0

if __name__ == '__main__':
    # number of points in [0,360) range of angles
    npts = 6
    angles = np.arange(npts) / npts * 360

    # Analyse the reflection on this frequency
    getFrequencies = np.array([1000e6])
    nfreqs = len(getFrequencies)

    # Define arrays to plot later
    Theta = np.zeros((npts, nfreqs))
    powerRCS_at_f_phi = np.zeros((npts, nfreqs))

    # calculating the normalized reflection for different angles
    for n in range(npts):
        print('\x1b[6;30;42m' + "Angle of incidence: {:.4f} [rad] or {:.4f} [degree]"
              .format(np.deg2rad(angles[n]), angles[n]) + '\x1b[0m')
        print("Starting the simulation...")
        Theta[n], powerRCS_at_f_phi[n] = dihedral_reflector(angles[n], getFrequencies)

    # Post plotting and saving
    fig1 = plt.subplot(111, projection='polar')
    fig1.set_theta_zero_location("N")
    fig1.set_theta_direction(-1)
    for x, y in zip(np.deg2rad(Theta[:]), powerRCS_at_f_phi[:]):
        plt.polar(x, y, 'ro', color='b')
        fig1.set_ylim([0, np.amax(powerRCS_at_f_phi[:, :]) * 5 / 4])

    plt.show()
The problem is that I must choose the frequency so, that the wavelength is smaller than the shape size to avoid any Mie scattering effect. For instance,

Code: Select all

f_stop = 20e9
and

Code: Select all

getFrequencies = np.array([18e9]) 
in the script above. However, a wideband Gaussian source with GHz frequencies explodes the required RAM storage and the simulation time on my machine (my machine has 32GB of RAM).
Do you know any trick to reduce the required amount of RAM, and also speeding up the simulation? Intuitively, a single frequency source would help, but does such a thing exist in OpenEMS python interface? Additionally, considering symmetries would speed up the simulation, however, I'm not sure how I can use symmetries into my code (please have a look at the script)

Also considering the RCS_sphere tutorial, It is not clear to me why we use both

Code: Select all

FDTD.SetGaussExcite(0.5 * (f_start + f_stop), 0.5 * (f_stop - f_start)) 
and

Code: Select all

pw_exc = CSX.AddExcitation('plane_wave', exc_type=10, exc_val=E_dir)
pw_exc.SetPropagationDir(k_dir)
pw_exc.SetFrequency(f0)
together. What is the difference between these two and why do we have different exitation frequencies in each?!

techfreakz
Posts: 1
Joined: Wed 19 Feb 2020, 22:01

Re: RCS calculation in very high frequencies

Post by techfreakz » Wed 19 Feb 2020, 22:03

Hello khashabri,

I'm going to be attempting some RCS modelling of a vehicle soon and wondered how you had progressed with this problem?

Did you find any solutions?

Best regards,
Alex

Hale_812
Posts: 170
Joined: Fri 13 May 2016, 02:54

Re: RCS calculation in very high frequencies

Post by Hale_812 » Thu 20 Feb 2020, 02:21

I did not see your example yet... just for comparison, I was simulating pulse scattering (not RCS, we were interested in energy leak paths) from large objects in a space like 3x5x2 meters at 10-20 GHz band. It was fitting in 32 Gb with proper optimization of mesh; but I was cutting on resolution in free space between antennas and the object. It toook a few weeks though; but gave a nice insight image of pulse propagtion which you could not see at university lectures. Small pure RCS models like 0.5^2 meters were fitting in 16Gb easily with arbitrary incident angle.
I use Matlab or Octave.

FDTD.SetGaussExcite ... defines a Gauss pulse shape based on its spectral width, it looks pretty clear just from the name, and there's a help also attached, and a wiki article..

Not you should know, that there is only one excitation function(above), which can be used by multiple excitation sources (below) simultaneously.

CSX.AddExcitation it adds an excotation source to CSX model.
SetPropagationDir(k_dir) ... just modifies a default value for direction
SetFrequency .... don't know what's that. some crutch for python interface, probably. There's no such thing in Matlab interface.

In Matlab FDTD (excitation signal parameters), and CSX(model geometry and attributes) are different structures. When you finish editing, you save them in one XML (WriteOpenEMS), and feed it to the solver (RunOpenEMS).

khashabri
Posts: 4
Joined: Wed 13 Nov 2019, 12:45

Re: RCS calculation in very high frequencies

Post by khashabri » Wed 11 Mar 2020, 18:52

Hello Guys,
Did you find any solutions?

No, I worked around the problem :? . I chose 7 GHz Frequency for 1200 mm Simulation Box and it got ≈ 20GB of RAM. As I have 4 Computers, I have divided the task by four and let every Computer to calculate the RCS for some Angles. Then I merged the results for different angels together and got the complete RCS of all around the object.
It was fitting in 32 GB with proper optimization of mesh; but I was cutting on resolution in free space between antennas and the object.
Can you help anyhow with how I can optimize the mesh and maybe use some non-uniform mesh for my simulation? :oops:

TorrinFu
Posts: 1
Joined: Wed 06 May 2020, 19:21

Re: RCS calculation in very high frequencies

Post by TorrinFu » Wed 06 May 2020, 19:23

Hi....the effect (sensitivity and frequency dependence) on reflections could be why your RCM measurements are difficult to reproduce. If the resonant quality factor (Q) is high and the object dimensions are large compared to the RF wavelength, the internal mode spectrum can be very dense, sensitive to small changes and very frequency dependent. I suggest that you average the RCM measurement over a frequency bandwidth that includes several fluctuations (modes) seen in the measurement.

prototype pcb

Post Reply