def __init__(self, **kwargs): """ This is where the "instantiation" occurs. Think of this as "rendering the template" or "using the cookie-cutter to make the cookie". Here is where we call all the methods that determine design parameters of the specific LFOM we are building. Parameters ---------- q : flow rate The max flow rate the LFOM can handle """ # Check the types of the required inputs required = {"q": u.L/u.s} assert_types(kwargs, required) # Check the types of the optional inputs optional = {"hL": u.cm} assert_types(kwargs, optional, strict=False) # Where the output sent to Fusion is stored self.dp = SimpleNamespace() dp = self.dp params = self.params # add kwargs as instance fields to params for k, v in kwargs.items(): setattr(params, k, v) n_rows = self.n_lfom_rows(params.q, params.hl) dp.b_row = params.hl/n_rows dp.od = pipe.OD(self.nom_diam_lfom_pipe(params.q, params.hl)) dp.d_orifice = self.orifice_diameter(params.q, params.hl, mat.DIAM_DRILL_ENG) num_orifices_final = self.n_lfom_orifices_fusion(params.q, params.hl, mat.DIAM_DRILL_ENG, n_rows) i=0 for num_per_row in num_orifices_final: setattr(dp, 'n_row_' + str(i+1), int(num_per_row)) i += 1
def test_OD(self): checks = [[1.0 * u.inch, 1.315 * u.inch]] for i in checks: with self.subTest(i=i): self.assertAlmostEqual(pipe.OD(i[0]), i[1])
def test_k_value_thick_orifice(self): self.assertAlmostEqual(k.k_value_orifice(pipe.OD(6), pipe.OD(4), 1*u.inch, 1 * u.L / u.s), 2.9070736824641181)
def test_k_value_thin_orifice(self): self.assertAlmostEqual(k.k_value_orifice(pipe.OD(6), pipe.OD(4), 0*u.inch, 1 * u.L / u.s), 3.3497584836648246)
def test_k_value_super_thick_orifice_high_headloss(self): self.assertAlmostEqual(k.k_value_orifice(pipe.OD(6), pipe.OD(4), 60*u.inch, 1 * u.L / u.s), 1.8350488368427034)
def test_k_value_expansion_into_very_large_pipe_laminar(self): self.assertAlmostEqual(k.k_value_expansion(pipe.OD(1), pipe.OD(400), 0.1 * u.L / u.s), 1.0216612503304363)
def test_k_value_expansion_into_large_tank(self): self.assertAlmostEqual(k.k_value_expansion(pipe.OD(4), pipe.OD(400), 4 * u.L / u.s), 1.0110511331493719)
def test_k_value_reduction_from_very_large_pipe_turbulent(self): self.assertAlmostEqual(k.k_value_reduction(pipe.OD(400), pipe.OD(4), 4 * u.L / u.s), 105560.31724275621)
def test_k_value_reduction_laminar(self): self.assertAlmostEqual(k.k_value_reduction(pipe.OD(1), pipe.OD(0.5), 0.1 * u.L / u.s), 2.1802730749680945)
def test_k_value_reduction_square_turbulent(self): self.assertAlmostEqual(k.k_value_reduction(pipe.OD(4), pipe.OD(2), 4 * u.L/u.s), 5.6677039356929662)
##Diameter of the holes drilled in the manifold so that the molded 1" # diffuser pipes can fit tightly in place (normal OD of a 1" pipe is # close to 1-5/16") DIAM_SED_MANIFOLD_PORT = 1.25 * u.inch ND_JET_REVERSER = 3 * u.inch # nominal diameter of pipe used for jet reverser in bottom of set tank SDR_REVERSER = 26 # SDR of jet reverser pipe ## Diffuser geometry SDR_DIFFUSER = 26 # SDR of diffuser pipe ND_DIFFUSER_PIPE = 4 * u.cm # nominal diameter of pipe used to make diffusers AREA_PVC_DIFFUSER = (np.pi/4) * ((pipe.OD(ND_DIFFUSER_PIPE)**2) - (pipe.ID_SDR(ND_DIFFUSER_PIPE, SDR_DIFFUSER))**2) RATIO_PVC_STRETCH = 1.2 # stretch factor applied to the diffuser PVC pipes as they are heated and molded T_DIFFUSER = ((pipe.OD(ND_DIFFUSER_PIPE) - pipe.ID_SDR(ND_DIFFUSER_PIPE, SDR_DIFFUSER)) / (2 * RATIO_PVC_STRETCH)) W_DIFFUSER_INNER = 0.3175 * u.cm # opening width of diffusers # Calculating using a minor loss equation with K = 1 V_SED_DIFFUSER_MAX = np.sqrt(2 * GRAVITY * HL_SED_INLET_MAX).to(u.mm/u.s) L_DIFFUSER = 15 * u.cm # vertical length of diffuser