Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE GetCondFDInput
! SUBROUTINE INFORMATION:
! AUTHOR Curtis Pedersen
! DATE WRITTEN July 2006
! MODIFIED Brent Griffith Mar 2011, user settings
!
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is the main driver for initializations for the variable property CondFD part of the
! MFD algorithm
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataIPShortCuts
USE InputProcessor, ONLY: GetNumObjectsFound,GetObjectItem,FindItemInList
USE DataHeatBalance, ONLY: MaxAllowedDelTempCondFD, CondFDRelaxFactor, CondFDRelaxFactorInput
USE General, ONLY: RoundSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: IOStat ! IO Status when calling get input subroutine
CHARACTER(len=MaxNameLength),DIMENSION(3) &
:: MaterialNames ! Number of Material Alpha names defined
CHARACTER(len=MaxNameLength),DIMENSION(3) :: ConstructionName ! Name of Construction with CondFDsimplified
INTEGER :: MaterNum ! Counter to keep track of the material number
INTEGER :: MaterialNumAlpha ! Number of material alpha names being passed
INTEGER :: MaterialNumProp ! Number of material properties being passed
REAL(r64), DIMENSION(40) :: MaterialProps !Temporary array to transfer material properties
LOGICAL :: ErrorsFound = .false. ! If errors detected in input
! INTEGER :: CondFDMat ! Number of variable property CondFD materials in input
INTEGER :: ConstructNumber ! Cconstruction with CondHBsimple to be overridden with CondHBdetailed
INTEGER :: NumConstructionAlpha
Integer :: Loop
INTEGER :: NumAlphas
INTEGER :: NumNumbers
INTEGER :: propNum
INTEGER :: pcount
INTEGER :: pcMat
INTEGER :: vcMat
INTEGER :: inegptr
LOGICAL :: nonInc
! user settings for numerical parameters
cCurrentModuleObject = 'HeatBalanceSettings:ConductionFiniteDifference'
IF (GetNumObjectsFound(cCurrentModuleObject) > 0) THEN
CALL GetObjectItem(cCurrentModuleObject,1,cAlphaArgs,NumAlphas, &
rNumericArgs,NumNumbers,IOSTAT, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IF (.NOT. lAlphaFieldBlanks(1)) THEN
SELECT CASE (cAlphaArgs(1))
CASE ('CRANKNICHOLSONSECONDORDER')
CondFDSchemeType = CrankNicholsonSecondOrder
CASE ('FULLYIMPLICITFIRSTORDER')
CondFDSchemeType = FullyImplicitFirstOrder
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': invalid '//TRIM(cAlphaFieldNames(1))// &
' entered='//TRIM(cAlphaArgs(1))//', must match CrankNicholsonSecondOrder or FullyImplicitFirstOrder.')
ErrorsFound=.true.
END SELECT
ENDIF
IF (.NOT. lNumericFieldBlanks(1)) THEN
SpaceDescritConstant = rNumericArgs(1)
ENDIF
IF (.NOT. lNumericFieldBlanks(2)) THEN
CondFDRelaxFactorInput = rNumericArgs(2)
CondFDRelaxFactor = CondFDRelaxFactorInput
ENDIF
IF (.NOT. lNumericFieldBlanks(3)) THEN
MaxAllowedDelTempCondFD = rNumericArgs(3)
ENDIF
ENDIF ! settings object
pcMat=GetNumObjectsFound('MaterialProperty:PhaseChange')
vcMat=GetNumObjectsFound('MaterialProperty:VariableThermalConductivity')
ALLOCATE(MaterialFD(TotMaterials))
! Load the additional CondFD Material properties
cCurrentModuleObject='MaterialProperty:PhaseChange' ! Phase Change Information First
IF ( pcMat .NE. 0 ) Then ! Get Phase Change info
! CondFDVariableProperties = .TRUE.
DO Loop=1,pcMat
!Call Input Get routine to retrieve material data
CALL GetObjectItem(cCurrentModuleObject,Loop,MaterialNames,MaterialNumAlpha, &
MaterialProps,MaterialNumProp,IOSTAT, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
!Load the material derived type from the input data.
MaterNum = FindItemInList(MaterialNames(1),Material%Name,TotMaterials)
IF (MaterNum == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': invalid '//TRIM(cAlphaFieldNames(1))// &
' entered='//TRIM(MaterialNames(1))//', must match to a valid Material name.')
ErrorsFound=.true.
Cycle
ENDIF
IF (Material(MaterNum)%Group /= RegularMaterial) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)// &
': Reference Material is not appropriate type for CondFD properties, material='// &
TRIM(Material(MaterNum)%Name)//', must have regular properties (L,Cp,K,D)')
ErrorsFound=.true.
ENDIF
! Once the material derived type number is found then load the additional CondFD variable material properties
! Some or all may be zero (default). They will be checked when calculating node temperatures
MaterialFD(MaterNum)%tk1 = MaterialProps(1)
MaterialFD(MaterNum)%numTempEnth = (MaterialNumProp-1)/2
IF (MaterialFD(MaterNum)%numTempEnth*2 /= (MaterialNumProp-1)) THEN
CALL ShowSevereError('GetCondFDInput: '//trim(cCurrentModuleObject)//'="'//trim(MaterialNames(1))// &
'", mismatched pairs')
CALL ShowContinueError('...expected '//trim(RoundSigDigits(MaterialFD(MaterNum)%numTempEnth))// &
' pairs, but only entered '//trim(RoundSigDigits(MaterialNumProp-1))//' numbers.')
ErrorsFound=.true.
ENDIF
ALLOCATE(MaterialFD(MaterNum)%TempEnth(MaterialFD(MaterNum)%numTempEnth,2))
MaterialFD(MaterNum)%TempEnth =0.0d0
propNum=2
! Temperature first
DO pcount=1,MaterialFD(MaterNum)%numTempEnth
MaterialFD(MaterNum)%TempEnth(pcount,1) = MaterialProps(propNum)
propNum=propNum+2
ENDDO
propNum=3
! Then Enthalpy
DO pcount=1,MaterialFD(MaterNum)%numTempEnth
MaterialFD(MaterNum)%TempEnth(pcount,2) = MaterialProps(propNum)
propNum=propNum+2
ENDDO
nonInc=.false.
inegptr=0
DO pcount=1,MaterialFD(MaterNum)%numTempEnth-1
IF (MaterialFD(MaterNum)%TempEnth(pcount,1) < MaterialFD(MaterNum)%TempEnth(pcount+1,1)) CYCLE
nonInc=.true.
inegptr=pcount+1
EXIT
ENDDO
IF (nonInc) THEN
CALL ShowSevereError('GetCondFDInput: '//trim(cCurrentModuleObject)//'="'//trim(MaterialNames(1))// &
'", non increasing Temperatures. Temperatures must be strictly increasing.')
CALL ShowContinueError('...occurs first at item=['//trim(RoundSigDigits(inegptr))//'], value=['// &
trim(RoundSigDigits(MaterialFD(MaterNum)%TempEnth(inegptr,1),2))//'].')
ErrorsFound=.true.
ENDIF
nonInc=.false.
inegptr=0
DO pcount=1,MaterialFD(MaterNum)%numTempEnth-1
IF (MaterialFD(MaterNum)%TempEnth(pcount,2) <= MaterialFD(MaterNum)%TempEnth(pcount+1,2)) CYCLE
nonInc=.true.
inegptr=pcount+1
EXIT
ENDDO
IF (nonInc) THEN
CALL ShowSevereError('GetCondFDInput: '//trim(cCurrentModuleObject)//'="'//trim(MaterialNames(1))// &
'", non increasing Enthalpy.')
CALL ShowContinueError('...occurs first at item=['//trim(RoundSigDigits(inegptr))//'], value=['// &
trim(RoundSigDigits(MaterialFD(MaterNum)%TempEnth(inegptr,2),2))//'].')
CALL ShowContinueError('...These values may be Cp (Specific Heat) rather than Enthalpy. Please correct.')
ErrorsFound=.true.
ENDIF
ENDDO
END IF
! Get CondFD Variable Thermal Conductivity Input
cCurrentModuleObject='MaterialProperty:VariableThermalConductivity' ! Variable Thermal Conductivity Info next
IF ( vcMat .NE. 0 ) Then ! variable k info
! CondFDVariableProperties = .TRUE.
DO Loop=1,vcMat
!Call Input Get routine to retrieve material data
CALL GetObjectItem(cCurrentModuleObject,Loop,MaterialNames,MaterialNumAlpha, &
MaterialProps,MaterialNumProp,IOSTAT, &
AlphaBlank=lAlphaFieldBlanks,NumBlank=lNumericFieldBlanks, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
!Load the material derived type from the input data.
MaterNum = FindItemInList(MaterialNames(1),Material%Name,TotMaterials)
IF (MaterNum == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//': invalid '//TRIM(cAlphaFieldNames(1))// &
' entered='//TRIM(MaterialNames(1))//', must match to a valid Material name.')
ErrorsFound=.true.
Cycle
ENDIF
IF (Material(MaterNum)%Group /= RegularMaterial) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)// &
': Reference Material is not appropriate type for CondFD properties, material='// &
TRIM(Material(MaterNum)%Name)//', must have regular properties (L,Cp,K,D)')
ErrorsFound=.true.
ENDIF
! Once the material derived type number is found then load the additional CondFD variable material properties
! Some or all may be zero (default). They will be checked when calculating node temperatures
MaterialFD(MaterNum)%numTempCond = MaterialNumProp/2
IF (MaterialFD(MaterNum)%numTempCond*2 /= MaterialNumProp) THEN
CALL ShowSevereError('GetCondFDInput: '//trim(cCurrentModuleObject)//'="'//trim(MaterialNames(1))// &
'", mismatched pairs')
CALL ShowContinueError('...expected '//trim(RoundSigDigits(MaterialFD(MaterNum)%numTempCond))// &
' pairs, but only entered '//trim(RoundSigDigits(MaterialNumProp))//' numbers.')
ErrorsFound=.true.
ENDIF
ALLOCATE(MaterialFD(MaterNum)%TempCond(MaterialFD(MaterNum)%numTempCond,2))
MaterialFD(MaterNum)%TempCond =0.0d0
propNum=1
! Temperature first
DO pcount=1,MaterialFD(MaterNum)%numTempCond
MaterialFD(MaterNum)%TempCond(pcount,1) = MaterialProps(propNum)
propNum=propNum+2
ENDDO
propNum=2
! Then Conductivity
DO pcount=1,MaterialFD(MaterNum)%numTempCond
MaterialFD(MaterNum)%TempCond(pcount,2) = MaterialProps(propNum)
propNum=propNum+2
ENDDO
nonInc=.false.
inegptr=0
DO pcount=1,MaterialFD(MaterNum)%numTempCond-1
IF (MaterialFD(MaterNum)%TempCond(pcount,1) < MaterialFD(MaterNum)%TempCond(pcount+1,1)) CYCLE
nonInc=.true.
inegptr=pcount+1
EXIT
ENDDO
IF (nonInc) THEN
CALL ShowSevereError('GetCondFDInput: '//trim(cCurrentModuleObject)//'="'//trim(MaterialNames(1))// &
'", non increasing Temperatures. Temperatures must be strictly increasing.')
CALL ShowContinueError('...occurs first at item=['//trim(RoundSigDigits(inegptr))//'], value=['// &
trim(RoundSigDigits(MaterialFD(MaterNum)%TempCond(inegptr,1),2))//'].')
ErrorsFound=.true.
ENDIF
ENDDO
END IF
DO MaterNum=1,TotMaterials
IF (MaterialFD(MaterNum)%numTempEnth == 0) THEN
MaterialFD(MaterNum)%numTempEnth=3
ALLOCATE(MaterialFD(MaterNum)%TempEnth(MaterialFD(MaterNum)%numTempEnth,2))
MaterialFD(MaterNum)%TempEnth=-100.0d0
ENDIF
IF (MaterialFD(MaterNum)%numTempCond == 0) THEN
MaterialFD(MaterNum)%numTempCond=3
ALLOCATE(MaterialFD(MaterNum)%TempCOnd(MaterialFD(MaterNum)%numTempCond,2))
MaterialFD(MaterNum)%TempCond=-100.0d0
ENDIF
ENDDO
IF (ErrorsFound) THEN
CALL ShowFatalError('GetCondFDInput: Errors found getting ConductionFiniteDifference properties. Program terminates.')
ENDIF
CALL InitialInitHeatBalFiniteDiff
RETURN
END SUBROUTINE GetCondFDInput