def btx(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.properties = BTXParameterBlock(default={"valid_phase": 'Liq'}) m.fs.unit = Product(default={"property_package": m.fs.properties}) return m
def btx(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.properties = BTXParameterBlock(default={ "valid_phase": ('Liq', 'Vap'), "activity_coeff_model": "Ideal" }) m.fs.unit = Flash(default={"property_package": m.fs.properties}) return m
def btx(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.properties = BTXParameterBlock(default={"valid_phase": 'Liq'}) m.fs.unit = Heater(default={ "property_package": m.fs.properties, "has_pressure_change": True }) return m
def trans(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.properties1 = SaponificationParameterBlock() m.fs.properties2 = BTXParameterBlock() m.fs.unit = Translator( default={"inlet_property_package": m.fs.properties1, "outlet_property_package": m.fs.properties2}) return m
def btx(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.properties = BTXParameterBlock(default={"valid_phase": 'Liq'}) m.fs.unit = PressureChanger( default={ "property_package": m.fs.properties, "thermodynamic_assumption": ThermodynamicAssumption.isothermal }) return m
def btx(self): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.properties = BTXParameterBlock(default={"valid_phase": 'Liq'}) m.fs.unit = HeatExchanger( default={ "shell": { "property_package": m.fs.properties }, "tube": { "property_package": m.fs.properties }, "flow_pattern": HeatExchangerFlowPattern.cocurrent }) return m
def test_build(): m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) m.fs.ideal = BTXParameterBlock() m.fs.sap = SaponificationParameterBlock() m.fs.trans = Translator( default={"inlet_property_package": m.fs.ideal, "outlet_property_package": m.fs.sap}) assert hasattr(m.fs.trans, "inlet") assert len(m.fs.trans.inlet.vars) == 4 assert hasattr(m.fs.trans.inlet, "flow_mol") assert hasattr(m.fs.trans.inlet, "mole_frac") assert hasattr(m.fs.trans.inlet, "temperature") assert hasattr(m.fs.trans.inlet, "pressure") assert hasattr(m.fs.trans, "outlet") assert len(m.fs.trans.outlet.vars) == 4 assert hasattr(m.fs.trans.outlet, "flow_vol") assert hasattr(m.fs.trans.outlet, "conc_mol_comp") assert hasattr(m.fs.trans.outlet, "temperature") assert hasattr(m.fs.trans.outlet, "pressure")
# See if ipopt is available and set up solver if SolverFactory('ipopt').available(): solver = SolverFactory('ipopt') solver.options = {'tol': 1e-6, 'mu_init': 1e-8, 'bound_push': 1e-8} else: solver = None # ----------------------------------------------------------------------------- # Create a flowsheet for test m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) # vapor-liquid (ideal) - FcTP m.fs.properties_ideal_vl = BTXParameterBlock( default={ "valid_phase": ('Liq', 'Vap'), "activity_coeff_model": "Ideal", "state_vars": "FcTP" }) m.fs.state_block_ideal_vl = m.fs.properties_ideal_vl.\ state_block_class(default={"parameters": m.fs.properties_ideal_vl, "defined_state": True}) # liquid only (ideal) m.fs.properties_ideal_l = BTXParameterBlock(default={ "valid_phase": 'Liq', "activity_coeff_model": "Ideal", "state_vars": "FcTP" }) m.fs.state_block_ideal_l = m.fs.properties_ideal_l.state_block_class( default={ "parameters": m.fs.properties_ideal_l,
import pytest from pyomo.environ import ConcreteModel from idaes.core import FlowsheetBlock from idaes.property_models.activity_coeff_models.BTX_activity_coeff_VLE \ import BTXParameterBlock from idaes.core.util.model_statistics import degrees_of_freedom # ----------------------------------------------------------------------------- # Create a flowsheet for test m = ConcreteModel() m.fs = FlowsheetBlock(default={"dynamic": False}) # vapor-liquid (Wilson) m.fs.properties_Wilson_vl = BTXParameterBlock(default={ "valid_phase": ('Liq', 'Vap'), "activity_coeff_model": 'Wilson' }) m.fs.state_block_Wilson_vl = m.fs.properties_Wilson_vl.state_block_class( default={ "parameters": m.fs.properties_Wilson_vl, "defined_state": True }) # liquid only (Wilson) m.fs.properties_Wilson_l = BTXParameterBlock(default={ "valid_phase": 'Liq', "activity_coeff_model": 'Wilson' }) m.fs.state_block_Wilson_l = m.fs.properties_Wilson_l.state_block_class( default={ "parameters": m.fs.properties_Wilson_l,