Compare commits
No commits in common. "215eb8563f22349626f6d024869fa688af0ddeab" and "38d1d575cbd64310560a7f21ae7ffa6c318d6a9e" have entirely different histories.
215eb8563f
...
38d1d575cb
23 changed files with 3220 additions and 3315 deletions
Binary file not shown.
|
|
@ -398,9 +398,6 @@ make
|
|||
Trigger between writings is the same as in \textbf{triggerOutput}.
|
||||
\item \textbf{EMField}: Logical.
|
||||
Determines if the electromagnetic field is printed.
|
||||
\item \textbf{bounraiesParticle}: Logical.
|
||||
Determines if the properties of the boundaries are written.
|
||||
\textit{Warning}: Not all particle models produce this output, only those whose properties change during the simulation.
|
||||
\item \textbf{probes}: Array of objects.
|
||||
Defines the probes employed for obtaining the distribution function at specific positions.
|
||||
See Sec.~\ref{sec:probing} for more information.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"path": "./runs/0D_Argon/",
|
||||
"triggerOutput": 1,
|
||||
"numColl": true,
|
||||
"folder": "output"
|
||||
"folder": "test"
|
||||
},
|
||||
"reference": {
|
||||
"density": 1.0e16,
|
||||
|
|
|
|||
1002
runs/0D_Argon/output/OUTPUT_Argon+.dat
Normal file
1002
runs/0D_Argon/output/OUTPUT_Argon+.dat
Normal file
File diff suppressed because it is too large
Load diff
1002
runs/0D_Argon/output/OUTPUT_Argon.dat
Normal file
1002
runs/0D_Argon/output/OUTPUT_Argon.dat
Normal file
File diff suppressed because it is too large
Load diff
1002
runs/0D_Argon/output/OUTPUT_Collisions.dat
Normal file
1002
runs/0D_Argon/output/OUTPUT_Collisions.dat
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,2 +0,0 @@
|
|||
"L_ref","v_ref","ti_ref","Vol_ref","EF_ref","Volt_ref","B_ref"
|
||||
7.433780E-005,1.554141E+003,4.783208E-008,4.107987E-013,1.345150E+004,9.999550E-001,8.655264E+000
|
||||
|
|
|
@ -6,6 +6,7 @@ OBJECTS = $(OBJDIR)/moduleMesh.o $(OBJDIR)/moduleMeshCommon.o $(OBJDIR)/moduleCo
|
|||
$(OBJDIR)/moduleCollisions.o $(OBJDIR)/moduleTable.o $(OBJDIR)/moduleParallel.o \
|
||||
$(OBJDIR)/moduleEM.o $(OBJDIR)/moduleRandom.o $(OBJDIR)/moduleMath.o \
|
||||
$(OBJDIR)/moduleProbe.o $(OBJDIR)/moduleAverage.o $(OBJDIR)/moduleCoulomb.o \
|
||||
$(OBJDIR)/moduleMeshInoutCommon.o \
|
||||
$(OBJDIR)/moduleMeshInputVTU.o $(OBJDIR)/moduleMeshOutputVTU.o \
|
||||
$(OBJDIR)/moduleMeshInputGmsh2.o $(OBJDIR)/moduleMeshOutputGmsh2.o \
|
||||
$(OBJDIR)/moduleMeshInput0D.o $(OBJDIR)/moduleMeshOutput0D.o \
|
||||
|
|
|
|||
|
|
@ -491,8 +491,7 @@ MODULE moduleInput
|
|||
|
||||
CALL config%get(object // '.cpuTime', timeOutput, found)
|
||||
CALL config%get(object // '.numColl', collOutput, found)
|
||||
CALL config%get(object // '.EMField', emOutput, found)
|
||||
call config%get(object // '.boundariesParticle', boundaryParticleOutput, found)
|
||||
CALL config%get(object // '.EMField', emOutput, found)
|
||||
|
||||
CALL config%get(object // '.triggerCPUTime', triggerCPUTime, found)
|
||||
IF (.NOT. found) THEN
|
||||
|
|
@ -1570,29 +1569,35 @@ MODULE moduleInput
|
|||
END SUBROUTINE readParallel
|
||||
|
||||
SUBROUTINE initOutput(inputFile)
|
||||
USE moduleRefParam
|
||||
USE moduleMesh, ONLY: mesh, doubleMesh, pathMeshParticle, pathMeshColl
|
||||
USE moduleOutput, ONLY: createOutputFolder, writeReference, copyFileToOutput, writeCommit
|
||||
USE moduleOutput, ONLY: path, folder
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(:), ALLOCATABLE, INTENT(in):: inputFile
|
||||
INTEGER:: fileReference = 30
|
||||
!If everything is correct, creates the output folder
|
||||
call createOutputFolder()
|
||||
CALL EXECUTE_COMMAND_LINE('mkdir ' // path // folder )
|
||||
!Copies input file to output folder
|
||||
call copyFileToOutput(inputFile)
|
||||
CALL EXECUTE_COMMAND_LINE('cp ' // inputFile // ' ' // path // folder)
|
||||
!Copies particle mesh
|
||||
IF (mesh%dimen > 0) THEN
|
||||
call copyFileToOutput(pathMeshParticle)
|
||||
CALL EXECUTE_COMMAND_LINE('cp ' // pathMeshParticle // ' ' // path // folder)
|
||||
IF (doubleMesh) THEN
|
||||
call copyFileToOutput(pathMeshColl)
|
||||
CALL EXECUTE_COMMAND_LINE('cp ' // pathMeshColl // ' ' // path // folder)
|
||||
|
||||
END IF
|
||||
|
||||
END IF
|
||||
|
||||
! Write commit of fpakc
|
||||
call writeCommit()
|
||||
CALL SYSTEM('git rev-parse HEAD > ' // path // folder // '/' // 'fpakc_commit.txt')
|
||||
|
||||
call writeReference()
|
||||
! Write file with reference values
|
||||
OPEN (fileReference, file=path // folder // '/' // 'reference.txt')
|
||||
WRITE(fileReference, "(7(1X,A20))") 'L_ref', 'v_ref', 'ti_ref', 'Vol_ref', 'EF_ref', 'Volt_ref', 'B_ref'
|
||||
WRITE(fileReference, "(7(1X,ES20.6E3))") L_ref, v_ref, ti_ref, Vol_ref, EF_ref, Volt_ref, B_ref
|
||||
CLOSE(fileReference)
|
||||
|
||||
END SUBROUTINE initOutput
|
||||
|
||||
|
|
|
|||
|
|
@ -15,24 +15,22 @@ MODULE moduleMeshOutput0D
|
|||
CHARACTER(:), ALLOCATABLE:: fileName
|
||||
|
||||
DO i = 1, nSpecies
|
||||
fileName = formatFileName('Output', species(i)%obj%name, 'csv')
|
||||
fileName='OUTPUT_' // species(i)%obj%name // '.dat'
|
||||
IF (timeStep == 0) THEN
|
||||
OPEN(20, file = generateFilePath(fileName), action = 'write')
|
||||
WRITE(20, "(*("//fmtColStr//"))")'"t (s)"','"density (m^-3)"', &
|
||||
'"velocity (m/s):0"', '"velocity (m/s):1"', '"velocity (m/s):2"', &
|
||||
'"pressure (Pa)"', &
|
||||
'"temperature (K)"'
|
||||
call informFileCreation(fileName)
|
||||
OPEN(20, file = path // folder // '/' // fileName, action = 'write')
|
||||
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)
|
||||
|
||||
END IF
|
||||
|
||||
OPEN(20, file = generateFilePath(fileName), position = 'append', action = 'write')
|
||||
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, "(*("//fmtColReal//"))") REAL(timeStep)*tauMin*ti_ref, output%density, &
|
||||
output%velocity, &
|
||||
output%pressure, &
|
||||
output%temperature
|
||||
WRITE(20, "(7(ES20.6E3))") REAL(timeStep)*tauMin*ti_ref, output%density, &
|
||||
output%velocity, &
|
||||
output%pressure, &
|
||||
output%temperature
|
||||
CLOSE(20)
|
||||
|
||||
END DO
|
||||
|
|
@ -51,22 +49,17 @@ MODULE moduleMeshOutput0D
|
|||
CHARACTER(:), ALLOCATABLE:: fileName
|
||||
INTEGER:: k
|
||||
|
||||
fileName = formatFileName('Output', 'Collisions', 'csv')
|
||||
fileName='OUTPUT_Collisions.dat'
|
||||
IF (timeStep == tInitial) THEN
|
||||
OPEN(20, file = generateFilePath(fileName), action = 'write')
|
||||
call informFileCreation(fileName)
|
||||
WRITE(20, "(A,A)", advance='no') "t (s)", ','
|
||||
do k = 1, nCollPairs-1
|
||||
write(20, '(A,A,I3,A,A)', advance='no') '"',"pair", k, '"', ','
|
||||
|
||||
end do
|
||||
write(20, "(A,A,I3,A)", advance='no') '"',"pair",k, '"'
|
||||
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 = generateFilePath(fileName), position = 'append', action = 'write')
|
||||
WRITE(20, "("//fmtColReal//", *("//fmtColInt//"))") REAL(timeStep)*tauMin*ti_ref, (self%cells(1)%obj%tallyColl(k)%tally, k=1,nCollPairs)
|
||||
OPEN(20, file = path // folder // '/' // fileName, position = 'append', action = 'write')
|
||||
WRITE(20, "(ES20.6E3, 10I20)") REAL(timeStep)*tauMin*ti_ref, (self%cells(1)%obj%tallyColl(k)%tally, k=1,nCollPairs)
|
||||
CLOSE(20)
|
||||
|
||||
END SUBROUTINE printColl0D
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ MODULE moduleMeshOutputGmsh2
|
|||
!Node data subroutines
|
||||
!Header
|
||||
SUBROUTINE writeGmsh2HeaderNodeData(fileID, title, iteration, time, dimensions, nNodes)
|
||||
use moduleOutput
|
||||
IMPLICIT NONE
|
||||
|
||||
INTEGER, INTENT(in):: fileID
|
||||
|
|
@ -26,14 +25,14 @@ MODULE moduleMeshOutputGmsh2
|
|||
|
||||
|
||||
WRITE(fileID, "(A)") '$NodeData'
|
||||
WRITE(fileID, "("//fmtInt//")") 1
|
||||
WRITE(fileID, "(I10)") 1
|
||||
WRITE(fileID, "(A1, A, A1)") '"' , title , '"'
|
||||
WRITE(fileID, "("//fmtInt//")") 1
|
||||
WRITE(fileID, "("//fmtReal//")") time
|
||||
WRITE(fileID, "("//fmtInt//")") 3
|
||||
WRITE(fileID, "("//fmtInt//")") iteration
|
||||
WRITE(fileID, "("//fmtInt//")") dimensions
|
||||
WRITE(fileID, "("//fmtInt//")") nNodes
|
||||
WRITE(fileID, "(I10)") 1
|
||||
WRITE(fileID, "(ES20.6E3)") time
|
||||
WRITE(fileID, "(I10)") 3
|
||||
WRITE(fileID, "(I10)") iteration
|
||||
WRITE(fileID, "(I10)") dimensions
|
||||
WRITE(fileID, "(I10)") nNodes
|
||||
|
||||
END SUBROUTINE writeGmsh2HeaderNodeData
|
||||
|
||||
|
|
@ -50,7 +49,6 @@ MODULE moduleMeshOutputGmsh2
|
|||
!Element data subroutines
|
||||
!Header
|
||||
SUBROUTINE writeGmsh2HeaderElementData(fileID, title, iteration, time, dimensions, nVols)
|
||||
use moduleOutput
|
||||
IMPLICIT NONE
|
||||
|
||||
INTEGER, INTENT(in):: fileID
|
||||
|
|
@ -60,14 +58,14 @@ MODULE moduleMeshOutputGmsh2
|
|||
|
||||
|
||||
WRITE(fileID, "(A)") '$ElementData'
|
||||
WRITE(fileID, "("//fmtInt//")") 1
|
||||
WRITE(fileID, "(I10)") 1
|
||||
WRITE(fileID, "(A1, A, A1)") '"' , title , '"'
|
||||
WRITE(fileID, "("//fmtInt//")") 1
|
||||
WRITE(fileID, "("//fmtReal//")") time
|
||||
WRITE(fileID, "("//fmtInt//")") 3
|
||||
WRITE(fileID, "("//fmtInt//")") iteration
|
||||
WRITE(fileID, "("//fmtInt//")") dimensions
|
||||
WRITE(fileID, "("//fmtInt//")") nVols
|
||||
WRITE(fileID, "(I10)") 1
|
||||
WRITE(fileID, "(ES20.6E3)") time
|
||||
WRITE(fileID, "(I10)") 3
|
||||
WRITE(fileID, "(I10)") iteration
|
||||
WRITE(fileID, "(I10)") dimensions
|
||||
WRITE(fileID, "(I10)") nVols
|
||||
|
||||
END SUBROUTINE writeGmsh2HeaderElementData
|
||||
|
||||
|
|
@ -87,6 +85,7 @@ MODULE moduleMeshOutputGmsh2
|
|||
USE moduleRefParam
|
||||
USE moduleSpecies
|
||||
USE moduleOutput
|
||||
USE moduleMeshInoutCommon
|
||||
USE moduleCaseParam, ONLY: timeStep
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
@ -100,33 +99,33 @@ MODULE moduleMeshOutputGmsh2
|
|||
|
||||
DO i = 1, nSpecies
|
||||
fileName = formatFileName(prefix, species(i)%obj%name, 'msh', timeStep)
|
||||
call informFileCreation(fileName)
|
||||
OPEN (60, file = generateFilePath(fileName))
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
OPEN (60, file = path // folder // '/' // fileName)
|
||||
|
||||
CALL writeGmsh2HeaderMesh(60)
|
||||
|
||||
CALL writeGmsh2HeaderNodeData(60, species(i)%obj%name // ' density (m^-3)', timeStep, time, 1, self%numNodes)
|
||||
DO n=1, self%numNodes
|
||||
CALL calculateOutput(self%nodes(n)%obj%output(i), output(n), self%nodes(n)%obj%v, species(i)%obj)
|
||||
WRITE(60, "(I6,"//fmtReal//")") n, output(n)%density
|
||||
WRITE(60, "(I6,ES20.6E3)") n, output(n)%density
|
||||
END DO
|
||||
CALL writeGmsh2FooterNodeData(60)
|
||||
|
||||
CALL writeGmsh2HeaderNodeData(60, species(i)%obj%name // ' velocity (m s^-1)', timeStep, time, 3, self%numNodes)
|
||||
DO n=1, self%numNodes
|
||||
WRITE(60, "(I6,3("//fmtReal//"))") n, output(n)%velocity
|
||||
WRITE(60, "(I6,3(ES20.6E3))") n, output(n)%velocity
|
||||
END DO
|
||||
CALL writeGmsh2FooterNodeData(60)
|
||||
|
||||
CALL writeGmsh2HeaderNodeData(60, species(i)%obj%name // ' Pressure (Pa)', timeStep, time, 1, self%numNodes)
|
||||
DO n=1, self%numNodes
|
||||
WRITE(60, "(I6,3("//fmtReal//"))") n, output(n)%pressure
|
||||
WRITE(60, "(I6,3(ES20.6E3))") n, output(n)%pressure
|
||||
END DO
|
||||
CALL writeGmsh2FooterNodeData(60)
|
||||
|
||||
CALL writeGmsh2HeaderNodeData(60, species(i)%obj%name // ' Temperature (K)', timeStep, time, 1, self%numNodes)
|
||||
DO n=1, self%numNodes
|
||||
WRITE(60, "(I6,3("//fmtReal//"))") n, output(n)%temperature
|
||||
WRITE(60, "(I6,3(ES20.6E3))") n, output(n)%temperature
|
||||
END DO
|
||||
CALL writeGmsh2FooterNodeData(60)
|
||||
CLOSE (60)
|
||||
|
|
@ -142,6 +141,7 @@ MODULE moduleMeshOutputGmsh2
|
|||
USE moduleCaseParam
|
||||
USE moduleCollisions
|
||||
USE moduleOutput
|
||||
USE moduleMeshInoutCommon
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshGeneric), INTENT(in):: self
|
||||
|
|
@ -169,8 +169,8 @@ MODULE moduleMeshOutputGmsh2
|
|||
time = DBLE(timeStep)*tauMin*ti_ref
|
||||
|
||||
fileName = formatFileName(prefix, 'Collisions', 'msh', timeStep)
|
||||
call informFileCreation(fileName)
|
||||
OPEN (60, file = generateFilePath(fileName))
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
OPEN (60, file = path // folder // '/' // fileName)
|
||||
|
||||
CALL writeGmsh2HeaderMesh(60)
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ MODULE moduleMeshOutputGmsh2
|
|||
title = '"Pair ' // interactionMatrix(k)%sp_i%name // '-' // interactionMatrix(k)%sp_j%name // ' collision ' // cString
|
||||
CALL writeGmsh2HeaderElementData(60, title, timeStep, time, 1, self%numCells)
|
||||
DO n=1, self%numCells
|
||||
WRITE(60, "(I6,"//fmtInt//")") n + numEdges, self%cells(n)%obj%tallyColl(k)%tally(c)
|
||||
WRITE(60, "(I6,I10)") n + numEdges, self%cells(n)%obj%tallyColl(k)%tally(c)
|
||||
END DO
|
||||
CALL writeGmsh2FooterElementData(60)
|
||||
|
||||
|
|
@ -200,6 +200,7 @@ MODULE moduleMeshOutputGmsh2
|
|||
USE moduleRefParam
|
||||
USE moduleCaseParam
|
||||
USE moduleOutput
|
||||
USE moduleMeshInoutCommon
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshParticles), INTENT(in):: self
|
||||
|
|
@ -214,8 +215,8 @@ MODULE moduleMeshOutputGmsh2
|
|||
time = DBLE(timeStep)*tauMin*ti_ref
|
||||
|
||||
fileName = formatFileName(prefix, 'EMField', 'msh', timeStep)
|
||||
call informFileCreation(fileName)
|
||||
OPEN (20, file = generateFilePath(fileName))
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
OPEN (20, file = path // folder // '/' // fileName)
|
||||
|
||||
CALL writeGmsh2HeaderMesh(20)
|
||||
|
||||
|
|
@ -250,6 +251,7 @@ MODULE moduleMeshOutputGmsh2
|
|||
USE moduleSpecies
|
||||
USE moduleOutput
|
||||
USE moduleAverage
|
||||
USE moduleMeshInoutCommon
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshParticles), INTENT(in):: self
|
||||
|
|
@ -260,12 +262,12 @@ MODULE moduleMeshOutputGmsh2
|
|||
|
||||
DO i = 1, nSpecies
|
||||
fileName = formatFileName('Average_mean', species(i)%obj%name, 'msh')
|
||||
call informFileCreation(fileName)
|
||||
OPEN (fileMean, file = generateFilePath(fileName))
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
OPEN (fileMean, file = path // folder // '/' // fileName)
|
||||
|
||||
fileName = formatFileName('Average_deviation', species(i)%obj%name, 'msh')
|
||||
call informFileCreation(fileName)
|
||||
OPEN (filedeviation, file = generateFilePath(fileName))
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
OPEN (filedeviation, file = path // folder // '/' // fileName)
|
||||
|
||||
CALL writeGmsh2HeaderMesh(fileMean)
|
||||
CALL writeGmsh2HeaderMesh(fileDeviation)
|
||||
|
|
@ -274,9 +276,9 @@ MODULE moduleMeshOutputGmsh2
|
|||
CALL writeGmsh2HeaderNodeData(fileDeviation, species(i)%obj%name // ' density, sd (m^-3)', 0, 0.D0, 1, self%numNodes)
|
||||
DO n=1, self%numNodes
|
||||
CALL calculateOutput(averageScheme(n)%mean%output(i), outputMean(n), self%nodes(n)%obj%v, species(i)%obj)
|
||||
WRITE(fileMean, "(I6,"//fmtReal//")") n, outputMean(n)%density
|
||||
WRITE(fileMean, "(I6,ES20.6E3)") n, outputMean(n)%density
|
||||
CALL calculateOutput(averageScheme(n)%deviation%output(i), outputDeviation(n), self%nodes(n)%obj%v, species(i)%obj)
|
||||
WRITE(fileDeviation, "(I6,"//fmtReal//")") n, outputDeviation(n)%density
|
||||
WRITE(fileDeviation, "(I6,ES20.6E3)") n, outputDeviation(n)%density
|
||||
END DO
|
||||
CALL writeGmsh2FooterNodeData(fileMean)
|
||||
CALL writeGmsh2FooterNodeData(fileDeviation)
|
||||
|
|
@ -284,8 +286,8 @@ MODULE moduleMeshOutputGmsh2
|
|||
CALL writeGmsh2HeaderNodeData(fileMean, species(i)%obj%name // ' velocity, mean (m s^-1)', 0, 0.D0, 3, self%numNodes)
|
||||
CALL writeGmsh2HeaderNodeData(fileDeviation, species(i)%obj%name // ' velocity, sd (m s^-1)', 0, 0.D0, 3, self%numNodes)
|
||||
DO n=1, self%numNodes
|
||||
WRITE(fileMean, "(I6,3("//fmtReal//"))") n, outputMean(n)%velocity
|
||||
WRITE(fileDeviation, "(I6,3("//fmtReal//"))") n, outputDeviation(n)%velocity
|
||||
WRITE(fileMean, "(I6,3(ES20.6E3))") n, outputMean(n)%velocity
|
||||
WRITE(fileDeviation, "(I6,3(ES20.6E3))") n, outputDeviation(n)%velocity
|
||||
END DO
|
||||
CALL writeGmsh2FooterNodeData(fileMean)
|
||||
CALL writeGmsh2FooterNodeData(fileDeviation)
|
||||
|
|
@ -293,8 +295,8 @@ MODULE moduleMeshOutputGmsh2
|
|||
CALL writeGmsh2HeaderNodeData(fileMean, species(i)%obj%name // ' Pressure, mean (Pa)', 0, 0.D0, 1, self%numNodes)
|
||||
CALL writeGmsh2HeaderNodeData(fileDeviation, species(i)%obj%name // ' Pressure, sd (Pa)', 0, 0.D0, 1, self%numNodes)
|
||||
DO n=1, self%numNodes
|
||||
WRITE(fileMean, "(I6,3("//fmtReal//"))") n, outputMean(n)%pressure
|
||||
WRITE(fileDeviation, "(I6,3("//fmtReal//"))") n, outputDeviation(n)%pressure
|
||||
WRITE(fileMean, "(I6,3(ES20.6E3))") n, outputMean(n)%pressure
|
||||
WRITE(fileDeviation, "(I6,3(ES20.6E3))") n, outputDeviation(n)%pressure
|
||||
END DO
|
||||
CALL writeGmsh2FooterNodeData(fileMean)
|
||||
CALL writeGmsh2FooterNodeData(fileDeviation)
|
||||
|
|
@ -302,8 +304,8 @@ MODULE moduleMeshOutputGmsh2
|
|||
CALL writeGmsh2HeaderNodeData(fileMean, species(i)%obj%name // ' Temperature, mean (K)', 0, 0.D0, 1, self%numNodes)
|
||||
CALL writeGmsh2HeaderNodeData(fileDeviation, species(i)%obj%name // ' Temperature, sd (K)', 0, 0.D0, 1, self%numNodes)
|
||||
DO n=1, self%numNodes
|
||||
WRITE(fileMean, "(I6,3("//fmtReal//"))") n, outputMean(n)%temperature
|
||||
WRITE(fileDeviation, "(I6,3("//fmtReal//"))") n, outputDeviation(n)%temperature
|
||||
WRITE(fileMean, "(I6,3(ES20.6E3))") n, outputMean(n)%temperature
|
||||
WRITE(fileDeviation, "(I6,3(ES20.6E3))") n, outputDeviation(n)%temperature
|
||||
END DO
|
||||
CALL writeGmsh2FooterNodeData(fileMean)
|
||||
CALL writeGmsh2FooterNodeData(fileDeviation)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
all: vtu.o gmsh2.o 0D.o text.o
|
||||
|
||||
vtu.o:
|
||||
vtu.o: moduleMeshInoutCommon.o
|
||||
$(MAKE) -C vtu all
|
||||
|
||||
gmsh2.o:
|
||||
|
|
|
|||
27
src/modules/mesh/inout/moduleMeshInoutCommon.f90
Normal file
27
src/modules/mesh/inout/moduleMeshInoutCommon.f90
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
MODULE moduleMeshInoutCommon
|
||||
|
||||
CHARACTER(LEN=4):: prefix = 'Step'
|
||||
|
||||
CONTAINS
|
||||
PURE FUNCTION formatFileName(prefix, suffix, extension, timeStep) RESULT(fileName)
|
||||
USE moduleOutput
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(*), INTENT(in):: prefix, suffix, extension
|
||||
INTEGER, INTENT(in), OPTIONAL:: timeStep
|
||||
CHARACTER (LEN=iterationDigits):: tString
|
||||
CHARACTER(:), ALLOCATABLE:: fileName
|
||||
|
||||
IF (PRESENT(timeStep)) THEN
|
||||
WRITE(tString, iterationFormat) timeStep
|
||||
fileName = prefix // '_' // tString // '_' // suffix // '.' // extension
|
||||
|
||||
ELSE
|
||||
fileName = prefix // '_' // suffix // '.' // extension
|
||||
|
||||
END IF
|
||||
|
||||
END FUNCTION formatFileName
|
||||
|
||||
|
||||
END MODULE moduleMeshInoutCommon
|
||||
|
|
@ -121,6 +121,7 @@ module moduleMeshOutputText
|
|||
subroutine printOutputText(self)
|
||||
use moduleMesh
|
||||
use moduleSpecies
|
||||
use moduleMeshInoutCommon
|
||||
use moduleCaseParam, ONLY: timeStep
|
||||
implicit none
|
||||
|
||||
|
|
@ -133,8 +134,8 @@ module moduleMeshOutputText
|
|||
|
||||
do s = 1, nSpecies
|
||||
fileName = formatFileName(prefix, species(s)%obj%name, 'csv', timeStep)
|
||||
call informFileCreation(fileName)
|
||||
open (fileID, file = generateFilePath(fileName))
|
||||
write(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
open (fileID, file = path // folder // '/' // fileName)
|
||||
|
||||
write(fileID, '(5(A,","),A)') '"Position (m)"', &
|
||||
'"Density (m^-3)"', &
|
||||
|
|
@ -152,6 +153,7 @@ module moduleMeshOutputText
|
|||
subroutine printCollText(self)
|
||||
use moduleMesh
|
||||
use moduleOutput
|
||||
use moduleMeshInoutCommon
|
||||
use moduleCaseParam, only: timeStep
|
||||
implicit none
|
||||
|
||||
|
|
@ -165,8 +167,8 @@ module moduleMeshOutputText
|
|||
|
||||
if (collOutput) then
|
||||
fileName = formatFileName(prefix, 'Collisions', 'csv', timeStep)
|
||||
call informFileCreation(fileName)
|
||||
open (fileID, file = generateFilePath(fileName))
|
||||
write(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
open (fileID, file = path // folder // '/' // fileName)
|
||||
|
||||
write(fileID, '(A)', advance='no') "Cell"
|
||||
do k = 1, nCollPairs
|
||||
|
|
@ -189,6 +191,7 @@ module moduleMeshOutputText
|
|||
|
||||
subroutine printEMText(self)
|
||||
use moduleMesh
|
||||
use moduleMeshInoutCommon
|
||||
use moduleCaseParam, only: timeStep
|
||||
implicit none
|
||||
|
||||
|
|
@ -200,8 +203,8 @@ module moduleMeshOutputText
|
|||
|
||||
if (emOutput) then
|
||||
fileName = formatFileName(prefix, 'EMField', 'csv', timeStep)
|
||||
call informFileCreation(fileName)
|
||||
open (fileID, file = generateFilePath(fileName))
|
||||
write(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
open (fileID, file = path // folder // '/' // fileName)
|
||||
|
||||
write(fileID, '(8(A,","),A)') '"Position (m)"', &
|
||||
'"Potential (V)"', &
|
||||
|
|
@ -219,6 +222,7 @@ module moduleMeshOutputText
|
|||
subroutine printAverageText(self)
|
||||
use moduleMesh
|
||||
use moduleSpecies
|
||||
use moduleMeshInoutCommon
|
||||
implicit none
|
||||
|
||||
class(meshParticles), intent(in):: self
|
||||
|
|
@ -231,8 +235,8 @@ module moduleMeshOutputText
|
|||
|
||||
do s = 1, nSpecies
|
||||
fileNameMean = formatFileName('Average_mean', species(s)%obj%name, 'csv')
|
||||
call informFileCreation(fileNameMean)
|
||||
open (fileIDMean, file = generateFilePath(fileNameMean))
|
||||
write(*, "(6X,A15,A)") "Creating file: ", fileNameMean
|
||||
open (fileIDMean, file = path // folder // '/' // fileNameMean)
|
||||
|
||||
write(fileIDMean, '(5(A,","),A)') '"Position (m)"', &
|
||||
'"Density, mean (m^-3)"', &
|
||||
|
|
@ -240,8 +244,8 @@ module moduleMeshOutputText
|
|||
'"Temperature, mean (K)"'
|
||||
|
||||
fileNameDeviation = formatFileName('Average_deviation', species(s)%obj%name, 'csv')
|
||||
call informFileCreation(fileNameDeviation)
|
||||
open (fileIDDeviation, file = generateFilePath(fileNameDeviation))
|
||||
write(*, "(6X,A15,A)") "Creating file: ", fileNameDeviation
|
||||
open (fileIDDeviation, file = path // folder // '/' // fileNameDeviation)
|
||||
|
||||
write(fileIDDeviation, '(5(A,","),A)') '"Position (m)"', &
|
||||
'"Density, deviation (m^-3)"', &
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ MODULE moduleMeshOutputVTU
|
|||
WRITE(fileID,"(A)") '<?xml version="1.0"?>'
|
||||
WRITE(fileID,"(2X, A)") '<VTKFile type="UnstructuredGrid">'
|
||||
WRITE(fileID,"(4X, A)") '<UnstructuredGrid>'
|
||||
WRITE(fileID,"(6X, A, "//fmtInt//", A, "//fmtInt//", A)") '<Piece NumberOfPoints="', nNodes, '" NumberOfCells="', nCells, '">'
|
||||
WRITE(fileID,"(6X, A, I10, A, I10, A)") '<Piece NumberOfPoints="', nNodes, '" NumberOfCells="', nCells, '">'
|
||||
|
||||
END SUBROUTINE writeHeader
|
||||
|
||||
|
|
@ -87,14 +87,14 @@ MODULE moduleMeshOutputVTU
|
|||
!Write nodes coordinates
|
||||
WRITE(fileID, "(8X, A)") '<Points>'
|
||||
WRITE(fileID, "(10X,A)") '<DataArray type="Float32" NumberOfComponents="3" format="ascii">'
|
||||
WRITE(fileID, "(6("//fmtReal//"))") (self%nodes(e)%obj%getCoordinates()*L_ref, e = 1, self%numNodes)
|
||||
WRITE(fileID, "(6(ES20.6E3))") (self%nodes(e)%obj%getCoordinates()*L_ref, e = 1, self%numNodes)
|
||||
WRITE(fileID, "(10X, A)") '</DataArray>'
|
||||
WRITE(fileID, "(8X, A)") '</Points>'
|
||||
|
||||
WRITE(fileID, "(8X, A)") '<Cells>'
|
||||
!Write nodes connectivity of each cell
|
||||
WRITE(fileID, "(10X,A)") '<DataArray type="Int32" Name="connectivity" format="ascii">'
|
||||
WRITE(fileID, "(6("//fmtInt//"))") (self%cells(e)%obj%getNodes(self%cells(e)%obj%nNodes) - 1, e = 1, self%numCells) !Array starts on 0
|
||||
WRITE(fileID, "(6(I10))") (self%cells(e)%obj%getNodes(self%cells(e)%obj%nNodes) - 1, e = 1, self%numCells) !Array starts on 0
|
||||
WRITE(fileID, "(10X, A)") '</DataArray>'
|
||||
!Write offset of each cell
|
||||
offset(1) = self%cells(1)%obj%nNodes
|
||||
|
|
@ -103,7 +103,7 @@ MODULE moduleMeshOutputVTU
|
|||
offset(e) = offset(e - 1) + self%cells(e)%obj%nNodes
|
||||
|
||||
END DO
|
||||
WRITE(fileID, "(6("//fmtInt//"))") offset
|
||||
WRITE(fileID, "(6(I10))") offset
|
||||
WRITE(fileID, "(10X, A)") '</DataArray>'
|
||||
!Write type of each cell
|
||||
WRITE(fileID, "(10X,A)") '<DataArray type="Int32" Name="types" format="ascii">'
|
||||
|
|
@ -111,7 +111,7 @@ MODULE moduleMeshOutputVTU
|
|||
types(e) = getCellType(self%cells(e)%obj)
|
||||
|
||||
END DO
|
||||
WRITE(fileID, "(6("//fmtInt//"))") types
|
||||
WRITE(fileID, "(6(I10))") types
|
||||
WRITE(fileID, "(10X, A)") '</DataArray>'
|
||||
WRITE(fileID, "(8X, A)") '</Cells>'
|
||||
|
||||
|
|
@ -137,19 +137,19 @@ MODULE moduleMeshOutputVTU
|
|||
WRITE(fileID,"(8X,A)") '<PointData>'
|
||||
!Write density
|
||||
WRITE(fileID,"(10X,A)") '<DataArray type="Float64" Name="Density (m^-3)" NumberOfComponents="1">'
|
||||
WRITE(fileID,"(6("//fmtReal//"))") (output(n)%density, n = 1, self%numNodes)
|
||||
WRITE(fileID,"(6(ES20.6E3))") (output(n)%density, n = 1, self%numNodes)
|
||||
WRITE(fileID,"(10X,A)") '</DataArray>'
|
||||
!Write velocity
|
||||
WRITE(fileID,"(10X,A)") '<DataArray type="Float64" Name="Velocity (m s^-1)" NumberOfComponents="3">'
|
||||
WRITE(fileID,"(6("//fmtReal//"))") (output(n)%velocity, n = 1, self%numNodes)
|
||||
WRITE(fileID,"(6(ES20.6E3))") (output(n)%velocity, n = 1, self%numNodes)
|
||||
WRITE(fileID,"(10X,A)") '</DataArray>'
|
||||
!Write pressure
|
||||
WRITE(fileID,"(10X,A)") '<DataArray type="Float64" Name="Pressure (Pa)" NumberOfComponents="1">'
|
||||
WRITE(fileID,"(6("//fmtReal//"))") (output(n)%pressure, n = 1, self%numNodes)
|
||||
WRITE(fileID,"(6(ES20.6E3))") (output(n)%pressure, n = 1, self%numNodes)
|
||||
WRITE(fileID,"(10X,A)") '</DataArray>'
|
||||
!Write temperature
|
||||
WRITE(fileID,"(10X,A)") '<DataArray type="Float64" Name="Temperature (K)" NumberOfComponents="1">'
|
||||
WRITE(fileID,"(6("//fmtReal//"))") (output(n)%temperature, n = 1, self%numNodes)
|
||||
WRITE(fileID,"(6(ES20.6E3))") (output(n)%temperature, n = 1, self%numNodes)
|
||||
WRITE(fileID,"(10X,A)") '</DataArray>'
|
||||
!End node data
|
||||
WRITE(fileID,"(8X,A)") '</PointData>'
|
||||
|
|
@ -173,7 +173,7 @@ MODULE moduleMeshOutputVTU
|
|||
WRITE(cString, "(I2)") c
|
||||
title = 'Pair ' // interactionMatrix(k)%sp_i%name // '-' // interactionMatrix(k)%sp_j%name // ' collision ' // cString
|
||||
WRITE(fileID,"(10X,A, A, A)") '<DataArray type="Float64" Name="',title, '" NumberOfComponents="1">'
|
||||
WRITE(fileID, "(6("//fmtInt//"))") (self%cells(n)%obj%tallyColl(k)%tally(c), n = 1, self%numCells)
|
||||
WRITE(fileID, "(6(I10))") (self%cells(n)%obj%tallyColl(k)%tally(c), n = 1, self%numCells)
|
||||
WRITE(fileID, "(10X, A)") '</DataArray>'
|
||||
|
||||
END DO
|
||||
|
|
@ -196,11 +196,11 @@ MODULE moduleMeshOutputVTU
|
|||
WRITE(fileID,"(8X,A)") '<PointData>'
|
||||
!Electric potential
|
||||
WRITE(fileID,"(10X,A)") '<DataArray type="Float64" Name="Potential (V)" NumberOfComponents="1">'
|
||||
WRITE(fileID,"(6("//fmtReal//"))") (self%nodes(n)%obj%emData%phi*Volt_ref, n = 1, self%numNodes)
|
||||
WRITE(fileID,"(6(ES20.6E3))") (self%nodes(n)%obj%emData%phi*Volt_ref, n = 1, self%numNodes)
|
||||
WRITE(fileID,"(10X,A)") '</DataArray>'
|
||||
!Magnetic Field
|
||||
WRITE(fileID,"(10X,A)") '<DataArray type="Float64" Name="Magnetic Field (T)" NumberOfComponents="3">'
|
||||
WRITE(fileID,"(6("//fmtReal//"))") (self%nodes(n)%obj%emData%B*B_ref, n = 1, self%numNodes)
|
||||
WRITE(fileID,"(6(ES20.6E3))") (self%nodes(n)%obj%emData%B*B_ref, n = 1, self%numNodes)
|
||||
WRITE(fileID,"(10X,A)") '</DataArray>'
|
||||
WRITE(fileID,"(8X,A)") '</PointData>'
|
||||
|
||||
|
|
@ -209,7 +209,7 @@ MODULE moduleMeshOutputVTU
|
|||
WRITE(fileID,"(8X,A)") '<CellData>'
|
||||
!Electric field
|
||||
WRITE(fileID,"(10X,A, A, A)") '<DataArray type="Float64" Name="Electric Field (V m^-1)" NumberOfComponents="3">'
|
||||
WRITE(fileID,"(6("//fmtReal//"))") (self%cells(n)%obj%gatherElectricField(Xi)*EF_ref, n = 1, self%numCells)
|
||||
WRITE(fileID,"(6(ES20.6E3))") (self%cells(n)%obj%gatherElectricField(Xi)*EF_ref, n = 1, self%numCells)
|
||||
WRITE(fileID,"(10X,A)") '</DataArray>'
|
||||
WRITE(fileID,"(8X,A)") '</CellData>'
|
||||
|
||||
|
|
@ -221,31 +221,30 @@ MODULE moduleMeshOutputVTU
|
|||
USE moduleRefParam
|
||||
IMPLICIT NONE
|
||||
|
||||
INTEGER, intent(in):: fileID
|
||||
CHARACTER(*), intent(in):: fileNameStep, fileNameCollection
|
||||
INTEGER:: fileID
|
||||
CHARACTER(*):: fileNameStep, fileNameCollection
|
||||
|
||||
IF (timeStep == tInitial) THEN
|
||||
!Create collection file
|
||||
call informFileCreation(fileNameCollection)
|
||||
OPEN (fileID + 1, file = generateFilePath(fileNameCollection))
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileNameCollection
|
||||
OPEN (fileID + 1, file = path // folder // '/' // fileNameCollection)
|
||||
WRITE (fileID + 1, "(A)") '<VTKFile type="Collection">'
|
||||
WRITE (fileID + 1, "(2X, A)") '<Collection>'
|
||||
|
||||
else
|
||||
OPEN (fileID + 1, file = generateFilePath(fileNameCollection), ACCESS='APPEND')
|
||||
! Append removing the last two lines that close the <tags>
|
||||
backspace(fileID + 1)
|
||||
backspace(fileID + 1)
|
||||
CLOSE(fileID + 1)
|
||||
|
||||
END IF
|
||||
|
||||
!Write iteration file in collection
|
||||
WRITE(fileID + 1, "(4X, A, "//fmtReal//", A, A, A)") &
|
||||
OPEN (fileID + 1, file = path // folder // '/' // fileNameCollection, ACCESS='APPEND')
|
||||
WRITE(fileID + 1, "(4X, A, ES20.6E3, A, A, A)") &
|
||||
'<DataSet timestep="', DBLE(timeStep)*tauMin*ti_ref,'" file="', fileNameStep,'"/>'
|
||||
|
||||
WRITE (fileID + 1, "(2X, A)") '</Collection>'
|
||||
WRITE (fileID + 1, "(A)") '</VTKFile>'
|
||||
!Close collection file
|
||||
IF (timeStep == tFinal) THEN
|
||||
WRITE (fileID + 1, "(2X, A)") '</Collection>'
|
||||
WRITE (fileID + 1, "(A)") '</VTKFile>'
|
||||
|
||||
END IF
|
||||
CLOSE(fileID + 1)
|
||||
|
||||
END SUBROUTINE writeCollection
|
||||
|
|
@ -277,29 +276,29 @@ MODULE moduleMeshOutputVTU
|
|||
!Write density
|
||||
WRITE(fileIDMean, "(10X,A)") '<DataArray type="Float64" Name="Density, mean (m^-3)" NumberOfComponents="1">'
|
||||
WRITE(fileIDDeviation,"(10X,A)") '<DataArray type="Float64" Name="Density, deviation (m^-3)" NumberOfComponents="1">'
|
||||
WRITE(fileIDMean, "(6("//fmtReal//"))") (outputMean(n)%density, n = 1, self%numNodes)
|
||||
WRITE(fileIDDeviation,"(6("//fmtReal//"))") (outputDeviation(n)%density, n = 1, self%numNodes)
|
||||
WRITE(fileIDMean, "(6(ES20.6E3))") (outputMean(n)%density, n = 1, self%numNodes)
|
||||
WRITE(fileIDDeviation,"(6(ES20.6E3))") (outputDeviation(n)%density, n = 1, self%numNodes)
|
||||
WRITE(fileIDMean,"(10X,A)") '</DataArray>'
|
||||
WRITE(fileIDDeviation,"(10X,A)") '</DataArray>'
|
||||
!Write velocity
|
||||
WRITE(fileIDMean, "(10X,A)") '<DataArray type="Float64" Name="Velocity, mean (m s^-1)" NumberOfComponents="3">'
|
||||
WRITE(fileIDDeviation,"(10X,A)") '<DataArray type="Float64" Name="Velocity, deviation (m s^-1)" NumberOfComponents="3">'
|
||||
WRITE(fileIDMean, "(6("//fmtReal//"))") (outputMean(n)%velocity, n = 1, self%numNodes)
|
||||
WRITE(fileIDDeviation,"(6("//fmtReal//"))") (outputDeviation(n)%velocity, n = 1, self%numNodes)
|
||||
WRITE(fileIDMean, "(6(ES20.6E3))") (outputMean(n)%velocity, n = 1, self%numNodes)
|
||||
WRITE(fileIDDeviation,"(6(ES20.6E3))") (outputDeviation(n)%velocity, n = 1, self%numNodes)
|
||||
WRITE(fileIDMean, "(10X,A)") '</DataArray>'
|
||||
WRITE(fileIDDeviation,"(10X,A)") '</DataArray>'
|
||||
!Write pressure
|
||||
WRITE(fileIDMean, "(10X,A)") '<DataArray type="Float64" Name="Pressure, mean (Pa)" NumberOfComponents="1">'
|
||||
WRITE(fileIDDeviation,"(10X,A)") '<DataArray type="Float64" Name="Pressure, deviation (Pa)" NumberOfComponents="1">'
|
||||
WRITE(fileIDMean, "(6("//fmtReal//"))") (outputMean(n)%pressure, n = 1, self%numNodes)
|
||||
WRITE(fileIDDeviation,"(6("//fmtReal//"))") (outputDeviation(n)%pressure, n = 1, self%numNodes)
|
||||
WRITE(fileIDMean, "(6(ES20.6E3))") (outputMean(n)%pressure, n = 1, self%numNodes)
|
||||
WRITE(fileIDDeviation,"(6(ES20.6E3))") (outputDeviation(n)%pressure, n = 1, self%numNodes)
|
||||
WRITE(fileIDMean, "(10X,A)") '</DataArray>'
|
||||
WRITE(fileIDDeviation,"(10X,A)") '</DataArray>'
|
||||
!Write temperature
|
||||
WRITE(fileIDMean, "(10X,A)") '<DataArray type="Float64" Name="Temperature, mean (K)" NumberOfComponents="1">'
|
||||
WRITE(fileIDDeviation,"(10X,A)") '<DataArray type="Float64" Name="Temperature, deviation (K)" NumberOfComponents="1">'
|
||||
WRITE(fileIDMean, "(6("//fmtReal//"))") (outputMean(n)%temperature, n = 1, self%numNodes)
|
||||
WRITE(fileIDDeviation,"(6("//fmtReal//"))") (outputDeviation(n)%temperature, n = 1, self%numNodes)
|
||||
WRITE(fileIDMean, "(6(ES20.6E3))") (outputMean(n)%temperature, n = 1, self%numNodes)
|
||||
WRITE(fileIDDeviation,"(6(ES20.6E3))") (outputDeviation(n)%temperature, n = 1, self%numNodes)
|
||||
WRITE(fileIDMean, "(10X,A)") '</DataArray>'
|
||||
WRITE(fileIDDeviation,"(10X,A)") '</DataArray>'
|
||||
!End node data
|
||||
|
|
@ -311,6 +310,7 @@ MODULE moduleMeshOutputVTU
|
|||
SUBROUTINE printOutputVTU(self)
|
||||
USE moduleMesh
|
||||
USE moduleSpecies
|
||||
USE moduleMeshInoutCommon
|
||||
USE moduleCaseParam, ONLY: timeStep
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
@ -322,8 +322,8 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
DO i = 1, nSpecies
|
||||
fileName = formatFileName(prefix, species(i)%obj%name, 'vtu', timeStep)
|
||||
call informFileCreation(fileName)
|
||||
OPEN (fileID, file = generateFilePath(fileName))
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
OPEN (fileID, file = path // folder // '/' // fileName)
|
||||
|
||||
CALL writeHeader(self%numNodes, self%numCells, fileID)
|
||||
|
||||
|
|
@ -346,6 +346,7 @@ MODULE moduleMeshOutputVTU
|
|||
SUBROUTINE printCollVTU(self)
|
||||
USE moduleMesh
|
||||
USE moduleOutput
|
||||
USE moduleMeshInoutCommon
|
||||
USE moduleCaseParam, ONLY: timeStep
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
@ -357,8 +358,8 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
IF (collOutput) THEN
|
||||
fileName = formatFileName(prefix, 'Collisions', 'vtu', timeStep)
|
||||
call informFileCreation(fileName)
|
||||
OPEN (fileID, file = generateFilePath(fileName))
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
OPEN (fileID, file = path // folder // '/' // fileName)
|
||||
|
||||
CALL writeHeader(self%numNodes, self%numCells, fileID)
|
||||
|
||||
|
|
@ -380,6 +381,7 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
SUBROUTINE printEMVTU(self)
|
||||
USE moduleMesh
|
||||
USE moduleMeshInoutCommon
|
||||
USE moduleCaseParam, ONLY: timeStep
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
@ -391,8 +393,8 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
IF (emOutput) THEN
|
||||
fileName = formatFileName(prefix, 'EMField', 'vtu', timeStep)
|
||||
call informFileCreation(fileName)
|
||||
OPEN (fileID, file = generateFilePath(fileName))
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
OPEN (fileID, file = path // folder // '/' // fileName)
|
||||
|
||||
CALL writeHeader(self%numNodes, self%numCells, fileID)
|
||||
|
||||
|
|
@ -414,8 +416,8 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
SUBROUTINE printAverageVTU(self)
|
||||
USE moduleMesh
|
||||
use moduleOutput
|
||||
USE moduleSpecies
|
||||
USE moduleMeshInoutCommon
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshParticles), INTENT(in):: self
|
||||
|
|
@ -427,12 +429,12 @@ MODULE moduleMeshOutputVTU
|
|||
|
||||
DO i = 1, nSpecies
|
||||
fileNameMean = formatFileName('Average_mean', species(i)%obj%name, 'vtu')
|
||||
call informFileCreation(fileNameMean)
|
||||
OPEN (fileIDMean, file = generateFilePath(fileNameMean))
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileNameMean
|
||||
OPEN (fileIDMean, file = path // folder // '/' // fileNameMean)
|
||||
|
||||
fileNameDeviation = formatFileName('Average_deviation', species(i)%obj%name, 'vtu')
|
||||
call informFileCreation(fileNameDeviation)
|
||||
OPEN (fileIDDeviation, file = generateFilePath(fileNameDeviation))
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileNameDeviation
|
||||
OPEN (fileIDDeviation, file = path // folder // '/' // fileNameDeviation)
|
||||
|
||||
CALL writeHeader(self%numNodes, self%numCells, fileIDMean)
|
||||
CALL writeHeader(self%numNodes, self%numCells, fileIDDeviation)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ MODULE moduleMesh
|
|||
USE moduleOutput
|
||||
USE moduleCollisions
|
||||
use moduleSpecies, only: nSpecies
|
||||
IMPLICIT NONE
|
||||
|
||||
! MESH ELEMENTS
|
||||
!Generic mesh element
|
||||
|
|
@ -709,11 +710,10 @@ MODULE moduleMesh
|
|||
end subroutine updateParticle_interface
|
||||
|
||||
! Update the values of the particle boundary model
|
||||
subroutine printParticle_interface(self, fileID)
|
||||
subroutine printParticle_interface(self)
|
||||
import boundaryParticleGeneric
|
||||
|
||||
class(boundaryParticleGeneric), intent(in):: self
|
||||
integer, intent(in):: fileID
|
||||
class(boundaryParticleGeneric), intent(inout):: self
|
||||
|
||||
end subroutine printParticle_interface
|
||||
|
||||
|
|
@ -887,16 +887,12 @@ MODULE moduleMesh
|
|||
!Array for boundaries
|
||||
type(boundaryParticleCont), allocatable, target:: boundariesParticle(:)
|
||||
|
||||
! Update the particle boundary models
|
||||
interface
|
||||
! Update the particle boundary models
|
||||
module subroutine boundariesParticle_update()
|
||||
|
||||
end subroutine boundariesParticle_update
|
||||
|
||||
! Write data about particle boundaries
|
||||
module subroutine boundariesParticle_write()
|
||||
|
||||
end subroutine boundariesParticle_write
|
||||
end interface
|
||||
|
||||
! BOUNDARY ELECTROMAGNETIC DEFINITIONS
|
||||
|
|
|
|||
|
|
@ -404,21 +404,16 @@ submodule(moduleMesh) boundaryParticle
|
|||
|
||||
end subroutine quasiNeutrality_update
|
||||
|
||||
subroutine quasiNeutrality_print(self, fileID)
|
||||
subroutine quasiNeutrality_print(self)
|
||||
implicit none
|
||||
|
||||
class(boundaryParticleGeneric), intent(in):: self
|
||||
integer, intent(in):: fileID
|
||||
integer:: e
|
||||
class(boundaryParticleGeneric), intent(inout):: self
|
||||
|
||||
print *, 'test'
|
||||
|
||||
write(fileID, '(A)') self%name
|
||||
select type(self)
|
||||
type is(boundaryQuasiNeutrality)
|
||||
write(fileID, '(A,",",A)') '"Edge id"', '"alpha"'
|
||||
do e = 1, size(self%edges)
|
||||
write(fileID, '(I0,",",ES0.6E3)') self%edges(e)%obj%n, self%alpha(self%edges(e)%obj%n)
|
||||
|
||||
end do
|
||||
print*, self%alpha
|
||||
|
||||
end select
|
||||
|
||||
|
|
@ -475,33 +470,6 @@ submodule(moduleMesh) boundaryParticle
|
|||
|
||||
end do
|
||||
|
||||
end subroutine boundariesParticle_update
|
||||
|
||||
module subroutine boundariesParticle_write()
|
||||
use moduleCaseparam, only: timeStep
|
||||
use moduleOutput, only:fileID_boundaryParticle, formatFileName, informFileCreation
|
||||
implicit none
|
||||
|
||||
integer:: b
|
||||
character(:), allocatable:: fileName
|
||||
|
||||
if (boundaryParticleOutput) then
|
||||
fileName = formatFileName(prefix, 'boundariesParticle', 'csv', timeStep)
|
||||
call informFileCreation(fileName)
|
||||
open(fileID_boundaryParticle, file = path // folder // '/' // fileName)
|
||||
|
||||
do b = 1, nBoundariesParticle
|
||||
if (associated(boundariesParticle(b)%obj%print)) then
|
||||
call boundariesParticle(b)%obj%print(fileID_boundaryParticle)
|
||||
|
||||
end if
|
||||
|
||||
end do
|
||||
|
||||
close(fileID_boundaryParticle)
|
||||
|
||||
end if
|
||||
|
||||
end subroutine boundariesParticle_write
|
||||
end subroutine boundariesParticle_update
|
||||
|
||||
end submodule boundaryParticle
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ MODULE moduleProbe
|
|||
WRITE(pstring, "(I3.3)") self%id
|
||||
fileName='Probe_' // tstring// '_f_' // pstring // '.dat'
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
OPEN (10, file = generateFilePath(fileName))
|
||||
OPEN (10, file = path // folder // '/' // fileName)
|
||||
WRITE(10, "(A1, 1X, A)") "# ", self%species%name
|
||||
WRITE(10, "(A6, 3(ES15.6E3), A2)") "# r = ", self%r(:)*L_ref, " m"
|
||||
WRITE(10, "(A6, ES15.6E3, A2)") "# t = ", REAL(timeStep)*tauMin*ti_ref, " s"
|
||||
|
|
@ -216,10 +216,10 @@ MODULE moduleProbe
|
|||
DO i = 1, self%nv(1)
|
||||
DO j = 1, self%nv(2)
|
||||
DO k = 1, self%nv(3)
|
||||
WRITE(10, "(4("//fmtReal//"))") self%vi(i)*v_ref, &
|
||||
self%vj(j)*v_ref, &
|
||||
self%vk(k)*v_ref, &
|
||||
self%f(i, j, k)
|
||||
WRITE(10, "(4(ES20.6E3))") self%vi(i)*v_ref, &
|
||||
self%vj(j)*v_ref, &
|
||||
self%vk(k)*v_ref, &
|
||||
self%f(i, j, k)
|
||||
|
||||
END DO
|
||||
WRITE(10, *)
|
||||
|
|
|
|||
|
|
@ -1,40 +1,6 @@
|
|||
!Contains information about output
|
||||
MODULE moduleOutput
|
||||
! Path and folder for the output
|
||||
CHARACTER(:), ALLOCATABLE:: path
|
||||
CHARACTER(:), ALLOCATABLE:: folder
|
||||
! Number of digits for step files
|
||||
INTEGER:: iterationDigits
|
||||
CHARACTER(:), ALLOCATABLE:: iterationFormat
|
||||
! Triggers and counters for output
|
||||
INTEGER:: triggerOutput, counterOutput = 0
|
||||
INTEGER:: triggerCPUTime, counterCPUTime = 0
|
||||
! logicals to activate file output
|
||||
LOGICAL:: timeOutput = .FALSE.
|
||||
LOGICAL:: collOutput = .FALSE.
|
||||
LOGICAL:: emOutput = .FALSE.
|
||||
logical:: boundaryParticleOutput = .false.
|
||||
|
||||
! Prefix for iteration files
|
||||
character(len=*), parameter:: prefix = 'Step'
|
||||
|
||||
! Column separator
|
||||
character(len=*), parameter:: colSep = '","'
|
||||
|
||||
! General format for file outputs
|
||||
character(len=*), parameter:: fmtColReal = 'ES0.6E3,:,'//colSep ! Column with real
|
||||
character(len=*), parameter:: fmtColInt = 'I0,:,'//colSep ! Column with integer
|
||||
character(len=*), parameter:: fmtColStr = 'A,:,'//colSep ! Column with text
|
||||
character(len=*), parameter:: fmtReal = 'ES14.6E3' ! Fixed size real
|
||||
character(len=*), parameter:: fmtInt = 'I14' ! Fixed size real
|
||||
|
||||
! File IDs for different input/output
|
||||
integer, parameter:: fileID_mesh = 10 ! Base id for mesh files
|
||||
integer, parameter:: fileID_output = 20 ! Base id for species/collisions/EM output
|
||||
integer, parameter:: fileID_boundaryParticle = 30 ! Particle boundaries
|
||||
integer, parameter:: fileID_boundaryEM = 31 ! EM boundaries
|
||||
integer, parameter:: fileID_reference = 40 ! Reference values
|
||||
integer, parameter:: fileID_time =50 ! Computation time
|
||||
IMPLICIT NONE
|
||||
|
||||
!Output for each node
|
||||
TYPE, PUBLIC:: outputNode
|
||||
|
|
@ -67,68 +33,17 @@ MODULE moduleOutput
|
|||
|
||||
END TYPE
|
||||
|
||||
CHARACTER(:), ALLOCATABLE:: path
|
||||
CHARACTER(:), ALLOCATABLE:: folder
|
||||
INTEGER:: iterationDigits
|
||||
CHARACTER(:), ALLOCATABLE:: iterationFormat
|
||||
INTEGER:: triggerOutput, counterOutput = 0
|
||||
INTEGER:: triggerCPUTime, counterCPUTime = 0
|
||||
LOGICAL:: timeOutput = .FALSE.
|
||||
LOGICAL:: collOutput = .FALSE.
|
||||
LOGICAL:: emOutput = .FALSE.
|
||||
|
||||
CONTAINS
|
||||
PURE FUNCTION formatFileName(pref, suff, extension, timeStep) RESULT(fileName)
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(*), INTENT(in):: pref, suff, extension
|
||||
INTEGER, INTENT(in), OPTIONAL:: timeStep
|
||||
CHARACTER (LEN=iterationDigits):: tString
|
||||
CHARACTER(:), ALLOCATABLE:: fileName
|
||||
|
||||
IF (PRESENT(timeStep)) THEN
|
||||
WRITE(tString, iterationFormat) timeStep
|
||||
fileName = pref // '_' // tString // '_' // suff // '.' // extension
|
||||
|
||||
ELSE
|
||||
fileName = pref // '_' // suff // '.' // extension
|
||||
|
||||
END IF
|
||||
|
||||
END FUNCTION formatFileName
|
||||
|
||||
subroutine createOutputFolder()
|
||||
implicit none
|
||||
|
||||
call execute_command_line('mkdir ' // path // folder )
|
||||
|
||||
end subroutine createOutputFolder
|
||||
|
||||
subroutine copyFileToOutput(fileName)
|
||||
implicit none
|
||||
|
||||
character(*), intent(in):: fileName
|
||||
|
||||
call execute_command_line('cp ' // fileName // ' ' // path // folder)
|
||||
|
||||
end subroutine copyFileToOutput
|
||||
|
||||
subroutine writeCommit()
|
||||
implicit none
|
||||
|
||||
call system('git rev-parse HEAD > ' // path // folder // '/' // 'fpakc_commit.txt')
|
||||
|
||||
end subroutine writeCommit
|
||||
|
||||
pure function generateFilePath(filename) result(completePath)
|
||||
implicit none
|
||||
|
||||
character(*), intent(in):: fileName
|
||||
character(:), allocatable:: completePath
|
||||
|
||||
completePath = path // folder // '/' // fileName
|
||||
|
||||
end function generateFilePath
|
||||
|
||||
subroutine informFileCreation(filename)
|
||||
implicit none
|
||||
|
||||
character(*), intent(in):: fileName
|
||||
|
||||
write(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
|
||||
end subroutine informFileCreation
|
||||
|
||||
PURE SUBROUTINE outputNode_equal_outputNode(self, from)
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
@ -244,7 +159,7 @@ MODULE moduleOutput
|
|||
|
||||
END SUBROUTINE calculateOutput
|
||||
|
||||
SUBROUTINE writeTime(first)
|
||||
SUBROUTINE printTime(first)
|
||||
USE moduleSpecies
|
||||
USE moduleCompTime
|
||||
USE moduleCaseParam, ONLY: timeStep
|
||||
|
|
@ -253,43 +168,31 @@ MODULE moduleOutput
|
|||
LOGICAL, INTENT(in), OPTIONAL:: first
|
||||
CHARACTER(:), ALLOCATABLE:: fileName
|
||||
|
||||
fileName = 'cpuTime.csv'
|
||||
fileName = 'cpuTime.dat'
|
||||
|
||||
IF (timeOutput) THEN
|
||||
IF (PRESENT(first)) THEN
|
||||
IF (first) THEN
|
||||
OPEN(fileID_time, file = generateFilePath(fileName), action = 'write')
|
||||
WRITE(fileID_time, "(*("//fmtColStr//"))") "t","n","total (s)","push (s)","reset (s)", &
|
||||
"collision (s)","coulomb (s)", &
|
||||
"weighting (s)","EMField (s)"
|
||||
call informFileCreation(fileName)
|
||||
CLOSE(fileID_time)
|
||||
OPEN(20, file = path // folder // '/' // fileName, action = 'write')
|
||||
WRITE(20, "(A1, 8X, A1, 9X, A1, 7(A20))") "#","t","n","total (s)","push (s)","reset (s)", &
|
||||
"collision (s)","coulomb (s)", &
|
||||
"weighting (s)","EMField (s)"
|
||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||
CLOSE(20)
|
||||
|
||||
END IF
|
||||
|
||||
END IF
|
||||
|
||||
OPEN(fileID_time, file = generateFilePath(fileName), position = 'append', action = 'write')
|
||||
OPEN(20, file = path // folder // '/' // fileName, position = 'append', action = 'write')
|
||||
|
||||
WRITE (fileID_time, "(*("//fmtColInt//"),*("//fmtColReal//"))") timeStep, nPartOld, tStep, tPush, tReset, tColl, tCoul, tWeight, tEMField
|
||||
WRITE (20, "(I10, I10, 7(ES20.6E3))") timeStep, nPartOld, tStep, tPush, tReset, tColl, tCoul, tWeight, tEMField
|
||||
|
||||
CLOSE(fileID_time)
|
||||
CLOSE(20)
|
||||
|
||||
END IF
|
||||
|
||||
END SUBROUTINE writeTime
|
||||
|
||||
! Write file with reference values
|
||||
subroutine writeReference()
|
||||
use moduleRefParam
|
||||
implicit none
|
||||
|
||||
open (fileID_reference, file=generateFilePath('reference.csv'))
|
||||
write(fileID_reference, "(*("//fmtColStr//"))") '"L_ref"','"v_ref"','"ti_ref"','"Vol_ref"','"EF_ref"','"Volt_ref"','"B_ref"'
|
||||
write(fileID_reference, "(*("//fmtColReal//"))") L_ref, v_ref, ti_ref, Vol_ref, EF_ref, Volt_ref, B_ref
|
||||
close(fileID_reference)
|
||||
|
||||
end subroutine writeReference
|
||||
END SUBROUTINE printTime
|
||||
|
||||
END MODULE moduleOutput
|
||||
|
||||
|
|
|
|||
|
|
@ -523,6 +523,8 @@ MODULE moduleSolver
|
|||
USE moduleCaseParam, ONLY: timeStep
|
||||
IMPLICIT NONE
|
||||
|
||||
integer:: b ! TEMPORARY
|
||||
|
||||
CALL outputProbes()
|
||||
|
||||
counterOutput = counterOutput + 1
|
||||
|
|
@ -535,10 +537,6 @@ MODULE moduleSolver
|
|||
CALL mesh%printOutput()
|
||||
IF (ASSOCIATED(meshForMCC)) CALL meshForMCC%printColl()
|
||||
CALL mesh%printEM()
|
||||
|
||||
! Output of boundaries
|
||||
call boundariesParticle_write()
|
||||
|
||||
WRITE(*, "(5X,A21,I10,A1,I10)") "t/tFinal: ", timeStep, "/", tFinal
|
||||
WRITE(*, "(5X,A21,I10)") "Particles: ", nPartOld
|
||||
IF (timeStep == 0) THEN
|
||||
|
|
@ -555,6 +553,17 @@ MODULE moduleSolver
|
|||
END IF
|
||||
WRITE(*,*)
|
||||
|
||||
! TEMPORARY
|
||||
! Output of boundaries. TODO: Move this to mesh module
|
||||
do b = 1, nBoundariesParticle
|
||||
if (associated(boundariesParticle(b)%obj%print)) then
|
||||
print *, b
|
||||
call boundariesParticle(b)%obj%print()
|
||||
|
||||
end if
|
||||
|
||||
end do
|
||||
|
||||
END IF
|
||||
|
||||
counterCPUTime = counterCPUTime + 1
|
||||
|
|
@ -564,7 +573,7 @@ MODULE moduleSolver
|
|||
!Reset CPU Time counter
|
||||
counterCPUTime = 0
|
||||
|
||||
CALL writeTime(timeStep == 0)
|
||||
CALL printTime(timeStep == 0)
|
||||
|
||||
END IF
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue