feature/meshText #57
2 changed files with 35 additions and 1 deletions
Output for species
First output done. Now it is mostly Copy Paste. There are so many things I need to reform in other parts... Learning new things is awful.
commit
27158c7c1d
|
|
@ -4,11 +4,24 @@ 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
|
||||
|
||||
|
|
@ -34,10 +47,31 @@ module moduleMeshOutputText
|
|||
|
||||
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:1 (m s^-1)', 'Velocity:2 (m s^-1)', 'Velocity:3 (m s^-1)', 'Temperature (K)'
|
||||
|
||||
call writeSpeciesOutput(self, fileID, s)
|
||||
|
||||
close(fileID)
|
||||
|
||||
end do
|
||||
|
||||
end subroutine printOutputText
|
||||
|
||||
subroutine printCollText(self)
|
||||
|
|
|
|||
|
|
@ -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