-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOrifice_testing.py
More file actions
61 lines (41 loc) · 2.35 KB
/
Copy pathOrifice_testing.py
File metadata and controls
61 lines (41 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from FCOFFS.utilities.units import *
#from FCOFFS.utilities.uniSS import *
from FCOFFS.components import *
from FCOFFS.interfaces.interface import *
from FCOFFS.systems.steady import *
from FCOFFS.systems.transient import *
import matplotlib.pyplot as plt
SS = SteadySolver(ref_p=UnitValue("IMPERIAL", "PRESSURE", "psig", 0))
# TS = TransientSolver(ref_p=UnitValue("IMPERIAL", "PRESSURE", "psig", 0))
interface1 = Interface("INTER1")
interface2 = Interface("INTER2")
interface3 = Interface("INTER3")
interface4 = Interface("INTER4")
inlet = pressure_tank_inlet.PressurantTank(SS, UnitValue.create_unit("in", 0.25), "N2", UnitValue.create_unit("psig", 872), UnitValue.create_unit("C", 5), UnitValue.create_unit("m^3", 0.1), UnitValue.create_unit("m/s", 10))
#inlet = pressure_inlet.PressureInlet(SS.quasi_steady_solver, UnitValue.create_unit("in", 0.25), "N2", UnitValue.create_unit("psi", 800), UnitValue.create_unit("C", 5), UnitValue.create_unit("m/s", 10), "pressure_inlet")
#p = pipe.Pipe(SS, UnitValue.create_unit('in', 0.25), "N2", UnitValue.create_unit('ft', 2))
orifice = critical_orifice.CriticalOrifice(SS, UnitValue.create_unit("in",0.25), UnitValue.create_unit("in", 0.25), UnitValue.create_unit("in", 0.07), "N2", Cd=0.9)
#p2 = pipe.Pipe(SS, UnitValue.create_unit('in', 0.25), "N2", UnitValue.create_unit('ft', 2), name = "pipe 2")
outlet = pressure_outlet.PressureOutlet(SS, UnitValue.create_unit("in",0.25), "N2", UnitValue.create_unit("psig", 0))
#outlet = mass_flow_outlet.MassFlowOutlet(SS, UnitValue.create_unit("in", 0.25), "N2", UnitValue.create_unit("kg/s", 0.06))
inlet.set_connection(downstream=interface1)
#p.set_connection(interface1, interface2)
orifice.set_connection(interface1, interface2)
#p2.set_connection(interface3, interface4)
outlet.set_connection(upstream=interface2)
'''
inter_face
'''
SS.Output.toggle_steady_state_output()
SS.Output.set_ouput_unit("psi")
SS.initialize([inlet, orifice, outlet])
SS.solve()
interface1.state.T
# SS.solve(0, 0.1)
flow = interface1.state.mdot/interface1.state.rho
flow.to("SCFM", temperature=interface1.state.T, pressure=interface1.state.p)
print(flow)
# def comp_eval(component: componentClass.ComponentClass, inlet: componentClass.ComponentClass, outlet: componentClass.ComponentClass):
# system = SteadySolver()
# system.initialize([inlet, component, outlet])
# system.solve()