Exemplo n.º 1
0
    def __init__(self, inputs: dict, ip: InputProcessor, op: OutputProcessor):
        SimulationEntryPoint.__init__(self, inputs)
        self.load = inputs['value']
        self.ip = ip
        self.op = op

        # report variables
        self.inlet_temp = ip.init_temp()
        self.outlet_temp = ip.init_temp()
    def __init__(self, inputs: dict, ip: InputProcessor, op: OutputProcessor):
        SimulationEntryPoint.__init__(self, inputs)
        self.ip = ip
        self.op = op

        # props instances
        self.fluid = ip.props_mgr.fluid
        self.soil = ip.props_mgr.soil

        # init paths
        self.paths = []
        for path in inputs['flow-paths']:
            self.paths.append(Path(path, ip, op))

        # some stats about the bh field
        self.h = self.calc_bh_ave_length()
        self.num_bh = self.count_bhs()
        self.num_paths = len(self.paths)

        # generate the g-function data
        self.ts = self.h**2 / (9 * self.soil.diffusivity)
        self.lntts = None
        self.g = None
        self.lntts_b = None
        self.g_b = None

        if 'g-function-path' in inputs:
            data_g = np.genfromtxt(inputs['g-function-path'], delimiter=',')
            self.lntts = data_g[:, 0]
            self.g = data_g[:, 1]
        else:
            self.generate_g()

        # load aggregation method
        la_inputs = merge_dicts(inputs['load-aggregation'], {
            'lntts': self.lntts,
            'g-values': self.g,
            'time-scale': self.ts
        })
        self.load_agg = make_agg_method(la_inputs, ip)

        # other
        self.energy = 0
        self.c_0 = 1 / (2 * pi * self.soil.conductivity)

        # report variables
        self.heat_rate = 0
        self.heat_rate_bh = 0
        self.flow_rate = 0
        self.inlet_temperature = ip.init_temp()
        self.outlet_temperature = ip.init_temp()
        self.bh_wall_temperature = ip.init_temp()
Exemplo n.º 3
0
    def __init__(self, inputs: dict, ip: InputProcessor, op: OutputProcessor):
        SimulationEntryPoint.__init__(self, inputs)
        self.temperature = inputs['value']
        self.ip = ip
        self.op = op

        self.inlet_temperature = ip.init_temp()
    def __init__(self, inputs: dict, ip: InputProcessor, op: OutputProcessor):
        SimulationEntryPoint.__init__(self, inputs)
        self.ip = ip
        self.op = op

        # props instances
        self.fluid = ip.props_mgr.fluid
        self.soil = ip.props_mgr.soil

        # geometry and other config parameters needed externally
        self.h = inputs['length']
        self.num_bh = inputs['number-boreholes']
        self.num_paths = len(inputs['flow-paths'])

        # load aggregation method
        ts = self.h**2 / (9 * self.soil.diffusivity)
        la_inputs = merge_dicts(
            inputs['load-aggregation'], {
                'g-function-path': inputs['g-function-path'],
                'g_b-function-path': inputs['g_b-function-path'],
                'time-scale': ts
            })

        if 'g_b-flow-rates' in inputs:
            la_inputs['g_b-flow-rates'] = inputs['g_b-flow-rates']
        self.load_agg = make_agg_method(la_inputs, ip)

        # average borehole
        d_ave_bh = {
            'average-borehole': inputs['average-borehole'],
            'name': 'average-borehole',
            'borehole-type': 'single-grouted'
        }
        self.ave_bh = make_borehole(d_ave_bh, ip, op)

        self.cross_ghe_present = False
        self.cross_ghe = []
        if 'cross-loads' in inputs:
            self.cross_ghe_present = True
            for x_ghe in inputs['cross-loads']:
                d_x = {
                    'load-aggregation':
                    merge_dicts(
                        inputs['load-aggregation'], {
                            'g-function-path': x_ghe['g-function-path'],
                            'time-scale': ts
                        }),
                    'load-data-path':
                    x_ghe['load-data-path'],
                    'start-time':
                    x_ghe['start-time'],
                    'length':
                    x_ghe['length']
                }
                if 'number-of-instances' in x_ghe:
                    num_duplicates = x_ghe['number-of-instances']
                else:
                    num_duplicates = 1
                for idx in range(num_duplicates):
                    self.cross_ghe.append(CrossGHE(d_x, ip, op))

        # method constants
        k_s = self.soil.conductivity
        self.c_0 = 1 / (2 * pi * k_s)

        # heat rate (W/m)
        self.q = 0

        # energy (J/m)
        self.energy = 0

        # report variables
        self.heat_rate = 0
        self.inlet_temperature = ip.init_temp()
        self.outlet_temperature = ip.init_temp()
        self.bh_wall_temperature = ip.init_temp()
        self.resist_b = 0
        self.resist_b_eff = 0