Skip to content

Electric Properties

ElectricProperties is the per-component storage layer for the electrics subsystem. It holds the polarization density, the charge density (derived from composition and the molar charges of each component), and the boundary handling used by the solver. For most simulations, the input of the molar charges actually comes through ElectricalPotential via the $Z<q> elementary-charge keys — ElectricProperties stores the derived MolarChargeq=zqF values and uses them to compute the space charge:

(1)ρc(x)=qMolarChargeqcq(x)Vqmolar,

where cq is the mole fraction of component q (from Composition) and Vqmolar is its molar volume (from the periodic-table lookup held by the Thermodynamics side).

Key Classes and Concepts

  • ElectricProperties : public OPObject: stores ChargeDensity(i,j,k), PolarizationDensity(i,j,k), and per-component MolarCharge[q]; offers CalculateChargeDensity(const Composition&) and SetBoundaryConditions(const BoundaryConditions&).

Usage

Input

ElectricProperties is usually driven by ElectricalPotential; the primary user-facing tokens ($Nelectrodes, $CntElectr<i>, $Z<q>) live in that block. See ElectricalPotential → Input.

Output

  • Boundary conditions are applied on the polarization density via SetBoundaryConditions(BC).
  • The space charge field populated by CalculateChargeDensity is read by the solver.

Example

cpp
#include "Electrics/ElectricProperties.h"
#include "Electrics/ElectricSolverSpectral.h"

ElectricProperties       ElecP(OPSettings, InputFile);
ElectricSolverSpectral   ElecS(OPSettings, InputFile);

for(RTC.tStep = RTC.tStart; RTC.tStep <= RTC.nSteps; RTC.IncrementTimeStep())
{
    ElecP.CalculateChargeDensity(Cx);
    ElecP.SetBoundaryConditions(BC);
    ElecS.Solve(ElecP, BC);
}

Dependencies

Released under the GNU GPLv3 License.