New boundary condition 'wallTemperature' that simulates a reflecting
wall with constant temperature and specific heat.
This commit is contained in:
parent
ef0b4ae832
commit
baf25c1157
8 changed files with 194 additions and 0 deletions
|
|
@ -100,6 +100,66 @@ SUBMODULE (moduleMeshCyl) moduleMeshCylBoundary
|
|||
|
||||
END SUBROUTINE transparent
|
||||
|
||||
!Wall with temperature
|
||||
SUBROUTINE wallTemperature(edge, part)
|
||||
USE moduleSpecies
|
||||
USE moduleBoundary
|
||||
USE moduleConstParam, ONLY: PI
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshEdge), INTENT(inout):: edge
|
||||
CLASS(particle), INTENT(inout):: part
|
||||
REAL(8):: edgeNorm, cosT, sinT, rp(1:2), rpp(1:2), vpp(1:2)
|
||||
INTEGER:: i
|
||||
REAL(8):: x, y
|
||||
|
||||
!Modifies particle velocity according to wall temperature
|
||||
SELECT TYPE(bound => edge%boundary%bTypes(part%sp)%obj)
|
||||
TYPE IS(boundaryWallTemperature)
|
||||
DO i = 1, 3
|
||||
x = 0.D0
|
||||
DO WHILE (x == 0.D0)
|
||||
CALL RANDOM_NUMBER(x)
|
||||
|
||||
END DO
|
||||
|
||||
CALL RANDOM_NUMBER(y)
|
||||
|
||||
part%v(i) = part%v(i) + bound%vTh*DSQRT(-2.D0*DLOG(x))*DCOS(2.D0*PI*y)
|
||||
|
||||
END DO
|
||||
|
||||
END SELECT
|
||||
|
||||
!Reflects particle in the edge
|
||||
SELECT TYPE(edge)
|
||||
TYPE IS(meshEdgeCyl)
|
||||
edgeNorm = DSQRT((edge%r(2)-edge%r(1))**2 + (edge%z(2)-edge%z(1))**2)
|
||||
cosT = (edge%z(2)-edge%z(1))/edgeNorm
|
||||
sinT = DSQRT(1-cosT**2)
|
||||
|
||||
rp(1) = part%r(1) - edge%z(1);
|
||||
rp(2) = part%r(2) - edge%r(1);
|
||||
|
||||
rpp(1) = cosT*rp(1) - sinT*rp(2)
|
||||
rpp(2) = sinT*rp(1) + cosT*rp(2)
|
||||
rpp(2) = -rpp(2)
|
||||
|
||||
vpp(1) = cosT*part%v(1) - sinT*part%v(2)
|
||||
vpp(2) = sinT*part%v(1) + cosT*part%v(2)
|
||||
vpp(2) = -vpp(2)
|
||||
|
||||
part%r(1) = cosT*rpp(1) + sinT*rpp(2) + edge%z(1);
|
||||
part%r(2) = -sinT*rpp(1) + cosT*rpp(2) + edge%r(1);
|
||||
part%v(1) = cosT*vpp(1) + sinT*vpp(2)
|
||||
part%v(2) = -sinT*vpp(1) + cosT*vpp(2)
|
||||
|
||||
END SELECT
|
||||
|
||||
part%n_in = .TRUE.
|
||||
|
||||
END SUBROUTINE wallTemperature
|
||||
|
||||
!Symmetry axis. Dummy function
|
||||
SUBROUTINE symmetryAxis(edge, part)
|
||||
USE moduleSpecies
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue