<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Field Precision software tips</title>
	<atom:link href="http://fieldp.com/myblog/feed/" rel="self" type="application/rss+xml" />
	<link>http://fieldp.com/myblog</link>
	<description>Effective finite-element modeling of electromagnetic fields</description>
	<lastBuildDate>Sat, 20 Apr 2013 12:58:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Internal voids in HeatWave</title>
		<link>http://fieldp.com/myblog/2013/internal-voids-in-heatwave/</link>
		<comments>http://fieldp.com/myblog/2013/internal-voids-in-heatwave/#comments</comments>
		<pubDate>Sat, 20 Apr 2013 12:37:34 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[conductor]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[finite]]></category>
		<category><![CDATA[generation]]></category>
		<category><![CDATA[HeatWave]]></category>
		<category><![CDATA[insulator]]></category>
		<category><![CDATA[internal]]></category>
		<category><![CDATA[Mesh]]></category>
		<category><![CDATA[node]]></category>
		<category><![CDATA[thermal]]></category>
		<category><![CDATA[vacuum]]></category>
		<category><![CDATA[void]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1797</guid>
		<description><![CDATA[<p>A customer recently reported strange behavior of HeatWave thermal solutions involving internal voids. A void material is one that has zero thermal conductivity. Therefore, it acts as an ideal thermal insulator. Voids are also used in solutions where objects emit thermal radiation. In this case, void elements act as an infinite vacuum. The intersections with voids [...]]]></description>
				<content:encoded><![CDATA[<p>A customer recently reported strange behavior of <strong>HeatWave</strong> thermal solutions involving internal voids. A <em>void</em> material is one that has zero thermal conductivity. Therefore, it acts as an ideal thermal insulator. Voids are also used in solutions where objects emit thermal radiation. In this case, void elements act as an infinite vacuum. The intersections with voids define emission surfaces. No problems have been observed in these types of solution where the void elements are <em>outside</em> the material regions.</p>
<p>Figure 1 illustrates the problem with internal voids. The steady state solution addresses a square volume of uniform conductivity with a void spherical bubble at the center. The upper and lower boundaries in <em>z</em> have different fixed temperatures. We expect to see a solution like the lower one where the void makes a local perturbation such that lines of thermal flux go around it. Instead, in the top solution the void acts like a fixed-temperature surface with <em>T</em> = 0 °C.</p>
<div class="wp-caption aligncenter" style="width: 410px"><img alt="Thermal solution example" src="http://www.fieldp.com/myblog/images/internal_void.png" width="400" height="753" /><p class="wp-caption-text">Figure 1. Thermal solutions, uniform conductor between fixed-temperature plates with an insulating bubble. Top: Incorrect node assignment. Bottom: Valid solution.</p></div>
<p>The resolution lies in how region numbers are assigned to nodes and elements in <strong>MetaMesh</strong>. Here is an excerpt from the <strong>MetaMesh</strong> script for the example:</p>
<pre>RegName(1): Conductor
RegName(2): Void
RegName(3): BoundDn
RegName(4): BoundUp
 ...</pre>
<pre>PART
  Region: Conductor
  Name: SolutionVolume
  Type: Box
  Fab:   2.00000E+00  2.00000E+00  2.00000E+00
END</pre>
<pre>PART
  Region: Void
  Name: Void
  Type: Sphere
  Fab:   2.50000E-01
  Surface Region Conductor
END</pre>
<p>The first <em>Part</em> section fills the entire solution volume with the conductive material (region 1). The program sets the region numbers of all nodes and elements to <em>RegNo</em> = 1. The next <em>Part</em> section adds the spherical void (region 2). When an internal region is defined in <strong>MetaMesh</strong>, the convention is to overwrite existing element and node region numbers in the shared volume. In this case, nodes on the spherical boundary assume the region number of the void, which has undefined material properties in the <strong>HeatWave</strong> solution. In other words, the boundary nodes will remain at the default <strong>HeatWave</strong> condition of fixed-temperature of T = 0 deg-C.</p>
<p>The solution is to add the following command to the void part section:</p>
<pre>Coat Conductor Conductor</pre>
<p>The first region number following the <em>Coat</em> keyword is a region adjacent to the current part. <strong>MetaMesh</strong> collects nodes that lie on this intersection and changes their region to the second region number. In this case, all nodes on the surface of the sphere will have the material properties of the conductor. The coat command was included in the <strong>MetaMesh</strong> script to obtain a valid solution (lower part of the figure).</p>
<p>Use this link to download the input files for the demo calculation:<a href="http://www.fieldp.com/myblog/examples/InternalVoidDemo.zip"> InternalVoidDemo.zip</a>. If you have questions or comments, please contact us at techinfo@fieldp.com</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2013/internal-voids-in-heatwave/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transparent electrodes in OmniTrak</title>
		<link>http://fieldp.com/myblog/2013/transparent-electrodes-in-omnitrak/</link>
		<comments>http://fieldp.com/myblog/2013/transparent-electrodes-in-omnitrak/#comments</comments>
		<pubDate>Sat, 13 Apr 2013 16:09:28 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[column]]></category>
		<category><![CDATA[cyclotron]]></category>
		<category><![CDATA[electrode]]></category>
		<category><![CDATA[Electrostatic]]></category>
		<category><![CDATA[HiPhi]]></category>
		<category><![CDATA[ion]]></category>
		<category><![CDATA[MetaMesh]]></category>
		<category><![CDATA[OmniTrak]]></category>
		<category><![CDATA[plasma]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1788</guid>
		<description><![CDATA[<p>There are occasions in OmniTrak simulations when charged particles should pass through fixed potential surfaces. One example is the passage of high-energy electrons through a thin foil. Another example suggested by a customer are trajectories in the vicinity of the plasma column of a cyclotron ion source. Here, the plasma acts as a fixed-potential volumetric body [...]]]></description>
				<content:encoded><![CDATA[<p>There are occasions in <strong>OmniTrak</strong> simulations when charged particles should pass through fixed potential surfaces. One example is the passage of high-energy electrons through a thin foil. Another example suggested by a customer are trajectories in the vicinity of the plasma column of a cyclotron ion source. Here, the plasma acts as a fixed-potential volumetric body transparent to recirculating ions. The main affect of the plasma is to distort the macroscopic electric field resulting in ion deflections.</p>
<p>To understand transparent electrodes, we need to review some features of electric-field solutions and particle tracking in <strong>HiPhi</strong> and <strong>OmniTrak</strong>. The mesh created by <strong>MetaMesh</strong> consists of hexahedron <em>elements</em>, small divisions of the volume. <em>Nodes</em> are the vertices of the hexahedrons. In <strong>MetaMesh</strong>, region numbers are assigned to both the elements and nodes. The solution of Poisson&#8217;s equation involves determining electrostatic potential values at the nodes, influenced by the assigned of dielectric constant to the elements. Nodes inside and on the surface of an electrode are assigned a value that remains unchanged during the <strong>HiPhi</strong> solution process. Therefore, the region identity of elements inside the electrode does not affect the field solution. During particle tracking, <strong>OmniTrak</strong> stops a particle if it enters a <em>Material</em> region. Because the nodes have no volume, the code checks the region identity of elements. Therefore, if we constructed an electrode where the region number of nodes had the <em>Material</em> property but the region number of elements had the <em>Vacuum</em> property, then 1) the electric-field solution would be correct, and 2) particles would pass through without stopping. We can create such a region using the <em>Coat</em> command in <strong>MetaMesh</strong>.</p>
<p>Figure 1 shows an example solution, <em>SOLIDDEMO</em>. Protons accelerate across the Dee gap of a cyclotron with a cylindrical plasma column on the downstream side. Excerpts from the <strong>MetaMesh</strong> input file are listed at the end of the article. The solution includes the following regions:</p>
<pre>RegName(1): Vacuum
RegName(2): Upstream
RegName(3): Downstream
RegName(4): Plasma</pre>
<p>Region 1 is the standard vacuum propagation region, treated as a dielectric in <strong>HiPhi</strong> with εr = 1.0. Regions 2 and 3 are the fixed-potential electrodes. The important step is to assign a unique region number to the elements of the plasma column, even though they have the same physical property as the vacuum elements. <strong>MetaMesh</strong> uses this region number to identify nodes on the surface of the plasma.</p>
<div class="wp-caption aligncenter" style="width: 789px"><img alt="Geometry of the SOLIDDEMO example" src="http://www.fieldp.com/myblog/images/transparent01.png" width="779" height="679" /><p class="wp-caption-text">Figure 1. Geometry of the SOLIDDEMO example</p></div>
<p>The <em>Part</em> sections to define solution volume and electrodes are unexceptional. The <em>Part</em> section for the plasma is the interesting one:</p>
<pre>PART
  Region: Plasma
  Name: Plasma
  Type: Cylinder
  Fab:   5.00000E-01  2.00000E+00
  Shift:   2.00000E+00  0.00000E+00  0.00000E+00
  Rotate:    90.00    0.00    0.00  XYZ
  Surface Region Vacuum
  Coat Vacuum Downstream
END</pre>
<p>The <em>Surface</em> command shapes facets on the boundary of the <em>Plasma</em> and <em>Vacuum</em> regions to conform to the cylindrical shape. The <em>Coat</em> command specifies that all nodes on the boundary between <em>Plasma</em> and <em>Vacuum</em> elements should be reassigned to the fixed-potential <em>Downstream</em> region. The plot of Figure 2 in a plane normal to the plasma column shows the assignment of nodes. This is exactly the condition that we want.</p>
<div class="wp-caption aligncenter" style="width: 636px"><img alt="Assignment of nodes in the SOLIDDEMO example." src="http://www.fieldp.com/myblog/images/transparent02.png" width="626" height="568" /><p class="wp-caption-text">Figure 2. Assignment of nodes in the SOLIDDEMO example. Zoomed plot in a plane normal to the plasma column.</p></div>
<p>Figure 3 (a plot in the mid-plane normal to the plasma column) shows the distortion of fields resulting from the presence of the plasma along with sample orbits of 5 keV protons crossing the gap with an applied accelerating voltage of 10 kV. Similar techniques may be applied to 2D solutions with <strong>EStat</strong> and <strong>Trak</strong>. In this case, a fixed potential line region on the surface of the cylinder is created after the definition of the dielectric cylinder volume. For <strong>OmniTrak</strong> users, here is a link to download the input files for the <em>SOLIDDEMO</em> example: <a href="http://www.fieldp.com/myblog/examples/soliddemo.zip">http://www.fieldp.com/myblog/examples/soliddemo.zip</a>. If you have questions or comments, please contact us at techinfo@fieldp.com</p>
<div class="wp-caption aligncenter" style="width: 667px"><img alt="Electrostatic potential and particle orbits near the plasma column." src="http://www.fieldp.com/myblog/images/transparent03.png" width="657" height="585" /><p class="wp-caption-text">Figure 3. Electrostatic potential and particle orbits near the plasma column in the mid-plane normal to the column.</p></div>
<pre>* File: SOLIDDEMO.MIN
GLOBAL
  XMesh
   -5.00000E+00  5.00000E+00  1.00000E-01
  End
  YMesh
   -5.00000E+00  5.00000E+00  1.00000E-01
  End
  ZMesh
   -5.00000E+00  5.00000E+00  1.00000E-01
  End
  RegName(  1): Vacuum
  RegName(  2): Upstream
  RegName(  3): Downstream
  RegName(  4): Plasma
END
PART
  Region: Vacuum
  Name: SolutionVolume
  Type: Box
  Fab:   1.00000E+01  1.00000E+01  1.00000E+01
END
PART
  Region: Upstream
  Name: ElectUpTop
  Type: Box
  Fab:   3.50000E+00  1.00000E+00  1.00000E+01
  Shift:  -3.25000E+00  1.50000E+00  0.00000E+00
END
 ...
PART
  Region: Plasma
  Name: Plasma
  Type: Cylinder
  Fab:   5.00000E-01  2.00000E+00
  Shift:   2.00000E+00  0.00000E+00  0.00000E+00
  Rotate:    90.00    0.00    0.00  XYZ
  Surface Region Vacuum
  Coat Vacuum Downstream
END
ENDFILE</pre>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2013/transparent-electrodes-in-omnitrak/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conditions for corona discharges</title>
		<link>http://fieldp.com/myblog/2013/conditions-for-corona-discharges/</link>
		<comments>http://fieldp.com/myblog/2013/conditions-for-corona-discharges/#comments</comments>
		<pubDate>Fri, 08 Mar 2013 21:39:09 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[breakdown]]></category>
		<category><![CDATA[corona]]></category>
		<category><![CDATA[discharge]]></category>
		<category><![CDATA[equipment]]></category>
		<category><![CDATA[gas]]></category>
		<category><![CDATA[high]]></category>
		<category><![CDATA[Paschen]]></category>
		<category><![CDATA[voltage]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1777</guid>
		<description><![CDATA[<p>This article briefly reviews the nature of corona discharges around high-voltage electric equipment in air. A previous article covered the theory of a self-sustained gas breakdown in a planar gap. Equation 9.47 gives the threshhold voltage for breakdown, Vs (volt) in a gap of with d (cm) at gas pressure p (torr). The gas parameters Vsmin [...]]]></description>
				<content:encoded><![CDATA[<p>This article briefly reviews the nature of corona discharges around high-voltage electric equipment in air. A<a href="http://fieldp.com/myblog/2013/gas-breakdown-theory/" target="_blank"> previous article</a> covered the theory of a self-sustained gas breakdown in a planar gap. Equation 9.47 gives the threshhold voltage for breakdown, <em>Vs</em> (volt) in a gap of with <em>d</em> (cm) at gas pressure <em>p</em> (torr). The gas parameters <em>Vsmin</em> and <em>(pd)min</em> are listed in the previous article. For dry air, the parameters are <em>Vsmin</em> = 327 V and <em>(pd)min</em> = 0.567 torr-cm.</p>
<p><img class="aligncenter" alt="Corona equations" src="http://www.fieldp.com/myblog/images/corona_equation.png" width="624" height="121" /></p>
<p>Corona discharges in gases occur only in when electrodes have strong two- or three-dimensional variations (as in Figure 1). <em>Corona</em> (<em>crown</em> in Latin) is a pattern of bright sparks near a point or edge of an electrode. In such a region, the electric field is enhanced above the breakdown limit so that spark discharges occur. Taking the dimension of the corona region as <em>dc</em>, the approximate condition for breakdown is given by Eq. 9.49. In the equation, <em>&lt;E&gt;</em> is the<br />
average electric field in the corona region. A self-sustained breakdown cannot be maintained by the low electric field in the bulk of the gap. Current in the low-field region is conducted by a Townsend (or dark) discharge, with the corona providing the source current. The system is stabilized by the high resistivity of the dark discharge. A relatively constant<br />
current flows, even though the sparks of the corona fluctuate, extinguish, and reform rapidly. Inspection of Eq. (9.49) shows that for constant geometry, the size of the corona region grows with increasing electrode voltage. The voltage drop in the highly ionized corona is low; therefore, the voltage drop is concentrated in the dark discharge region. At some elevated voltage, bulk breakdown occurs and the electrodes are shorted.</p>
<div class="wp-caption aligncenter" style="width: 534px"><img alt="Physical basis for a corona discharge" src="http://www.fieldp.com/myblog/images/corona.png" width="524" height="343" /><p class="wp-caption-text">Figure 1. Physical basis for a corona discharge at a pointed electrode.</p></div>
<p>Substituting air parameters in Eq. 9.49 at one atmosphere (<em>p</em> = 760 torr) and solving for the average electric field leads to the following relationship:</p>
<p><em>&lt;E&gt;</em> ≈ 438/ln(1340 dc)  [kV/cm]</p>
<p>The electric field depends weakly on the average size of the breakdown region. Very small electrode protrusions may not cause corona because the length of the resulting enhanced field is not be long enough to sustain a breakdown. For <em>dc</em> = 1.0 cm, the critical field is <em>&lt;E&gt;</em> ≈ 60 kV/cm. The number applies to dry air at sea level. The danger level for non-ideal conditions is generally taken as &lt;E&gt; ≈ 35 kV/cm.</p>
<p>If you have questions or comments, please contact us at techinfo@fieldp.com</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2013/conditions-for-corona-discharges/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Non-recursive directory tree assembly in RealBasic</title>
		<link>http://fieldp.com/myblog/2013/non-recursive-directory-tree-assembly-in-realbasic/</link>
		<comments>http://fieldp.com/myblog/2013/non-recursive-directory-tree-assembly-in-realbasic/#comments</comments>
		<pubDate>Wed, 06 Mar 2013 21:44:45 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[contents]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[manager]]></category>
		<category><![CDATA[realbasic]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[tree]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1766</guid>
		<description><![CDATA[<p>Recursion is the crystal meth of computer programing. It may seem terrific the first time you try it, but generally leads to negative long-term consequences. A good general rule is never use recursion if there is any alternative. Finding all the subdirectories and files in a parent directory is a task where recursion is often invoked [...]]]></description>
				<content:encoded><![CDATA[<p>Recursion is the crystal meth of computer programing. It may seem terrific the first time you try it, but generally leads to negative long-term consequences. A good general rule is never use recursion if there is any alternative. Finding all the subdirectories and files in a parent directory is a task where recursion is often invoked because the depth of the structure is not known in advance. Let&#8217;s consider a typical routine using RealBasic. We want to make a list of all files contained within and under the directory represented by the folder item <em>FTarget</em>. With this information, we can perform file management operations such as copy, move or delete. We will store the list in <em>FArray</em>, a global array of folder items:</p>
<pre>dim FArray() as FolderItem</pre>
<p>These statements appear in the calling routine:</p>
<pre>redim FArray(-1)
CollectFiles(FTarget)</pre>
<p>The recursive subroutine has the form:</p>
<pre>sub CollectFiles(FItem as FolderItem)
Dim n as Integer
Dim f as FolderItem</pre>
<pre>For n = 1 to FItem.Count
  f = FItem.Item(n)
  if f.directory then
    CollectFiles(f)  // Recursive call
  else
    FArray.append f
  end if
next
end sub</pre>
<p>The subroutine <em>CollectFiles</em> calls itself to whatever depth is necessary. Although the approach is succinct and guaranteed to astound the hoi polloi, there is a significant drawback. What if <em>FTarget</em> is extremely large and the user becomes bored? How can the collection process be stopped? Killing the thread that performs the collection in the middle of the recursion leaves an indefinite operation stack, generally followed by strange program behavior.</p>
<p>The point is that the same function can be accomplished with a safe non-recursive routine. Such a routine can be aborted at any time with no consequences. Recursion gives no advantages in speed or resource efficiency, so why climb a cliff if you can walk around? Here is my solution. I have divided the folder items for files and directories in separate global arrays:</p>
<pre>Dim DirectoryCollection() as FolderItem
Dim FileCollection() as FolderItem</pre>
<p>The non-recursive subroutine has the compact form:</p>
<pre>sub CollectFiles(FTarget as FolderItem)
Dim NStart,NEnd as integer
Dim n,m as integer
Dim FItem,f as FolderItem</pre>
<pre>// Reset the arrays
redim DirectoryCollection(-1)
redim FileCollection(-1)</pre>
<pre>// Set the initial state
DirectoryCollection.Append FTarget
NStart = 0
NEnd = UBound(DirectoryCollection)</pre>
<pre>// Main loop, repeat until there are no additional directories
do
  // Loop through directories at the current level
  for n = NStart to NEnd
    FItem = DirectoryCollection(n)
    // Add items for the current directory
    for m = 1 to FItem.Count
      f = FItem.Item(m)
      if f.directory then
        DirectoryCollection.Append f
      else
        FileCollection.Append f
      end if
    next
  next
  NStart = NEnd + 1
  NEnd = UBound(DirectoryCollection)
loop until (NStart &gt; NEnd)
end sub</pre>
<p>If you have questions or comments, please contact us at techinfo@fieldp.com</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2013/non-recursive-directory-tree-assembly-in-realbasic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gas breakdown theory</title>
		<link>http://fieldp.com/myblog/2013/gas-breakdown-theory/</link>
		<comments>http://fieldp.com/myblog/2013/gas-breakdown-theory/#comments</comments>
		<pubDate>Tue, 19 Feb 2013 16:58:33 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[breakdown]]></category>
		<category><![CDATA[coefficient]]></category>
		<category><![CDATA[gas]]></category>
		<category><![CDATA[high]]></category>
		<category><![CDATA[insulation]]></category>
		<category><![CDATA[ionization]]></category>
		<category><![CDATA[law]]></category>
		<category><![CDATA[Paschen]]></category>
		<category><![CDATA[power line]]></category>
		<category><![CDATA[spark]]></category>
		<category><![CDATA[Townsend]]></category>
		<category><![CDATA[voltage]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1745</guid>
		<description><![CDATA[<p>I recently consulted on issues of corona discharges from equipment near high-voltage power lines. It was an opportunity to review material from my book Principles of Charged Particle Acceleration. Corona is a practical topic of general interest, so I decided to include the information in this blog. This article deals with a necessary preliminary: the physics [...]]]></description>
				<content:encoded><![CDATA[<p>I recently consulted on issues of corona discharges from equipment near high-voltage power lines. It was an opportunity to review material from my book <strong>Principles of Charged Particle Acceleration</strong>. Corona is a practical topic of general interest, so I decided to include the information in this blog. This article deals with a necessary preliminary: the physics of breakdowns in gas insulators. A following article will cover the specific application to corona discharges. For reference, you can download the complete book in PDF format at <a href="http://www.fieldp.com/cpa.html" target="_blank">http://www.fieldp.com/cpa.html</a>. A low-cost printed edition is available from Dover Press at <a href="store.doverpublications.com/0486498182.html" target="_blank">store.doverpublications.com/0486498182.html</a>.</p>
<p>Gas insulation is used is used extensively in high-voltage power transmission for two reasons:</p>
<ol>
<li>Gas can recover its insulating properties after a breakdown.</li>
<li>It&#8217;s free.</li>
</ol>
<p>In this application, it is critical to ensure that voltages and electric fields are well below levels that can lead to a self-sustained breakdown. To derive the breakdown conditions, first consider the one-dimensional gas-filled gap of Figure 1. The electrodes have separation <em>d</em> and the applied voltage is <em>Vo</em>. There is no charge flow between the electrodes at low voltage. We want to determine how a large interelectrode current can be initiated at high voltage.</p>
<div class="wp-caption aligncenter" style="width: 620px"><img alt="One-dimensional gas-filled gap" src="http://www.fieldp.com/myblog/images/gas_breakdown_01.png" width="610" height="321" /><p class="wp-caption-text">Figure 1. One-dimensional gas-filled gap.</p></div>
<p>Suppose that a few electrons are produced on the negative electrode (possibly caused by photo-emission from cosmic rays or ultraviolet light). The small source current density leaving the electrode is represented by <em>jo</em>. The electrons are accelerated by the applied field and move between the widely spaced gas molecules, as shown in Figure 2<em>a</em>. In a collision with a molecule, an electron is strongly deflected and much of its kinetic energy is absorbed. As a simplification, assume that electrons are accelerated between molecules and lose all their directed energy in a collision. The parameter λ is the mean free path, the average distance between collisions. The mean free path is inversely proportional to the density of gas molecules. In turn, the density is proportional to the pressure, <em>p</em>, so that λ ~ 1/<em>p</em> .</p>
<div class="wp-caption aligncenter" style="width: 688px"><img alt="Processes in a gas-filled, high-voltage gap." src="http://www.fieldp.com/myblog/images/gas_breakdown_02.png" width="678" height="247" /><p class="wp-caption-text">Figure 2. Processes in a gas-filled, high-voltage gap. a) Electron migration in the presence of an electric field. b) Liberation of electrons on the negative electrode by ion recombination.</p></div>
<p>The average energy gained by an electron between collisions is given by Eq. 9.33. An election may ionize a molecule in a collision if ΔT is high enough (ΔT &gt; 30 eV). In the ionization process, the excess kinetic energy of the electron drives an electron out of the molecule, leaving a positive ion. The two electrons move forward under the influence of the field, producing further electrons. The current density increases geometrically along the electron drift direction. The ions drift in the opposite direction and do not contribute to ionization in the gas. The motion of drifting ions is dominated by collisions; generally, they cannot reach high enough velocity to eject electrons in a collision with a molecule.</p>
<p><img class="aligncenter" alt="Gas breakdown equations" src="http://www.fieldp.com/myblog/images/gas_breakdown_equations.png" width="664" height="765" /></p>
<p>Electron multiplication in a gas with an applied electric field is characterized by α, the first Townsend coefficient [J. S. Townsend, Electricity in Gases, Phil. Trans. <strong>A193</strong>, 129 (1900)]. This parameter is defined by Eq. 9.34. Consider an element of length Δ<em>x</em> at the position <em>x</em>. The quantity <em>n(x)</em> is the density of electrons at <em>x</em>. According to the definition of α, the total number of additional electrons produced in a volume with cross-sectional area <em>dA</em> and length Δ<em>x</em> is given by Eq. 9.34<em>a</em>. Dividing both sides of the equation by <em>dA</em>Δ<em>x</em>, and taking the limit of small Δ<em>x</em> leads to Eq. 9.35. The solution of the equation implies an exponential electron density variation. Expressed in terms of the current density of electrons (assuming that the average electron drift velocity is independent of <em>x</em>), Eq. 9.35 implies the result of Eq. 9.36 if the negative electrode is located at <em>x</em> = 0. The current density arriving at the positive electrode is given by Eq. 9.37.</p>
<p>Although the amplification factor may be high, Eq. 9.37 does not imply that there is an insulation breakdown. The current terminates if the source term is removed. A breakdown occurs when current flow is self-sustaining, or independent of the assumed properties of the source. In the breakdown mode, the current density rapidly multiplies until the voltage supply is shorted (discharged). Ion interactions at the negative electrode introduce a mechanism to maintain a self-sustained discharge. Although the positive ions do not gain enough energy to ionize gas molecules during their transit, they may generate electrons at the negative electrode through secondary emission (Fig. 2<em>b</em>). This process is parametrized by the secondary emission coeficient γ. The coefficient is high at high ion energy (&gt; 100 keV). The large value of reflects the fact that ions have a short stopping range in solid matter and deposit their energy near the surface. Ions in a gas-filled gap have low average energy. The secondary-emission coefficient has a nonzero value for slow ions because there is available energy from recombination of the ion with an electron at the surface. The secondary emission coefficient for a zero-velocity ion is in the range γ ~ 0.02.</p>
<p>With ion interactions, the total electron current density leaving the negative electrode consists of the source term plus a contribution from secondary emission. We define the following current densities: <em>jo</em> is the source, <em>jc</em> is the net current density leaving the negative electrode, <em>ji</em> is the ion current density arriving at the negative electrode, and <em>ja</em> is the total electron flux arriving at the positive electrode. Each ionizing collision creates one electron and one ion. By conservation of charge, the ion current is given by Eq. 9.38. The equation states that ions and electrons leave, the gap at the same rate in the steady state. The portion of the electron current density from the negative electrode associated with secondary emission is given by Eq. 9.39. Equation 9.39 implies the result of Eq. 9.40. By the definition of the Townsend coefficient α, we can write the total electron current arriving at the anode as Eq. 9.41. Combining Eqs. 9.40 and 9.41 leads to the result of Eq. 9.42.</p>
<p>Comparing Eq. (9.42) with (9.37), the effects of ion feedback appear in the denominator. The current density amplification becomes infinite when the denominator equals zero.  When the conditions are such that the denominator of Eq. (9.42) is zero, a small charge at the negative electrode can initiate a self-sustained discharge.  The discharge current grows rapidly over a  time scale on the order of the ion drift time, heating and ionizing the gas. The end result is a spark (a high-current-density plasma channel). Equation 9.43 gives the condition for spark formation.</p>
<p>Calculation of the absolute value of α as a function of the gap parameters involves complex atomic physics. Instead, we will develop a simple scaling relationship for α as a function of gas pressure and electric field. Such a relationship helps to organize experimental data and predict breakdown properties in parameter regimes where data is unavailable. The ionization coefficient is proportional to the number of collisions between an electron and gas atoms per centimeter traveled, or α ~ 1\λ.  The ionization coefficient also depends on the average electron drift energy, Eλ. The ionization rate is proportional to the fraction of collisions in which an electron enters with kinetic energy greater than the ionization energy of the atom, <em>I</em>. The properties of particles traveling through a random distribution of collision centers is treated in texts on nuclear physics. The familiar result is that the distance between collisions is a random variable that follows the Poisson distribution of Eq. 9.44. The energy of a colliding electron is, by definition, <em>T</em> = <em>xeVo/d</em>. The fraction of collisions in which an electron has <em>T</em> &gt; <em>I</em> is given by the integral of Eq. 9.44 from <em>x = Id/eVo</em> to infinity. The result of these considerations is that α is well described by the scaling law of Eq. 9.45. The quantities <em>A</em> and <em>B</em> are determined from experiments or detailed collision theory. Equation 9.45<em>a</em>, the gap voltage for sparking, follows from substitution of Eq. 9.45 into 9.43. Solving for the sparking voltage <em>Vs</em> give the main result, Eq. 9.46.</p>
<p>Equation 9.46 is known as Paschen&#8217;s law [F.Paschen, Wied.  Ann. <strong>37</strong>, 69 (1889)] for gas breakdown. The sparking voltage is a function of the product <em>pd</em> and constants that depend on the gas properties. The values of <em>A</em> and <em>B</em> are relatively constant over a wide voltage range when the average electron energy is less than <em>I</em>. Furthermore, <em>Vs</em> is insensitive to γ; therefore, the results are almost independent of the electrode material. Figure 3 shows a normalized lot of <em>Vs</em> versus <em>pd</em>. The sparking voltage reaches a minimum value <em>Vsmin</em> at a value <em>pdmin</em>. Voltage hold-off increases at both low and high values of <em>pd</em>. Voltage hold-off is high at low <em>pd</em> because there is a small probability that an electron will strike a molecule while traveling between electrodes. At high values of pd, <em>Vs</em> ~ <em>pd</em> . In this regime, electrons undergo many collisions, but the mean free path is short. Few electrons gain enough energy to produce an ionization.</p>
<div class="wp-caption aligncenter" style="width: 537px"><img alt="Normalized Paschen curve" src="http://www.fieldp.com/myblog/images/gas_breakdown_03.png" width="527" height="433" /><p class="wp-caption-text">Figure 3. Normalized Paschen curve: sparking voltage versus the product of pressure and gap width.</p></div>
<p>Equation 9.46 can be rewritten as Eq. 9.47. The table below shows the spark parameters for some common gases. The minimum sparking voltage is high for electronegative gases like oxygen and low for gases with little probability of electron capture like helium and argon. In electronegative gases, there is a high probability that electrons are captured to form negative ions. The heavy negative ions cannot produce further ionization, so that the electron is removed from the current multiplication process. If you have questions or comments, please contact us at techinfo@fieldp.com.</p>
<p><img class="aligncenter" alt="Minimum sparking constants" src="http://www.fieldp.com/myblog/images/gas_breakdown_table.png" width="398" height="323" /></p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2013/gas-breakdown-theory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a rounded box with MetaMesh</title>
		<link>http://fieldp.com/myblog/2013/building-a-rounded-box-with-metamesh/</link>
		<comments>http://fieldp.com/myblog/2013/building-a-rounded-box-with-metamesh/#comments</comments>
		<pubDate>Fri, 01 Feb 2013 22:39:45 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[conformal]]></category>
		<category><![CDATA[fillet]]></category>
		<category><![CDATA[generation]]></category>
		<category><![CDATA[Mesh]]></category>
		<category><![CDATA[MetaMesh]]></category>
		<category><![CDATA[parametric]]></category>
		<category><![CDATA[spreadsheet]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1726</guid>
		<description><![CDATA[<p>The standard method for building objects in MetaMesh is to piece them together from one or more parts. A part is a basic geometric shape defined by a parametric model (e.g., the radius and length of a cylinder, the side lengths of a box,&#8230;). Sometimes it&#8217;s easy to make the shape you want, and sometimes it&#8217;s [...]]]></description>
				<content:encoded><![CDATA[<p>The standard method for building objects in <strong>MetaMesh</strong> is to piece them together from one or more parts. A <em>part</em> is a basic geometric shape defined by a parametric model (<em>e.g.</em>, the radius and length of a cylinder, the side lengths of a box,&#8230;). Sometimes it&#8217;s easy to make the shape you want, and sometimes it&#8217;s not. That&#8217;s why we included the capability of importing parts from 3D CAD programs like <strong>SolidWorks</strong> or <strong>ProE</strong>. There are some advantages to using the native models of <strong>MetaMesh</strong>, even if it takes some effort:</p>
<ul>
<li>You can tailor shapes to coordinate with mesh divisions.</li>
<li>You can change parameters in <strong>MetaMesh</strong> scripts with your own programs to create control loops and extended run sequences.</li>
<li>If you&#8217;re an infrequent 3D CAD user, you can avoid the anguish of relearning the program twice a year.</li>
<li>Getting modified CAD shapes from your mechanical engineer can be time consuming.</li>
<li>You only have to build a model once. After that, you can generate an infinite set of related shapes just by typing in a few numbers.</li>
</ul>
<p>If that last point sounds intriguing, read on. In this article, I&#8217;ll show how to build a spreadsheet that can generate a entire class of shapes simply by changing parameters.</p>
<p>As an example, consider the rounded box of Fig. 1. The box has full widths of <em>Wx</em>, <em>Wy</em> and <em>Wz</em> along the axes of the fabrication space. The edges and corners have fillets of radius <em>R</em>. The top part shows a <strong>Geometer</strong> view of the box hanging on a rod with color-coding by parts. The following parts are required to construct the shape:</p>
<ul>
<li>8 spheres of radius <em>R</em> shifted to the corners.</li>
<li>12 cylinders of radius <em>R</em> to define the edges with rotations and translations to position them.</li>
<li>6 boxes (slabs) to define the faces.</li>
</ul>
<p>Looks like a lot of work. But remember, you only have to do it once!</p>
<div class="wp-caption aligncenter" style="width: 649px"><img alt="Rounded box model" src="http://www.fieldp.com/myblog/images/roundedbox01.jpg" width="639" height="953" /><p class="wp-caption-text">Figure 1. Rounded box model. Top: Geometer display of the component parts. Bottom: Finished mesh, output from MetaMesh.</p></div>
<p>The key is to use a spreadsheet to create <strong>MetaMesh</strong> script commands directly. Figure 2 shows my spreadsheet. Notice that comment lines start with an asterisk, following the <strong>MetaMesh</strong> script convention. The defining parameters are gathered at the top. To create the complete assembly, all you need do is set the four values. I also included the option of setting the region name of the assembly as well as that of the surrounding medium as strings in the parameter section. This information is copied to the <em>REGION</em> and <em>SURFACE</em> commands of all the parts. The content cells for the <em>NAME</em> command have entries like</p>
<pre>=CONCATENATE($B$9;"DDD")</pre>
<p>The highlighted cell in Fig. 2 shows typical information to set the required shifts and rotations to build the box. I won&#8217;t attempt to describe the content of every cell. Rather, I&#8217;ll give a link below so you can download the spreadsheet in <strong>Open Office Calc</strong> and <strong>Microsoft Excel</strong> format.</p>
<div class="wp-caption aligncenter" style="width: 595px"><img alt="Initial section of the RoundedBox spreadsheet" src="http://www.fieldp.com/myblog/images/roundedbox02.png" width="585" height="691" /><p class="wp-caption-text">Figure 2. Initial section of the RoundedBox spreadsheet.</p></div>
<p>To add the part to a <strong>MetaMesh</strong> script, just copy and paste all the active cells of the spread sheet. This is where script directives come in handy. You can shift and rotate all 26 parts as a rigid body. Here&#8217;s an excerpt from a test script:</p>
<pre>#SHIFT 0.00 23.75 0.00
* Corners
PART
 Region:    RoundedBox
 Name:    RoundedBoxDDD
 Type:    Sphere
 Fab:    0.5
 Shift:    -2.5    -1.75    -2
 Surface    Region    Air
END
PART
 Region:    RoundedBox
 Name:    RoundedBoxUDD
 Type:    Sphere
 Fab:    0.5
 ...</pre>
<pre> Fab:    5    3.5    1
 Shift:    0    0    -2
 Surface    Region    Air
END
PART
 Region:    RoundedBox
 Name:    RoundedBoxZD
 Type:    Box
 Fab:    5    3.5    1
 Shift:    0    0    2
 Surface    Region    Air
END
#ENDSHIFT</pre>
<p>Here a link to zip file that contains the spreadsheets and the full MetaMesh script: <a href="http://www.fieldp.com/myblog/examples/RoundedBox.piz">RoundedBox.piz</a>. Change the <em>piz</em> suffix to <em>zip</em> after you download it. Consider a standard parametric model whenever you find yourself building the same shapes multiple times. I gave similar pointers for working with <strong>Magwinder</strong> in an <a href="http://fieldp.com/myblog/2012/creating-a-coil-box-with-magwinder/" target="_blank">article </a>last year. If you have questions or comments, please contact us at techinfo@fieldp.com.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2013/building-a-rounded-box-with-metamesh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Short circuit near a gas transmission line</title>
		<link>http://fieldp.com/myblog/2013/short-circuit-near-a-gas-transmission-line/</link>
		<comments>http://fieldp.com/myblog/2013/short-circuit-near-a-gas-transmission-line/#comments</comments>
		<pubDate>Sun, 20 Jan 2013 20:27:27 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[calculation]]></category>
		<category><![CDATA[circuit]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[conductivitys]]></category>
		<category><![CDATA[depth]]></category>
		<category><![CDATA[gas]]></category>
		<category><![CDATA[high]]></category>
		<category><![CDATA[natural]]></category>
		<category><![CDATA[numerical]]></category>
		<category><![CDATA[resistance]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[skin]]></category>
		<category><![CDATA[voltage]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1712</guid>
		<description><![CDATA[<p>I can help out with consulting support if a potential customer is unsure which of our programs to use for an application and what is the best computational strategy. On occasion, I will do a courtesy analysis if an application is particularly interesting.</p>
<p>A trial user posed the problem related to the system of Fig. 1. A [...]]]></description>
				<content:encoded><![CDATA[<p>I can help out with consulting support if a potential customer is unsure which of our programs to use for an application and what is the best computational strategy. On occasion, I will do a courtesy analysis if an application is particularly interesting.</p>
<p>A trial user posed the problem related to the system of Fig. 1. A three-phase power line parallels a transport pipe for natural gas. The line and pipe are buried in the earth. What would happen if one of the wires in the power line shorted to the earth? With regard to a gas explosion, what is the current carried by the pipe, and is there a significant electric field inside? The trial user specified a peak current of 42 A at frequency 50 Hz at the shorting point and gave conductivity values of σ = 0.0066 S/m for the earth and 0.0039 S/m for the concrete. Because the problem involved time-varying currents and applied to a long pipe, he requested a trial of the 2D <strong>Universal BField Toolkit</strong>. Although he generated carefully-prepared input files for the <strong>Pulse</strong> program, it was not at all clear what the results meant.</p>
<div class="wp-caption aligncenter" style="width: 660px"><img alt=" Definition of calculation" src="http://www.fieldp.com/myblog/images/cable_short_fig01.png" width="650" height="980" /><p class="wp-caption-text">Figure 1. Definition of calculation.</p></div>
<p>I always welcome a chance to exercise one of my prime functions at Field Precision — telling people not to buy our software. In this case, the <strong>Pulse</strong> program for the calculation of time-dependent magnetic fields and inductive electric fields is not applicable. Let&#8217;s see why. The wavelength of electromagnetic radiation in air at 50 Hz is 6 million meters. Even if the ground had a significant relative dielectric constant, the wavelength is large even compared to the 15 km length of the pipe. Furthermore, the skin depth for magnetic-field penetration into the surrounding medium is over a km. Therefore, the role of inductive electric fields is negligible. Voltage differences arise from the flow of real current through the conductive media. The system is essentially a resistive voltage divider, that can be modeled with an electrostatic code like <strong>HiPhi</strong>.</p>
<p>Before getting involved in numerics, it&#8217;s useful to ask what is the worst possible scenario. At some point, all the current from the short-circuit makes its way through the earth and concrete to the pipe, where it travels several kilometers back to the station plant. If the return current is distributed uniformly over the pipe cross-section, the resistance per length for a conductivity σs is</p>
<p><em>r</em> = 1/σs*<em>A</em>,</p>
<p>where the cross section area <em>A</em> is 2π<em>R</em>Δ<em>R</em>. Values σs = 8.2E4 S/m, <em>R</em> = 0.25 m and Δ<em>R</em> = 0.022 m imply a resistance per length of 3.5E-4 Ω/m. For a current of 40 A, the maximum field inside the pipe is only 13 mV/m, well below the level for corona. Actually, the field is even less than this value. The skin depth in steel is</p>
<p>δ = sqrt[1/(π σs μr μ0 <em>f</em>).</p>
<p>For μr = 1500 and <em>f</em> = 50.0 Hz, the skin depth is only δ = 6.38 mm, implying good shielding. I could have emplyed <strong>Pulse</strong> for this type of calculation, but it is probably not worth detailed simulations for such small field values.</p>
<p>&nbsp;</p>
<div class="wp-caption aligncenter" style="width: 660px"><img class=" " alt=" Plot of current-density amplitude near the short-circuit" src="http://www.fieldp.com/myblog/images/cable_short_fig02.png" width="650" height="641" /><p class="wp-caption-text">Figure 2. Plot of current-density amplitude near the short-circuit. The discontinuity shows the surface of the concrete.</p></div>
<p>Figure 2.</p>
<p>http://www.fieldp.com/myblog/images/cable_short_fig02.png</p>
<p>On the other hand, it is useful to perform numerical calculations to see what type of voltages occur outside the pipe and the length scale for collection of all current on the pipe. I set up an electrostatic solution using <strong>HiPhi</strong> in a large solution volume (a cube 20 m on a side) with a steel pipe of radius 0.25 m inside a concrete pipe of radius 0.32 m. Both pipes ran the length of the solution volume along <em>z</em>. The bulk of the solution volume (earth) was a conductor with σ = 0.0066 S/m while the concrete pipe had σ = 0.0039 S/m. The steel pipe was an equipotential region at φ = 0.0. I represented the source of short-circuit current as a fixed-potential sphere of radius 0.05 m at a distance 0.4 m from the pipe center. I set the sphere potential at 1.0 V in an initial solution and used the automatic capability of <strong>PhiView</strong> to perform a surface integral of current collected by the pipe. I then adjusted the source potential to give a collected current of 42 A. At the adjusted potential of 40 kV the peak electric field on the source surface was about 8000 V/cm. It is probable that sparks and breakdown would be localized to the immediate region of the short circuit. Figure 2 shows a spatial plot of current-density amplitude near the short circuit in the plane <em>y</em>  = 0.0 m. Figure 3 shows a scan of current density along the surface of the pipe on the side facing the source. Despite the low conductivity of earth, most of return current was collected by the pipe within 0.5 m of the short-circuit point.</p>
<p>If you have questions or comments, please contact us at techinfo@fieldp.com.</p>
<div class="wp-caption aligncenter" style="width: 660px"><img alt="Scan of |J| along the surface of the pipe facing the source" src="http://www.fieldp.com/myblog/images/cable_short_fig03.png" width="650" height="476" /><p class="wp-caption-text">Figure 3. Scan of |J| along the surface of the pipe facing the source.</p></div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2013/short-circuit-near-a-gas-transmission-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conductive-type electrostatic solutions</title>
		<link>http://fieldp.com/myblog/2013/conductive-type-electrostatic-solutions/</link>
		<comments>http://fieldp.com/myblog/2013/conductive-type-electrostatic-solutions/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 17:26:24 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[accuracy]]></category>
		<category><![CDATA[conductivity]]></category>
		<category><![CDATA[electric]]></category>
		<category><![CDATA[electrical]]></category>
		<category><![CDATA[Electrostatic]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[EStat]]></category>
		<category><![CDATA[field]]></category>
		<category><![CDATA[finite]]></category>
		<category><![CDATA[HiPhi]]></category>
		<category><![CDATA[numerical]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1702</guid>
		<description><![CDATA[<p>EStat and HiPhi can determine dielectric-type and conductive-type electrostatic solutions. As discussed in the program manuals, both types involve a solution to the Poisson equation. There are two differences in conductive solutions:</p>

The relative dielectric ε is replaced with the conductivity σ.
There is no accumulation of space-charge, ρ = 0.0.

<p>A customer recently suggested a good EStat accuracy test [...]]]></description>
				<content:encoded><![CDATA[<p><strong>EStat</strong> and <strong>HiPhi</strong> can determine dielectric-type and conductive-type electrostatic solutions. As discussed in the program manuals, both types involve a solution to the Poisson equation. There are two differences in conductive solutions:</p>
<ul>
<li>The relative dielectric ε is replaced with the conductivity σ.</li>
<li>There is no accumulation of space-charge, ρ = 0.0.</li>
</ul>
<p>A customer recently suggested a good <strong>EStat</strong> accuracy test involving a conductive solution, so I prepared a demonstration calculation. I will describe it this article because it gives a good opportunity to review features of conductive solutions.</p>
<p>Figure 1 shows the geometry of a planar (infinite extent out of the page) <strong>EStat</strong> calculation. Most of the volume is filled with a medium (<em>CONDUCTOR</em>) with electrical conductivity σ = 1.0 S/m. A large insulator (<em>INSULATOR01</em>) separates two electrodes (<em>ELECTRODELEFT</em> at +1.0 V and <em>ELECTRODERIGHT</em> at -1.0 V). I added a second insulator (<em>INSULATOR02</em>) to introduce a significant asymmetry between the electrodes. The accuracy test is the following: no matter what geometry is chosen, the current out of one electrode should exactly equal the current into the other electrode. This condition follows because no current enters or leaves the solution volume.</p>
<div class="wp-caption aligncenter" style="width: 710px"><img alt=" Calculation with internal insulators approximated with regions of low conductivity" src="http://www.fieldp.com/myblog/images/cond_test01.jpg" width="700" height="699" /><p class="wp-caption-text">Figure 1. Calculation with internal insulators approximated with regions of low conductivity.</p></div>
<p>The solution (<em>CONDTEST01</em>) has two features of interest:</p>
<ul>
<li>In dielectric-type solutions, application of the Neumann boundary condition (the natural boundary of finite-element solution) around the entire solution volume is usually non-physical. Such a condition would apply to a periodic set of solution volumes, infinite in both directions. On the other hand, an extended Neumann boundary is appropriate in most conductive solutions. The condition that the component of electric field normal to the boundary is zero. implies that the current must flow parallel to the boundary. In other words, the Neumann condition implies that the conductive medium is enclosed is an ideal insulating container. Note that the equipotential lines in Fig. 1 intersect the boundaries at right angles so that the normal component of electric field is zero.</li>
<li>The computational method to solve the Poisson equation is invalid if σ = 0.0, so we must choose a relatively low value of conductivity to represent the internal insulators. I picked σ = 10^(-6). Note that extremely low values impede the numerical convergence and can lead to inaccurate solutions.</li>
</ul>
<p>The bottom part of Fig. 1 shows calculated equipotential lines. Note that, despite the system asymmetry, the electric field values on the surfaces of the two electrodes are equal. With regard to calculating total current, its always best to avoid integrals over the surfaces of electrodes with sharp edges. I elected to use the line integral function in the <strong>EStat</strong> analysis menu to find the integral of total normal linear current a short distance from each electrode surface. Here is an analysis script that I prepared to perform the calculation automatically:</p>
<pre>Output CondTest.DAT
Configuration c:\fieldp\tricomp\estat_conductive.cfg</pre>
<pre>Input CondTest01.EOU
LineInt -1.65 0.00  -1.65 1.00
LineInt -0.00 0.00   0.00 1.00
LineInt  1.45 0.00   1.45 1.00</pre>
<pre>Input CondTest02.EOU
LineInt -1.65 0.00  -1.65 1.00
LineInt  1.45 0.00   1.45 1.00</pre>
<pre>ENDFILE</pre>
<p>The calculation showed a total line current of -0.2052514 A/m on the left side and -0.2052518 on the right, equal to within 2.0 × 10^(-6). The current through the central approximated insulator was only 1.0 × 10^(-6) A/m.</p>
<p>The solution geometry has the feature that all internal insulators contact the solution-volume boundary. In this case, we can an alternate approach — defining a complex boundary for the conducting medium that excludes the insulators (<em>COND_TEST02</em>). In this case, the Neumann condition applies around the entire boundary except the portion occupied by the electrodes (Dirichlet boundary). Figure 2 shows the geometry and calculated field lines. In principle, no approximation is required for the internal insulators so that solution is ideal. The disadvantage is that it gives no information about the field distribution inside the insulators. For comparison, a line integral gives -0.2052507 A/m on the left-hand side and -0.2052511 A/m on the right (again a difference of about 2.0 × 10^(-6)). The solution confirms that the choice σ = 1.0 × 10^(-6) was sufficiently small to give accurate results. For extra credit, try this solution with a spatial variation of conductivity. The electrode currents will still be equal.</p>
<p>If you have questions or comments, please contact us at techinfo@fieldp.com.</p>
<div class="wp-caption aligncenter" style="width: 710px"><img alt="Calculation with a shaped Neumann solution-volume boundary to define the internal insulators" src="http://www.fieldp.com/myblog/images/cond_test02.jpg" width="700" height="690" /><p class="wp-caption-text">Figure 2. Calculation with a shaped Neumann solution-volume boundary to define the internal insulators.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2013/conductive-type-electrostatic-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Launching Windows programs and batch files in RealBasic</title>
		<link>http://fieldp.com/myblog/2013/launching-windows-programs-and-batch-files-in-realbasic/</link>
		<comments>http://fieldp.com/myblog/2013/launching-windows-programs-and-batch-files-in-realbasic/#comments</comments>
		<pubDate>Fri, 04 Jan 2013 18:27:33 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[cmd.exe]]></category>
		<category><![CDATA[dos]]></category>
		<category><![CDATA[dos commands]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[launch]]></category>
		<category><![CDATA[realbasic]]></category>
		<category><![CDATA[terminal window]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1683</guid>
		<description><![CDATA[<p>In the development of a file management module for our program controllers, I encountered several instances where it was necessary to launch external programs and batch files from the RealBasic program. With the combined quirks of RealBasic and Windows DOS commands, the procedures involved some subtleties that I will share in this article.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Task: Open a external [...]]]></description>
				<content:encoded><![CDATA[<p>In the development of a file management module for our program controllers, I encountered several instances where it was necessary to launch external programs and batch files from the <strong>RealBasic</strong> program. With the combined quirks of <strong>RealBasic</strong> and Windows DOS commands, the procedures involved some subtleties that I will share in this article.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><strong>Task</strong>: Open a external file editor, passing the absolute path of a file to edit.</p>
<p><strong>Problem</strong>: The editor was confused if the absolute path of the file contained spaces.</p>
<p><strong>Resolution</strong>: Enclose the file absolute path in quotation marks. (Note: In <strong>RealBasic</strong>, a literal quote in a string is designated by two quotation marks.)</p>
<p><strong>Sample code</strong>:</p>
<pre>dim FileEditor as string
dim TargetFile as string
dim FProg as FolderItem</pre>
<pre>FileEditor = "C:\PROGRAM FILES (X86)\CONTEXT\CONTEXT.EXE"
TargetFile = "K:\SAMPLE TEXTS\TESTFILE.TXT"
TargetFile = """" + TargetFile + """"
FProg = GetFolderItem(FileEditor)
FProg.launch(TargetFile)</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<div class="wp-caption aligncenter" style="width: 760px"><img title="Terminal window opened in the right directory of the file manager" alt="Terminal window opened in the right directory of the file manager" src="http://www.fieldp.com/myblog/images/launch_realbasic.png" width="750" height="461" /><p class="wp-caption-text">Figure 1. Terminal window opened in the right directory of the file manager.</p></div>
<p><strong>Task</strong>: Open a terminal window in a specified directory. In the case of the file manager, I wanted the terminal to open in the currently-active display directory (Figure 1).</p>
<p><strong>Problem</strong>: The terminal always opened in the current working directory of the file manager application (<em>e.g</em>., <em>C:\Program Files (x86)\Real Software\Real Studio 2012r2\</em>).</p>
<p><strong>Resolution</strong>: This took some experimentation. I tried shell commands (<em>e.g</em>.,<em> s.execute</em>), but I couldn&#8217;t get any of them to work as described in the RB documentation. The best way to explain my solution is to step through the sample code listed below. <em>OpeningDirectory</em> is the desired absolute path, such as <em>K:\DesiredDirectory</em>. The idea is to open a terminal window with <em>cmd.exe</em> and then to move from the current working directory with two DOS commands: change the drive and then to go to the target directory:</p>
<pre>K:
CD \DesiredDirectory</pre>
<p>We can send initial commands to <em>cmd.exe</em> with the <em>/k</em> option (<em>i.e.</em>, include commands and keep the terminal window open). In order to build a <em>CommandString</em> with two DOS commands, we split the string <em>OpeningDirectory</em> into <em>DriveString</em> and <em>PathString</em>. Notice the ampersand (&amp;) separating the two DOS commands in <em>CommandString</em>. Shouldn&#8217;t that be a semicolon? That&#8217;s what they&#8217;d LIKE you to think! Finally, notice that I used the full path to <em>cmd.exe</em>. I had no luck with <em>f = GetFolderItem(&#8220;cmd.exe&#8221;)</em>. The test for <em>NColon</em> = 2 was probably unnecessary, but I added it for safety.</p>
<p><strong>Sample code</strong>:</p>
<pre>dim OpeningDirectory as string
dim DriveString as string
dim PathString as string
dim NColon as integer
dim CommandString as string</pre>
<pre>OpeningDirectory = CurrentPath.AbsolutePath
NColon = Instr(PathString,":")
if (NColon = 2) then
  DriveString = mid(PathString,1,2)
  NColon = len(PathString) - 2
  PathString = right(PathString,NColon)
  CommandString = " /k " + DriveString + " &amp; cd " + PathString
else
  CommandString = " /k cd " + PathString
end if
f = GetFolderItem("C:\Windows\System32\cmd.exe")
f.launch(CommandString)</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><strong>Task</strong>: Run a batch file by double-clicking it in a file manager.</p>
<p><strong>Problem</strong>: It we start a batch file that contains a command like <em>DIR &gt;DIRLIST.TXT</em>, we expect it to give information on the directory in which the batch file opened. Instead, I found that everything was again referenced to the current working directory of the file manager program, not very useful.</p>
<p><strong>Resolution</strong>: The sample code below appears in the <em>DoubleClick</em> event of the <em>ListBox</em> that contains the file names of the current directory. <em>FExt</em> is a function that returns the file extension of an absolute path. Clicking on files with other extensions opens them in the associated Windows program (<em>e.g.,</em> the default browser for <em>FName.html</em>). The code is similar to the previous example. We start <em>cmd.exe</em> with commands to go to the drive and directory that contains the batch file. The one difference is that the option <em>/c</em> is used instead of <em>/k</em>. We want the window to close when the batch operations have been completed.</p>
<p>If you have questions or comments, please contact us at techinfo@fieldp.com.</p>
<p><strong>Sample code</strong>:</p>
<pre>dim row,column as Integer
dim OpenFItem as folderitem
dim OpenFName as string
// Batch files
dim FExt as string
dim DriveString as string
dim PathString as string
dim NColon as integer
dim CommandString as string</pre>
<pre>row=Me.RowFromXY(System.MouseX - Me.Left - Self.Left,System.MouseY - Me.Top - Self.Top)
column = 0
if (row &lt; me.ListCount) then
  if me.CellTag( row, column ) = "Directory" then
  // Directory navigation commands
  else
  // Open a file
    OpenFName = CurrentDirectory.AbsolutePath + me.cell(row,column)
    FExt = Uppercase(FileExt(OpenFName))
    if (FExt = "BAT") then
    // Batch files (change to the batch file directory before executing commands)
      PathString = RightDirectory.AbsolutePath
      NColon = Instr(PathString,":")
      if (NColon = 2) then
        DriveString = mid(PathString,1,2)
        NColon = len(PathString) - 2
        PathString = right(PathString,NColon)
        CommandString = " /c " + DriveString + " &amp; cd " + PathString + _
          " &amp; " + me.cell(row,column)
      else
        CommandString = " /c cd " + PathString + _
          " &amp; " + me.cell(row,column)
      end if
      OpenFItem = GetFolderItem("C:\Windows\System32\cmd.exe")
      if (OpenFItem &lt;&gt; nil) then
        OpenFItem.launch(CommandString)
      end if
    else
 // Standard programs
      OpenFItem = GetFolderItem(OpenFName)
      if (OpenFItem &lt;&gt; nil) then
        OpenFItem.launch
      end if
    end if
  end if
 end if</pre>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2013/launching-windows-programs-and-batch-files-in-realbasic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Organizing data file sets</title>
		<link>http://fieldp.com/myblog/2013/organizing-data-file-sets/</link>
		<comments>http://fieldp.com/myblog/2013/organizing-data-file-sets/#comments</comments>
		<pubDate>Tue, 01 Jan 2013 17:24:45 +0000</pubDate>
		<dc:creator>shumphries</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[NewFeatures]]></category>
		<category><![CDATA[commander]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[FreeCommander]]></category>
		<category><![CDATA[manager]]></category>
		<category><![CDATA[navigator]]></category>
		<category><![CDATA[norton]]></category>
		<category><![CDATA[organizer]]></category>
		<category><![CDATA[turbo]]></category>

		<guid isPermaLink="false">http://fieldp.com/myblog/?p=1672</guid>
		<description><![CDATA[<p>In the beginning, you either had an IBM PC or a clone. In either case, the operating system was MSDOS which was supplied with no utilities whatever. Organizing files with DOS commands was time-consuming and frustrating. It was a joy when the first two-window file management programs were released. The best-known example was Norton Commander, although [...]]]></description>
				<content:encoded><![CDATA[<p>In the beginning, you either had an IBM PC or a clone. In either case, the operating system was MSDOS which was supplied with no utilities whatever. Organizing files with DOS commands was time-consuming and frustrating. It was a joy when the first two-window file management programs were released. The best-known example was <strong>Norton Commander</strong>, although there were several popular programs at the time. I remember happily organizing files in the glow of the traffic-light-orange-on-black of the monitor of my Zenith computer. (At that time computers supported only monochrome monitors, and there were several pseudo-scientific studies that showed that strange text colors were better for your brain than the standard white-on-black.)</p>
<p>After 30 years, I remain convinced that the fixed two-window file manager is the best choice for organizing a hard disk. The advantages are especially apparent when you run technical programs like ours and have to keep track of extensive sets of data files. Although several excellent commercial and freeware programs are available[1], we decided to create our own program (<strong>FP File Organizer</strong>) for the following reasons:</p>
<ul>
<li>The file-management functions that we are developing will be added to major upgrades of our program launchers (tc.exe., amaze.exe, gambet.exe and xenos.exe). These programs will be distributed with the February 2013 update.</li>
<li>We can easily add custom features to facilitate work with our technical codes.</li>
<li>We designed the interface with care to make it easy to learn the program and to perform common operations.</li>
</ul>
<div class="wp-caption aligncenter" style="width: 760px"><img title="Screenshot of FP File Organizer" alt="Screenshot of FP File Organizer" src="http://www.fieldp.com/myblog/images/fpfileorganizer.png" width="750" height="399" /><p class="wp-caption-text">Figure 1. Screenshot of FP File Organizer.</p></div>
<p>In this article, I&#8217;ll discuss the interface design and some of the program features. Figure 1 shows a screenshot. As in other commander-type programs, there are two windows that point to different directories (folders) or drives. The locations are determined by the navigation controls at the top. The principle of operation is simple. One of the windows is active (indicated by the red light). A window is made active by selecting a file or directory or by clicking an associated control. The <em>Delete</em>, <em>Rename</em> and <em>Edit file</em> commands work on selected files in the active window. The <em>Copy</em> and <em>Move</em> commands transfer selected files in the active window to the other window. Within this basic organization, our program has several unique features.</p>
<ul>
<li>Notice in Fig. 1 the absence of a menu and toolbar at the top, common features of Windows programs that I dislike. All the controls of <strong>FP File Organizer</strong> are clearly visible at fixed locations.</li>
<li>99.9% of the work you perform with a file manager involves the fundamental operations copy, move, delete, rename and create-directory. Other available file managers are involved in an arms race of advanced features that tend to accumulate on the toolbar. Working with other programs involves continually seeking important controls in a sea of small icons. We will add future advanced features for <strong>FP File Organizer</strong> to to a popup menu, with no changes to the basic control layout.</li>
<li>All controls are easily-identified push buttons at logical positions. Folder navigation controls are grouped at the top. The fundamental file controls are placed between the windows at the focal point in the middle of the program window to emphasize their function.</li>
<li>Other file managers attempt to put too much information in the left and right windows. <strong>FP File Organzer</strong> shows the file directory name plus one item of context-sensitive information. Directories are always collected at the top the listing, with shading and names in uppercase letters. The order of the lists depends on the current sort mode. For <em>sort-by-name</em>, directories are listed in alphabetic order with their creation date and files are organized alphabetically with their exact byte size. For <em>sort-by-extension</em>, the files are grouped alphabetically by their extension and then by name, again with the byte size. Finally, in <em>sort-by-date</em> both directories and files are ordered first by creation date and then alphabetically by name showing the creation date.</li>
<li>With regard to navigation, I find I spend too much time stepping back to the same disk location I used earlier. To minimize effort, <strong>FP File Organizer</strong> supports a saved-location list. If you expect to return to a directory, click <em>Add location</em> to put it on the list. Locations are easily removed when you move on to another task. The program also stores a list of previous locations for each window so you can move quickly back-and-forth between directories. The program remembers locations from the previous session.</li>
</ul>
<p>If you have questions or comments, please contact us at techinfo@fieldp.com.</p>
<p><strong>Footnotes</strong></p>
<p>[1] The two-window file manager lives on, albeit with many more advanced features. I use <strong>FreeCommander</strong>, a freeware program available at <a href="http://www.freecommander.com/" target="_blank">http://www.freecommander.com/</a>. An alternative is <strong>Turbo Navigator</strong>. It is out-of-print, but you can download the last version here: <a href="http://www.321download.com/LastFreeware/page6.html" target="_blank">http://www.321download.com/LastFreeware/page6.html</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fieldp.com/myblog/2013/organizing-data-file-sets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
