Electrostatics template

\(\renewcommand{\vec}[1]{\mathbf{#1}} \newcommand{\Grad}[1]{\mathbf{\text{grad}}\,{#1}} \newcommand{\Curl}[1]{\mathbf{\text{curl}}\,{#1}} \newcommand{\Div}[1]{\text{div}\,{#1}} \newcommand{\Real}[1]{\text{Re}({#1})} \newcommand{\Imag}[1]{\text{Im}({#1})} \newcommand{\pvec}[2]{{#1}\times{#2}} \newcommand{\psca}[2]{{#1}\cdot{#2}} \newcommand{\E}[1]{\,10^{#1}} \newcommand{\Ethree}{{\mathbb{E}^3}} \newcommand{\Etwo}{{\mathbb{E}^2}} \newcommand{\Units}[1]{[\mathrm{#1}]} \)The Electrostatics.pro template focuses on the determination of the distribution of the electric field $\vec{e}$ $\Units{V/m}$ due to static electric charge densities $\rho$ $\Units{C/m^3}$ and/or levels of electric potential $v$ $\text[V]$. This is called an electrostatic problem, or simply electrostatics.

  • Download the templates (they are also directly available in the ONELAB bundle)
  • Create a geometry with Gmsh, or open an existing geometry
  • File/Merge the Electrostatics.pro template
  • For each physical group in the model, you will be asked to select the material, sources or boundary conditions

Every time you run your model, the ONELAB database is saved to disk (you can later reload it using the gear menu). A flattened problem file containing the GetDP definitions is also saved in case you want to edit it manually later on.

Governing equations

The equations describing electrostatics are obtained by dropping the terms with time derivatives (since we only consider static phenomena) in Maxwell's equations. The equations involving the electric and magnetic quantities (the electric field $\vec{e}$ and the electric displacement $\vec{d}$ on one side, the magnetic field $\vec{h}$ and the magnetic induction $\vec{b}$ on the other) then become decoupled and in order to determine the electric field we can thus only consider: \begin{align} \Curl{\vec{e}} &= 0 , \label{eq:curle}\\ \Div{\vec{d}} &= \rho , \label{eq:divd} \end{align} together with the dielectric constitutive law \begin{equation} \vec{d} = \epsilon \vec{e} + \vec{p}_e , \label{eq:de} \end{equation} where the charge density $\rho$ and the source polarization $\vec{p}_e$ are given (see Maxwell's equations for additional details).

Scalar electric potential

Since $\Curl{\vec{e}} = 0$, the electric field can be derived from a scalar potential (the electric scalar potential $v$ such that \begin{equation} \vec{e} = - \Grad{v} . \label{eq:v} \end{equation}

Introducing \eqref{eq:v} and \eqref{eq:de} in \eqref{eq:divd}, we obtain \begin{equation}\label{eq:elesta} -\Div{\epsilon\,\Grad{v}} = \rho . \end{equation} Our goal is to solve this equation in a bounded open set $\Omega$ of the oriented Euclidean space $\Ethree$. Note that if $\epsilon$ is a constant, \eqref{eq:elesta} reduces to Poisson's equation: $\Delta\,v=-\rho/\epsilon$.

Weak formulation

Domain and its boundary.
Domain and its boundary.

Let us skip all the mathematical details related to the conditions for the existence and uniqueness of the solution to this problem and focus instead on reformulating of the problem in order to solve it using the finite element method with GetDP. In order to do this, we need to transform the original partial differential equation into a so-called weak formulation. This weak formulation is obtained by testing equation \eqref{eq:elesta} with a series of functions, which means taking the scalar product of the equation with these test functions. Mathematically, one can show that \eqref{eq:elesta} is equivalent to finding the solution $v$ such that \begin{equation}\label{eq:elesta_weak} - \int_\Omega (\Div{\epsilon\,\Grad{v}}) \,v' \,d\Omega = \int_\Omega \rho \,v' \,d\Omega \end{equation} holds for all test functions $v'$ in an appropriate function space. This is the weak formulation of \eqref{eq:elesta}, where the appropriate function spaces for $v$ and $v'$ are Sobolev spaces of square integrable functions whose gradients are also square integrable, the precise definition of which depends on the applied boundary conditions. Using the $(\cdot,\cdot)$ notation for the scalar product, we can write the weak formulation in a more compact form as: Find $v$ such that \begin{equation}\label{eq:elesta_weak2} - (\Div{\epsilon\,\Grad{v}} , v')_\Omega = (\rho , v')_\Omega, \quad \forall v'. \end{equation} It is advantageous to integrate the left-hand side of \eqref{eq:elesta_weak2} by parts, which symmetrizes it and reduces the continuity requirements on $\epsilon$ and $v$. Applying Green's first identity, the weak formulation then becomes: Find $v$ such that: \begin{equation}\label{eq:elesta_weak3} (\epsilon\,\Grad{v} , \Grad{v'} )_\Omega - (\epsilon\, \vec{n}\cdot\Grad{v} , v' )_{\partial\Omega} = (\rho , v')_\Omega ,\quad \forall v'. \end{equation} The weak formulation \eqref{eq:elesta_weak3} is what is written symbolically in the Electrostatics.pro template.