Modeling nonequilibrium electromagnetic fluctuations with scuffneq
scuffneq is an application code in the scuffem suite for studying nonequilibrium (NEQ) electromagneticfluctuationinduced phenomenaspecifically, for computing radiative heattransfer rates and nonequilibrium Casimir forces and torques for bodies of arbitrary shapes and arbitrary (linear, isotropic, piecewise homogeneous) frequencydependent permittivity and permeability.
scuffneq implements the fluctuatingsurface current (FSC) approach approach to numerical modeling of nonequilibrium fluctuation phenomena. The FSC method was first developed to compute equilibrium Casimir forces (as implemented by scuffcas3d) [1] and was subsequently extended to handle nonequilibrium radiative heattransfer problems [2] and later nonequilibrium forces and torques [3].
As discussed in more detail below, what scuffneq actually computes are temperatureindependent quantities known as generalized fluxes that describe frequencyresolved contributions to various quantities of interest in fluctuational electromagnetism, including both (a) spatiallyintegrated (SI) quantities such as the total rate of heat absorbed or radiated by, or the total force or torque on, a material body, and (b) spatiallyresolved (SR) quantities such as the Poynting flux or Maxwell stress tensor at individual points in space. scuffneq outputs data files giving values of generalized fluxes at various frequencies you specify; these data may then be integrated by the separate utility code scuffintegrate to compute full thermallyaveraged values of SI and SR quantities for various body temperatures.
When requesting spatiallyintegrated quantities, you will specify which of the various computational techniques you want the code to use to compute total energies and forces/torques on bodies; the main options are the displaced surfaceintegral (DSI) method, which integrates the Poynting vector or Maxwell stress tensor over a bounding surface surrounding the body, or the energymomentum transfer (EMT) method, which integrates the local power absorption and force over the volume of the body. (Algorithms for spatiallyintegrated PFT calculation are discussed in Refs. [ [3] and [4] ](scuffneq.md#bibliography) below.
When requesting spatiallyresolved quantities, you will specify a list of evaluation points, and you will get back a data file giving (generalized fluxes for) the Poynting vector and Maxwell stress tensor at each point.
scuffneq also offers options for generating visualization files showing the spatial distribution of energy and momentum absorption by bodies.
As in scuffcas3d, you can specify an optional list of geometrical transformations describing various displacements and rotations of the bodies in your geometry; in this case you will get back multiple copies of all output quantities, one for each transformation in your list.
For Casimir forces and torques, the quantities computed by scuffneq are only the nonequilibrium contributions to the total force and torquethat is, the contributions arising from the temperature differences between individual bodies and the surrounding environment. To get the total force, these must be added to the equilibrium contributions, which are the Casimir forces and torques for the case in which all bodies are at the temperature of the environment. These contributions must be computed by doing a separate scuffcas3d calculation, on the same geometry, at the temperature of the external medium. (For heattransfer rates there is of course no equilibrium contribution, as there is no net power transfer between bodies at thermal equilibrium.)
One difference between scuffcas3d and scuffneq is that,
whereas in scuffcas3d you use commandline options like
zForce
or xTorque
to request computation of specific
SI quantities, in scuffneq you automatically get all 8
SI quantities (heat radiated, heat absorbed, plus all 3
components of the force and torque).
Another difference between scuffcas3d and scuffneq is that,
whereas scuffcas3d reports only the Casimir force on one body in
a geometry (namely, the first body listed in the .scuffgeo
file),
scuffneq reports forces and heattransfer rates for all bodies
in the geometry. [The extra information would typically
be redundant in an equilibrium Casimir calculation, since the equilibrium
Casimir force on the second body (in a twobody geometry) is just equal
and opposite to the force on the first body; but in general no such
relation holds in the nonequilibrium case.]
In fact, the output from scuffneq is even more detailed than that: in addition to the total power/force/torque on each body, you also get the contributions of each individual source body to those quantities. All of this means that the output from scuffneq requires some effort to interpret, as discussed in more detail below.
1. What scuffneq actually computes
Consider a collection of one or more homogeneous material bodies, each maintained at a given temperature, embedded in an finite (or zero) temperature environment. The electromagnetic fields radiated by thermallyinduced fluctuating sources in each body carry energy and momentum, which we may characterize either in terms of (a) spatiallyresolved (SR) quantities like the timeaverage Poynting vector or Maxwell stress tensor at given points in space, or (b) spatiallyintegrated (SI) quantities like the total timeaverage heat absorbed or radiated by, or force or torque on, entire bodies. In the FSC approach to nonequilibrium fluctuation phenomena implemented by scuffneq, the total thermallyaveraged value of any SR or SI quantity is computed by summing the contributions of fluctuations from all bodies at all frequencies:
where is the temperature of body, is a temperatureindependent generalized flux describing the contribution of frequency source fluctuations in body , and is the BoseEinstein factor.
The sum over bodies in this equation includes the contributions of the external environment. To isolate these contributions it is convenient to decompose into a sum of two terms:
where
The quantity is the average value of that would obtain if the temperature in all material regions were equal to the environment temperature that is, it is the equilibrium value of at temperature . The equilibrium value of PFT quantities may be computed by methods that are less costly than scuffneq. (For example, if is a spatiallyintegrated force or torque, then is just the equilibrium Casimir force, which is computed efficiently by scuffcas3d. On the other hand, if is a spatiallyintegrated power transfer quantity, then identically.) Thus this contribution is not computed by scuffneq.
The quantity is the extent to which deviates from its equilibrium value, and the sum in its definition ranges only over the source bodies in the geometry, not including the environment contribution.
The job of scuffneq is to compute the quantity known as a generalized flux that enters the integral defining ; scuffneq will do this computation at each of multiple frequencies that you specify in advance. These data are then used by the separate scuffintegrate utility to evaluate the actual integrals and compute thermallyaveraged power, force, and torque quantities at various temperatures.
2. scuffneq commandline options
Options specifying the geometry
````geometry MyGeometry.scuffgeo TransFile MyTransFile
{.toc}
The mandatory `geometry` option specifies the
[<span class=SC>scuffem</span> geometry file][Geometries]
describing your geometry.
The optional `TransFile` option specifies a
[list of geometrical transformations][Transformations]
to be applied to your geometry. Each output quantity you
request will be separately computed and reported for
each transform you request.
### Options specifying frequencies
````omega 1.23
OmegaFile MyOmegaFile
The first option here requests computation at just a single angular frequency (interpreted in standard scuffem units of rad/sec).
The second option specifies a file containing a list of frequencies (one per line) at which to compute generalized fluxes .
Options requesting spatiallyintegrated output quantities
DSIPFT
OPFT
Request calculation of spatiallyintegrated quantities via one of the available methods: the energy/momentum transfer (EMT) method, the displacedsurfaceintegral (DSI) method, or the overlap (O) method. You may specify none, any combination, or all of these options.
Note that all of these methods are computing the same quantities, so in principle their results should be equivalent, and specifying more than one should be redundant. However, in practice it is often helpful to compute SI quantities via multiple methods as a confirmation and accuracy check.
For the particular case of DSIPFT,
there are several
options controlling the particular implementation of the
algorithm; see below.
Option requesting spatiallyresolved output quantities
EPFile MyEPFile
Specifies a file containing a list of evaluation points, one per line (three Cartesian coordinates), at which values of the Poynting vector and Maxwell stress tensor are to be computed.
Options controlling DSI calculations
The displacedsurfaceintegral (DSI) method total absorbed/radiated power, force, and torque on each body in a geometry by integrating the Poynting flux and Maxwell stress over a bounding surface surrounding the body. You have two options for what bounding surface is used: (a) a gmsh mesh file you provide giving a discretized version of your bounding surface, or (b) a sphere centered at the body. (In both cases, the surface is displaced and recentered at the origin of each body to compute DSIPFT for that body.)
To use option (a), say
DSIMesh MyDSIMesh.msh
If the DSIMesh
option is not specified, scuffneq
defaults to a spherical bounding surface. In this case you may
use the commandline options
DSIRadius 2.0
DSIPoints 302
to set the radius of this sphere and the number of cubature
points used to approximate the surface integral over it.
(Use scuffneq help
to see a list of the available values
of DSIPoints
). If you don't specify values for these
options, they will be set automatically.
DSIPoints2 770
For the case of a spherical bounding surface, you may specify
DSIPoints2
to request a "second opinion" DSI calculation
with a different number of cubature points to check the
accuracy of the numerical cubature. The secondopinion DSI
data will be written to a file with file extension .SIFlux.DSI2
(This is optional; if you
don't specify DSIPoints2
no secondopinion calculation
is done.)
DSIOmegaFile DSIOmegaFile
Because the DSI calculation can be slow, in some cases you
may wish to request that it only be performed at a subset
of the frequencies in your OmegaFile
. You specify
that subset using the DSIOmegaFile
option. For example,
you might say EMTPFT
to request EMT calculations at
all frequencies, but use DSIPFT
with a DSIOmegaFile
containing only every 5th or 10th frequency in your full
OmegaFile
to obtain a sanity check on the EMTPFT results.
Option requesting visualization output
PlotFlux
This option directs scuffneq to produce visualization files (in addition to its usual output files) which may be opened in gmsh to visualize, for each spatiallyintegrated PFT quantity you requested, the spatial distribution of the Poynting flux or Maxwell stress on the surfaces of objects or the displaced bounding surfaces over which those quantities are integrated to compute the total PFT quantity.
Other options
FileBase MyFileBaSe
Specifies the base filename for all output files.
If this option is not specified, FileBase
is set
to the base filename of the .scuffgeo
file.
SourceObject MySourceObject
DestObject MyDestObject
For a geometry containing bodies,
by default scuffneq computes
the full matrix of generalized flux
quantities describing the
energy/momentum transfer to destination body due
to fluctuations in source body .
You may use either or both of SourceObject
and DestObject
to compute
only quantities sourced by a given source body
and/or only energy/momentum transfer to a given
destination body; the arguments to these options are the
labels you specified for the objects in question in the .scuffgeo
file.
Note: Because of the way the EMTPFT method works, this
algorithm always computes results for all destination
bodies, so DestObject
has no effect on EMTPFT
calculations. (But SourceObject
can still be used
to reduce the number of EMTPFT calculations performed.)
OmitSelfTerms
This flag may be set to bypass the calculations of selfcontributions (i.e. fluxes of the form ).
3. scuffneq output files
The .log
file
Like all commandline codes in the scuffem suite,
scuffcas3d writes a .log
file that you
can monitor to keep track of your calculation's progress.
Output files for spatiallyintegrated PFTs: The .SIFlux.METHOD
file
If you used an option like EMTPFT
or DSIPFT
to request
computation of spatiallyintegrated PFT data,
you will get back a file with extension .SIFlux.METHOD
(where SIFlux
stands for "spatiallyintegrated flux" and
where METHOD
is replaced by the method used, i.e., EMTPFT, DSIPFT,
etc.)
reporting values
of the generalized fluxes at each frequency you requested.
Generalized fluxes represent temperatureindependent frequencyresolved contributions to thermallyaveraged rates of energy and momentum transfer; as noted, above, they are multiplied by temperaturedependent BoseEinstein factors and integrated over frequency to yield full thermally and temporallyaveraged data. This integration operation is carried out by the utility code scuffintegrate, as described below.
Output files for spatiallyresolved PFTs: The .SRFlux
file
If you requested the computation of spatiallyresolved
power and momentum flux (by specifying the EPFile
commandline option), you will get back a file with
extension .SRFlux
reporting temperaturedependent
frequencyresolving contributions to the Poynting flux
and Maxwell stress at each point in your EPFile
.
(See below for more information on what these values mean.)
4. Using scuffintegrate to perform frequency integrals
After running scuffneq to get temperatureindependent generalized flux data at various frequencies, we run scuffintegrate to evaluate the frequency integrals that compute total thermallyaveraged rates of energy and momentum transfer.
Specifying temperatures
To convert frequencyresolved data into thermallyaveraged
data, we need to know the temperature of all bodies in
the geometry, as well as that of the environment; in
general, we will want results for multiple
different combinations of body and environment temperatures
This information is specified to scuffintegrate in the
form of a simple text file (I usually call it simply TemperatureFile
)
in which each line describes
a separate assignment of temperatures to the environment
and to the various bodies in the geometry, with format
TEnv T1 T2 ... TN
where TEnv
is the environment temperature
and T1
, T2
, ..., TN
are the temperatures of the
first, second, ..., N
th bodies in your geometry
(indexed in order of their appearance in the .scuffgeo
file).
For example, here's a TemperatureFile
for a twobody
geometry in which we request data for
the first body held at temperatures of K
with the second body held fixed at K and the
environment kept at K
(temperatures are always specified in units of Kelvin):
0 50 100
0 100 100
0 150 100
Spatiallyintegrated quantities
For spatiallyintegrated quantities (total heat radiation/absorption,
force, and torque on bodies),
scuffintegrate inputs a .SIFlux
produced by scuffneq
and produces two further output files with extensions
.NEQPFT
and .SIIntegrand,
which report respectively
the total (frequencyintegrated) thermallyaveraged quantities
and the temperatureweighted integrand of the frequency
integral that produced them.
To understand the various quantities written to these 3 files, let be the spatiallyintegrated PFT on a destination body , and write the FSC decomposition of the thermal average of in the form
In this equation,

is a dimensionless frequency variable: , where rad/sec. (Thus agrees numerically with the arguments to the
omega
option.) 
is a dimensionless version of the usual BoseEinstein factor, defined by .

is the difference between the dimensionless BoseEinstein factors of source body and the environment.

is the temperatureindependent generalized flux describing the contributions of fluctuations in source body to the power, force, or torque on destination body . Values of this quantity are written to the
.SIFlux.METHOD
output file (whereMETHOD
is a string likeEMTPFT
identifying the spatialintegration method used). 
is the spectral density of temperatureweighted contributions from fluctuations in source body to the PFT on destination body . Values of this quantity are written to the
.SIIntegrand
output file. 
Finally, is the total thermallyaveraged PFT on body . Values of this quantity are written to the
.NEQPFT
output file.
In all of these files, each single line corresponds to a single frequency, a single geometric transformation, and a single pair of (source,destination) objects.
At the top of each output file you will find a file header
explaining the significance of each of the various
columns in the file. One of the columns will be
described in the header as # (source object, dest object),
and will take values like 12
, 22
, or 02.
The first case (12
) indicates that the data on that
line correspond to the contributions of object 1 to the
PFT on object 2. (The ordering of objects corresponds
with the order of their appearance in the .scuffgeo
file). The second case (22
) indicate that the data
on that line correspond to the selfcontributions of
object 2 to its own PFT. The third case (02
)
indicates that the data on that line correspond to
the total PFT on object 2that is, the sum of
contributions from all source objects.
Spatiallyresolved quantities
For spatiallyresolved data,
scuffintegrate inputs a .SRFlux
produced by scuffneq
and produces two further output files with extensions
.PVMST
and .SRIntegrand,
which report respectively
values of the total (frequencyintegrated) thermallyaveraged
Poynting Vector and Maxwell Stress Tensor
and the temperatureweighted integrand of the frequency
integral that produced them.
The breakdown here is similar to that described above for spatiallyintegrated quantities. To understand this, let be a spatiallyresolved PFT quantity (a component of the Poynting vector or Maxwell stress tensor) at a point . Then the thermal average of may be written in the form
In this equation,

is the temperatureindependent generalized flux describing the contributions of fluctuations in source body to the Poynting flux or Maxwell stress at . Values of this quantity are written to the
.SRFlux
output file. 
is the spectral density of temperatureweighted contributions from fluctuations in source body to the Poynting flux or Maxwell stress at . Values of this quantity are written to the
.SRIntegrand
output file. 
Finally, is the total thermallyaveraged Poynting vector or Maxwell stress tensor at . Values of this quantity are written to the
.PVMST
output file.
In all of these files, each line corresponds to a single frequency, a single geometric transformation, and a single source object. At the top of each output file you will find a file header explaining how to interpret the various data columns on each line.
Units of output quantities

The units of the total (frequencyintegrated) spatiallyintegrated output quantities reported in the
.NEQPFT
file are watts for power, nanoNewtons for force, and nanoNewtons microns for torque. 
The quantities in the
.SIIntegrand
output file are the PFT quantities per unit dimensionless frequency, so have the same units as the corresponding quantities in the.NEQPFT
file. 
The quantities in the
.SIFlux
output file are the quantities per unit dimensionless frequency per watt of thermal energy, so these quantities have the same units as the quantities in the.NEQPFT
and.SIIntegrand
file, but divided by watts: thus the power flux is dimensionless, the force flux has units of nanoNewtons / watts, and the torque flux has units of nanoNewtons microns/watts.
4. Examples of calculations using scuffneq

Heat transfer and nonequilibrium Casimir forces between warm and cold spheres

Spatial distribution of poynting flux from a warm tip above a cold substrate
Bibliography
Here are the original papers cited above describing the FSC approach to fluctuational electromagnetism:
The various algorithms for computing spatiallyintegrated data (DSI, EMT, etc.) are described in Ref. 3 here; see also this paper.