Skip to content

Commit

Permalink
Merge pull request #13205 from drjfloyd/master
Browse files Browse the repository at this point in the history
FDS Source: Add RAMP_DT to TIME Issue #8422
  • Loading branch information
drjfloyd authored Jul 23, 2024
2 parents a4d640b + 99d094b commit 0aa020d
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 43 deletions.
3 changes: 2 additions & 1 deletion Source/cons.f90
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,8 @@ MODULE OUTPUT_CLOCKS
INTEGER :: RAMP_SL3D_INDEX=0 !< Ramp index for 3D slice file time series
INTEGER :: RAMP_SM3D_INDEX=0 !< Ramp index for smoke3d file time series
INTEGER :: RAMP_SPEC_INDEX=0 !< Ramp index for species file time series
INTEGER :: RAMP_TIME_INDEX=0 !< Ramp index for specied simulation time steps
INTEGER :: RAMP_TIME_INDEX=0 !< Ramp index for specified simulation time steps
INTEGER :: RAMP_DT_INDEX=0 !< Ramp index for specified minimum simulation time step
INTEGER :: RAMP_TMP_INDEX =0 !< Ramp index for temperature file time series
INTEGER :: RAMP_UVW_INDEX =0 !< Ramp index for velocity file time series
REAL(EB), ALLOCATABLE, DIMENSION(:) :: BNDF_CLOCK, CPU_CLOCK,CTRL_CLOCK,DEVC_CLOCK,FLSH_CLOCK,GEOM_CLOCK, HRR_CLOCK,HVAC_CLOCK,&
Expand Down
53 changes: 24 additions & 29 deletions Source/dump.f90
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ SUBROUTINE INITIALIZE_GLOBAL_DUMPS(T,DT)
ENDDO
ENDIF

IF (APPEND) THEN
IF (.NOT. APPEND) THEN
OPEN(LU_HRR,FILE=FN_HRR,FORM='FORMATTED',STATUS='OLD')
CALL APPEND_FILE(LU_HRR,2,T_BEGIN+(T-T_BEGIN)*TIME_SHRINK_FACTOR)
ELSE
Expand Down Expand Up @@ -1023,12 +1023,7 @@ SUBROUTINE INITIALIZE_MESH_DUMPS(NM)

DO N=1,N_ISOF
IS => ISOSURFACE_FILE(N)
IF (APPEND) THEN
OPEN(ABS(LU_ISOF(N,NM)),FILE=FN_ISOF(N,NM),FORM='UNFORMATTED',STATUS='OLD',POSITION='APPEND')
IF(IS%INDEX2 /= -1 ) THEN
OPEN(ABS(LU_ISOF2(N,NM)),FILE=FN_ISOF2(N,NM),FORM='UNFORMATTED',STATUS='OLD',POSITION='APPEND')
ENDIF
ELSE
IF (.NOT. APPEND) THEN
OPEN(ABS(LU_ISOF(N,NM)),FILE=FN_ISOF(N,NM),FORM='UNFORMATTED',STATUS='REPLACE')
IF (IS%INDEX2 /= -1 ) THEN
OPEN(ABS(LU_ISOF2(N,NM)),FILE=FN_ISOF2(N,NM),FORM='UNFORMATTED',STATUS='REPLACE')
Expand Down Expand Up @@ -1069,24 +1064,19 @@ SUBROUTINE INITIALIZE_MESH_DUMPS(NM)

DO N=1,N_SMOKE3D
IF (SMOKE3D_FILE(N)%QUANTITY_INDEX==0) CYCLE
IF (APPEND) THEN
OPEN(LU_SMOKE3D(N,NM), FILE=FN_SMOKE3D(N,NM), FORM='UNFORMATTED',STATUS='OLD',POSITION='APPEND')
OPEN(LU_SMOKE3D(N+N_SMOKE3D,NM), FILE=FN_SMOKE3D(N+N_SMOKE3D,NM), FORM='FORMATTED', STATUS='OLD',POSITION='APPEND')
IF (SMOKE3D_16) THEN
OPEN(LU_SMOKE3D(N+2*N_SMOKE3D,NM),FILE=FN_SMOKE3D(N+2*N_SMOKE3D,NM),FORM='UNFORMATTED', STATUS='OLD',POSITION='APPEND')
ENDIF
ELSE
IF (.NOT. APPEND) THEN
OPEN(LU_SMOKE3D(N,NM), FILE=FN_SMOKE3D(N,NM), FORM='UNFORMATTED',STATUS='REPLACE')
WRITE(LU_SMOKE3D(N,NM)) INTEGER_ONE,INTEGER_ZERO,0,M%IBAR,0,M%JBAR,0,M%KBAR

CLOSE(LU_SMOKE3D(N,NM))
OPEN(LU_SMOKE3D(N+N_SMOKE3D,NM),FILE=FN_SMOKE3D(N+N_SMOKE3D,NM),FORM='FORMATTED',STATUS='REPLACE')
WRITE(LU_SMOKE3D(N+N_SMOKE3D,NM),*) INTEGER_ZERO

CLOSE(LU_SMOKE3D(N+N_SMOKE3D,NM))
IF (SMOKE3D_16) THEN
SMOKE3D_16_COMPRESS = 0
SMOKE3D_16_VERSION = 1
OPEN(LU_SMOKE3D(N+2*N_SMOKE3D,NM), FILE=FN_SMOKE3D(N+2*N_SMOKE3D,NM),FORM='UNFORMATTED',STATUS='REPLACE')
WRITE(LU_SMOKE3D(N+2*N_SMOKE3D,NM)) INTEGER_ONE,SMOKE3D_16_VERSION,SMOKE3D_16_COMPRESS,M%IBP1,M%JBP1,M%KBP1
CLOSE(LU_SMOKE3D(N+2*N_SMOKE3D,NM))
ENDIF
IF (M%N_STRINGS+5>M%N_STRINGS_MAX) CALL RE_ALLOCATE_STRINGS(NM)
M%N_STRINGS = M%N_STRINGS + 1
Expand Down Expand Up @@ -1314,9 +1304,7 @@ SUBROUTINE INITIALIZE_MESH_DUMPS(NM)

BF => BOUNDARY_FILE(NF)

RESTART: IF (APPEND) THEN
OPEN(LU_BNDF(NF,NM),FILE=FN_BNDF(NF,NM),FORM='UNFORMATTED',STATUS='OLD',POSITION='APPEND')
ELSE RESTART
IF (.NOT. APPEND) THEN
IF (M%N_STRINGS+5>M%N_STRINGS_MAX) CALL RE_ALLOCATE_STRINGS(NM)
M%N_STRINGS = M%N_STRINGS + 1
IF (BF%CELL_CENTERED) THEN
Expand All @@ -1341,20 +1329,16 @@ SUBROUTINE INITIALIZE_MESH_DUMPS(NM)
PA=>M%PATCH(IP)
WRITE(LU_BNDF(NF,NM)) PA%I1,PA%I2,PA%J1,PA%J2,PA%K1,PA%K2,PA%IOR,PA%OBST_INDEX,NM
ENDDO
ENDIF RESTART
CLOSE(LU_BNDF(NF,NM))
ENDIF

ENDDO BOUNDARY_FILES

! Initialize particle dump file

PARTICLE_IF: IF (PARTICLE_FILE) THEN

APPEND_PARTICLE_FILE: IF (APPEND) THEN

OPEN(LU_PART(NM),FILE=FN_PART(NM),FORM='UNFORMATTED',STATUS='OLD',POSITION='APPEND')
OPEN(LU_PART(NM+NMESHES),FILE=FN_PART(NM+NMESHES),FORM='FORMATTED',STATUS='OLD',POSITION='APPEND')

ELSE APPEND_PARTICLE_FILE
IF (.NOT. APPEND) THEN

IF (M%N_STRINGS+10*N_LAGRANGIAN_CLASSES>M%N_STRINGS_MAX) CALL RE_ALLOCATE_STRINGS(NM)
N = M%N_STRINGS_MAX/MAX(1,N_LAGRANGIAN_CLASSES)
Expand Down Expand Up @@ -1384,8 +1368,10 @@ SUBROUTINE INITIALIZE_MESH_DUMPS(NM)
WRITE(LU_PART(NM)) OUTPUT_QUANTITY(LPC%QUANTITIES_INDEX(NN))%UNITS(1:30)
ENDDO
ENDDO
CLOSE(LU_PART(NM))
CLOSE(LU_PART(NM+NMESHES))

ENDIF APPEND_PARTICLE_FILE
ENDIF
ENDIF PARTICLE_IF

! Initialize radiation file (RADF)
Expand Down Expand Up @@ -1418,8 +1404,7 @@ SUBROUTINE INITIALIZE_MESH_DUMPS(NM)
NRM = NORM2([DLX(NN),DLY(NN),DLZ(NN)])
WRITE(LU_RADF(N,NM),'(3F7.3)') DLX(NN)/NRM,DLY(NN)/NRM,DLZ(NN)/NRM
ENDDO
ELSE
OPEN(LU_RADF(N,NM),FILE=FN_RADF(N,NM),FORM='FORMATTED',STATUS='OLD',POSITION='APPEND')
CLOSE(LU_RADF(N,NM))
ENDIF
ENDDO

Expand Down Expand Up @@ -3871,6 +3856,9 @@ SUBROUTINE DUMP_PART(T,NM)

STIME = T_BEGIN + (T-T_BEGIN)*TIME_SHRINK_FACTOR

OPEN(LU_PART(NM),FILE=FN_PART(NM),FORM='UNFORMATTED',STATUS='REPLACE')
OPEN(LU_PART(NM+NMESHES),FILE=FN_PART(NM+NMESHES),FORM='FORMATTED',STATUS='REPLACE')

WRITE(LU_PART(NM)) REAL(STIME,FB)
WRITE(LU_PART(NM+NMESHES),'(ES13.6,1X,I4,1X,I4)')STIME, N_LAGRANGIAN_CLASSES, PART_BOUNDFILE_VERSION

Expand Down Expand Up @@ -3958,6 +3946,9 @@ SUBROUTINE DUMP_PART(T,NM)

ENDDO LAGRANGIAN_PARTICLE_CLASS_LOOP

CLOSE(LU_PART(NM))
CLOSE(LU_PART(NM+NMESHES))

END SUBROUTINE DUMP_PART


Expand Down Expand Up @@ -10244,6 +10235,7 @@ SUBROUTINE DUMP_BNDF(T,DT,NM)
PY => PROPERTY(BF%PROP_INDEX)
BOUND_MAX = -1.0E+33_FB
BOUND_MIN = -BOUND_MAX
OPEN(LU_BNDF(NF,NM),FILE=FN_BNDF(NF,NM),FORM='UNFORMATTED',STATUS='OLD',POSITION='APPEND')
WRITE(LU_BNDF(NF,NM)) STIME
IND = ABS(BF%INDEX)
NC = 0
Expand Down Expand Up @@ -10352,6 +10344,9 @@ SUBROUTINE DUMP_BNDF(T,DT,NM)
ENDIF

ENDDO PATCH_LOOP

CLOSE(LU_BNDF(NF,NM))

CHANGE_BOUND = 0
IF (REAL(T-T_BEGIN,FB)<TWO_EPSILON_FB) THEN
BNDF_VAL_MIN = BOUND_MIN
Expand Down
28 changes: 25 additions & 3 deletions Source/prop.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ MODULE THERMO_PROPS
LOGICAL :: FUEL=.FALSE. !< Use fuel property array for MIE
END TYPE THERMO_DATA_TYPE

