feature/meshText #57

Merged
JGonzalez merged 10 commits from feature/meshText into development 2026-01-23 15:27:27 +01:00
2 changed files with 35 additions and 1 deletions
Showing only changes of commit 27158c7c1d - Show all commits

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.
Jorge Gonzalez 2026-01-22 18:44:25 +01:00

View file

@ -4,11 +4,24 @@ module moduleMeshOutputText
subroutine writeSpeciesOutput(self, fileID, speciesIndex) subroutine writeSpeciesOutput(self, fileID, speciesIndex)
use moduleMesh use moduleMesh
use moduleOutput use moduleOutput
use moduleRefParam, only: L_ref
implicit none implicit none
class(meshParticles), INTENT(in):: self class(meshParticles), INTENT(in):: self
integer, intent(in):: fileID integer, intent(in):: fileID
integer, intent(in):: speciesIndex 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 end subroutine writeSpeciesOutput
@ -34,10 +47,31 @@ module moduleMeshOutputText
subroutine printOutputText(self) subroutine printOutputText(self)
use moduleMesh use moduleMesh
use moduleSpecies
use moduleMeshInoutCommon
use moduleCaseParam, ONLY: timeStep
implicit none implicit none
class(meshParticles), intent(in):: self 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 end subroutine printOutputText
subroutine printCollText(self) subroutine printCollText(self)

View file

@ -11,7 +11,7 @@ MODULE moduleMeshOutputVTU
WRITE(fileID,"(A)") '<?xml version="1.0"?>' WRITE(fileID,"(A)") '<?xml version="1.0"?>'
WRITE(fileID,"(2X, A)") '<VTKFile type="UnstructuredGrid">' 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, '">' WRITE(fileID,"(6X, A, I10, A, I10, A)") '<Piece NumberOfPoints="', nNodes, '" NumberOfCells="', nCells, '">'
END SUBROUTINE writeHeader END SUBROUTINE writeHeader