Calculating current in node. Maybe it should be on edge. Need to check.
This commit is contained in:
parent
2291236efb
commit
40163a0056
2 changed files with 37 additions and 0 deletions
|
|
@ -173,9 +173,36 @@ submodule(moduleMesh) boundaryEM
|
|||
|
||||
! Update
|
||||
subroutine updateFloating(self)
|
||||
use moduleMesh, only: qSpecies, meshNode
|
||||
implicit none
|
||||
|
||||
class(boundaryEMGeneric), intent(inout):: self
|
||||
integer:: n, s
|
||||
integer, allocatable:: nodes(:)
|
||||
class(meshNode), pointer:: node
|
||||
real(8):: momNode, momNodeTotal, totalCurrent
|
||||
|
||||
totalCurrent = 0.0d0
|
||||
select type(self)
|
||||
type is(boundaryEMFloating)
|
||||
do n = 1, self%nNodes
|
||||
momNodeTotal = 0.0d0
|
||||
|
||||
node => self%nodes(n)%obj
|
||||
|
||||
do s = 1, nSpecies
|
||||
print *, s, node%output(s)%mom
|
||||
momNode = norm2(node%output(s)%mom)
|
||||
|
||||
momNodeTotal = momNodeTotal + qSpecies(s) * momNode
|
||||
|
||||
end do
|
||||
|
||||
totalCurrent = totalCurrent + momNodeTotal
|
||||
|
||||
end do
|
||||
|
||||
print *, totalCurrent
|
||||
|
||||
end select
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue