Added the possibility to have different boundary conditions per species.

A boundary condition for each species must be indicated in the case
file.
This opens the door to use boundary conditions with different parameters
(for example, a wall temperature, coefficients for reflection or
 absorption...)

The examples included with the code have been updated accordently.
This commit is contained in:
Jorge Gonzalez 2020-12-17 18:21:27 +01:00
commit 2c3e25b40e
18 changed files with 19389 additions and 1174 deletions

View file

@ -23,7 +23,7 @@ MODULE moduleMeshCyl
END TYPE meshNodeCyl
TYPE, PUBLIC, ABSTRACT, EXTENDS(meshEdge):: meshEdgeCyl
TYPE, PUBLIC, EXTENDS(meshEdge):: meshEdgeCyl
!Element coordinates
REAL(8):: r(1:2) = 0.D0, z(1:2) = 0.D0
!Connectivity to nodes
@ -35,6 +35,37 @@ MODULE moduleMeshCyl
END TYPE meshEdgeCyl
!Boundary functions defined in the submodule Boundary
INTERFACE
MODULE SUBROUTINE reflection(edge, part)
USE moduleSpecies
IMPLICIT NONE
CLASS(meshEdge), INTENT(inout):: edge
CLASS(particle), INTENT(inout):: part
END SUBROUTINE reflection
MODULE SUBROUTINE absorption(edge, part)
USE moduleSpecies
IMPLICIT NONE
CLASS(meshEdge), INTENT(inout):: edge
CLASS(particle), INTENT(inout):: part
END SUBROUTINE absorption
MODULE SUBROUTINE symmetryAxis(edge, part)
USE moduleSpecies
IMPLICIT NONE
CLASS(meshEdge), INTENT(inout):: edge
CLASS(particle), INTENT(inout):: part
END SUBROUTINE symmetryAxis
END INTERFACE
TYPE, PUBLIC, ABSTRACT, EXTENDS(meshVol):: meshVolCyl
CONTAINS
PROCEDURE, PASS:: detJac => detJCyl
@ -68,6 +99,7 @@ MODULE moduleMeshCyl
END INTERFACE
!Quadrilateral volume element
TYPE, PUBLIC, EXTENDS(meshVolCyl):: meshVolCylQuad
!Element coordinates
REAL(8):: r(1:4) = 0.D0, z(1:4) = 0.D0
@ -98,6 +130,7 @@ MODULE moduleMeshCyl
END TYPE meshVolCylQuad
!Triangular volume element
TYPE, PUBLIC, EXTENDS(meshVolCyl):: meshVolCylTria
!Element coordinates
REAL(8):: r(1:3) = 0.D0, z(1:3) = 0.D0
@ -131,7 +164,6 @@ MODULE moduleMeshCyl
END TYPE meshVolCylTria
CONTAINS
!NODE FUNCTIONS
!Inits node element
SUBROUTINE initNodeCyl(self, n, r)
@ -154,6 +186,7 @@ MODULE moduleMeshCyl
END SUBROUTINE initNodeCyl
!Get coordinates from node
PURE FUNCTION getCoordCyl(self) RESULT(r)
IMPLICIT NONE
@ -167,6 +200,9 @@ MODULE moduleMeshCyl
!EDGE FUNCTIONS
!Inits edge element
SUBROUTINE initEdgeCyl(self, n, p, bt, physicalSurface)
USE moduleSpecies
USE moduleBoundary
USE moduleErrors
IMPLICIT NONE
CLASS(meshEdgeCyl), INTENT(out):: self
@ -175,6 +211,7 @@ MODULE moduleMeshCyl
INTEGER, INTENT(in):: bt
INTEGER, INTENT(in):: physicalSurface
REAL(8), DIMENSION(1:3):: r1, r2
INTEGER:: s
self%n = n
self%n1 => mesh%nodes(p(1))%obj
@ -189,8 +226,28 @@ MODULE moduleMeshCyl
self%z(2)-self%z(1), &
0.D0 /)
!Boundary index
self%bt = bt
!Phyiscal Surface
self%boundary => boundary(bt)
ALLOCATE(self%fboundary(1:nSpecies))
!Assign functions to boundary
DO s = 1, nSpecies
SELECT TYPE(obj => self%boundary%bTypes(s)%obj)
TYPE IS(boundaryAbsorption)
self%fBoundary(s)%apply => absorption
TYPE IS(boundaryReflection)
self%fBoundary(s)%apply => reflection
TYPE IS(boundaryAxis)
self%fBoundary(s)%apply => symmetryAxis
CLASS DEFAULT
CALL criticalError("Boundary type not defined in this geometry", 'initEdgeCyl')
END SELECT
END DO
!Physical surface
self%physicalSurface = physicalSurface
END SUBROUTINE initEdgeCyl