First commit of code.
New functionality:
- DSMC module:
- 2D cyl geometry
- GMSH file format
- Elastic cross-section for Argon-Argon collisions.
- Basic boundary conditions: reflection, absorption and axis
symmetry.
Bugs fixed:
Other comments:
- Still searching for name.
This commit is contained in:
commit
bd7e8b040b
29 changed files with 4069 additions and 0 deletions
66
src/modules/moduleSpecies.f95
Normal file
66
src/modules/moduleSpecies.f95
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
!Contains the information about species (particles)
|
||||
MODULE moduleSpecies
|
||||
USE moduleCaseParam
|
||||
USE moduleList
|
||||
IMPLICIT NONE
|
||||
|
||||
TYPE, ABSTRACT:: speciesGeneric
|
||||
CHARACTER(:), ALLOCATABLE:: name
|
||||
REAL(8):: m=0.D0, weight=0.D0
|
||||
INTEGER:: pt=0
|
||||
END TYPE speciesGeneric
|
||||
|
||||
TYPE, EXTENDS(speciesGeneric):: speciesNeutral
|
||||
|
||||
END TYPE speciesNeutral
|
||||
|
||||
TYPE, EXTENDS(speciesGeneric):: speciesCharged
|
||||
REAL(8):: q=0.D0, qm=0.D0
|
||||
|
||||
END TYPE speciesCharged
|
||||
|
||||
TYPE:: speciesCont
|
||||
CLASS(speciesGeneric), ALLOCATABLE:: obj
|
||||
|
||||
END TYPE
|
||||
|
||||
INTEGER:: nSpecies
|
||||
TYPE(speciesCont), ALLOCATABLE:: species(:)
|
||||
|
||||
TYPE particle
|
||||
REAL(8):: r(1:3) !Position
|
||||
REAL(8):: v(1:3) !Velocity
|
||||
INTEGER:: pt !Particle species id
|
||||
INTEGER:: e_p !Index of element in which the particle is located
|
||||
REAL(8):: xLog(1:2) !Logical coordinates of particle in element e_p.
|
||||
LOGICAL:: n_in !Flag that indicates if a particle is in the domain
|
||||
|
||||
END TYPE particle
|
||||
|
||||
INTEGER:: n_part_old, n_part_new
|
||||
INTEGER:: nPartInj
|
||||
!Arrays that define the particles
|
||||
TYPE(particle), ALLOCATABLE, DIMENSION(:), TARGET:: part_old
|
||||
TYPE(particle), ALLOCATABLE, DIMENSION(:):: part_new
|
||||
TYPE(particle), ALLOCATABLE, DIMENSION(:):: part_inj !array of inject particles
|
||||
|
||||
CONTAINS
|
||||
FUNCTION speciesName2Index(speciesName) RESULT(pt)
|
||||
IMPLICIT NONE
|
||||
|
||||
CHARACTER(:), ALLOCATABLE:: speciesName
|
||||
INTEGER:: pt
|
||||
INTEGER:: n
|
||||
|
||||
pt = 0
|
||||
DO n = 1, nSpecies
|
||||
IF (speciesName == species(n)%obj%name) THEN
|
||||
pt = species(n)%obj%pt
|
||||
EXIT
|
||||
END IF
|
||||
END DO
|
||||
!TODO: add error handling when species not found
|
||||
|
||||
END FUNCTION speciesName2Index
|
||||
|
||||
END MODULE moduleSpecies
|
||||
Loading…
Add table
Add a link
Reference in a new issue