TYPE(THERMO_DATA_TYPE), TARGET:: THERMO_DATA(-1:367)
TYPE(THERMO_DATA_TYPE), TARGET:: THERMO_DATA(-1:368)

CONTAINS

Expand Down Expand Up @@ -1224,10 +1224,10 @@ SUBROUTINE DEFINE_THERMO_PROPS
(/ 0.202310511E+06_EB,-0.113823591E+04_EB, 0.370027950E+01_EB,-0.183380773E-03_EB, 0.634368325E-07_EB,&
-0.706858948E-11_EB, 0.333543598E-15_EB/)
THERMO_DATA(58)%B(1:2,3) = (/ 0.584813485E+04_EB,-0.235092528E+02_EB/)
THERMO_DATA(58)%H_F = 0.000000_EB
THERMO_DATA(58)%H_F = 0.000_EB
THERMO_DATA(58)%SIGMA = 3.798_EB ! R-132
THERMO_DATA(58)%EPSOK = 71.40_EB
THERMO_DATA(58)%PR = 0.71_EB ! Assume N2
THERMO_DATA(58)%PR = 0.67_EB ! GRM3
THERMO_DATA(58)%RADCAL_ID = 'SOOT'

THERMO_DATA(59)%FORMULA = 'C10H16'
Expand Down Expand Up @@ -7570,6 +7570,28 @@ SUBROUTINE DEFINE_THERMO_PROPS
THERMO_DATA(367)%MU = 0.00051_EB !N.s/m^2
THERMO_DATA(367)%BETA = 0.00114_EB !1/K

THERMO_DATA(368)%FORMULA = 'C'
THERMO_DATA(368)%NAME = 'SOOTg'
THERMO_DATA(368)%POLY = 'NASA9'
THERMO_DATA(368)%BANDS = 3
THERMO_DATA(368)%T(1:4) = (/ 0.200000000E+03_EB, 0.100000000E+04_EB, 0.600000000E+04_EB, 0.200000000E+05_EB/)
THERMO_DATA(368)%A(1:7,1) = &
(/ 6.495031470E+02_EB,-9.649010860E-01_EB, 2.504675479E+00_EB,-1.281448025E-05_EB, 1.980133654E-08_EB,&
-1.606144025E-11_EB, 5.314483411E-15_EB/)
THERMO_DATA(368)%B(1:2,1) = (/ 8.545763110E+04_EB, 4.747924288E+00_EB/)
THERMO_DATA(368)%A(1:7,2) = &
(/ -1.289136472E+05_EB, 1.719528572E+02_EB, 2.646044387E+00_EB,-3.353068950E-04_EB, 1.742092740E-07_EB,&
-2.902817829E-11_EB, 1.642182385E-15_EB/)
THERMO_DATA(368)%B(1:2,2) = (/ 8.410597850E+04_EB, 4.130047418E+00_EB/)
THERMO_DATA(368)%A(1:7,3) = &
(/ 4.432528010E+08_EB,-2.886018412E+05_EB, 7.737108320E+01_EB,-9.715281890E-03_EB, 6.649595330E-07_EB,&
-2.230078776E-11_EB, 2.899388702E-16_EB/)
THERMO_DATA(368)%B(1:2,3) = (/ 2.355273444E+06_EB,-6.405123160E+02_EB/)
THERMO_DATA(368)%H_F = 716.67672_EB
THERMO_DATA(368)%SIGMA = 3.798_EB ! R-132
THERMO_DATA(368)%EPSOK = 71.40_EB
THERMO_DATA(368)%PR = 0.67_EB ! GRM3

END SUBROUTINE DEFINE_THERMO_PROPS

END MODULE THERMO_PROPS
2 changes: 2 additions & 0 deletions Source/radi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4594,6 +4594,7 @@ SUBROUTINE RADIATION_FVM

DO N=1,N_RADF
RF => RAD_FILE(N)
OPEN(LU_RADF(N,NM),FILE=FN_RADF(N,NM),FORM='FORMATTED',STATUS='OLD',POSITION='APPEND')
WRITE(LU_RADF(N,NM),'(/A)') 'TIME'
WRITE(LU_RADF(N,NM),'(F8.2)') T
WRITE(LU_RADF(N,NM),'(/A)') 'INTENSITIES'
Expand All @@ -4605,6 +4606,7 @@ SUBROUTINE RADIATION_FVM
ENDDO
ENDDO
ENDDO
CLOSE(LU_RADF(N,NM))
ENDDO

RADF_COUNTER(NM) = RADF_COUNTER(NM) + 1
Expand Down
14 changes: 11 additions & 3 deletions Source/read.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1474,18 +1474,19 @@ END SUBROUTINE READ_TRAN
SUBROUTINE READ_TIME(DT)

USE MATH_FUNCTIONS, ONLY: GET_RAMP_INDEX
USE OUTPUT_CLOCKS, ONLY: RAMP_TIME_INDEX
USE OUTPUT_CLOCKS, ONLY: RAMP_TIME_INDEX,RAMP_DT_INDEX
REAL(EB), INTENT(OUT) :: DT
CHARACTER(LABEL_LENGTH) :: RAMP_TIME
CHARACTER(LABEL_LENGTH) :: RAMP_TIME,RAMP_DT
NAMELIST /TIME/ DT,DT_END_FILL,DT_END_MINIMUM,DT_EXTERNAL,DT_EXTERNAL_HEARTBEAT,EXTERNAL_HEARTBEAT_FILENAME,HEARTBEAT_FAIL,&
FYI,LIMITING_DT_RATIO,LOCK_TIME_STEP,&
FYI,LIMITING_DT_RATIO,LOCK_TIME_STEP,RAMP_DT,&
RAMP_TIME,RESTRICT_TIME_STEP,T_BEGIN,T_END,TIME_SHRINK_FACTOR,WALL_INCREMENT

DT = -1._EB
TIME_SHRINK_FACTOR = 1._EB
T_BEGIN = 0._EB
T_END = 1._EB
RAMP_TIME = 'null'
RAMP_DT = 'null'

REWIND(LU_INPUT) ; INPUT_FILE_LINE_NUMBER = 0
READ_TIME_LOOP: DO
Expand All @@ -1505,7 +1506,14 @@ SUBROUTINE READ_TIME(DT)

! Set up time ramp if specified

IF (RAMP_TIME /='null' .AND. RAMP_DT /='null') THEN
WRITE(MESSAGE,'(A)') &
'ERROR(XXX): On TIME, do not set both RAMP_TIME and RAMP_DT.'
CALL SHUTDOWN(MESSAGE) ; RETURN
ENDIF

IF (RAMP_TIME /='null') CALL GET_RAMP_INDEX(RAMP_TIME,'TIME',RAMP_TIME_INDEX)
IF (RAMP_DT /='null') CALL GET_RAMP_INDEX(RAMP_DT,'TIME',RAMP_DT_INDEX)

IF (DT_EXTERNAL_HEARTBEAT <= TWO_EPSILON_EB .NEQV. EXTERNAL_HEARTBEAT_FILENAME=='null') THEN
WRITE(MESSAGE,'(A)') &
Expand Down
14 changes: 12 additions & 2 deletions Source/smvv.f90
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ END SUBROUTINE SLICE_TO_RLEFILE
SUBROUTINE SMOKE3D_TO_FILE(NM,TIME,DX,SMOKE3D_INDEX,VALS,NX,NY,NZ,SMOKE3D_16_FLAG)

