@@ -85,7 +85,8 @@ void RadCooling::TownsendIntegration(real dt) {
8585 int T_indx_lo = 0 ;
8686 int T_indx_hi = static_cast <int >(temperature_data.extent (0 )) - 1 ;
8787 int T_indx_mid = 0 ;
88- real temperature_max = temperature_data (T_indx_hi);
88+ real temperature_max_data = temperature_data (T_indx_hi);
89+ real temperature_min_data = temperature_data (T_indx_lo);
8990 // ideal gas eos is used
9091 real temperature = Vc (PRS ,k,j,i)/Vc (RHO ,k,j,i)*(mu*m_p/kB )*pow (vel_unit,2 );
9192
@@ -94,12 +95,12 @@ void RadCooling::TownsendIntegration(real dt) {
9495 // delta_eng(k,j,i) = ZERO_F;
9596 real del_prs = -Vc (RHO ,k,j,i)/(mu*m_p/kB )*(temperature-TcoolFloor)/pow (vel_unit,2 );
9697 delta_eng (k,j,i) = eos.GetInternalEnergy (del_prs, Vc (RHO ,k,j,i));
97- } else if ((temperature < temperature_data ( 0 ) ) ||
98- (temperature > temperature_max )) {
98+ } else if ((temperature < temperature_min_data ) ||
99+ (temperature > temperature_max_data )) {
99100 // tabulated data does not enclose the temperature value
100101 printf (" RadCooling::TownsendIntegration Temperature out of range: T=%e, "
101102 " valid range=[%e, %e]\n " ,
102- temperature, temperature_data ( 0 ), temperature_max );
103+ temperature, temperature_min_data, temperature_max_data );
103104 Kokkos::abort (" RadCooling::TownsendIntegration Temperature out of range" );
104105 } else {
105106 while (T_indx_lo<=T_indx_hi) {
0 commit comments