0D Grid geometry

Implementation of the 0D grid to test collisional processes.

An OMP_LOCK was added to the nodes to properly write perform the
scattering (it is weird that multiple threads work in the same node at
the same time, but in 0D happens everytime).

Added a new case to test the 0D geometry.

User Manual updated with the new options.
This commit is contained in:
Jorge Gonzalez 2021-04-13 21:48:44 +02:00
commit a681b9f533
18 changed files with 348 additions and 114 deletions

View file

@ -19,6 +19,7 @@ MODULE moduleMeshInput0D
TYPE IS(meshParticles)
self%printOutput => printOutput0D
self%printEM => printEM0D
self%readInitial => readInitial0D
END SELECT
self%readMesh => read0D
@ -63,4 +64,37 @@ MODULE moduleMeshInput0D
END SUBROUTINE read0D
SUBROUTINE readInitial0D(sp, filename, density, velocity, temperature)
IMPLICIT NONE
INTEGER, INTENT(in):: sp
CHARACTER(:), ALLOCATABLE, INTENT(in):: filename
REAL(8), ALLOCATABLE, INTENT(out), DIMENSION(:):: density
REAL(8), ALLOCATABLE, INTENT(out), DIMENSION(:,:):: velocity
REAL(8), ALLOCATABLE, INTENT(out), DIMENSION(:):: temperature
REAL(8):: dummy
INTEGER:: stat
ALLOCATE(density(1:1))
ALLOCATE(velocity(1:1, 1:3))
ALLOCATE(temperature(1:1))
OPEN(10, file = TRIM(filename))
!Finds the last line of data
stat = 0
DO WHILE (stat==0)
READ(10, *, iostat = stat)
END DO
!Go back two line
BACKSPACE(10)
BACKSPACE(10)
!Reads data
READ(10, *) dummy, density(1), velocity(1, 1:3), dummy, temperature(1)
END SUBROUTINE readInitial0D
END MODULE moduleMeshInput0D

View file

@ -18,7 +18,8 @@ MODULE moduleMeshOutput0D
fileName='OUTPUT_' // species(i)%obj%name // '.dat'
IF (t == 0) THEN
OPEN(20, file = path // folder // '/' // fileName, action = 'write')
WRITE(20, "(A1, 8X, A1, 6(A20))") "#","t","density", "velocity", "pressure", "temperature"
WRITE(20, "(A1, 14X, A5, A20, 40X, A20, 2(A20))") "#","t (s)","density (m^-3)", "velocity (m/s)", &
"pressure (Pa)", "temperature (K)"
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
CLOSE(20)
@ -26,7 +27,7 @@ MODULE moduleMeshOutput0D
OPEN(20, file = path // folder // '/' // fileName, position = 'append', action = 'write')
CALL calculateOutput(self%nodes(1)%obj%output(i), output, self%nodes(1)%obj%v, species(i)%obj)
WRITE(20, "(I10, 6(ES20.6E3))") t, output%density, output%velocity, output%pressure, output%temperature
WRITE(20, "(7(ES20.6E3))") REAL(t)*tauMin*ti_ref, output%density, output%velocity, output%pressure, output%temperature
CLOSE(20)
END DO
@ -43,6 +44,20 @@ MODULE moduleMeshOutput0D
CLASS(meshGeneric), INTENT(in):: self
INTEGER, INTENT(in):: t
CHARACTER(:), ALLOCATABLE:: fileName
fileName='OUTPUT_Collisions.dat'
IF (t == 0) THEN
OPEN(20, file = path // folder // '/' // fileName, action = 'write')
WRITE(20, "(A1, 14X, A5, A20)") "#","t (s)","collisions"
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
CLOSE(20)
END IF
OPEN(20, file = path // folder // '/' // fileName, position = 'append', action = 'write')
WRITE(20, "(ES20.6E3, I20)") REAL(t)*tauMin*ti_ref, mesh%vols(1)%obj%nColl
CLOSE(20)
END SUBROUTINE printColl0D

View file

@ -292,7 +292,6 @@ MODULE moduleMeshInputGmsh2
!Reads the initial information from an output file for an species
SUBROUTINE readInitialGmsh2(sp, filename, density, velocity, temperature)
USE moduleRefParam
IMPLICIT NONE
INTEGER, INTENT(in):: sp