Because the optics of thin dielectric films is based on reflection and refraction at multiple surfaces, we begin by reviewing the governing equations for reflection and refraction at a single boundary between two media, called a *material discontinuity*. The reflection and refraction of light at the boundary is governed by the *Fresnel equations*:

(1)

\begin{aligned}

t_s &= \frac{2n_1 \cos\theta_i}{n_1 \cos\theta_i+n_2 \cos\theta_t} \\

t_p &= \frac{2n_1 \cos\theta_i}{n_2 \cos\theta_i+n_1 \cos\theta_t} \\

r_s &= \frac{n_1 \cos\theta_i-n_2 \cos\theta_t}{n_1 \cos\theta_i+n_2 \cos\theta_t} \\

r_p &= \frac{n_2 \cos\theta_i-n_1 \cos\theta_t}{n_2 \cos\theta_i+n_1 \cos\theta_t}

\end{aligned}

t_s &= \frac{2n_1 \cos\theta_i}{n_1 \cos\theta_i+n_2 \cos\theta_t} \\

t_p &= \frac{2n_1 \cos\theta_i}{n_2 \cos\theta_i+n_1 \cos\theta_t} \\

r_s &= \frac{n_1 \cos\theta_i-n_2 \cos\theta_t}{n_1 \cos\theta_i+n_2 \cos\theta_t} \\

r_p &= \frac{n_2 \cos\theta_i-n_1 \cos\theta_t}{n_2 \cos\theta_i+n_1 \cos\theta_t}

\end{aligned}

where n_1 and n_2 are the refractive indices in the adjacent domains containing the incident and refracted rays, respectively, \theta_i is the angle of incidence, and \theta_t is the angle of refraction. This is illustrated by the following diagram.

The coefficients r and t are the reflection and transmission coefficients, respectively. The subscripts s and p indicate the polarization of the incident ray. If the electric field vector is normal to the *plane of incidence* (the plane containing the incident ray and the surface normal), the ray is *s-polarized*; if the electric field vector lies in the plane of incidence, the ray is *p-polarized*.

For clarity, in the following discussion we drop the suffixes that indicate s- and p-polarization and assume that the correct reflection and transmission coefficients are used.

If the incident ray has intensity I_0, the reflected and refracted rays have intensity given by

(2)

\begin{aligned}

I_r &= R I_0 \\

I_t &= T I_0 \\

R &= \left|r\right|^2 \\

T &= \frac{n_2 \cos\theta_t}{n_1 \cos\theta_i}\left|t\right|^2

\end{aligned}

I_r &= R I_0 \\

I_t &= T I_0 \\

R &= \left|r\right|^2 \\

T &= \frac{n_2 \cos\theta_t}{n_1 \cos\theta_i}\left|t\right|^2

\end{aligned}

The quantities R and T are called the *reflectance* and *transmittance*, respectively. By combining Eq.(2) with either set of Fresnel coefficients from Eq.(1), we observe that energy is conserved, I_r+I_t=I_0.

We now consider what happens if rays are reflected and refracted at two parallel boundaries that are separated by a small distance. These two boundaries are the surfaces of a thin dielectric film that separates two media. By “small”, we usually mean that the film thickness is comparable in magnitude to the electromagnetic wavelength. Let us assume that the film thickness is much smaller than the *coherence length* of the radiation — in other words, over a length scale comparable to the film thickness, we can treat electromagnetic waves as perfect sinusoidal curves. We wish to compute the intensity of radiation that propagates into the domains on either side of the thin film.

As illustrated below, we can imagine a single ray entering a narrow region of refractive index n_2, sandwiched between media with indices n_1 and n_3. Let r_{12} indicate the reflection coefficient at the interface between domains 1 and 2, while r_{23} indicates the reflection coefficient at the boundary between domains 2 and 3.

After entering the thin film, the ray is reflected back and forth between the two boundaries. Every time the ray reaches a boundary with a neighboring domain, a refracted ray propagates into that domain, causing the intensity within the film to be reduced. The amplitudes of the multiple rays that propagate into the domains adjacent to the film will all contribute to the total reflected and transmitted fields. Because each of these rays travels a different distance within the film, they may *interfere* constructively or destructively with each other — that is, the total amplitude of the transmitted and reflected fields can increase or decrease, depending on the phase difference between the rays.

Because of these interference effects, the intensity of the reflected and refracted radiation depends on the ratio of the free-space wavelength, \lambda_0, to the film thickness, d, not just on the medium properties and angle of incidence. As per *Optical Properties of Thin Solid Films* by O. S. Heavens (1991), the *equivalent reflection coefficient* req for the single-layer film is given as

(3)

r_{\textrm{eq}} = \frac{r_{12}+r_{23}e^{-2i\delta}}{1+r_{12}r_{23}e^{-2i\delta}}

where \delta is the phase delay that is introduced by crossing the film:

(4)

\delta = \frac{2\pi n_2 d \cos\theta_2}{\lambda_0}

and \theta_2 is the acute angle that the ray makes with the surface normal as it propagates through the film. If multiple thin layers are placed side-by-side, it is possible to use Eq.(3) recursively to compute the transmittance and reflectance of the entire structure. There are also several other algorithms that can be used to compute the transmittance and reflectance of a multilayer film. See, for example, *Optical Properties of Thin Solid Films* by O. S. Heavens (1991) and *Principles of Optics* by M. Born and E. Wolf (1999).

We have seen that, due to the interference of electromagnetic waves on either side of a thin film, the transmittance of the film can be significantly larger or smaller than the transmittance of a single boundary between two media, depending on the medium properties, film thickness, wavelength, and angle of incidence. We can use this behavior to control the amount of transmitted or reflected radiation in an optical system.

When thin dielectric films are used to reduce the reflectance at a material discontinuity, such films form an *anti-reflective coating*. The coating may consist of a single layer or multiple layers. Anti-reflective coatings can significantly reduce the amount of unwanted or unintended radiation, called *stray light*, in an optical system. For example, suppose that light propagating through a room is focused by a glass lens with a refractive index of 1.45. Assuming that the angle of incidence is nearly 0, the reflectance of the glass surface is

(5)

R\approx\left(\frac{1-1.45}{1+1.45}\right)^2\approx 0.034

That is, more than 3% of the radiation is reflected immediately when reaching the lens, reducing the amount of light that can be properly focused by the lens. Usually, we wish to reduce the amount of stray light as much as possible.

For example, if the reflection coefficients on both sides of the film are equal, r_{12}=r_{23}, and the phase delay for rays crossing the layer is \delta = \pi/2, then, by applying Eq.(3) we find that r_{\textrm{eq}}=0 and no radiation is reflected at all. For rays at normal incidence, we can obtain the desired phase delay by adjusting the thickness of the layer so that d=\lambda_0/(4n_2), i.e., the optical thickness of the single-layer coating is a quarter of the wavelength. To ensure that r_{12}=r_{23}, the refractive index of the film should be the geometric mean of the refractive indices on either side, n_2=\sqrt{n_1 n_3}.

The single-layer coating we’ve just described would have a reflectance of exactly zero, but only for a specific frequency of radiation and a specific angle of incidence. In addition, we might not have access to a material with a refractive index equal to the geometric mean of the refractive indices on either side of the film. A solution to this dilemma is to use a multilayer film that is capable of providing consistently low reflectance across a wide frequency band while also providing more flexibility in the selection of materials.

The Ray Optics Module includes settings for applying single-layer or multilayer films to surfaces. It includes a built-in option to apply single-layer anti-reflective coatings at boundaries. There are also built-in settings for applying single-layer films that have a specified reflectance or transmittance for a certain refractive index, electromagnetic wavelength, and angle of incidence. Alternatively, single-layer or multilayer films can be applied at boundaries by specifying the refractive index and thickness of each layer directly.

For example, the following plot compares the reflectance of an anti-reflective coating with two layers, each of which has a thickness equal to 1/4 of the wavelength, to an anti-reflective coating consisting of three layers with thicknesses of 1/4 of the wavelength, 1/2 of the wavelength, and 1/4 of the wavelength, respectively. We see that the quarter-quarter film provides a reflectance of less than 0.5% over a range of about 100 nm, whereas the quarter-half-quarter film provides a reflectance of less than 0.5% over a range of more than 250 nm.

For more information about the set-up of thin dielectric films, see the Anti-reflective Coating, Multilayer tutorial.

Thin dielectric films can also be used to increase the reflectance at a boundary, creating mirrors with significantly lower losses than shiny metallic surfaces. These arrangements of films are called *high-reflection coatings* or *distributed Bragg reflectors* (DBRs). The DBR consists of alternating layers of higher refractive index n_H and lower refractive index n_L, as shown below.

The thicknesses of the layers are determined by the equation

(6)

n_H t_H = n_L t_L = \frac{\lambda_0}{4}

The DBR is characterized by a photonic stop-band \Delta \lambda_0, which is the range of wavelengths over which the reflectance is nearly 1:

(7)

\Delta \lambda_0 = \frac{4\lambda_0}{\pi}\arcsin\left(\frac{n_H-n_L}{n_H+n_L}\right)

The reflectance becomes closer to 1 within the stop-band as the number of layers is increased.

To learn more about the set-up of distributed Bragg reflectors, see the Distributed Bragg Reflector tutorial.

This tutorial is also available as a runnable application. With the Distributed Bragg Reflector (DBR) Filter application, you can compute the reflectance of a DBR over a wide frequency range. In addition to plotting the reflectance as a function of the vacuum wavelength, the application also computes the width of the stop-band, defined as the region in which the reflectance exceeds a specified threshold.

As we’ve seen previously, the optical thickness of each layer in a typical DBR is equal to \lambda_0/4. If a layer of optical thickness \lambda_0/2 is inserted within the DBR, then it becomes possible to transmit radiation of a specific frequency within the stop-band, as illustrated below.

This type of filter is useful for transmitting radiation from a spectrally narrow source while rejecting contamination from other sources.

You can download the Distributed Bragg Reflector (DBR) Filter app here.

- See what else is new in the Ray Optics Module with COMSOL Multiphysics version 5.1, released on April 15, 2015.

A *spectrometer* is a device that measures some property of radiation (e.g., its intensity or state of polarization) as a function of its frequency. Spectrometers can be designed for detecting radiation at a number of different frequency ranges. This extends from visible light to gamma rays and infrared radiation.

A basic spectrometer includes a lens or mirror to convert incoming light into a parallel (or *collimated*) beam along with a mechanism for separating the light into different frequencies. The device also features another lens or mirror to focus light of different frequencies at specific locations. If a narrow exit slit is used to only transmit radiation of a specific frequency, the device is referred to as a *monochromator*.

Spectrometers are widely used to analyze the composition of mixtures of chemicals. Each element releases photons in specific frequency ranges (collectively known as the element’s *emission spectrum*) as excited electrons return to lower energy states. Using known emission spectra, it is possible to determine the composition of a sample based on the radiation that it emits. Similarly, it is possible to analyze the composition of stars based on the radiation they emit and even estimate the redshift of very distant objects.

There are several ways to separate polychromatic light into individual colors. Early spectrometers often used a prism made of a material with a frequency-dependent refractive index n. Such materials are also called *dispersive media*. As light enters and leaves the prism, its direction of propagation is determined by Snell’s Law,

(1)

n_i \sin(\theta_i) = n_t \sin(\theta_t)

where the subscripts i and t denote the incident and refracted light, respectively. If the refractive index is frequency-dependent and the angle of incidence is nonzero, then the angle of refraction is also frequency-dependent. As a result, a collimated beam of polychromatic light will be separated, as illustrated below.

Modern spectrometers typically use a diffraction grating instead of a prism containing a dispersive medium. A *diffraction grating* is a periodic arrangement containing a large number of identical unit cells. When an electromagnetic wave reaches the grating, it can only be transmitted and reflected in specific directions. These directions depend on the wavelength of the incident light and the width of a single unit cell d.

In order for reflected or refracted light to propagate in a certain direction, the waves from adjacent unit cells must interfere constructively with each other. For a reflected ray of free-space wavelength \lambda_0 with integer-valued *diffraction order* m, the angle of incidence \theta_i and angle of reflection \theta_r are related by

(2)

m\lambda_0 = d n_1 \left(\sin\theta_r -\sin\theta_i\right)

The reflection of rays from adjacent unit cells is illustrated below.

From Eq. (2), it is clear that if the diffraction order is nonzero, the direction of reflected radiation will depend on the free-space wavelength. This is the basic property of the grating that can be used to separate different frequencies of radiation.

We now use COMSOL Multiphysics with the Ray Optics Module to model light propagation in a basic optical device. This example consists of two mirrors and a diffraction grating arranged in a *crossed Czerny-Turner configuration*, which is depicted below.

Incoming rays are released from a slit (1) with a conical distribution. The rays are reflected by a collimating mirror (2) so that all of the rays are parallel as they hit the diffraction grating (3). The reflected rays of diffraction order 0 travel along parallel paths because their angle of reflection is not wavelength-dependent. Because the different colors have not been separated, these rays are aimed away from the mirrors and ignored (4).

However, the rays of diffraction order 1 are reflected in different directions based on free-space wavelength. They are reflected by a focusing mirror (5) so that rays of different frequencies are focused at different points on a detector (6). If a narrow exit slit were placed at the detector, the resulting device would be a Czerny-Turner monochromator capable of transmitting radiation only in an extremely narrow frequency band.

In order to compute the ray paths as accurately as possible, we can resolve the mesh on the curved surfaces of the collimating mirror and the focusing mirror. On planar surfaces, a coarse mesh is acceptable. One way to quickly set up the mesh is to specify a very low *curvature factor*, which causes the mesh to be automatically refined near curved boundaries.

The paths followed by rays of different colors are shown in the following plot.

Although the crossed Czerny-Turner configuration appears to focus rays of each frequency to a distinct point, rays of a single frequency are actually distributed over an area of small but nonzero width. We can see this more clearly by zooming in at the detector surface.

It is clear that rays of a single frequency are not focused to a single point. This naturally leads us to wonder about the resolution of the device. In other words, using the mirrors and grating as they are arranged in this model, what is the smallest change in wavelength that we can detect? It is possible to analyze the resolution using the Ray plot type. One way to quantify the resolution of the device is by using the expression

(3)

\textrm{Resolution} = \frac{Sw_{i}}{Nw_{p}}

where S is the spectral width of the incident polychromatic beam, w_i is the width of an incident monochromatic beam at the detector, w_p is the width of a single pixel on the detector, and N is the total number of pixels. The resulting resolution is shown in the following plot.

To learn more about modeling the separation of polychromatic light with the Ray Optics Module, download the Czerny-Turner Monochromator model from our Model Gallery.

]]>

In particle tracing and ray tracing simulations, we often need to use the particle or ray properties to change a variable that is defined on a set of domains or boundaries. For example, solid particles in a fluid might exert a significant force on the surrounding fluid, and they may also erode the surfaces they hit.

In previous blog posts, I’ve discussed two other cases in greater detail: divergence of an electron beam due to self-potential and thermal deformation of lenses in a high-powered laser system. Each of these phenomena can be modeled using Accumulators or the specialized features that are derived from them.

An Accumulator is a physics feature that communicates information from particles or rays to the underlying finite element mesh. For each Accumulator feature in a model, a corresponding dependent variable, called an *accumulated variable*, is declared. These accumulated variables can be defined either within a set of domains or on a set of boundaries, and they can represent any physical quantity, making them extremely flexible.

The Accumulator features can be added to any of the physics interfaces of the Particle Tracing Module. They can also be used in the *Geometrical Optics* interface, available with the Ray Optics Module, and the *Ray Acoustics* interface, available with the Acoustics Module.

Depending on the physics interface, more specialized versions of the Accumulator may be available for computing specific types of physical quantities. For example, the *Particle Tracing for Fluid Flow* interface includes a dedicated *Erosion* boundary condition that includes several built-in models for computing the rate of erosive wear on a surface.

The Accumulators can be divided into three broad categories, which function in the following ways:

- Accumulators on boundaries increment a variable defined on a boundary element whenever a particle hits it.
- Accumulators on domains project information from each particle to the mesh elements the particle passes through.
- Nonlocal accumulators communicate information from a particle’s current position to the location where it was originally released.

We will now investigate each of these varieties in greater detail.

When particles or rays strike a surface, they can affect that surface in a wide variety of ways. For example, a laser can cause a boundary to heat up, sediment particles can erode their surroundings, and sputtering can occur when high-velocity ions strike a wafer in a process chamber. All of these effects require the same basic modeling procedure; we define a variable on the boundary and change its value when particles or rays interact with the boundary.

To begin, let’s consider a simple case in which we want to count the number of times a boundary is hit. We first define a variable, called `rpd`

, for example, which can have a distinct value in every boundary mesh element. Initially, this variable is set to zero in all elements. Every time a particle hits a mesh element on this boundary, we would like to increment the variable on that element by 1.

The values of the accumulated variable on the boundary elements (illustrated as triangles) after one collision are shown below:

To implement this in COMSOL Multiphysics, we first set up the particle tracing model, then add a “Wall” node to the boundary for which we want to count collisions. In this case, let’s specify that particles are reflected at this surface by selecting the Bounce wall condition. We then add the Accumulator node as a subnode to this Wall.

The settings shown in the following screenshot cause the accumulated variable (called `rpb`

) to be incremented by 1 (the expression in the Source edit field) every time a particle hits the wall.

I have created an animation that demonstrates how the number of collisions with each boundary element is counted over the course of the study. Check it out:

By changing the expression in the Source edit field, it is possible to increment the accumulated variable using any combination of variables that exist on the particle and on the boundary. For example, the accumulated variable may increase by a different amount based on the velocity or mass of incoming particles. The dependent variable need not be dimensionless. In fact, it can represent any physical quantity.

In addition to the generic Accumulator subnode — which can represent anything — dedicated accumulator-based features are available in the different physics interfaces, including the following:

- In the
*Charged Particle Tracing*physics interface:*Etch*(Use this to model physical sputtering of a surface by energetic ions.)*Current Density**Heat Source**Surface Charge Density*

- In the
*Particle Tracing for Fluid Flow*physics interface:*Erosion*(For computing the total mass removed from the surface or the rate of erosive wear.)*Mass Deposition**Boundary Load**Mass Flux*

- In the
*Geometrical Optics*physics interface:*Deposited Ray Power*(For computing a boundary heat source using the power of incident rays.)

We may also want to transfer information from particles to all of the mesh elements they pass through, not just the boundary elements they touch. We can do so by adding an Accumulator node to the physics interface directly, instead of adding it as a subnode to a Wall or other boundary condition.

For example, we can use an Accumulator to reconstruct the number density of particles within a domain. This technique is used in a benchmark model of free molecular flow through an s-bend in which the *Free Molecular Flow* interface is used to compute the number density of molecules in a rarefied gas.

Here is the geometry of the s-bend:

The settings window for the Accumulator is shown below.

The expression in the Source edit field is a bit more complicated than in the previous case. The source term R is defined as

(1)

R = \frac{J_{\textrm{in}} L}{N_{p}}

where J_{\textrm{in}} (SI unit: 1/(m^2 s)) is the molecular flux at the inlet, L (SI unit: m) is the length of the inlet, and N_{p} (dimensionless) is the number of model particles.

Physically, we can interpret R as the number of real molecules per unit time, per unit length in the out-of-plane direction, that are represented by each model particle. Because this source term acts on the time derivative of the accumulated variable, each particle leaves behind a “trail” in the mesh elements it passes through, which contributes to the number density in those elements.

I have created a second animation in which the number density of molecules is computed using the Accumulator (bottom) and the result is compared to the result of the *Free Molecular Flow* interface (top). Here it is:

We do see some noise in the particle tracing solution because each particle can only make a uniform contribution to the mesh element it is currently in. However, when the number of particles is large compared to the number of mesh elements, it is still possible to obtain an accurate solution.

In addition to the generic Accumulator node, which can represent anything, dedicated accumulator-based features are available in the different physics interfaces, including the following:

- In the
*Charged Particle Tracing*physics interface:- Particle-Field Interaction computes the charge density of particles, which can then be used as a source term to compute the self-potential of a beam of ions or electrons. It is also possible to compute the current density, which can create a significant magnetic field if the beam is relativistic.

- In the
*Particle Tracing for Fluid Flow*physics interface:- Fluid-Particle Interaction computes the body load exerted by particles on the surrounding fluid.

- In the
*Geometrical Optics*physics interface:- Deposited Ray Power generates a heat source term based on the amount of power absorbed by the medium if rays propagate through an absorbing medium.

The third variety of Accumulator is a bit more advanced than the previous two. A *Nonlocal Accumulator* is used to communicate information from a particle’s current position to the initial position from which it was released. The Nonlocal Accumulator can be added to an “Inlet” node, causing it to declare an accumulated variable on the mesh elements on the Inlet boundary.

The Nonlocal Accumulator can be used in some advanced models of surface-to-surface radiation. In many cases, the *Surface-to-Surface Radiation* physics interface (available with the Heat Transfer Module) can be used to efficiently and accurately model radiative heat transfer. However, the *Surface-to-Surface Radiation* interface relies on the assumption that all surfaces reflect radiation diffusely. That is, the direction of reflected radiation is completely independent of the direction of incident radiation. It cannot be used, for example, if some of the radiation undergoes specular reflection at smooth, polished, metallic surfaces.

One approach to modeling radiative heat transfer with a combination of specular and diffuse radiation is to use the *Mathematical Particle Tracing* interface, as demonstrated in the example of mixed diffuse and specular reflection between two parallel plates.

The incident heat flux on each plate is computed by releasing particles from the plate surface, querying the temperature of each surface the particles hit, and communicating this information back to the point at which the particles are initially released. The below image shows the temperature distribution between the two plates, where the top plate is heated by an external Gaussian source.

We have seen that Accumulators can be used to model interactions between particles or rays and any field that is defined on the surrounding domains of boundaries. The accumulated variables can represent any physical quantity. The Accumulator is the basic building block that allows for sophisticated one-way or two-way coupling between a particle- or ray-based physics interface and any of the other products in the COMSOL product suite.

The Accumulators and related physics features have too many settings and applications to discuss in detail in a single blog post. To learn more about the many options available, please refer to the User’s Guide for the Particle Tracing Module (for particle tracing physics interfaces), the Ray Optics Module (for the *Geometrical Optics* interface), or the Acoustics Module (for the *Ray Acoustics* interface).

If you are interested in learning more about any of these products, please contact us.

]]>Almost all media absorb electromagnetic radiation to some extent. In high-powered laser focusing systems, a medium such as a glass lens may absorb enough energy from the laser to heat up significantly, resulting in thermal deformation and changing the material’s refractive index. These perturbations, in turn, can change the way the laser propagates. With the Ray Optics Module, it is possible to create a fully self-consistent model of laser propagation that includes thermal and structural effects.

To understand how ray trajectories are affected by self-induced temperature changes, consider a collimated beam that strikes a pane of glass at normal incidence. Assume that an anti-reflective coating has been applied to the glass surface so that the rays are not reflected. A typical pane of glass absorbs a very small, but nonzero, fraction of the power transmitted by the beam. If the power is sufficiently low, the temperature change within the glass will be negligible, and the outgoing rays will be parallel to the incoming rays.

However, if a large amount of power is transmitted by the beam, the power absorbed by the pane of glass may substantially alter the temperature of the glass. The glass expands slightly, changing the angle of incidence of the rays and causing the transmitted rays to be deflected from their initially parallel trajectories. In addition, many materials have temperature-dependent refractive indices, and the temperature-induced change in the refractive index can also perturb the ray trajectories. Because the structural deformation and the change in refractive index tend to focus the outgoing rays, this phenomenon is known as *thermal lensing*.

Next, we take a more in-depth look at an application in which thermal and structural effects can significantly perturb ray trajectories.

Consider a basic laser focusing system that consists of two plano-convex lenses. The first lens collimates the output of an optical fiber while the second lens focuses the collimated beam toward a small target.

If the laser beam delivers a small amount of power, then it is straightforward to model the propagation of the beam toward the target by using the *Geometrical Optics* interface and ignoring the temperature change in the lenses. The following image shows the trajectories of the rays in the lens system.

However, even a high-quality glass lens absorbs a small fraction of the electromagnetic radiation that passes through it. If the optical fiber delivers a very large amount of power, then a *thermally induced focal shift* may occur; in other words, the changes in refractive index and lens shape can move the focus of the beam by a significant amount. If it is necessary to focus the laser accurately, then the possibility of thermally induced focal shift must be taken into account when designing the lens system.

In this example, we will observe how the temperature change in the lenses causes the beam to be focused at a location several millimeters away from the target.

To model ray propagation in the thermally deformed lens system, we use the following physics interfaces:

*Geometrical Optics*— To compute the ray trajectories.*Heat Transfer in Solids*— To compute the temperature in the lenses.*Solid Mechanics*— To model the thermal expansion of the lenses.*Moving Mesh*— To deform the finite element mesh in domains adjacent to the lenses.

The physics interfaces and nodes used in this model are shown in the following screenshot.

In addition to the Ray Optics Module, either the Structural Mechanics Module or the MEMS Module is needed to model the thermal expansion of the lenses.

Under the hood, the Ray Optics Module computes the ray trajectories by solving a set of coupled first-order ordinary differential equations,

(1)

\begin{aligned}

\frac{d\mathbf{q}}{dt} &= \frac{\partial \omega}{\partial \mathbf{k}}\\

\frac{d\mathbf{k}}{dt} &= -\frac{\partial \omega}{\partial \mathbf{q}}

\end{aligned}

\frac{d\mathbf{q}}{dt} &= \frac{\partial \omega}{\partial \mathbf{k}}\\

\frac{d\mathbf{k}}{dt} &= -\frac{\partial \omega}{\partial \mathbf{q}}

\end{aligned}

where \mathbf{q} is the ray position, \mathbf{k} is the wave vector, and \omega is the angular frequency. The wave vector and angular frequency are related by

(2)

\omega = \frac{c\left|\mathbf{k}\right|}{n}

where c is the speed of light in a vacuum. In an absorbing medium, the refractive index can be expressed as n-i\kappa, in which n and \kappa are real-valued quantities.

As the rays enter and leave the lenses, they undergo refraction according to Snell’s Law,

(3)

n_1 \sin(\theta_1) = n_2 \sin(\theta_2)

where \theta_1 and \theta_2 are the angle of incidence and the angle of refraction, respectively.

The intensity and power of the refracted rays are computed using the Fresnel Equations. In most industrial laser focusing systems, an anti-reflective coating is applied to the surfaces of the lenses to prevent large amounts of radiation from being reflected.

In this example, the anti-reflective coating is modeled by applying a Thin Dielectric Film node to the surfaces of the lenses.

The variables that are used to compute ray intensity are controlled by the “Intensity computation” combobox in the settings window for the *Geometrical Optics* interface. To compute a heat source using the energy lost by the rays, select “Using principal curvatures and ray power”.

The total power transmitted by each ray, Q, remains constant in non-absorbing domains. In a homogeneous, absorbing domain, the power decays exponentially,

(4)

Q(\mathbf{r})=Q(\mathbf{r}_0)\exp\left(-2k_0 \kappa\left|\mathbf{r}-\mathbf{r}_0\right|\right)

where k_0 is the free-space wave number of the ray.

In order to apply the power lost by the rays as a source term in the *Heat Transfer in Solids* interface, it is necessary to add a Deposited Ray Power node to the absorbing domains. This node defines a variable Q_{\textrm{src}} (SI unit: W/m^3) for the volumetric heat source due to ray attenuation in the selected domains. As the rays propagate through the lenses, they contribute to the value of Q_{\textrm{src}},

(5)

\frac{dQ_{\textrm{src}}}{dt} = -\sum_{j=1}^{N_t} \frac{dQ_j}{dt}\delta(\mathbf{r}-\mathbf{q}_j)

where Q_{j} (SI unit: W) is the power transmitted by the ray with index j, N_t is the total number of rays, and \delta is the Dirac delta function. In practice, each ray cannot generate a heat source term at its precise location because the rays occupy infinitesimally small points in space, whereas the underlying mesh elements have finite size, so the power lost by each ray is uniformly distributed over the mesh element the ray is currently in.

The following short animation illustrates how the heat source defined on domain mesh elements (top) is increased as the power transmitted by each ray (bottom) is reduced.

The temperature in the lens, T, can be computed by solving the heat equation,

(6)

\nabla \cdot \left(-k\nabla T\right) = Q_{\textrm{src}}

where k is the thermal conductivity of the medium. A Heat Flux node is used to apply convective cooling at all boundaries that are exposed to the surrounding air,

(7)

-\mathbf{n}\cdot\left(-k\nabla T\right) = h\left(T_{\textrm{ext}}-T\right)

As the temperature changes, it contributes a thermal strain term \epsilon_{\textrm{th}} to the total inelastic strain in the lenses. The thermal strain is defined as

(8)

\epsilon_{\textrm{th}}=\alpha\left(T-T_{\textrm{ref}}\right)

where \alpha is the thermal expansion coefficient, T is the temperature of the medium, and T_{\textrm{ref}} is the reference temperature. The resulting displacement field \mathbf{u} is then computed by the *Solid Mechanics* interface.

If the power transmitted by the beam is very low, then the energy lost by the rays to their surroundings does not noticeably change the temperature of the medium. However, it is still possible for other phenomena, such as external forces and heat sources, to change the shape or temperature of the lenses.

In this case, it is necessary to first compute the displacement field and temperature in the domain, and then compute the ray trajectories. This is considered a *unidirectional*, or one-way, coupling because the temperature change and structural deformation can affect the ray trajectories, but not the other way around.

If the power transmitted by the beam is sufficiently large, then the dissipation of energy in an absorbing medium may generate enough heat to noticeably change the shape of the domain or the refractive index in the medium. In this case, the ray trajectories affect variables, such as temperature, that are defined on the surrounding domain, and these variables in turn affect the ray trajectories. This is considered a *bidirectional*, or two-way, coupling.

In this example, we assume that the laser is operating at constant power, so it is preferable to compute the temperature and displacement field using a Stationary study step. However, the ray trajectories are computed in the time domain.

To set up a bidirectional coupling between the ray trajectories and the temperature and displacement fields, we first create a Stationary study step to model the heating and deformation of the lenses, then add a Ray Tracing study step to compute the ray trajectories. Then, the corresponding solvers are enclosed within a loop using the For and End For nodes. The following image shows the solver sequence that is used to set up a bidirectional coupling between the ray trajectories and the temperature and displacement fields.

The nodes between the For and End For nodes are repeated a number of times that is specified in the settings window for the For node. Furthermore, every time a solver is run, it uses the solution from the previous solver. In this way, it is possible to set up a bidirectional coupling between the two studies and iterate between them until a self-consistent solution is reached.

We now examine the ray trajectories close to the target for two cases: A 1-watt beam and a 3,000-watt beam.

For the 1-watt beam, we observe that the focal point of the beam is extremely close to the target surface. The rays do not converge to a single point due to spherical aberration. For the 3,000-watt beam, we see that the beam has already started to diverge by the time it reaches the target surface. The following image compares the deposited ray power at the target for the two cases.

*Comparison of the deposited ray power for a 3,000-watt beam (left) and 1-watt beam (right). For comparison and visualization purposes, the color expression for deposited power has been normalized and plotted on a logarithmic scale.*

The *Geometrical Optics* interface also includes built-in operators for evaluating the sum, average, maximum, or minimum of an expression over all rays. Using these operators, it is possible to quantify the beam width in a variety of ways. As shown in the plot below, the 3,000-watt beam is focused more than 2 millimeters away from the target surface.

We have seen that the temperature change and the resulting thermal expansion in a high-powered laser system can significantly shift the focal point of the beam. With the Ray Optics Module, it is possible to take thermally induced focal shift into account when designing such systems.

To learn more about computing ray trajectories in thermally deformed lens systems, please refer to the Thermal Lensing in High-Power Laser Focusing Systems model.

]]>

Consider the motion of a group of ions or electrons through electric and magnetic fields. To model the system using a one-way coupling, we first solve for the electric and magnetic fields, typically using a stationary or frequency-domain study step. To compute the trajectories of charged particles in these fields, we can then use the *Charged Particle Tracing* interface, which solves a second-order ODE for each particle’s position:

\frac{d}{dt}\left(m\mathbf{v}\right)= q\left({\mathbf{E} + \mathbf{v}\times\mathbf{B}}\right)

Here, m\mathbf{v} is the particle’s momentum, q is the particle’s charge, \mathbf{E} is the electric field, and \mathbf{B} is the magnetic flux density. This approach relies on the following assumptions:

- The fields are either stationary, change very slowly relative to the motion of the particles, or vary sinusoidally over time.
- The charged particles have a negligibly small effect on the electric and magnetic fields.

Being able to compute the fields using a stationary or frequency-domain study step is a tremendous time saver, since time-dependent studies involving the Particle Tracing Module often require a very large number of time steps. Several examples of one-way coupling between particles and electromagnetic fields are available in the Model Gallery, including the following:

- Magnetic Lens (requires the AC/DC Module)
- Particle Tracing in a Quadrupole Mass Spectrometer (requires the AC/DC Module)
- Quadrupole Mass Filter (requires the AC/DC Module)
- Einzel Lens

Several examples of one-way coupling between fluid velocity fields and particle trajectories are also available, such as the following:

All of these examples follow the same pattern: compute the field using a stationary or frequency-domain study step, then couple the solution to a time-dependent study step for the particle trajectories.

If the particles are numerous enough that they noticeably affect fields in the surrounding domains, we must recompute the fields at each time step to account for the changed positions of the particles. At this point, a two-way coupling between particles and fields is required. Typical examples of systems requiring a two-way coupling are ion and electron beams, electron guns, and sprays of particles entering a crossflow. In these situations, we must often compute the space charge density due to a group of charged particles or the volume force exerted by particles on a fluid.

The particles used in the physics interfaces of the Particle Tracing Module are treated as point masses in many respects. Although some pre-defined forces, such as the drag force, are size-dependent, the particles are considered infinitesimally small for the purpose of determining when they collide with walls. In addition, particles immersed in a fluid don’t displace any volume of fluid. Because each particle is treated as a point mass, the charge density or volume force due to the presence of a particle reaches a singularity at that particle’s location.

In some instances, you can improve the accuracy of a solution close to a singularity using adaptive mesh refinement; see, for example, Implementing a Point Source Using Poisson’s Equation in the Model Gallery. However, this is not a viable option for managing singularities due to particles for several reasons: there can be a very large number of singularities, the particles are constantly moving, and they generally don’t coincide with nodes of the finite element mesh. Instead, the singularities are avoided by distributing the space charge density or volume force due to each particle over the mesh element the particle is currently in. Although this means that the solution is somewhat mesh-dependent, the error introduced is typically very small if the number of particles is sufficiently large.

In the context of particle-field or fluid-particle interactions, we take *steady-state* to mean that the fields do not change over time. For example, an ion beam would be considered to operate under steady-state conditions if the electric field at any point remains constant, typically as a result of a constant ion flux. A pulsed beam, on the other hand, would not be considered a steady-state system.

A unique feature of steady-state systems is that they allow the particle trajectories and fields to be computed using a self-consistent method that is more efficient than computing the entire solution with a time-dependent study. This method involves the set-up of an iterative loop of different solver types, as we will see in the following example.

To illustrate the available solution techniques for steady-state systems with two-way coupling between particles and fields, consider a beam of electrons that is released into a large, open area at constant user-defined current. In order to model a large, open area, we add an Infinite Element Domain around the exterior of the modeling domain, represented by the highlighted areas in the image below. The circle shown at one end of the cylinder will be used to define an *Inlet* feature for electrons.

We expect that the electrons in the beam will repel each other, causing the beam to become wider as it propagates forward. We will assume that the electrons are non-relativistic, so that the force on the beam electrons due to the beam’s magnetic field is negligibly small compared to the force due to the beam’s electric field. We seek a self-consistent solution to the following equations of motion:

\begin{aligned}

-\nabla \cdot \epsilon_0 \nabla V &= \sum_{i=1}^N q\delta \left({\mathbf{r}}-{\mathbf{q}}_i\right)\\

