Structure for 3D Cartesian Grid created.
Unification of boundary conditions into one file. Some changes to input file for reference cases. This should have been done in another branch but I wanto to commit to save progress and I don't want to deal with tswitching branches right now, I'm very busy watching Futurama.
This commit is contained in:
parent
eb6b045734
commit
ac2965621a
29 changed files with 1549 additions and 40455 deletions
121
src/modules/mesh/moduleMeshBoundary.f90
Normal file
121
src/modules/mesh/moduleMeshBoundary.f90
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
!moduleMeshBoundary: Boundary functions
|
||||
MODULE moduleMeshBoundary
|
||||
USE moduleMesh
|
||||
|
||||
CONTAINS
|
||||
SUBROUTINE reflection(edge, part)
|
||||
USE moduleCaseParam
|
||||
USE moduleSpecies
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshEdge), INTENT(inout):: edge
|
||||
CLASS(particle), INTENT(inout):: part
|
||||
!rp = intersection between particle and edge
|
||||
!rpp = final position of particle
|
||||
!vpp = final velocity of particle
|
||||
REAL(8), DIMENSION(1:3):: rp, rpp, vpp
|
||||
REAL(8):: taup !time step for reflecting process
|
||||
|
||||
!Reflect particle velocity
|
||||
vpp = part%v - 2.D0*DOT_PRODUCT(part%v, edge%normal)*edge%normal
|
||||
|
||||
!Computes the intersection between particle and surface
|
||||
rp = edge%intersection(part%r, part%v)
|
||||
|
||||
!Computes the reflection time step
|
||||
taup = NORM2(part%r - rp)*tau(part%sp)
|
||||
|
||||
!New position of particle
|
||||
rpp = rp + vpp*taup
|
||||
|
||||
!assign new parameters to particle
|
||||
part%r = rpp
|
||||
part%v = vpp
|
||||
part%n_in = .TRUE.
|
||||
|
||||
END SUBROUTINE reflection
|
||||
|
||||
!Absoption in a surface
|
||||
SUBROUTINE absorption(edge, part)
|
||||
USE moduleSpecies
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshEdge), INTENT(inout):: edge
|
||||
CLASS(particle), INTENT(inout):: part
|
||||
REAL(8):: rpp(1:3) !Position of particle projected to the edge
|
||||
REAL(8):: d !Distance from particle to edge
|
||||
|
||||
rpp = edge%intersection(part%r, part%v)
|
||||
|
||||
d = NORM2(rpp - part%r)
|
||||
|
||||
IF (d >= 0.D0) THEN
|
||||
part%weight = part%weight/d
|
||||
|
||||
END IF
|
||||
|
||||
!Assign new position to particle
|
||||
part%r = rpp
|
||||
!Remove particle from the domain
|
||||
part%n_in = .FALSE.
|
||||
|
||||
!Scatter particle in associated volume
|
||||
IF (ASSOCIATED(edge%e1)) THEN
|
||||
CALL edge%e1%scatter(part)
|
||||
|
||||
ELSE
|
||||
CALL edge%e2%scatter(part)
|
||||
|
||||
END IF
|
||||
|
||||
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
|
||||
|
||||
!Wall with temperature
|
||||
SUBROUTINE wallTemperature(edge, part)
|
||||
USE moduleSpecies
|
||||
USE moduleBoundary
|
||||
USE moduleRandom
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshEdge), INTENT(inout):: edge
|
||||
CLASS(particle), INTENT(inout):: part
|
||||
INTEGER:: i
|
||||
|
||||
!Modifies particle velocity according to wall temperature
|
||||
SELECT TYPE(bound => edge%boundary%bTypes(part%sp)%obj)
|
||||
TYPE IS(boundaryWallTemperature)
|
||||
DO i = 1, 3
|
||||
part%v(i) = part%v(i) + bound%vTh*randomMaxwellian()
|
||||
|
||||
END DO
|
||||
|
||||
END SELECT
|
||||
|
||||
CALL reflection(edge, part)
|
||||
|
||||
END SUBROUTINE wallTemperature
|
||||
|
||||
!Symmetry axis. Dummy function
|
||||
SUBROUTINE symmetryAxis(edge, part)
|
||||
USE moduleSpecies
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshEdge), INTENT(inout):: edge
|
||||
CLASS(particle), INTENT(inout):: part
|
||||
|
||||
END SUBROUTINE symmetryAxis
|
||||
|
||||
END MODULE moduleMeshBoundary
|
||||
Loading…
Add table
Add a link
Reference in a new issue