Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
uvahotspot
GitHub Repository: uvahotspot/HotSpot
Path: blob/master/microchannel.h
612 views
1
#ifndef __MICROCHANNEL_H
2
#define __MICROCHANNEL_H
3
4
#include "util.h"
5
#include "materials.h"
6
7
// file extensions used for microchannels
8
#define NETWORK_EXTENSION ".csv"
9
#define FLOORPLAN_EXTENSION ".flp"
10
11
// Different types of cells in microchannel layer
12
#define TSV -1
13
#define SOLID 0
14
#define FLUID 1
15
#define INLET 2
16
#define OUTLET 3
17
18
// One extra node for the pump
19
#define EXTRA_PRESSURE_NODES 1
20
21
#define IS_FLUID_CELL(uconf, i, j) (uconf->cell_types[i][j] == FLUID || \
22
uconf->cell_types[i][j] == INLET || \
23
uconf->cell_types[i][j] == OUTLET)
24
25
#define IS_INLET_CELL(uconf, i, j) (uconf->cell_types[i][j] == INLET)
26
27
#define IS_OUTLET_CELL(uconf, i, j) (uconf->cell_types[i][j] == OUTLET)
28
29
typedef struct microchannel_config_t_st
30
{
31
// width of an individual cell in m
32
double cell_width;
33
34
// height of an individual cell in m
35
double cell_height;
36
37
// thickness of an individual cell in m
38
double cell_thickness;
39
40
// pumping pressure between inlet(s) and outlet(s) in Pa
41
double pumping_pressure;
42
43
// pump internal resistance in K/W
44
double pump_internal_res;
45
46
// temperature of coolant at inlet in K
47
double inlet_temperature;
48
49
// volumetric heat capacity of coolant in J/m^3-K
50
double coolant_capac;
51
52
// resistivity of coolant in m-K/W
53
double coolant_res;
54
55
// dynamic viscosity of coolant in Pa-s/m^3
56
double coolant_visc;
57
58
// volumetric heat capacity of channel walls in J/m^3-K
59
double wall_capac;
60
61
// resistivity of channel walls in m-K/W
62
double wall_res;
63
64
// Heat Transfer Coefficient from coolant to channel walls in W/m^2-K
65
double htc;
66
67
// csv file containing description of microchannel network
68
char network_file[STR_SIZE];
69
70
// floorplan file created from network_file
71
char floorplan_file[STR_SIZE+3];
72
73
// rows and columns in microchannel network
74
int num_rows;
75
int num_columns;
76
77
// number of fluid cells in microchannel network
78
int n_fluid_cells;
79
80
// array of cell types
81
int **cell_types;
82
83
// mapping from cell indices to pressure circuit node indices
84
int **mapping;
85
86
// For SuperLU
87
double **A;
88
double *b;
89
int nnz;
90
} microchannel_config_t;
91
92
microchannel_config_t default_microchannel_config(void);
93
void microchannel_config_add_from_strs(microchannel_config_t *config, materials_list_t *materials_list, str_pair *table, int size);
94
int microchannel_config_to_strs(microchannel_config_t *config, str_pair *table, int max_entries);
95
void microchannel_build_network(microchannel_config_t *config);
96
void build_pressure_matrix(microchannel_config_t *config);
97
double flow_rate(microchannel_config_t *config, int cell1_i, int cell1_j, int cell2_i, int cell2_j);
98
void copy_microchannel(microchannel_config_t *src, microchannel_config_t *dst);
99
void free_microchannel(microchannel_config_t * config);
100
101
#endif
102
103