def build(self): nfe = 6 fe_a = 1/4.0 fe_b = 0.2 fe_set = [0,0.004] for i in range(1,nfe+1): if i < nfe*fe_a: fe_set.append(i*fe_b/(nfe*fe_a)) elif i == nfe: fe_set.append(1) else: fe_set.append(fe_b + (i-nfe*fe_a)*(1-fe_b)/(nfe*(1-fe_a))) self.MB_fuel = MB_CLC_fuel.MB( parent=self, z_dae_method = 'OCLR', #t_dae_method = 'OCLR', t_dae_method = method, press_drop = p_drop, fe_set = fe_set, ncp = 3, horizon = H, nfe_t = 1, ncp_t = ncp)
def build(self): """ Make the flowsheet object, fix some variables, and solve the problem """ # Create a custom grid, fe_set # why create an fe_set instead of using Transformation # factory? nfe = 6 fe_a = 1 / 4.0 fe_b = 0.2 fe_set = [0, 0.004] for i in range(1, nfe + 1): if i < nfe * fe_a: fe_set.append(i * fe_b / (nfe * fe_a)) elif i == nfe: fe_set.append(1) else: fe_set.append(fe_b + (i - nfe * fe_a) * (1 - fe_b) / (nfe * (1 - fe_a))) """ Args: (to MB_CLC_fuel object, as defined in model file) dae_method = method to use for calcuating derivatives (default = OCLR) - BFD1 - 1st order backwards finite difference - OCLR - Orthogonal collocation, Lagrange-Radau - OCLL - Orthogonal collocation, Lagrange-Legendre press_drop = Pressure drop correlation for superficial velocity calc. - SimplifiedP - simplified pressure correlations - Ergun - Ergun equation fe_set = set of normalised finite element locations nfe = number of finite elements for bed discretization (default = 15) (not used if fe_set specified) ncp = number of collocation points (OCLR or OCLL only, default = 3) fe_set_t nfe_t ^ adding time set as a model-level continuous set... will change when moving to new framework """ # Create unit model for fuel reactor # unit model - an attribute of the flowsheet model # "a block within a block" #self.MB_fuel = MB_CLC_fuel.MB( # parent=self, # dae_method = 'OCLR', # press_drop = 'Ergun', # fe_set = fe_set, # ncp = 3) # need to add time set to the above # open question still: # how long of a horizon should I simulate? # # why is nfe in z-dimension not an input here? # controlled by fe_set... self.MB_fuel = MB_CLC_fuel.MB( parent=self, dae_method='OCLR', press_drop='Ergun', fe_set=fe_set, ncp=3, horizon=1, # was 10 nfe_t=1, # " " ncp_t=3)