Compare commits

..

No commits in common. "5d82ea2ddcb59a816fa32111b064c46cefe43bce" and "701586fc02c296a781e44cba89649fe0ac6d2c49" have entirely different histories.

16 changed files with 64 additions and 61 deletions

Binary file not shown.

View file

@ -48,9 +48,8 @@
\newglossaryentry{openblas}{name={OpenBLAS},description={Open-source implementation of BLAS and LAPACK APIs}} \newglossaryentry{openblas}{name={OpenBLAS},description={Open-source implementation of BLAS and LAPACK APIs}}
\newglossaryentry{git}{name={Git},description={Git is a distributed version-control system for tracking changes in a set of files}} \newglossaryentry{git}{name={Git},description={Git is a distributed version-control system for tracking changes in a set of files}}
\newglossaryentry{gitlab}{name={GitLab},description={GitLab is a web-based lifecycle tool that provides a \Gls{git}-repository manager}} \newglossaryentry{gitlab}{name={GitLab},description={GitLab is a web-based lifecycle tool that provides a \Gls{git}-repository manager}}
\newglossaryentry{gmsh}{name={Gmsh},description={A three-dimensional finite element mesh generator with built-in pre- and post-processing facilities}} \newglossaryentry{gmsh}{name={Gmsh},description={A three-dimensional finite element mesh generator with built-in pre- and post-processing facilities.}}
\newglossaryentry{gnuplot}{name={Gnuplot},description={A portable command-line driven graphing utility for Linux, OS/2, MS Windows, OSX, VMS, and many other platforms}} \newglossaryentry{gnuplot}{name={Gnuplot},description={A portable command-line driven graphing utility for Linux, OS/2, MS Windows, OSX, VMS, and many other platforms.}}
\newglossaryentry{paraview}{name={ParaView},description={Tool for post-processing and visualizing data from various formats like vtu}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\bibliography{bibliography} \bibliography{bibliography}
@ -847,14 +846,14 @@ make
\chapter{Example runs}\label{ch:exampleRuns} \chapter{Example runs}\label{ch:exampleRuns}
This chapter presents a description of the different example files distributed with \acrshort{fpakc}. This chapter presents a description of the different example files distributed with \acrshort{fpakc}.
All examples in the repository have a \lstinline|README.txt| file and a reference output. All examples in the repository have a \lstinline|README.txt| file and a reference output.
Plotting of the output is done with \Gls{gnuplot} or \Gls{paraview}. Plotting of the output is done with \Gls{gnuplot} or \Gls{gmsh}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{1D Emissive Cathode (1D\_Cathode)} \section{1D Emissive Cathode (1D\_Cathode)}
Emission from a 1D cathode in both, Cartesian and radial coordinates. Emission from a 1D cathode in both, Cartesian and radial coordinates.
Both cases insert the same number of electrons from the minimum coordinate and have the same boundary conditions for particles and the electrostatic field. Both cases insert the same number of electrons from the minimum coordinate and have the same boundary conditions for particles and the electrostatic field.
This case is useful to illustrate how \acrshort{fpakc} can deal with different geometries by just modifying some parameters in the input file. This case is useful to illustrate how \acrshort{fpakc} can deal with different geometries by just modifying some parameters in the input file.
The same mesh file (\lstinline|mesh.csv|) is used for both cases. The same mesh file (\lstinline|mesh.msh|) is used for both cases.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{0D \ce{Ar}-\ce{Ar+} Elastic Collision (0D\_Argon)} \section{0D \ce{Ar}-\ce{Ar+} Elastic Collision (0D\_Argon)}

View file

@ -509,7 +509,6 @@ MODULE moduleInput
USE moduleRefParam USE moduleRefParam
USE moduleList USE moduleList
USE json_module USE json_module
use moduleMesh, only: qSpecies
IMPLICIT NONE IMPLICIT NONE
TYPE(json_file), INTENT(inout):: config TYPE(json_file), INTENT(inout):: config
@ -518,7 +517,7 @@ MODULE moduleInput
CHARACTER(:), ALLOCATABLE:: speciesType CHARACTER(:), ALLOCATABLE:: speciesType
REAL(8):: mass, charge REAL(8):: mass, charge
LOGICAL:: found LOGICAL:: found
INTEGER:: s INTEGER:: i
CHARACTER(:), ALLOCATABLE:: linkName CHARACTER(:), ALLOCATABLE:: linkName
INTEGER:: linkID INTEGER:: linkID
@ -530,8 +529,8 @@ MODULE moduleInput
ALLOCATE(species(1:nSpecies)) ALLOCATE(species(1:nSpecies))
!Reads information of individual species !Reads information of individual species
DO s = 1, nSpecies DO i = 1, nSpecies
WRITE(iString, '(I2)') s WRITE(iString, '(I2)') i
object = 'species(' // TRIM(iString) // ')' object = 'species(' // TRIM(iString) // ')'
CALL config%get(object // '.type', speciesType, found) CALL config%get(object // '.type', speciesType, found)
CALL config%get(object // '.mass', mass, found) CALL config%get(object // '.mass', mass, found)
@ -540,12 +539,12 @@ MODULE moduleInput
!Allocate species depending on type and assign specific parameters !Allocate species depending on type and assign specific parameters
SELECT CASE(speciesType) SELECT CASE(speciesType)
CASE ("neutral") CASE ("neutral")
ALLOCATE(species(s)%obj, source=speciesNeutral()) ALLOCATE(species(i)%obj, source=speciesNeutral())
CASE ("charged") CASE ("charged")
CALL config%get(object // '.charge', charge, found) CALL config%get(object // '.charge', charge, found)
IF (.NOT. found) CALL criticalError("Required parameter charge not found for species " // object, 'readSpecies') IF (.NOT. found) CALL criticalError("Required parameter charge not found for species " // object, 'readSpecies')
ALLOCATE(species(s)%obj, source=speciesCharged(q = charge, & ALLOCATE(species(i)%obj, source=speciesCharged(q = charge, &
qm = charge/mass)) qm = charge/mass))
CASE DEFAULT CASE DEFAULT
@ -553,32 +552,18 @@ MODULE moduleInput
END SELECT END SELECT
!Assign shared parameters for all species !Assign shared parameters for all species
CALL config%get(object // '.name', species(s)%obj%name, found) CALL config%get(object // '.name', species(i)%obj%name, found)
CALL config%get(object // '.weight', species(s)%obj%weight, found) CALL config%get(object // '.weight', species(i)%obj%weight, found)
species(s)%obj%n = s species(i)%obj%n = i
species(s)%obj%m = mass species(i)%obj%m = mass
END DO
! Allocate the vector with the species charges for calculating the EM field
ALLOCATE(qSpecies(1:nSpecies))
DO s = 1, nSpecies
SELECT TYPE(sp => species(s)%obj)
TYPE IS (speciesCharged)
qSpecies(s) = sp%q
CLASS DEFAULT
qSpecies(s) = 0.D0
END SELECT
END DO END DO
!Read relations between species !Read relations between species
DO s = 1, nSpecies DO i = 1, nSpecies
WRITE(iString, '(I2)') s WRITE(iString, '(I2)') i
object = 'species(' // TRIM(iString) // ')' object = 'species(' // TRIM(iString) // ')'
SELECT TYPE(sp => species(s)%obj) SELECT TYPE(sp => species(i)%obj)
TYPE IS (speciesNeutral) TYPE IS (speciesNeutral)
!Get species linked ion !Get species linked ion
CALL config%get(object // '.ion', linkName, found) CALL config%get(object // '.ion', linkName, found)
@ -936,7 +921,7 @@ MODULE moduleInput
TYPE(json_file), INTENT(inout):: config TYPE(json_file), INTENT(inout):: config
CHARACTER(:), ALLOCATABLE:: object CHARACTER(:), ALLOCATABLE:: object
LOGICAL:: found LOGICAL:: found
INTEGER:: b INTEGER:: b, s
CHARACTER(2):: bString CHARACTER(2):: bString
character(:), allocatable:: bType character(:), allocatable:: bType
@ -991,6 +976,20 @@ MODULE moduleInput
end do end do
! TODO: Move this to the init of species
ALLOCATE(qSpecies(1:nSpecies))
DO s = 1, nSpecies
SELECT TYPE(sp => species(s)%obj)
TYPE IS (speciesCharged)
qSpecies(s) = sp%q
CLASS DEFAULT
qSpecies(s) = 0.D0
END SELECT
END DO
END SUBROUTINE readBoundaryEM END SUBROUTINE readBoundaryEM
subroutine readPhysicalSurfaces(config) subroutine readPhysicalSurfaces(config)
@ -1082,6 +1081,7 @@ MODULE moduleInput
integer:: b, ps, s integer:: b, ps, s
integer:: e integer:: e
integer:: nVolColl integer:: nVolColl
integer:: boundaryIndex
object = 'geometry' object = 'geometry'

View file

@ -43,7 +43,7 @@ MODULE moduleMesh0D
CLASS(meshNode0D), INTENT(out):: self CLASS(meshNode0D), INTENT(out):: self
INTEGER, INTENT(in):: n INTEGER, INTENT(in):: n
REAL(8), INTENT(in):: r(1:3) ! NOTE: Required by interface but unused REAL(8), INTENT(in):: r(1:3) !Unused variable
self%n = n self%n = n
@ -117,7 +117,7 @@ MODULE moduleMesh0D
PURE FUNCTION fPsi0D(Xi, nNodes) RESULT(fPsi) PURE FUNCTION fPsi0D(Xi, nNodes) RESULT(fPsi)
IMPLICIT NONE IMPLICIT NONE
REAL(8), INTENT(in):: Xi(1:3) ! NOTE: Required by interface but unused REAL(8), INTENT(in):: Xi(1:3)
INTEGER, INTENT(in):: nNodes INTEGER, INTENT(in):: nNodes
REAL(8):: fPsi(1:nNodes) REAL(8):: fPsi(1:nNodes)
@ -128,7 +128,7 @@ MODULE moduleMesh0D
PURE FUNCTION dPsi0D(Xi, nNodes) RESULT(dPsi) PURE FUNCTION dPsi0D(Xi, nNodes) RESULT(dPsi)
IMPLICIT NONE IMPLICIT NONE
REAL(8), INTENT(in):: Xi(1:3) ! NOTE: Required by interface but unused REAL(8), INTENT(in):: Xi(1:3)
INTEGER, INTENT(in):: nNodes INTEGER, INTENT(in):: nNodes
REAL(8):: dPsi(1:3,1:nNodes) REAL(8):: dPsi(1:3,1:nNodes)
@ -142,7 +142,7 @@ MODULE moduleMesh0D
CLASS(meshCell0D), INTENT(in):: self CLASS(meshCell0D), INTENT(in):: self
INTEGER, INTENT(in):: nNodes INTEGER, INTENT(in):: nNodes
REAL(8), INTENT(in):: dPsi(1:3,1:nNodes) REAL(8), INTENT(in):: dPsi(1:3,1:nNodes)
REAL(8):: pDer(1:3, 1:3) ! NOTE: Required by interface but unused REAL(8):: pDer(1:3, 1:3)
pDer = 0.D0 pDer = 0.D0
@ -205,7 +205,7 @@ MODULE moduleMesh0D
IMPLICIT NONE IMPLICIT NONE
CLASS(meshCell0D), INTENT(in):: self CLASS(meshCell0D), INTENT(in):: self
REAL(8), INTENT(in):: r(1:3) ! NOTE: Required by interface but unused REAL(8), INTENT(in):: r(1:3)
REAL(8):: xN(1:3) REAL(8):: xN(1:3)
xN = 0.D0 xN = 0.D0
@ -215,7 +215,7 @@ MODULE moduleMesh0D
PURE FUNCTION inside0D(Xi) RESULT(ins) PURE FUNCTION inside0D(Xi) RESULT(ins)
IMPLICIT NONE IMPLICIT NONE
REAL(8), INTENT(in):: Xi(1:3) ! NOTE: Required by interface but unused REAL(8), INTENT(in):: Xi(1:3)
LOGICAL:: ins LOGICAL:: ins
ins = .TRUE. ins = .TRUE.
@ -226,7 +226,7 @@ MODULE moduleMesh0D
IMPLICIT NONE IMPLICIT NONE
CLASS(meshCell0D), INTENT(in):: self CLASS(meshCell0D), INTENT(in):: self
REAL(8), INTENT(in):: Xi(1:3) ! NOTE: Required by interface but unused REAL(8), INTENT(in):: Xi(1:3)
CLASS(meshElement), POINTER, INTENT(out):: neighbourElement CLASS(meshElement), POINTER, INTENT(out):: neighbourElement
neighbourElement => NULL() neighbourElement => NULL()
@ -237,7 +237,7 @@ MODULE moduleMesh0D
PURE FUNCTION detJ0D(pDer) RESULT(dJ) PURE FUNCTION detJ0D(pDer) RESULT(dJ)
IMPLICIT NONE IMPLICIT NONE
REAL(8), INTENT(in):: pDer(1:3, 1:3) ! NOTE: Required by interface but unused REAL(8), INTENT(in):: pDer(1:3, 1:3)
REAL(8):: dJ REAL(8):: dJ
dJ = 0.D0 dJ = 0.D0
@ -247,7 +247,7 @@ MODULE moduleMesh0D
PURE FUNCTION invJ0D(pDer) RESULT(invJ) PURE FUNCTION invJ0D(pDer) RESULT(invJ)
IMPLICIT NONE IMPLICIT NONE
REAL(8), INTENT(in):: pDer(1:3, 1:3) ! NOTE: Required by interface but unused REAL(8), INTENT(in):: pDer(1:3, 1:3)
REAL(8):: invJ(1:3,1:3) REAL(8):: invJ(1:3,1:3)
invJ = 0.D0 invJ = 0.D0

View file

@ -156,7 +156,7 @@ MODULE moduleMesh1DCart
IMPLICIT NONE IMPLICIT NONE
CLASS(meshEdge1DCart), INTENT(in):: self CLASS(meshEdge1DCart), INTENT(in):: self
REAL(8), DIMENSION(1:3), INTENT(in):: r0 ! NOTE: Required by interface but unused REAL(8), DIMENSION(1:3), INTENT(in):: r0
REAL(8), DIMENSION(1:3):: r REAL(8), DIMENSION(1:3):: r
r = (/ self%x, 0.D0, 0.D0 /) r = (/ self%x, 0.D0, 0.D0 /)

View file

@ -156,7 +156,7 @@ MODULE moduleMesh1DRad
IMPLICIT NONE IMPLICIT NONE
CLASS(meshEdge1DRad), INTENT(in):: self CLASS(meshEdge1DRad), INTENT(in):: self
REAL(8), DIMENSION(1:3), INTENT(in):: r0 ! NOTE: Required by interface but unused REAL(8), DIMENSION(1:3), INTENT(in):: r0
REAL(8), DIMENSION(1:3):: r REAL(8), DIMENSION(1:3):: r
r = (/ self%r, 0.D0, 0.D0 /) r = (/ self%r, 0.D0, 0.D0 /)

View file

@ -34,7 +34,7 @@ MODULE moduleMeshInput0D
IMPLICIT NONE IMPLICIT NONE
CLASS(meshGeneric), INTENT(inout):: self CLASS(meshGeneric), INTENT(inout):: self
CHARACTER(:), ALLOCATABLE, INTENT(in):: filename ! NOTE: Required by interface but unused CHARACTER(:), ALLOCATABLE, INTENT(in):: filename !Dummy file, not used
REAL(8):: r(1:3) REAL(8):: r(1:3)
!Allocates one node !Allocates one node

View file

@ -197,7 +197,6 @@ module moduleMeshInputText
fileID = 10 fileID = 10
open(fileID, file=trim(filename)) open(fileID, file=trim(filename))
nNodes = 0
do do
read(fileID, *, iostat=reason) line read(fileID, *, iostat=reason) line

View file

@ -27,6 +27,7 @@ module moduleMeshOutputText
subroutine writeCollOutput(self, fileID) subroutine writeCollOutput(self, fileID)
use moduleMesh use moduleMesh
use moduleCollisions use moduleCollisions
use moduleRefParam, only: L_ref
implicit none implicit none
class(meshGeneric), intent(in):: self class(meshGeneric), intent(in):: self

View file

@ -99,6 +99,7 @@ submodule(moduleMesh) boundaryParticle
implicit none implicit none
class(boundaryParticleGeneric), allocatable, intent(inout):: boundary class(boundaryParticleGeneric), allocatable, intent(inout):: boundary
integer:: e, et
allocate(boundaryQuasiNeutrality:: boundary) allocate(boundaryQuasiNeutrality:: boundary)
@ -335,7 +336,6 @@ submodule(moduleMesh) boundaryParticle
real(8):: EF_dir real(8):: EF_dir
real(8):: alpha real(8):: alpha
alpha = 0.85d0
if (associated(edge%e1)) then if (associated(edge%e1)) then
cell => edge%e1 cell => edge%e1

View file

@ -28,7 +28,7 @@ module moduleMeshCommon
pure function fPsiPoint(Xi, nNodes) RESULT(fPsi) pure function fPsiPoint(Xi, nNodes) RESULT(fPsi)
implicit none implicit none
real(8), intent(in):: Xi(1:3) ! NOTE: Required by interface but unused real(8), intent(in):: Xi(1:3)
integer, intent(in):: nNodes integer, intent(in):: nNodes
real(8):: fPsi(1:nNodes) real(8):: fPsi(1:nNodes)
@ -104,7 +104,7 @@ module moduleMeshCommon
pure function dPsiSegm(Xi, nNodes) result(dPsi) pure function dPsiSegm(Xi, nNodes) result(dPsi)
implicit none implicit none
real(8), intent(in):: Xi(1:3) ! NOTE: Required by interface but unused real(8), intent(in):: Xi(1:3)
integer, intent(in):: nNodes integer, intent(in):: nNodes
real(8):: dPsi(1:3,1:nNodes) real(8):: dPsi(1:3,1:nNodes)
@ -142,7 +142,7 @@ module moduleMeshCommon
pure function dPsiTria(Xi, nNodes) result(dPsi) pure function dPsiTria(Xi, nNodes) result(dPsi)
implicit none implicit none
real(8), intent(in):: Xi(1:3) ! NOTE: Required by interface but unused real(8), intent(in):: Xi(1:3)
integer, intent(in):: nNodes integer, intent(in):: nNodes
real(8):: dPsi(1:3,1:nNodes) real(8):: dPsi(1:3,1:nNodes)
@ -157,7 +157,7 @@ module moduleMeshCommon
pure function dPsiTetra(Xi, nNodes) result(dPsi) pure function dPsiTetra(Xi, nNodes) result(dPsi)
implicit none implicit none
real(8), intent(in):: Xi(1:3) ! NOTE: Required by interface but unused real(8), intent(in):: Xi(1:3)
integer, intent(in):: nNodes integer, intent(in):: nNodes
real(8):: dPsi(1:3, 1:nNodes) real(8):: dPsi(1:3, 1:nNodes)

View file

@ -553,7 +553,7 @@ MODULE moduleCollisions
IMPLICIT NONE IMPLICIT NONE
CLASS(collisionBinaryChargeExchange), INTENT(in):: self CLASS(collisionBinaryChargeExchange), INTENT(in):: self
REAL(8), INTENT(in):: vRel ! NOTE: Required by itnerface but unused REAL(8), INTENT(in):: vRel
TYPE(particle), INTENT(inout), TARGET:: part_i, part_j TYPE(particle), INTENT(inout), TARGET:: part_i, part_j
SELECT TYPE(sp => part_i%species) SELECT TYPE(sp => part_i%species)

View file

@ -48,7 +48,9 @@ MODULE moduleInject
REAL(8):: tauInject REAL(8):: tauInject
REAL(8), INTENT(in):: flow REAL(8), INTENT(in):: flow
CHARACTER(:), ALLOCATABLE, INTENT(in):: units CHARACTER(:), ALLOCATABLE, INTENT(in):: units
INTEGER:: e INTEGER:: e, et
INTEGER:: phSurface(1:mesh%numEdges)
INTEGER:: nVolColl
REAL(8):: fluxPerStep = 0.D0 REAL(8):: fluxPerStep = 0.D0
self%id = i self%id = i
@ -68,8 +70,8 @@ MODULE moduleInject
!Calculates total area !Calculates total area
self%surface = 0.D0 self%surface = 0.D0
DO e = 1, self%nEdges DO et = 1, self%nEdges
self%surface = self%surface + self%edges(e)%obj%surface self%surface = self%surface + self%edges(et)%obj%surface
END DO END DO
@ -119,8 +121,8 @@ MODULE moduleInject
IF (particlesPerEdge > 0) THEN IF (particlesPerEdge > 0) THEN
! Particles per edge defined by the user ! Particles per edge defined by the user
self%particlesPerEdge = particlesPerEdge self%particlesPerEdge = particlesPerEdge
DO e = 1, self%nEdges DO et = 1, self%nEdges
self%weightPerEdge(e) = fluxPerStep * self%edges(e)%obj%surface / real(particlesPerEdge) self%weightPerEdge(et) = fluxPerStep * self%edges(et)%obj%surface / real(particlesPerEdge)
END DO END DO
@ -129,8 +131,8 @@ MODULE moduleInject
ELSE ELSE
! No particles assigned per edge, use the species weight ! No particles assigned per edge, use the species weight
self%weightPerEdge = self%species%weight self%weightPerEdge = self%species%weight
DO e = 1, self%nEdges DO et = 1, self%nEdges
self%particlesPerEdge(e) = max(1,FLOOR(fluxPerStep*self%edges(e)%obj%surface / self%species%weight)) self%particlesPerEdge(et) = max(1,FLOOR(fluxPerStep*self%edges(et)%obj%surface / self%species%weight))
END DO END DO
self%nParticles = SUM(self%particlesPerEdge) self%nParticles = SUM(self%particlesPerEdge)

View file

@ -253,6 +253,7 @@ MODULE moduleProbe
END SUBROUTINE doProbes END SUBROUTINE doProbes
SUBROUTINE outputProbes() SUBROUTINE outputProbes()
USE moduleCaseParam, ONLY: timeStep
IMPLICIT NONE IMPLICIT NONE
INTEGER:: i INTEGER:: i

View file

@ -121,6 +121,7 @@ MODULE moduleEM
REAL(8), INTENT(in):: phi(1:n) REAL(8), INTENT(in):: phi(1:n)
REAL(8):: n_e(1:n) REAL(8):: n_e(1:n)
REAL(8):: n_e0 = 1.0D16, phi_0 = -500.0D0, T_e = 11604.0 REAL(8):: n_e0 = 1.0D16, phi_0 = -500.0D0, T_e = 11604.0
INTEGER:: i
n_e = n_e0 / n_ref * exp(qe * (phi*Volt_ref - phi_0) / (kb * T_e)) n_e = n_e0 / n_ref * exp(qe * (phi*Volt_ref - phi_0) / (kb * T_e))

View file

@ -231,8 +231,8 @@ MODULE modulePusher
USE moduleSpecies USE moduleSpecies
IMPLICIT NONE IMPLICIT NONE
TYPE(particle), INTENT(inout):: part ! NOTE: Required by interface but unused TYPE(particle), INTENT(inout):: part
REAL(8), INTENT(in):: tauIn ! NOTE: Required by interface but unused REAL(8), INTENT(in):: tauIn
END SUBROUTINE push0D END SUBROUTINE push0D