void fill_liquid_cell_pf ( ThermalCell *thermal_cell, Time_t delta_time, CellDimension_t cell_length, CellDimension_t cell_width, CellDimension_t cell_height, ChannelModel_t pin_distribution, ChannelDimension_t porosity, Coolant_t coolant ) { Cconv_t C = CCONV_PF (coolant.VHC, coolant.DarcyVelocity, cell_length, cell_height); thermal_cell->North = C; thermal_cell->South = -C; thermal_cell->East = thermal_cell->West = (Conductance_t) 0.0 ; DarcyVelocity_t eff_htc ; if (pin_distribution == TDICE_CHANNEL_MODEL_PF_INLINE) eff_htc = EFFECTIVE_HTC_PF_INLINE(coolant.DarcyVelocity) ; else eff_htc = EFFECTIVE_HTC_PF_STAGGERED(coolant.DarcyVelocity) ; thermal_cell->Top = thermal_cell->Bottom = eff_htc * cell_width * cell_length ; thermal_cell->Capacity = ((cell_length * cell_width * cell_height) * coolant.VHC) * porosity / delta_time ; #ifdef PRINT_THERMAL_CELLS fprintf (stderr, "| l %6.1f w %6.1f h %6.1f " \ "| N % .5e S % .5e E % .5e W % .5e T % .5e B % .5e | C %.5e\n", cell_length, cell_width, cell_height, thermal_cell->North, thermal_cell->South, thermal_cell->East, thermal_cell->West, thermal_cell->Top, thermal_cell->Bottom, thermal_cell->Capacity) ; #endif }
Conductance_t get_conductance_bottom ( ThermalGrid_t *tgrid, Dimensions_t *dimensions, CellIndex_t layer_index, CellIndex_t row_index, CellIndex_t column_index ) { if (layer_index > tgrid->Size) { fprintf (stderr, "ERROR: layer index %d is out of range\n", layer_index) ; return 0.0 ; } switch (tgrid->LayersProfile [layer_index]) { case TDICE_LAYER_SOLID : case TDICE_LAYER_SOURCE : if (IS_FIRST_LAYER (layer_index)) return 0.0 ; else if (IS_LAST_LAYER (layer_index, dimensions)) return ( tgrid->TCProfile [ layer_index ] * get_cell_length (dimensions, column_index) * get_cell_width (dimensions, row_index) ) / get_cell_height (dimensions, layer_index) ; else return ( tgrid->TCProfile [ layer_index ] * get_cell_length (dimensions, column_index) * get_cell_width (dimensions, row_index) ) / (get_cell_height (dimensions, layer_index) / 2.0) ; case TDICE_LAYER_SOLID_CONNECTED_TO_AMBIENT : case TDICE_LAYER_SOURCE_CONNECTED_TO_AMBIENT : case TDICE_LAYER_SPREADER : case TDICE_LAYER_SINK : return ( tgrid->TCProfile [ layer_index ] * get_cell_length (dimensions, column_index) * get_cell_width (dimensions, row_index) ) / (get_cell_height (dimensions, layer_index) / 2.0) ; case TDICE_LAYER_CHANNEL_4RM : if (IS_CHANNEL_COLUMN (TDICE_CHANNEL_MODEL_MC_4RM, column_index)) return tgrid->Channel->Coolant.HTCBottom * get_cell_width (dimensions, row_index) * get_cell_length (dimensions, column_index) ; else // We assume that layer_index is not the top most layer // or the bottom most layer return ( tgrid->TCProfile [ layer_index ] * get_cell_length (dimensions, column_index) * get_cell_width (dimensions, row_index) ) / (get_cell_height (dimensions, layer_index) / 2.0) ; case TDICE_LAYER_CHANNEL_2RM : return tgrid->Channel->Coolant.HTCBottom * get_cell_width (dimensions, row_index) * get_cell_length (dimensions, column_index) ; case TDICE_LAYER_PINFINS_INLINE : return EFFECTIVE_HTC_PF_INLINE (tgrid->Channel->Coolant.DarcyVelocity) * get_cell_width (dimensions, row_index) * get_cell_length (dimensions, column_index) ; case TDICE_LAYER_PINFINS_STAGGERED : return EFFECTIVE_HTC_PF_STAGGERED (tgrid->Channel->Coolant.DarcyVelocity) * get_cell_width (dimensions, row_index) * get_cell_length (dimensions, column_index) ; case TDICE_LAYER_VWALL_CHANNEL : case TDICE_LAYER_VWALL_PINFINS : return ( tgrid->TCProfile [ layer_index ] * get_cell_length (dimensions, column_index) * get_cell_width (dimensions, row_index) ) / (get_cell_height (dimensions, layer_index) / 2.0) * (1.0 - tgrid->Channel->Porosity) ; case TDICE_LAYER_TOP_WALL : case TDICE_LAYER_BOTTOM_WALL : return 0.0 ; case TDICE_LAYER_NONE : fprintf (stderr, "ERROR: unset layer type\n") ; return 0.0 ; default : fprintf (stderr, "ERROR: unknown layer type %d\n", tgrid->LayersProfile [layer_index]) ; return 0.0 ; } }