Compare commits
2 commits
55645e18b0
...
8d98773af0
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d98773af0 | |||
| 48419b851d |
2 changed files with 14 additions and 2 deletions
|
|
@ -1119,6 +1119,7 @@ MODULE moduleMesh
|
||||||
type(meshEdgePointer), allocatable:: edges(:) ! Edges included in the boundary
|
type(meshEdgePointer), allocatable:: edges(:) ! Edges included in the boundary
|
||||||
real(8), allocatable:: electricField(:) ! Electric field normal to the edge that must be applied with a Neumann boundary condition
|
real(8), allocatable:: electricField(:) ! Electric field normal to the edge that must be applied with a Neumann boundary condition
|
||||||
real(8), allocatable:: surfaceCharge(:) ! Surface charge density
|
real(8), allocatable:: surfaceCharge(:) ! Surface charge density
|
||||||
|
integer:: counter
|
||||||
contains
|
contains
|
||||||
procedure, pass:: apply => applyFreeCurrent
|
procedure, pass:: apply => applyFreeCurrent
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -322,6 +322,8 @@ submodule(moduleMesh) boundaryEM
|
||||||
type is(boundaryEMFreeCurrent)
|
type is(boundaryEMFreeCurrent)
|
||||||
allocate(self%edges(0))
|
allocate(self%edges(0))
|
||||||
|
|
||||||
|
self%counter = 0
|
||||||
|
|
||||||
self%update => updateFreeCurrent
|
self%update => updateFreeCurrent
|
||||||
self%print => writeFreeCurrent
|
self%print => writeFreeCurrent
|
||||||
|
|
||||||
|
|
@ -376,6 +378,7 @@ submodule(moduleMesh) boundaryEM
|
||||||
|
|
||||||
select type(self)
|
select type(self)
|
||||||
type is(boundaryEMFreeCurrent)
|
type is(boundaryEMFreeCurrent)
|
||||||
|
self%counter = self%counter + 1
|
||||||
do e=1, self%nEdges
|
do e=1, self%nEdges
|
||||||
edgeDensityCurrent = 0.0d0
|
edgeDensityCurrent = 0.0d0
|
||||||
|
|
||||||
|
|
@ -404,10 +407,18 @@ submodule(moduleMesh) boundaryEM
|
||||||
|
|
||||||
self%surfaceCharge(e) = self%surfaceCharge(e) + edgeDensityCurrent * tauMin
|
self%surfaceCharge(e) = self%surfaceCharge(e) + edgeDensityCurrent * tauMin
|
||||||
|
|
||||||
self%electricField(e) = - self%surfaceCharge(e)
|
deallocate(nodes, mom_nodes)
|
||||||
|
|
||||||
end do
|
end do
|
||||||
|
|
||||||
|
if (self%counter == 10) then
|
||||||
|
self%counter = 0
|
||||||
|
|
||||||
|
self%electricField = self%electricField - self%surfaceCharge / 10.d0
|
||||||
|
self%surfaceCharge = 0.0d0
|
||||||
|
|
||||||
|
end if
|
||||||
|
|
||||||
end select
|
end select
|
||||||
|
|
||||||
end subroutine updateFreeCurrent
|
end subroutine updateFreeCurrent
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue