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.
75 lines
1.5 KiB
Fortran
75 lines
1.5 KiB
Fortran
MODULE moduleBoundary
|
|
|
|
!Generic type for boundaries
|
|
TYPE, PUBLIC:: boundaryGeneric
|
|
CONTAINS
|
|
|
|
END TYPE boundaryGeneric
|
|
|
|
!Reflecting boundary
|
|
TYPE, PUBLIC, EXTENDS(boundaryGeneric):: boundaryReflection
|
|
CONTAINS
|
|
|
|
END TYPE boundaryReflection
|
|
|
|
!Absorption boundary
|
|
TYPE, PUBLIC, EXTENDS(boundaryGeneric):: boundaryAbsorption
|
|
CONTAINS
|
|
|
|
END TYPE boundaryAbsorption
|
|
|
|
!Transparent boundary
|
|
TYPE, PUBLIC, EXTENDS(boundaryGeneric):: boundaryTransparent
|
|
CONTAINS
|
|
|
|
END TYPE boundaryTransparent
|
|
|
|
!Symmetry axis
|
|
TYPE, PUBLIC, EXTENDS(boundaryGeneric):: boundaryAxis
|
|
CONTAINS
|
|
|
|
END TYPE boundaryAxis
|
|
|
|
!Wall at constant temperature
|
|
TYPE, PUBLIC, EXTENDS(boundaryGeneric):: boundaryThermalWall
|
|
REAL(8):: wallTemperature
|
|
CONTAINS
|
|
|
|
END TYPE
|
|
|
|
TYPE:: bTypesCont
|
|
CLASS(boundaryGeneric), ALLOCATABLE:: obj
|
|
|
|
END TYPE bTypesCont
|
|
|
|
TYPE:: boundaryCont
|
|
INTEGER:: id = 0
|
|
CHARACTER(:), ALLOCATABLE:: name
|
|
INTEGER:: physicalSurface = 0
|
|
CLASS(bTypesCont), ALLOCATABLE:: bTypes(:)
|
|
CONTAINS
|
|
|
|
END TYPE boundaryCont
|
|
|
|
!Number of boundaries
|
|
INTEGER:: nBoundary = 0
|
|
!Array for boundary information
|
|
TYPE(boundaryCont), ALLOCATABLE, TARGET:: boundary(:)
|
|
|
|
CONTAINS
|
|
FUNCTION getBoundaryId(physicalSurface) RESULT(id)
|
|
IMPLICIT NONE
|
|
|
|
INTEGER:: physicalSurface
|
|
INTEGER:: id
|
|
INTEGER:: i
|
|
|
|
id = 0
|
|
DO i = 1, nBoundary
|
|
IF (physicalSurface == boundary(i)%physicalSurface) id = boundary(i)%id
|
|
|
|
END DO
|
|
|
|
END FUNCTION getBoundaryId
|
|
|
|
END MODULE moduleBoundary
|