Skip to content

Capacitor in 3D

This tutorial aims to provide an explanation of the steps on how to do a simple electrostatic simulation in openCFS from the setup description to postprocessing. External programs used for this tutorial are Coreform Cubit 2022.4, ParaView 5.6.0 and chosen XML-editor. All the files needed for this tutorial can be downloaded here.

Setup and problem description

For this simulation, a parallel plate capacitor with circular plates of radius r separated by a distance of d is modelled as a 3D quarter model, exhibiting symmetry around rotational axis. Excitation of the system is done by prescribing an electric potential to the surface of capacitor plates which corresponds to the Dirichlet boundary conditions. To ensure that the simulation software can work properly and deliver correct results, it is needed to determine the proper outer simulation area - set outer boundary condition, which is here a sphere with radius R filled with air.

In this example, a capacitance of the given setup is of interest. Capacitance is derived from electric energy, which can be calculated with following simple electrostatic simulation in openCFS, together with given electric potential that is used for excitation of the whole system.

Constructing the simulation model in Cubit

  1. Type 'cubit' or 'coreform_cubit' in the terminal.
  2. On the Cubit GUI open up and run the journal file capacitor.jou that contains Cubit commands for creating the geometry, meshing the whole model and defining nodes and blocks that will later be used in openCFS.
  3. A geometry of a rotationally symmetric capacitor modelled in 3D as a quarter model is created.
  4. The geometry model is exported as an ANSYS-cdb mesh file capacitor.cdb located in the same folder as journal file.
  5. Geometry could also be created as capacitor.cub5 to open it directly on Cubit (optional).

The file capacitor.cdb was created this way and is ready to be used by openCFS.

Simulation with openCFS

Defining the simulation input and storing the results is done in .xml file written with the chosen XML-editor (e.g. oXygen,eclipse or VSCode). For this tutorial a .xml file called capacitor.xml is already written and ready to be used. Regions that represent volumes and surfaces from cubit file are described and used to define the excitation way, analysis type and save wanted results.
Since the capacitance can be derived from the total electrical energy W_{el}=\frac{CV^2}{2}, the electrical energy W_{el} is stored as one of the main results of this electrostatic simulation.
In the file mat.xml the material porperties needed for successful simulation are defined. This file together with .cdb file and .xml file of the main simulation must be located in the same directory in order to function properly.

To start the computation run the following command in the terminal:

cfs -p capacitor.xml job
where job can be any name you choose to give to the two output files of the simulation.

CFS will write some output on the terminal containing time used to calculate PDEs on different regions, and produce the two files:

  • job.info.xml, which contains some details about the run - the so called history file, and
  • job.cfs in the results_hdf5 directory, which can later be visualized in ParaView.

In order to better understand the static analysis concept and governing PDEs of electrostatics used by the openCFS, it is recommended to read this article.

Postprocessing

  1. ParaView is used to visualize the field results from results_hdf5/capacitor.cfs which can be done by running the command:
    paraview capacitor.cfs
    
  2. Studying the integrated results in history/*, e.g. the electric energy in the region between the capacitor plates saved in text format in capacitor-elecEnergy-region-V_elec.hist
  3. Compare with the analytic estimates

Further Suggestions

You can modify the example to answer the following questions:

  • How large is the influence of the stray field on the total capacitance?
  • How large must the air domain around the capacitor be modelled?
  • What changes if one uses polyimide between the electrodes?