From 2095c669ee99715ed3cc12729ca54e1ec13ee18e Mon Sep 17 00:00:00 2001 From: Jason Floyd Date: Wed, 8 Nov 2023 08:34:41 -0500 Subject: [PATCH] FDS Source: Do smoothing on DV%VALUE when TEMPORAL_STATISTIC is not INSTANT, TIME AVERAGE, or SMOOTHED. --- Source/dump.f90 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/dump.f90 b/Source/dump.f90 index 56b06dad36d..b2c354ee273 100644 --- a/Source/dump.f90 +++ b/Source/dump.f90 @@ -6802,7 +6802,6 @@ SUBROUTINE UPDATE_DEVICES_2(T,DT) ! Create a smoothed output IF (DV%SMOOTHED_VALUE < -1.E9_EB) DV%SMOOTHED_VALUE = DV%INSTANT_VALUE - DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%INSTANT_VALUE*(1._EB-DV%SMOOTHING_FACTOR) ! Do not start summing time devices if this is the start of the simulation @@ -6823,18 +6822,22 @@ SUBROUTINE UPDATE_DEVICES_2(T,DT) CASE('INSTANT VALUE') DV%VALUE = DV%INSTANT_VALUE DV%TIME_INTERVAL = 1. + DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%INSTANT_VALUE*(1._EB-DV%SMOOTHING_FACTOR) CASE('TIME AVERAGE') DV%VALUE = DV%VALUE + DV%INSTANT_VALUE*DT DV%TIME_INTERVAL = DV%TIME_INTERVAL + DT + DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%INSTANT_VALUE*(1._EB-DV%SMOOTHING_FACTOR) CASE('RUNNING AVERAGE') WGT = DT/MAX(DT,T-DV%STATISTICS_START) DV%AVERAGE_VALUE = (1._EB-WGT)*DV%AVERAGE_VALUE + WGT*DV%INSTANT_VALUE DV%VALUE = DV%AVERAGE_VALUE + DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%VALUE*(1._EB-DV%SMOOTHING_FACTOR) DV%TIME_INTERVAL = 1._EB CASE('TIME INTEGRAL') WGT = DT/MAX(DT,T-DV%STATISTICS_START) DV%AVERAGE_VALUE = (1._EB-WGT)*DV%AVERAGE_VALUE + WGT*DV%INSTANT_VALUE DV%VALUE = DV%AVERAGE_VALUE*(T-DV%STATISTICS_START) + DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%VALUE*(1._EB-DV%SMOOTHING_FACTOR) DV%TIME_INTERVAL = 1._EB CASE('MAX','MAX TIME') INTERVAL_INDEX = INT((T-DV%STATISTICS_START)/(DV%STATISTICS_END-DV%STATISTICS_START)*REAL(DV%N_INTERVALS)) + 1 @@ -6853,6 +6856,7 @@ SUBROUTINE UPDATE_DEVICES_2(T,DT) ELSE DV%VALUE = DV%TIME_MAX_VALUE(INTERVAL_INDEX) ENDIF + DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%VALUE*(1._EB-DV%SMOOTHING_FACTOR) CASE('MIN','MIN TIME') INTERVAL_INDEX = INT((T-DV%STATISTICS_START)/(DV%STATISTICS_END-DV%STATISTICS_START)*REAL(DV%N_INTERVALS)) + 1 INTERVAL_INDEX = MAX(1,MIN(DV%N_INTERVALS,INTERVAL_INDEX)) @@ -6870,12 +6874,14 @@ SUBROUTINE UPDATE_DEVICES_2(T,DT) ELSE DV%VALUE = DV%TIME_MIN_VALUE(INTERVAL_INDEX) ENDIF + DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%VALUE*(1._EB-DV%SMOOTHING_FACTOR) CASE('RMS') WGT = DT/MAX(DT,T-DV%STATISTICS_START) DV%AVERAGE_VALUE = (1._EB-WGT)*DV%AVERAGE_VALUE + WGT*DV%INSTANT_VALUE WGT_UNBIASED = DT/MAX(DT,T-DV%STATISTICS_START+DT) DV%RMS_VALUE = (1._EB-WGT_UNBIASED)*DV%RMS_VALUE + WGT_UNBIASED*(DV%INSTANT_VALUE-DV%AVERAGE_VALUE)**2 DV%VALUE = SQRT(DV%RMS_VALUE) + DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%VALUE*(1._EB-DV%SMOOTHING_FACTOR) DV%TIME_INTERVAL = 1._EB CASE('COV') WGT = DT/MAX(DT,T-DV%STATISTICS_START) @@ -6885,6 +6891,7 @@ SUBROUTINE UPDATE_DEVICES_2(T,DT) DV%COV_VALUE = (1._EB-WGT_UNBIASED)*DV%COV_VALUE + & WGT_UNBIASED*(DV%INSTANT_VALUE-DV%AVERAGE_VALUE)*(DV%VALUE_2-DV%AVERAGE_VALUE2) DV%VALUE = DV%COV_VALUE + DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%VALUE*(1._EB-DV%SMOOTHING_FACTOR) DV%TIME_INTERVAL = 1._EB CASE('CORRCOEF') WGT = DT/MAX(DT,T-DV%STATISTICS_START) @@ -6896,12 +6903,14 @@ SUBROUTINE UPDATE_DEVICES_2(T,DT) DV%RMS_VALUE = (1._EB-WGT_UNBIASED)*DV%RMS_VALUE + WGT_UNBIASED*(DV%INSTANT_VALUE-DV%AVERAGE_VALUE )**2 DV%RMS_VALUE2 = (1._EB-WGT_UNBIASED)*DV%RMS_VALUE2+ WGT_UNBIASED*(DV%VALUE_2 -DV%AVERAGE_VALUE2)**2 DV%VALUE = DV%COV_VALUE/(SQRT(ABS(DV%RMS_VALUE*DV%RMS_VALUE2))+1.E-8_EB) + DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%VALUE*(1._EB-DV%SMOOTHING_FACTOR) DV%TIME_INTERVAL = 1._EB CASE('FAVRE AVERAGE') WGT = DT/MAX(DT,T-DV%STATISTICS_START) DV%AVERAGE_VALUE = (1._EB-WGT)*DV%AVERAGE_VALUE + WGT*DV%VALUE_1 DV%AVERAGE_VALUE2 = (1._EB-WGT)*DV%AVERAGE_VALUE2 + WGT*DV%VALUE_2 DV%VALUE = DV%AVERAGE_VALUE/DV%AVERAGE_VALUE2 * DV%CONVERSION_FACTOR + DV%CONVERSION_ADDEND + DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%VALUE*(1._EB-DV%SMOOTHING_FACTOR) DV%TIME_INTERVAL = 1._EB CASE('FAVRE RMS') WGT = DT/MAX(DT,T-DV%STATISTICS_START) @@ -6911,8 +6920,10 @@ SUBROUTINE UPDATE_DEVICES_2(T,DT) DV%RMS_VALUE = (1._EB-WGT_UNBIASED)*DV%RMS_VALUE & + WGT_UNBIASED*(DV%VALUE_1/DV%VALUE_2-DV%AVERAGE_VALUE/DV%AVERAGE_VALUE2)**2 DV%VALUE = SQRT(DV%RMS_VALUE) * DV%CONVERSION_FACTOR + DV%CONVERSION_ADDEND + DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%VALUE*(1._EB-DV%SMOOTHING_FACTOR) DV%TIME_INTERVAL = 1._EB CASE('SMOOTHED') + DV%SMOOTHED_VALUE = DV%SMOOTHED_VALUE*DV%SMOOTHING_FACTOR + DV%INSTANT_VALUE*(1._EB-DV%SMOOTHING_FACTOR) DV%VALUE = DV%SMOOTHED_VALUE DV%TIME_INTERVAL = 1. END SELECT