USE OUTPUT_DATA, ONLY: SMOKE3D_TYPE,SMOKE3D_FILE,N_SMOKE3D
USE GLOBAL_CONSTANTS, ONLY: TMPA,TMPM,LU_SMOKE3D,TEMP_MAX_SMV,HRRPUV_MAX_SMV
USE GLOBAL_CONSTANTS, ONLY: TMPA,TMPM,LU_SMOKE3D,FN_SMOKE3D,TEMP_MAX_SMV,HRRPUV_MAX_SMV
INTEGER, INTENT(IN) :: NX,NY,NZ,NM,SMOKE3D_INDEX
LOGICAL, INTENT(IN) :: SMOKE3D_16_FLAG
REAL(FB), INTENT(IN) :: TIME, DX
Expand Down Expand Up @@ -989,15 +989,19 @@ SUBROUTINE SMOKE3D_TO_FILE(NM,TIME,DX,SMOKE3D_INDEX,VALS,NX,NY,NZ,SMOKE3D_16_FLA
! Write size information to a text file

IF (.NOT.SMOKE3D_16_FLAG) THEN ! write out an extra column below if SMOKE3D_16_FLAG is true
OPEN(LU_SMOKE3D(SMOKE3D_INDEX+N_SMOKE3D,NM),FILE=FN_SMOKE3D(SMOKE3D_INDEX+N_SMOKE3D,NM),&
FORM='FORMATTED',STATUS='OLD',POSITION='APPEND')
WRITE(LU_SMOKE3D(SMOKE3D_INDEX+N_SMOKE3D,NM),*) TIME,NCHARS_IN,NCHARS_OUT,MAX_VAL
CLOSE(LU_SMOKE3D(SMOKE3D_INDEX+N_SMOKE3D,NM))
ENDIF

! Write data

OPEN(LU_SMOKE3D(SMOKE3D_INDEX,NM),FILE=FN_SMOKE3D(SMOKE3D_INDEX,NM),FORM='UNFORMATTED',STATUS='OLD',POSITION='APPEND')
WRITE(LU_SMOKE3D(SMOKE3D_INDEX,NM)) TIME
WRITE(LU_SMOKE3D(SMOKE3D_INDEX,NM)) NCHARS_IN,NCHARS_OUT
WRITE(LU_SMOKE3D(SMOKE3D_INDEX,NM)) (BUFFER_OUT(I),I=1,NCHARS_OUT)

CLOSE(LU_SMOKE3D(SMOKE3D_INDEX,NM))
! write out data as 2 byte integers

IF (SMOKE3D_16_FLAG) THEN
Expand All @@ -1022,12 +1026,18 @@ SUBROUTINE SMOKE3D_TO_FILE(NM,TIME,DX,SMOKE3D_INDEX,VALS,NX,NY,NZ,SMOKE3D_16_FLA
BUFFER16_IN(2*i) = CHAR(VAL_LOW)
ENDDO

OPEN(LU_SMOKE3D(SMOKE3D_INDEX+N_SMOKE3D,NM),FILE=FN_SMOKE3D(SMOKE3D_INDEX+N_SMOKE3D,NM),&
FORM='FORMATTED',STATUS='OLD',POSITION='APPEND')
WRITE(LU_SMOKE3D(SMOKE3D_INDEX+N_SMOKE3D,NM),*) TIME,NCHARS_IN,NCHARS_OUT,MAX_VAL,NVALS16_OUT
CLOSE(LU_SMOKE3D(SMOKE3D_INDEX+N_SMOKE3D,NM))

OPEN(LU_SMOKE3D(SMOKE3D_INDEX+2*N_SMOKE3D,NM),FILE=FN_SMOKE3D(SMOKE3D_INDEX+2*N_SMOKE3D,NM),FORM='UNFORMATTED',&
STATUS='OLD',POSITION='APPEND')
WRITE(LU_SMOKE3D(SMOKE3D_INDEX + 2*N_SMOKE3D,NM)) TIME
WRITE(LU_SMOKE3D(SMOKE3D_INDEX + 2*N_SMOKE3D,NM)) NVALS,NVALS16_OUT,SMOKE3D_16_VALMIN,SMOKE3D_16_VALMAX
! output (2**16 - 1)(val-valmin)/(valmax-valmin)
WRITE(LU_SMOKE3D(SMOKE3D_INDEX + 2*N_SMOKE3D,NM)) (BUFFER16_IN(I),I=1,2*NVALS)
CLOSE(LU_SMOKE3D(SMOKE3D_INDEX + 2*N_SMOKE3D,NM))
DEALLOCATE(BUFFER16_IN)
ENDIF

Expand Down
14 changes: 9 additions & 5 deletions Source/velo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ SUBROUTINE VELOCITY_PREDICTOR(T,DT,DT_NEW,NM)
IF (SOLID_PHASE_ONLY) RETURN
IF (PERIODIC_TEST==4) THEN
CALL COMPRESSION_WAVE(NM,T,4)
CALL CHECK_STABILITY(DT,DT_NEW,NM)
CALL CHECK_STABILITY(DT,DT_NEW,T,NM)
RETURN
ENDIF

Expand Down Expand Up @@ -1712,7 +1712,7 @@ SUBROUTINE VELOCITY_PREDICTOR(T,DT,DT_NEW,NM)

! Check the stability criteria, and if the time step is too small, send back a signal to kill the job

CALL CHECK_STABILITY(DT,DT_NEW,NM)
CALL CHECK_STABILITY(DT,DT_NEW,T,NM)

IF (DT_NEW(NM)<DT_INITIAL*LIMITING_DT_RATIO .AND. (T+DT_NEW(NM)<(T_END-TWO_EPSILON_EB))) STOP_STATUS = INSTABILITY_STOP

Expand Down Expand Up @@ -2984,15 +2984,17 @@ END SUBROUTINE MATCH_VELOCITY_FLUX
!> \brief Check the Courant and Von Neumann stability criteria, and if necessary, reduce or increase the time step
!> \param DT Time step (s)
!> \param DT_NEW New time step (s)
!> \param T Current time (s)
!> \param NM Mesh number

SUBROUTINE CHECK_STABILITY(DT,DT_NEW,NM)
SUBROUTINE CHECK_STABILITY(DT,DT_NEW,T,NM)

USE CC_SCALARS, ONLY : CHECK_CFLVN_LINKED_CELLS
USE OUTPUT_CLOCKS, ONLY: RAMP_TIME_INDEX
USE OUTPUT_CLOCKS, ONLY: RAMP_TIME_INDEX,RAMP_DT_INDEX
USE MATH_FUNCTIONS, ONLY: EVALUATE_RAMP

INTEGER, INTENT(IN) :: NM
REAL(EB), INTENT(IN) :: DT
REAL(EB), INTENT(IN) :: DT,T
REAL(EB) :: UODX,VODY,WODZ,UVW,UVWMAX,R_DX2,MU_MAX,MUTRM,PART_CFL,MU_TMP, UVWMAX_TMP, DT_CLIP, T_NOW
REAL(EB) :: DT_NEW(NMESHES)
INTEGER :: I,J,K,IW,IIG,JJG,KKG, ICFL_TMP, JCFL_TMP, KCFL_TMP
Expand Down Expand Up @@ -3153,6 +3155,8 @@ SUBROUTINE CHECK_STABILITY(DT,DT_NEW,NM)
DT_CLIP)
CHANGE_TIME_STEP_INDEX(NM) = -1
ENDIF

IF (RAMP_DT_INDEX > 0) DT_NEW(NM) = MIN(DT_NEW(NM),EVALUATE_RAMP(T,RAMP_DT_INDEX))

ENDIF RAMP_TIME_IF

Expand Down

0 comments on commit 0aa020d

Please sign in to comment.