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:
parent
dc98fe9399
commit
2c3e25b40e
18 changed files with 19389 additions and 1174 deletions
|
|
@ -2,6 +2,7 @@
|
|||
MODULE moduleMesh
|
||||
USE moduleList
|
||||
USE moduleOutput
|
||||
USE moduleBoundary
|
||||
IMPLICIT NONE
|
||||
|
||||
!Parent of Node element
|
||||
|
|
@ -45,6 +46,12 @@ MODULE moduleMesh
|
|||
|
||||
END TYPE meshNodeCont
|
||||
|
||||
!Type for array of boundary functions (one per species)
|
||||
TYPE, PUBLIC:: fBoundaryGeneric
|
||||
PROCEDURE(boundary_interface), POINTER, NOPASS:: apply => NULL()
|
||||
|
||||
END TYPE
|
||||
|
||||
!Parent of Edge element
|
||||
TYPE, PUBLIC, ABSTRACT:: meshEdge
|
||||
!Element index
|
||||
|
|
@ -53,13 +60,14 @@ MODULE moduleMesh
|
|||
CLASS(meshVol), POINTER:: e1 => NULL(), e2 => NULL()
|
||||
!Normal vector
|
||||
REAL(8):: normal(1:3)
|
||||
!Physical surface in mesh
|
||||
!Pointer to boundary element
|
||||
TYPE(boundaryCont), POINTER:: boundary
|
||||
!Array of functions for boundary conditions
|
||||
TYPE(fBoundaryGeneric), ALLOCATABLE:: fBoundary(:)
|
||||
!Physical surface for the edge
|
||||
INTEGER:: physicalSurface
|
||||
!id for boundary condition
|
||||
INTEGER:: bt = 0
|
||||
CONTAINS
|
||||
PROCEDURE(initEdge_interface), DEFERRED, PASS:: init
|
||||
PROCEDURE(boundary_interface), DEFERRED, PASS:: fBoundary
|
||||
PROCEDURE(getNodesEdge_interface), DEFERRED, PASS:: getNodes
|
||||
PROCEDURE(randPos_interface), DEFERRED, PASS:: randPos
|
||||
|
||||
|
|
@ -77,15 +85,6 @@ MODULE moduleMesh
|
|||
|
||||
END SUBROUTINE initEdge_interface
|
||||
|
||||
SUBROUTINE boundary_interface(self, part)
|
||||
USE moduleSpecies
|
||||
|
||||
IMPORT:: meshEdge
|
||||
CLASS (meshEdge), INTENT(inout):: self
|
||||
CLASS (particle), INTENT(inout):: part
|
||||
|
||||
END SUBROUTINE
|
||||
|
||||
PURE FUNCTION getNodesEdge_interface(self) RESULT(n)
|
||||
IMPORT:: meshEdge
|
||||
CLASS(meshEdge), INTENT(in):: self
|
||||
|
|
@ -102,6 +101,18 @@ MODULE moduleMesh
|
|||
|
||||
END INTERFACE
|
||||
|
||||
INTERFACE
|
||||
SUBROUTINE boundary_interface(edge, part)
|
||||
USE moduleSpecies
|
||||
|
||||
IMPORT:: meshEdge
|
||||
CLASS (meshEdge), INTENT(inout):: edge
|
||||
CLASS (particle), INTENT(inout):: part
|
||||
|
||||
END SUBROUTINE
|
||||
|
||||
END INTERFACE
|
||||
|
||||
!Containers for edges in the mesh
|
||||
TYPE:: meshEdgeCont
|
||||
CLASS(meshEdge), ALLOCATABLE:: obj
|
||||
|
|
@ -332,8 +343,8 @@ MODULE moduleMesh
|
|||
CALL nextElement%findCell(part, self)
|
||||
|
||||
CLASS IS (meshEdge)
|
||||
!Particle encountered an edge, execute boundary
|
||||
CALL nextElement%fBoundary(part)
|
||||
!Particle encountered an edge, apply boundary
|
||||
CALL nextElement%fBoundary(part%sp)%apply(nextElement,part)
|
||||
!If particle is still inside the domain, call findCell
|
||||
IF (part%n_in) THEN
|
||||
IF(PRESENT(oldCell)) THEN
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue