Compare commits
2 commits
3083e20ff7
...
8c8c6409f6
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c8c6409f6 | |||
| 27158c7c1d |
2 changed files with 98 additions and 2 deletions
|
|
@ -4,11 +4,23 @@ module moduleMeshOutputText
|
|||
subroutine writeSpeciesOutput(self, fileID, speciesIndex)
|
||||
use moduleMesh
|
||||
use moduleOutput
|
||||
use moduleRefParam, only: L_ref
|
||||
implicit none
|
||||
|
||||
class(meshParticles), INTENT(in):: self
|
||||
integer, intent(in):: fileID
|
||||
integer, intent(in):: speciesIndex
|
||||
type(outputFormat):: output
|
||||
real(8):: r(1:3)
|
||||
integer:: n
|
||||
|
||||
do n = 1, self%numNodes
|
||||
call calculateOutput(self%nodes(n)%obj%output(speciesIndex), output, self%nodes(n)%obj%v, species(speciesIndex)%obj)
|
||||
r = self%nodes(n)%obj%getCoordinates()
|
||||
|
||||
write(fileID, '(5(ES0.6E3,","),ES0.6E3)') r(1)*L_ref, output%density, output%velocity, output%temperature
|
||||
|
||||
end do
|
||||
|
||||
end subroutine writeSpeciesOutput
|
||||
|
||||
|
|
@ -24,35 +36,119 @@ module moduleMeshOutputText
|
|||
|
||||
subroutine writeEMOutput(self, fileID)
|
||||
use moduleMesh
|
||||
use moduleRefParam
|
||||
use moduleRefParam, only: L_ref, Volt_ref, B_ref, EF_ref
|
||||
implicit none
|
||||
|
||||
class(meshParticles), intent(in):: self
|
||||
integer, intent(in):: fileID
|
||||
integer:: n, c
|
||||
real(8):: r(1:3), Xi(1:3)
|
||||
|
||||
do n = 1, self%numNodes
|
||||
r = self%nodes(n)%obj%getCoordinates()
|
||||
if (n == self%numNodes) then
|
||||
Xi = (/ 1.D0, 0.D0, 0.D0 /)
|
||||
c = self%numNodes - 1
|
||||
|
||||
else
|
||||
Xi = (/ 0.D0, 0.D0, 0.D0 /)
|
||||
c = n
|
||||
|
||||
end if
|
||||
|
||||
associate(output => self%nodes(n)%obj%emData)
|
||||
write(fileID, '(7(ES0.6E3,","),ES0.6E3)') r(1)*L_ref, &
|
||||
output%phi*Volt_ref, &
|
||||
self%cells(c)%obj%gatherElectricField(Xi)*EF_ref, &
|
||||
output%B*B_ref
|
||||
|
||||
end associate
|
||||
|
||||
end do
|
||||
|
||||
end subroutine writeEMOutput
|
||||
|
||||
subroutine printOutputText(self)
|
||||
use moduleMesh
|
||||
use moduleSpecies
|
||||
use moduleMeshInoutCommon
|
||||
use moduleCaseParam, ONLY: timeStep
|
||||
implicit none
|
||||
|
||||
class(meshParticles), intent(in):: self
|
||||
|
||||
INTEGER:: s, fileID
|
||||
character(:), allocatable:: fileName
|
||||
|
||||
fileID = 60
|
||||
|
||||
do s = 1, nSpecies
|
||||
fileName = formatFileName(prefix, species(s)%obj%name, 'csv', timeStep)
|
||||
write(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
open (fileID, file = path // folder // '/' // fileName)
|
||||
|
||||
write(fileID, '(5(A,","),A)') 'Position (m)', &
|
||||
'Density (m^-3)', &
|
||||
'Velocity (m s^-1):0', 'Velocity (m s^-1):1', 'Velocity (m s^-1):2', &
|
||||
'Temperature (K)'
|
||||
|
||||
call writeSpeciesOutput(self, fileID, s)
|
||||
|
||||
close(fileID)
|
||||
|
||||
end do
|
||||
|
||||
end subroutine printOutputText
|
||||
|
||||
subroutine printCollText(self)
|
||||
use moduleMesh
|
||||
use moduleOutput
|
||||
use moduleMeshInoutCommon
|
||||
use moduleCaseParam, only: timeStep
|
||||
implicit none
|
||||
|
||||
class(meshGeneric), intent(in):: self
|
||||
integer:: fileID
|
||||
character(:), allocatable:: fileName
|
||||
|
||||
fileID = 62
|
||||
|
||||
if (collOutput) then
|
||||
fileName = formatFileName(prefix, 'Collisions', 'csv', timeStep)
|
||||
write(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
open (fileID, file = path // folder // '/' // fileName)
|
||||
|
||||
end if
|
||||
|
||||
end subroutine printCollText
|
||||
|
||||
subroutine printEMText(self)
|
||||
use moduleMesh
|
||||
use moduleMeshInoutCommon
|
||||
use moduleCaseParam, only: timeStep
|
||||
implicit none
|
||||
|
||||
class(meshParticles), intent(in):: self
|
||||
integer:: fileID
|
||||
character(:), allocatable:: fileName
|
||||
|
||||
fileID = 64
|
||||
|
||||
if (emOutput) then
|
||||
fileName = formatFileName(prefix, 'EMField', 'csv', timeStep)
|
||||
write(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
open (fileID, file = path // folder // '/' // fileName)
|
||||
|
||||
write(fileID, '(8(A,","),A)') 'Position (m)', &
|
||||
'Potential (V)', &
|
||||
'Electric Field (V m^-1):0', 'Electric Field (V m^-1):1', 'Electric Field (V m^-1):2', &
|
||||
'Magnetic Field (T):0', 'Magnetic Field (T):1', 'Magnetic Field (T):2'
|
||||
|
||||
call writeEMOutput(self, fileID)
|
||||
|
||||
close(fileID)
|
||||
|
||||
end if
|
||||
|
||||
end subroutine printEMText
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
WRITE(fileID,"(A)") '<?xml version="1.0"?>'
|
||||
WRITE(fileID,"(2X, A)") '<VTKFile type="UnstructuredGrid">'
|
||||
WRITE(fileID,"(4X, A,ES20.6E3,A)") '<UnstructuredGrid>'
|
||||
WRITE(fileID,"(4X, A)") '<UnstructuredGrid>'
|
||||
WRITE(fileID,"(6X, A, I10, A, I10, A)") '<Piece NumberOfPoints="', nNodes, '" NumberOfCells="', nCells, '">'
|
||||
|
||||
END SUBROUTINE writeHeader
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue