Compare commits

...

2 commits

2 changed files with 9 additions and 5 deletions

View file

@ -629,7 +629,8 @@ make
\item \textbf{floating}: The potential is adjusted over time to maintain a zero current on the surface, \textit{i. e.}, the surface is \textit{floating}.
\textbf{potential}: Real.
Potential for Dirichlet boundary condition.
Initial potential of the surface.
The initial charge value for the simulation will be calculated by the potential times the capacitance.
\textbf{capacitance}: Real.
Capacitance of the surface in Farads.

View file

@ -159,7 +159,7 @@ submodule(moduleMesh) boundaryEM
! Inverse of non-dimensional capacitance
self%invC = 1.0d0 / (capacitance / (eps_0 * L_ref))
self%charge = 0.0d0
self%charge = self%potential / self%invC
self%update => updateFloating
@ -223,6 +223,9 @@ submodule(moduleMesh) boundaryEM
mom_center = edge%gatherF(edge%centerXi(), edge%nNodes, mom_nodes)
! Only account for charge exiting the surface
mom_center = max(mom_center, 0.0d0)
edgeDensityCurrent = edgeDensityCurrent + qSpecies(s) * mom_center
end do
@ -242,7 +245,7 @@ submodule(moduleMesh) boundaryEM
subroutine writeFloating(self, fileID)
use moduleOutput, only: fmtColReal
use moduleConstParam, only: qe
use moduleRefParam, only: Volt_ref
use moduleRefParam, only: Volt_ref, v_ref, n_ref, L_ref, ti_ref
implicit none
class(boundaryEMGeneric), intent(inout):: self
@ -251,8 +254,8 @@ submodule(moduleMesh) boundaryEM
write(fileID, '(A)') self%name
select type(self)
type is(boundaryEMFloating)
write(fileID, '(A,",",A)') 'Total charge', 'Potential (V)'
write(fileID, '('//fmtColReal//','//fmtColReal//')') self%charge * qe, self%potential * Volt_ref
write(fileID, '(A,",",A)') 'Total charge (C)', 'Potential (V)'
write(fileID, '(*('//fmtColReal//'))') self%charge*qe*v_ref*n_ref*L_ref**2*ti_ref, self%potential * Volt_ref
end select