- conductorFunc
conductorFunc¶
UserFuncs of kind = conductorFunc
return a result with information
about a Conductor Block in a cutCellPoisson updater,
namely the voltage on the conductor,
the total and absorbed charge on the conductor, or the capacitance of
the conductor (with respect to other conductors).
UserFuncs of kind = conductorFunc
take zero arguments.
conductorFunc parameters¶
- conductor
The name of a Conductor Block to query for information. The name may need to be qualified, e.g., with the name of the MultiField and FieldUpdater containing the referenced conductor – e.g., myEsField.poissonUpdater.metalSphereC.
- result (string, required)
Specifies what information the function should return; depending on
result
, different attributes may apply.Following is a list of results and the extra attributes (if any) that pertain to each specific result. Each result is a scalar float.
- voltage
result = voltage
returns the voltage of the conductor (in Volts).
- charge
result = charge
returns the total charge on the conductor (in Coulombs). To calculate this,calculateCharge
must betrue
in the Conductor Block (this is automatically true for floating conductors).For floating conductors, this will be the absorbed charge (minus the emitted charge). For setVoltage conductors, this will be the induced charge, calculated from Gauss’s Law by integrating the electric field of the surface of the conductor.
- absorbedCharge
result = absorbedCharge
returns the absorbed charge on the conductor (in Coulombs). To calculate this,calculateCharge
must betrue
in the Conductor Block (this is automatically true for floating conductors).The absorbed charge is charge on the conductor resulting from absorbed/emitted particles as well as specified currents (cf.
ptclAbsorbers
,ptclSources
, and<Expression current>
in the Conductor Block). For floating conductors, the absorbed charge will be (nearly) equal to the total charge. For conductors with setVoltage, the absorbed charge will be zero.
- capacitance
This result uses the following attribute:
- otherConductor (string, optional, default: the same
- as 'conductor')
which (like
conductor
) specifies the name of a Conductor Block.
result = capacitance
returns the capacitance of the conductor with respect to another conductor (or itself). Unlike the other results, this does not typically change in time over the course of a simulation.The capacitance of conductor C1 with respect to another conductor C2 is defined as the charge induced on C1 when 1V is placed on conductor C2 (while the voltage of all other conductors – including C1 if C1 and C2 are not the same – is maintained at zero). The units are C/V (or Farads).
Note: the
otherConductor
must be in the same cutCellPoisson block as theconductor
.Note: either
conductor
orotherConductor
(or both) must be floating conductors (cf. Conductor Block) for the capacitance to be calculated.Note: if
conductor
andotherConductor
are the same, the capacitance is positive: 1 V on the conductor will generally induced a positive charge on that conductor. However, if the conductors are different, the resulting capacitance is negative: putting 1 V on C2 while C1 remains at 0 V will generally induce a negative charge on C1.Note: the capacitance between two floating conductors C1 and C2 is symmetric; swapping
conductor
andotherConductor
will yield the same result.
conductorFunc examples¶
In these examples, a conductorFunc
is used within a
functionOfTime TensorHistory to record charge, voltage, and
capacitance of a conductor. These assume that there is a
MultiField block ‘myEsField’ that contains a
cutCellPoisson updater block ‘poissonUpdater’ that
contains Conductor Block ‘sphereC’ and ‘plateC’, both of which are
floating conductors.
<History sphereVoltageAndCharge>
kind = functionOfTime
<Expression histCalc>
<UserFunc v>
kind = conductorFunc
conductor = myEsField.poissonUpdater.sphereC
result = voltage
</UserFunc>
<UserFunc q>
kind = conductorFunc
conductor = myEsField.poissonUpdater.sphereC
result = charge
</UserFunc>
expression = vector(v(), q())
</Expression>
</History>
<History sphereCapacitance>
kind = functionOfTime
<Expression histCalc>
<UserFunc c>
kind = conductorFunc
conductor = myEsField.poissonUpdater.sphereC
# otherConductor = sphereC # default
result = capacitance
</UserFunc>
expression = c()
</Expression>
applyPeriod = 0 # this doesn't change in time, so record just once
</History>
<History spherePlateCapacitance>
kind = functionOfTime
<Expression histCalc>
<UserFunc c>
kind = conductorFunc
conductor = myEsField.poissonUpdater.sphereC
otherConductor = plateC
result = capacitance
</UserFunc>
expression = abs(c()) # c() < 0; for convenience, we record abs(c()).
</Expression>
applyPeriod = 0 # this doesn't change in time, so record just once
</History>