Modification in boundary conditions:
- Now absorption scatte the particle properties into the edge nodes. - New boundary condition 'transparent' subsitute old absorption.
This commit is contained in:
parent
2c3e25b40e
commit
9e3a1a771b
15 changed files with 212 additions and 148 deletions
|
|
@ -55,6 +55,15 @@ MODULE moduleMeshCyl
|
|||
|
||||
END SUBROUTINE absorption
|
||||
|
||||
MODULE SUBROUTINE transparent(edge, part)
|
||||
USE moduleSpecies
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshEdge), INTENT(inout):: edge
|
||||
CLASS(particle), INTENT(inout):: part
|
||||
|
||||
END SUBROUTINE transparent
|
||||
|
||||
MODULE SUBROUTINE symmetryAxis(edge, part)
|
||||
USE moduleSpecies
|
||||
IMPLICIT NONE
|
||||
|
|
@ -126,7 +135,6 @@ MODULE moduleMeshCyl
|
|||
PROCEDURE, PASS:: getNodes => getNodesQuad
|
||||
PROCEDURE, PASS:: phy2log => phy2logQuad
|
||||
PROCEDURE, PASS:: nextElement => nextElementQuad
|
||||
PROCEDURE, PASS:: resetOutput => resetOutputQuad
|
||||
|
||||
END TYPE meshVolCylQuad
|
||||
|
||||
|
|
@ -159,7 +167,6 @@ MODULE moduleMeshCyl
|
|||
PROCEDURE, PASS:: getNodes => getNodesTria
|
||||
PROCEDURE, PASS:: phy2log => phy2logTria
|
||||
PROCEDURE, PASS:: nextElement => nextElementTria
|
||||
PROCEDURE, PASS:: resetOutput => resetOutputTria
|
||||
|
||||
END TYPE meshVolCylTria
|
||||
|
||||
|
|
@ -237,6 +244,9 @@ MODULE moduleMeshCyl
|
|||
TYPE IS(boundaryReflection)
|
||||
self%fBoundary(s)%apply => reflection
|
||||
|
||||
TYPE IS(boundaryTransparent)
|
||||
self%fBoundary(s)%apply => transparent
|
||||
|
||||
TYPE IS(boundaryAxis)
|
||||
self%fBoundary(s)%apply => symmetryAxis
|
||||
|
||||
|
|
@ -636,36 +646,6 @@ MODULE moduleMeshCyl
|
|||
|
||||
END SUBROUTINE nextElementQuad
|
||||
|
||||
!Reset the output of nodes in quad element
|
||||
PURE SUBROUTINE resetOutputQuad(self)
|
||||
USE moduleSpecies
|
||||
USE moduleOutput
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshVolCylQuad), INTENT(inout):: self
|
||||
INTEGER:: k
|
||||
|
||||
DO k = 1, nSpecies
|
||||
self%n1%output(k)%den = 0.D0
|
||||
self%n1%output(k)%mom = 0.D0
|
||||
self%n1%output(k)%tensorS = 0.D0
|
||||
|
||||
self%n2%output(k)%den = 0.D0
|
||||
self%n2%output(k)%mom = 0.D0
|
||||
self%n2%output(k)%tensorS = 0.D0
|
||||
|
||||
self%n3%output(k)%den = 0.D0
|
||||
self%n3%output(k)%mom = 0.D0
|
||||
self%n3%output(k)%tensorS = 0.D0
|
||||
|
||||
self%n4%output(k)%den = 0.D0
|
||||
self%n4%output(k)%mom = 0.D0
|
||||
self%n4%output(k)%tensorS = 0.D0
|
||||
|
||||
END DO
|
||||
|
||||
END SUBROUTINE resetOutputQuad
|
||||
|
||||
!TRIA ELEMENT
|
||||
!Init tria element
|
||||
SUBROUTINE initVolTriaCyl(self, n, p)
|
||||
|
|
@ -999,33 +979,6 @@ MODULE moduleMeshCyl
|
|||
|
||||
END SUBROUTINE nextElementTria
|
||||
|
||||
!Reset the output of nodes in tria element
|
||||
PURE SUBROUTINE resetOutputTria(self)
|
||||
USE moduleSpecies
|
||||
USE moduleOutput
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshVolCylTria), INTENT(inout):: self
|
||||
INTEGER:: k
|
||||
|
||||
DO k = 1, nSpecies
|
||||
self%n1%output(k)%den = 0.D0
|
||||
self%n1%output(k)%mom = 0.D0
|
||||
self%n1%output(k)%tensorS = 0.D0
|
||||
|
||||
self%n2%output(k)%den = 0.D0
|
||||
self%n2%output(k)%mom = 0.D0
|
||||
self%n2%output(k)%tensorS = 0.D0
|
||||
|
||||
self%n3%output(k)%den = 0.D0
|
||||
self%n3%output(k)%mom = 0.D0
|
||||
self%n3%output(k)%tensorS = 0.D0
|
||||
|
||||
END DO
|
||||
|
||||
END SUBROUTINE resetOutputTria
|
||||
|
||||
|
||||
!COMMON FUNCTIONS FOR CYLINDRICAL VOLUME ELEMENTS
|
||||
!Computes element Jacobian determinant
|
||||
PURE FUNCTION detJCyl(self, xi, dPsi_in) RESULT(dJ)
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ SUBMODULE (moduleMeshCyl) moduleMeshCylBoundary
|
|||
part%v(1) = cosT*vpp(1) + sinT*vpp(2)
|
||||
part%v(2) = -sinT*vpp(1) + cosT*vpp(2)
|
||||
|
||||
part%n_in = .TRUE.
|
||||
|
||||
END SELECT
|
||||
|
||||
part%n_in = .TRUE.
|
||||
|
||||
END SUBROUTINE reflection
|
||||
|
||||
!Absoption in a surface
|
||||
|
|
@ -47,13 +47,60 @@ SUBMODULE (moduleMeshCyl) moduleMeshCylBoundary
|
|||
|
||||
CLASS(meshEdge), INTENT(inout):: edge
|
||||
CLASS(particle), INTENT(inout):: part
|
||||
REAL(8):: rEdge(1:2) !Position of particle projected to the edge
|
||||
REAL(8):: a, b, c
|
||||
REAL(8):: a2b2
|
||||
REAL(8):: d !Distance from particle to edge
|
||||
|
||||
SELECT TYPE(edge)
|
||||
TYPE IS(meshEdgeCyl)
|
||||
a = (edge%z(1) - edge%z(2))
|
||||
b = (edge%r(1) - edge%r(2))
|
||||
c = edge%z(1)*edge%r(2) - edge%z(2)*edge%r(1)
|
||||
|
||||
!TODO: Add scatter to mesh nodes
|
||||
a2b2 = a**2 + b**2
|
||||
|
||||
rEdge(1) = (b*( b*part%r(1) - a*part%r(2)) - a*c)/a2b2
|
||||
rEdge(2) = (a*(-b*part%r(1) + a*part%r(2)) - b*c)/a2b2
|
||||
|
||||
d = NORM2(rEdge - part%r(1:2))
|
||||
!Reduce weight of particle by the distance to the edge and move it to the edge
|
||||
IF (d > 0.D0) THEN
|
||||
part%weight = part%weight / d
|
||||
part%r(1:2) = rEdge
|
||||
|
||||
END IF
|
||||
|
||||
!Scatter particle in associated volume
|
||||
IF (ASSOCIATED(edge%e1)) THEN
|
||||
CALL edge%e1%scatter(part)
|
||||
|
||||
ELSE
|
||||
CALL edge%e2%scatter(part)
|
||||
|
||||
END IF
|
||||
|
||||
END SELECT
|
||||
|
||||
!Remove particle from the domain
|
||||
part%n_in = .FALSE.
|
||||
|
||||
END SUBROUTINE absorption
|
||||
|
||||
!Transparent boundary condition
|
||||
SUBROUTINE transparent(edge, part)
|
||||
USE moduleSpecies
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshEdge), INTENT(inout):: edge
|
||||
CLASS(particle), INTENT(inout):: part
|
||||
|
||||
!Removes particle from domain
|
||||
part%n_in = .FALSE.
|
||||
|
||||
END SUBROUTINE transparent
|
||||
|
||||
!Symmetry axis. Dummy function
|
||||
SUBROUTINE symmetryAxis(edge, part)
|
||||
USE moduleSpecies
|
||||
IMPLICIT NONE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue