Preparing to change the input

This commit is contained in:
Jorge Gonzalez 2026-02-10 18:46:37 +01:00
commit defcf02466
3 changed files with 43 additions and 10 deletions

View file

@ -800,19 +800,18 @@ MODULE moduleInput
IMPLICIT NONE
TYPE(json_file), INTENT(inout):: config
INTEGER:: i, s
CHARACTER(2):: iString, sString
INTEGER:: b
CHARACTER(2):: iString
CHARACTER(:), ALLOCATABLE:: object
LOGICAL:: found
INTEGER:: nTypes
CALL config%info('boundary', found, n_children = nBoundary)
ALLOCATE(boundaries(1:nBoundary))
DO i = 1, nBoundary
WRITE(iString, '(i2)') i
DO b = 1, nBoundary
WRITE(iString, '(i2)') b
object = 'boundary(' // TRIM(iString) // ')'
call boundaries(i)%init(config, object, i)
call boundaries(i)%init(config, object, b)
END DO

View file

@ -587,6 +587,7 @@ MODULE moduleMesh
! Boundary Particle Definitions
!Generic type for boundaries
TYPE, abstract, PUBLIC:: boundaryGeneric
integer:: n
character(:), allocatable:: name
contains
procedure, pass:: init => initBoundary
@ -595,12 +596,13 @@ MODULE moduleMesh
END TYPE boundaryGeneric
interface
module subroutine initBoundary(self, config, object)
module subroutine initBoundary(self, config, object, b)
use json_module
class(boundaryGeneric), intent(out):: self
type(json_file), intent(inout):: config
character(:), allocatable, intent(in):: object
integer, intent(in):: b
end subroutine initBoundary
@ -778,7 +780,7 @@ MODULE moduleMesh
END TYPE boundaryCont
!Number of boundaries
INTEGER:: nBoundary = 0
INTEGER:: nBoundaries = 0
!Array for boundaries
TYPE(boundaryCont), ALLOCATABLE, TARGET:: boundariesParticle(:)

View file

@ -1,7 +1,31 @@
!moduleMeshBoundary: Boundary functions for the mesh edges
submodule(moduleMesh) boundary
contains
module subroutine initBoundary(self, config, object)
module function boundaryParticleName2Index(boundaryName) result(bp)
use moduleErrors
implicit none
character(:), allocatable:: boundaryName
integer:: bp
integer:: b
bp = 0
do b = 1, nBoundaries
if (boundaryName == boundariesParticle(b)%obj%name) then
bp = boundariesParticle(b)%obj%n
end if
end do
if (bp == 0) then
call criticalError('Boundary ' // boundaryName // ' not found', 'boundaryName2Index')
end if
end function boundaryParticleName2Index
module subroutine initBoundary(self, config, object, b)
use json_module
use moduleRefParam, only: m_ref
use moduleConstParam, only: me
@ -10,6 +34,7 @@ submodule(moduleMesh) boundary
class(boundaryGeneric), allocatable, intent(out):: self
type(json_file), intent(inout):: config
character(:), allocatable, intent(in):: object
integer, intent(in):: b
character(:), allocatable:: bType
logical:: found
real(8):: Tw, cw !Wall temperature and specific heat
@ -21,6 +46,7 @@ submodule(moduleMesh) boundary
integer:: speciesID, electronSecondaryID
character(:), allocatable:: speciesName, crossSection, electronSecondary
self%n = b
CALL config%get(object // '.name', self%name, found)
CALL config%get(object // '.type', bType, found)
SELECT CASE(bType)
@ -99,7 +125,13 @@ submodule(moduleMesh) boundary
REAL(8):: vTh
vTh = DSQRT(c * T) / v_ref
boundary = boundaryWallTemperature(vTh = vTh)
allocate(boundaryWallTemperature:: boundary)
select type(boundary)
type is(boundaryWallTemperature)
boundary%vTh = vTh
end select
END SUBROUTINE initWallTemperature