FEM Example Capacitance Two Balls/en

Introduction
This example is meant to show how to simulate the 6th example of Elmer GUI Tutorials, Electrostatic equation – Capacitance of two balls, using the new FEM Examples. It illustrates how to setup the example, study it's various parts, solve it using the Elmer Solver and visualise the results using Clip Filter.



Requirements

 * A compatible version of FreeCAD designated in the tutorial overview.
 * Use the to see the version of FreeCAD installed
 * No external software is needed for loading the example, viewing the mesh and geometry as well as for visualizing the results.
 * For solving the FEA, the solver software Elmer must be installed on your computer. See Elmer Solver for how to install Elmer.

Load FEM Workbench

 * Start FreeCAD, the Start Workbench should be loaded
 * Switch to [[Image:Workbench_FEM.svg|32px]] FEM workbench.

Load the example

 * Go to.
 * When the GUI opens, find and open "Electrostatics Capacitance Two Balls". You can easily find the example in or in . For opening the example, either double click on it or select it and click.



Understanding the Simulation Case
This case presents the solution of the capacitance of perfectly conducting balls in free space. A voltage difference between the balls results to electric charge being introduced to the system. The balls have also self-capacitance that comes from the voltage difference with the far field. Therefore a symmetric capacitance matrix with of size 2 × 2 needs to be solved. The capacitances may be computed from two different voltage configurations.

Understanding the Model

 * The model contains three spheres.
 * 1) The two smaller ones are the perfectly conducting balls.
 * 2) The bigger one is to simulate the surrounding air.
 * The two smaller spheres are fused together and then that fusion is is cut from the bigger sphere.



Analysis container and its objects

 * There are at least the 7 objects needed to make this electrostatic analysis.
 * [[Image:FEM_Analysis.png|32px]] analysis container
 * 1) [[Image:Fem-elmer.svg|32px]] Elmer solver
 * 2) [[Image:Fem-equation-electrostatic.svg|32px]] Electrostatic equation
 * 3) [[Image:Fem-material-fluid.svg|32px]] a fluid material (to represent the surrounding air)
 * 4) [[Image:Fem-constraint-electrostatic-potential.svg|32px]] electrostatic constraint (3 of them)
 * 5) [[Image:Fem-thermomechanical-analysis.svg|32px]]Constant Vaccum Permittivity
 * 6) [[Image:Fem-femmesh-gmsh-from-shape.svg|32px]] a Gmsh FEM mesh
 * 7) [[Image:Fem-femmesh-region.svg|32px]] Mesh region (for the smaller spheres)



Running the FEA

 * In Tree view double click on the solver object [[Image:Fem-elmer.svg|32px]].
 * Click on file in the same task window. Watch the log window until it prints "write completed."
 * Click on . Since this is a small analysis it should take a few seconds to run so wait till you see "ELMER SOLVER FINISHED AT" in the output.
 * Click on in the task window after the run is finished.
 * Two new result objects should be created, [[Image:Fem-data.svg|32px]] SolverElmerResult and [[Image:TextDocument.svg|32px]] SolverElmerOutput.
 * If you get an error message on solver binary or similar when triggering the analysis check installation of Elmer Solver.

Visualizing Results

 * Be sure the analysis is activated.
 * Be sure the analysis still contains the result object, if not just re-run the solver.
 * Make sure the mesh is invisible. If not, select the mesh object press to toggle the visibility.
 * Double click on the [[Image:Fem-data.svg|32px]] SolverElmerResult to load in the task panel.
 * Change the "Mode" to "Surface" and the "Field" to "potential". Press.
 * You will notice that the colour of the sphere has changed to blue and that the gradient on the right is showing values from 0 to +1. It should look something like this:



Post Processing the Result

 * While we have successfully visualised the potential result, currently we are only seeing the zero potential in the air surrounding the two balls. To view the potential on the balls we need to apply a clip filter.
 * In the tree view select the [[Image:Fem-data.svg|32px]] SolverElmerResult and then from the tool bar click on the [[Image:Fem-clip.svg|32px]] Post Create Clip Filter.
 * This will open the task panel with the clip filter configurations. Select "Plane" in the "Create" menu and check the "Cut Cells" box. After that click.




 * Then choose the same configurations (Surface and potential) as you have while visualising the results. Click . Toggle the visibility of [[Image:Fem-data.svg|32px]] SolverElmerResult using and you should see something like this:




 * Now we can clearly see that potential distribution in and around the balls.

Finding the Capacitance

 * Our actual focus is to find the capacitance which is contained in the [[Image:TextDocument.svg|32px]] SolverElmerOutput.
 * Double click on [[Image:TextDocument.svg|32px]] SolverElmerOutput to open it. Scroll down till you find:

StatElecSolve: Capacitance matrix computation performed (i,j,C_ij) StatElecSolve:  1  1    5.08013E+00 StatElecSolve:  1  2    1.70071E+00 StatElecSolve:  2  2    5.07960E+00


 * Here, our desired result is . This value is close to the  given in the Elmer GUI Tutorials. We can get an even closer value by making a finer Mesh Region but this activity is left for the user. Also, the user is advised to play with the Clip Filter to get a visual result similar to the first picture of this tutorial.