\frac{d}{dt}\left(m{\mathbf{v}}\right) &= -q\nabla V

\end{aligned}

-\nabla \cdot \epsilon_0 \nabla V &= \sum_{i=1}^N q\delta \left({\mathbf{r}}-{\mathbf{q}}_i\right)\\

\frac{d}{dt}\left(m{\mathbf{v}}\right) &= -q\nabla V

\end{aligned}

The first equation is a Poisson equation for the electric potential, with a space charge density term due to the presence of charged particles. Here, \delta is the Dirac delta function, N is the total number of particles, \mathbf{r} is the position vector of a point in space, and \mathbf{q}_i is the position of the ith particle. The second equation is the equation of motion of a particle subjected to an electric force. Solving both equations of motion in the same time-dependent study would be extremely time-consuming, and would require a very large number of particles to be released at small, regular time intervals to ensure that the desired beam current is maintained.

An alternative solution method involves a physics interface property called the *Release type*, available for the *Charged Particle Tracing* and *Particle Tracing for Fluid Flow* interfaces in COMSOL 4.4. The default setting, *Transient*, is the correct choice for most applications. Changing the *Release type* to “Static” affects the available settings of particle release features, such as the *Inlet*, and changes the way the Particle-Field Interaction and Fluid-Particle Interaction features work.

Working with the Static release type requires us to change our interpretation of what the model particles represent. Rather than representing a single particle or group of particles at a specific point in space, each model particle now represents a certain number of particles per unit time. The number of real particles per unit time represented by each model particle is computed so that each Inlet, Release, or Release from Grid feature provides a user-defined charged particle current or mass flow rate (for the *Charged Particle Tracing* and *Particle Tracing for Fluid Flow* interfaces, respectively).

To accompany this new interpretation of the model particles, the space charge density, \rho, due to the presence of charged particles is now computed as:

\frac{d\rho}{dt} = q\sum_{i=1}^N f_{\textrm{rel}}\delta\left({\mathbf{r}}-{\mathbf{q}}_i\right)

Here, f_{\textrm{rel}} is the number of ions or electrons per second represented by each model particle so that the user-defined current is obtained. Similarly, when modeling fluid-particle interactions, the volume force, \mathbf{F}_V, that is exerted by particles on the fluid is computed as:

\frac{d{\mathbf{F}}_V}{dt} = -\sum_{i=1}^N f_{\textrm{rel}}{\mathbf{F}}_D\delta\left({\mathbf{r}}-{\mathbf{q}}_i\right)

where {\mathbf{F}}_{\textrm{D}} is the drag force on the particle. The time derivative on the left-hand side of each equation indicates that instead of creating a contribution to the space charge density at one location in space, each model particle leaves a trail of space charge or volume force along its trajectory, representing the combined effect of all particles that follow that trajectory. As a result, only a single release of model particles at time t=0 is needed to compute the space charge density due to an electron beam operating at constant current.

When computing the space charge density due to a group of particles, a time-dependent solver with a fixed maximum time step is recommended. The maximum time step should be small enough so that, on average, each particle spends several time steps inside each mesh element. In addition, the number of model particles should be large compared to the number of mesh elements in a cross section of the beam. These two guidelines ensure that the particles don’t “miss” any elements inside the beam, thereby creating non-physical gaps in the space charge distribution.

So far, we’ve seen that a single release of particles can be used to compute the space charge density due to a continuous beam of charged particles. However, the resulting space charge density must still be coupled back to a Poisson equation for the electric potential. Changes to the electric potential might in turn perturb the particle trajectories. To reach a self-consistent solution, we can compute the electric potential using a stationary solver, then use this potential to compute the particle trajectories and space charge density using a time-dependent solver, then use the space charge density to recompute the electric potential, and so on. This type of iterative sequence can be implemented in COMSOL by adding *For* and *End For* nodes to the solver sequence. Any solvers in-between these two nodes will be executed a number of times specified by the user in the *For* node settings. New to COMSOL Multiphysics in version 4.4, the *For* and *End For* nodes give the user sophisticated tools to set up two-way coupling between physics interfaces that require different types of solvers.

The self-consistent solution confirms our expectations: the electron beam diverges due to its self potential. In the image below, the lines represent particle trajectories that begin in the background and move to the foreground. The shading of each line represents the model particle’s radial displacement from its original position; the slice plot shows the beam potential; and the arrows show the electric force acting on the beam due to self potential. The result is in close agreement with analytical expressions for the shape of a non-relativistic charged particle beam.

Although the method outlined above is only valid for static fields, it reduces the number of particles required for accurate modeling by several orders of magnitude. The Electron Beam Diverging Due to Self Potential model demonstrates the new *For* and *End For* nodes that can be added to the solver sequence with COMSOL 4.4.

- If the number density of particles is very low, the particles may have a negligibly small effect on electric, magnetic, or fluid velocity fields in the surrounding domain. In this case, computing the field first and then using this field to exert a force on the particles is the most efficient approach.
- To accurately model two-way coupling between particles and fields, use a large number of model particles and specify a fixed maximum time step. You may need to increase the number of particles or reduce the time step further after refining the mesh.
- The Static release type can be used to model a constant charged particle current or mass flow rate.
- If the field is not time-dependent, computing the fields and particle trajectories in separate steps within a solver loop can be much more efficient than including all physics in a single time-dependent study step.