New BC for quasi-neutrality
Still, the adjustment it is not iterative. I need to build new subroutines to gather values of edges.
This commit is contained in:
parent
13dde3b1f9
commit
e7e6e1bece
3 changed files with 80 additions and 59 deletions
|
|
@ -832,68 +832,74 @@ MODULE moduleInput
|
|||
WRITE(sString,'(i2)') s
|
||||
object = 'boundary(' // TRIM(iString) // ').bTypes(' // TRIM(sString) // ')'
|
||||
CALL config%get(object // '.type', bType, found)
|
||||
SELECT CASE(bType)
|
||||
CASE('reflection')
|
||||
ALLOCATE(boundaryReflection:: boundary(i)%bTypes(s)%obj)
|
||||
associate(bound => boundary(i)%bTypes(s)%obj)
|
||||
SELECT CASE(bType)
|
||||
CASE('reflection')
|
||||
ALLOCATE(boundaryReflection:: bound)
|
||||
|
||||
CASE('absorption')
|
||||
ALLOCATE(boundaryAbsorption:: boundary(i)%bTypes(s)%obj)
|
||||
CASE('absorption')
|
||||
ALLOCATE(boundaryAbsorption:: bound)
|
||||
|
||||
CASE('transparent')
|
||||
ALLOCATE(boundaryTransparent:: boundary(i)%bTypes(s)%obj)
|
||||
CASE('transparent')
|
||||
ALLOCATE(boundaryTransparent:: bound)
|
||||
|
||||
CASE('ionization')
|
||||
!Neutral parameters
|
||||
CALL config%get(object // '.neutral.ion', speciesName, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'ion' for neutrals in ionization", 'readBoundary')
|
||||
speciesID = speciesName2Index(speciesName)
|
||||
CALL config%get(object // '.neutral.mass', m0, found)
|
||||
IF (.NOT. found) THEN
|
||||
m0 = species(s)%obj%m*m_ref
|
||||
END IF
|
||||
CALL config%get(object // '.neutral.density', n0, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'density' for neutrals in ionization", 'readBoundary')
|
||||
CALL config%get(object // '.neutral.velocity', v0, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'velocity' for neutrals in ionization", 'readBoundary')
|
||||
CALL config%get(object // '.neutral.temperature', T0, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'temperature' for neutrals in ionization", 'readBoundary')
|
||||
CASE('axis')
|
||||
ALLOCATE(boundaryAxis:: bound)
|
||||
|
||||
CALL config%get(object // '.effectiveTime', effTime, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'effectiveTime' for ionization", 'readBoundary')
|
||||
CASE('wallTemperature')
|
||||
CALL config%get(object // '.temperature', Tw, found)
|
||||
IF (.NOT. found) CALL criticalError("temperature not found for wallTemperature boundary type", 'readBoundary')
|
||||
CALL config%get(object // '.specificHeat', cw, found)
|
||||
IF (.NOT. found) CALL criticalError("specificHeat not found for wallTemperature boundary type", 'readBoundary')
|
||||
|
||||
CALL config%get(object // '.energyThreshold', eThreshold, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'eThreshold' in ionization", 'readBoundary')
|
||||
CALL initWallTemperature(bound, Tw, cw)
|
||||
|
||||
CALL config%get(object // '.crossSection', crossSection, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'crossSection' for neutrals in ionization", 'readBoundary')
|
||||
CASE('ionization')
|
||||
!Neutral parameters
|
||||
CALL config%get(object // '.neutral.ion', speciesName, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'ion' for neutrals in ionization", 'readBoundary')
|
||||
speciesID = speciesName2Index(speciesName)
|
||||
CALL config%get(object // '.neutral.mass', m0, found)
|
||||
IF (.NOT. found) THEN
|
||||
m0 = species(s)%obj%m*m_ref
|
||||
END IF
|
||||
CALL config%get(object // '.neutral.density', n0, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'density' for neutrals in ionization", 'readBoundary')
|
||||
CALL config%get(object // '.neutral.velocity', v0, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'velocity' for neutrals in ionization", 'readBoundary')
|
||||
CALL config%get(object // '.neutral.temperature', T0, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'temperature' for neutrals in ionization", 'readBoundary')
|
||||
|
||||
CALL config%get(object // '.electronSecondary', electronSecondary, found)
|
||||
electronSecondaryID = speciesName2Index(electronSecondary)
|
||||
IF (found) THEN
|
||||
CALL initIonization(boundary(i)%bTypes(s)%obj, species(s)%obj%m, m0, n0, v0, T0, &
|
||||
speciesID, effTime, crossSection, eThreshold,electronSecondaryID)
|
||||
CALL config%get(object // '.effectiveTime', effTime, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'effectiveTime' for ionization", 'readBoundary')
|
||||
|
||||
ELSE
|
||||
CALL initIonization(boundary(i)%bTypes(s)%obj, species(s)%obj%m, m0, n0, v0, T0, &
|
||||
speciesID, effTime, crossSection, eThreshold)
|
||||
CALL config%get(object // '.energyThreshold', eThreshold, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'eThreshold' in ionization", 'readBoundary')
|
||||
|
||||
END IF
|
||||
CALL config%get(object // '.crossSection', crossSection, found)
|
||||
IF (.NOT. found) CALL criticalError("missing parameter 'crossSection' for neutrals in ionization", 'readBoundary')
|
||||
|
||||
CASE('wallTemperature')
|
||||
CALL config%get(object // '.temperature', Tw, found)
|
||||
IF (.NOT. found) CALL criticalError("temperature not found for wallTemperature boundary type", 'readBoundary')
|
||||
CALL config%get(object // '.specificHeat', cw, found)
|
||||
IF (.NOT. found) CALL criticalError("specificHeat not found for wallTemperature boundary type", 'readBoundary')
|
||||
CALL config%get(object // '.electronSecondary', electronSecondary, found)
|
||||
electronSecondaryID = speciesName2Index(electronSecondary)
|
||||
IF (found) THEN
|
||||
CALL initIonization(bound, species(s)%obj%m, m0, n0, v0, T0, &
|
||||
speciesID, effTime, crossSection, eThreshold,electronSecondaryID)
|
||||
|
||||
CALL initWallTemperature(boundary(i)%bTypes(s)%obj, Tw, cw)
|
||||
|
||||
CASE('axis')
|
||||
ALLOCATE(boundaryAxis:: boundary(i)%bTypes(s)%obj)
|
||||
ELSE
|
||||
CALL initIonization(bound, species(s)%obj%m, m0, n0, v0, T0, &
|
||||
speciesID, effTime, crossSection, eThreshold)
|
||||
|
||||
CASE DEFAULT
|
||||
CALL criticalError('Boundary type ' // bType // ' undefined', 'readBoundary')
|
||||
END IF
|
||||
|
||||
END SELECT
|
||||
case('quasiNeutrality')
|
||||
call initQuasiNeutrality(bound)
|
||||
|
||||
CASE DEFAULT
|
||||
CALL criticalError('Boundary type ' // bType // ' undefined', 'readBoundary')
|
||||
|
||||
END SELECT
|
||||
end associate
|
||||
|
||||
END DO
|
||||
|
||||
|
|
|
|||
|
|
@ -206,11 +206,11 @@ MODULE moduleMesh
|
|||
!Subroutine to find in which cell a particle is located
|
||||
PROCEDURE, PASS:: findCell
|
||||
!Gather value and spatial derivative on the nodes at position Xi
|
||||
PROCEDURE, PASS, PRIVATE:: gatherF_scalar
|
||||
PROCEDURE, PASS, PRIVATE:: gatherF_array
|
||||
PROCEDURE, PASS, PRIVATE:: gatherDF_scalar
|
||||
GENERIC:: gatherF => gatherF_scalar, gatherF_array
|
||||
GENERIC:: gatherDF => gatherDF_scalar
|
||||
PROCEDURE, PASS, PRIVATE:: gatherF_cell_scalar
|
||||
PROCEDURE, PASS, PRIVATE:: gatherF_cell_array
|
||||
PROCEDURE, PASS, PRIVATE:: gatherDF_cell_scalar
|
||||
GENERIC:: gatherF => gatherF_cell_scalar, gatherF_cell_array
|
||||
GENERIC:: gatherDF => gatherDF_cell_scalar
|
||||
|
||||
END TYPE meshCell
|
||||
|
||||
|
|
@ -546,7 +546,7 @@ MODULE moduleMesh
|
|||
END SUBROUTINE resetOutput
|
||||
|
||||
!Gather the value of valNodes (scalar) at position Xi
|
||||
PURE FUNCTION gatherF_scalar(self, Xi, nNodes, valNodes) RESULT(f)
|
||||
PURE FUNCTION gatherF_cell_scalar(self, Xi, nNodes, valNodes) RESULT(f)
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshCell), INTENT(in):: self
|
||||
|
|
@ -559,10 +559,10 @@ MODULE moduleMesh
|
|||
fPsi = self%fPsi(Xi, nNodes)
|
||||
f = DOT_PRODUCT(fPsi, valNodes)
|
||||
|
||||
END FUNCTION gatherF_scalar
|
||||
END FUNCTION gatherF_cell_scalar
|
||||
|
||||
!Gather the value of valNodes (array) at position Xi
|
||||
PURE FUNCTION gatherF_array(self, Xi, nNodes, valNodes) RESULT(f)
|
||||
PURE FUNCTION gatherF_cell_array(self, Xi, nNodes, valNodes) RESULT(f)
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshCell), INTENT(in):: self
|
||||
|
|
@ -575,10 +575,10 @@ MODULE moduleMesh
|
|||
fPsi = self%fPsi(Xi, nNodes)
|
||||
f = MATMUL(fPsi, valNodes)
|
||||
|
||||
END FUNCTION gatherF_array
|
||||
END FUNCTION gatherF_cell_array
|
||||
|
||||
!Gather the spatial derivative of valNodes (scalar) at position Xi
|
||||
PURE FUNCTION gatherDF_scalar(self, Xi, nNodes, valNodes) RESULT(df)
|
||||
PURE FUNCTION gatherDF_cell_scalar(self, Xi, nNodes, valNodes) RESULT(df)
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshCell), INTENT(in):: self
|
||||
|
|
@ -600,7 +600,7 @@ MODULE moduleMesh
|
|||
DOT_PRODUCT(dPsiR(2,:), valNodes), &
|
||||
DOT_PRODUCT(dPsiR(3,:), valNodes) /)
|
||||
|
||||
END FUNCTION gatherDF_scalar
|
||||
END FUNCTION gatherDF_cell_scalar
|
||||
|
||||
!Scatters particle properties into cell nodes
|
||||
SUBROUTINE scatter(self, nNodes, part)
|
||||
|
|
|
|||
|
|
@ -160,4 +160,19 @@ MODULE moduleBoundary
|
|||
|
||||
END SUBROUTINE initIonization
|
||||
|
||||
subroutine initQuasiNeutrality(boundary)
|
||||
implicit none
|
||||
|
||||
class(boundaryGeneric), allocatable, intent(out):: boundary
|
||||
|
||||
allocate(boundaryQuasiNeutrality:: boundary)
|
||||
|
||||
select type(boundary)
|
||||
type is(boundaryQuasiNeutrality)
|
||||
boundary%alpha = 0.d0
|
||||
|
||||
end select
|
||||
|
||||
end subroutine initQuasiNeutrality
|
||||
|
||||
END MODULE moduleBoundary
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue