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.
This commit is contained in:
Jorge Gonzalez 2026-01-22 18:44:25 +01:00
commit 27158c7c1d
2 changed files with 35 additions and 1 deletions

View file

@ -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)