Skip to content

Commit

Permalink
connected the thrust_weight_comp
Browse files Browse the repository at this point in the history
  • Loading branch information
FernCarrera committed May 30, 2019
1 parent 871bf17 commit ee49ca7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 34 deletions.
2 changes: 1 addition & 1 deletion n2.html
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ <h1>OpenMDAO Partition Tree and N<sup>2</sup> diagram.</h1>
</script>

<script type="text/javascript">
var modelData = {"tree": {"name": "root", "type": "root", "subsystem_type": "group", "linear_solver": "LN: RUNONCE", "nonlinear_solver": "NL: RUNONCE", "children": [{"name": "ivc", "type": "subsystem", "subsystem_type": "component", "linear_solver": "", "nonlinear_solver": "", "children": [{"name": "Wb", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "Wp", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "We/W0", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "m", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "r", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "TS", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "cd0", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "rho", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "V", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "Cd", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "Cl", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "S", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "AR", "type": "unknown", "implicit": false, "dtype": "ndarray"}]}, {"name": "weight", "type": "subsystem", "subsystem_type": "component", "linear_solver": "", "nonlinear_solver": "", "children": [{"name": "Wp", "type": "param", "dtype": "ndarray"}, {"name": "Wb", "type": "param", "dtype": "ndarray"}, {"name": "We/W0", "type": "param", "dtype": "ndarray"}, {"name": "W0", "type": "unknown", "implicit": false, "dtype": "ndarray"}]}, {"name": "FOM", "type": "subsystem", "subsystem_type": "component", "linear_solver": "", "nonlinear_solver": "", "children": [{"name": "W", "type": "param", "dtype": "ndarray"}, {"name": "cd0", "type": "param", "dtype": "ndarray"}, {"name": "rho", "type": "param", "dtype": "ndarray"}, {"name": "TS", "type": "param", "dtype": "ndarray"}, {"name": "r", "type": "param", "dtype": "ndarray"}, {"name": "FM", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "PH", "type": "unknown", "implicit": false, "dtype": "ndarray"}]}, {"name": "range", "type": "subsystem", "subsystem_type": "component", "linear_solver": "", "nonlinear_solver": "", "children": [{"name": "B_W", "type": "param", "dtype": "ndarray"}, {"name": "P_L", "type": "param", "dtype": "ndarray"}, {"name": "P_C", "type": "param", "dtype": "ndarray"}, {"name": "V", "type": "param", "dtype": "ndarray"}, {"name": "R", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "t", "type": "unknown", "implicit": false, "dtype": "ndarray"}]}, {"name": "cruiseP", "type": "subsystem", "subsystem_type": "component", "linear_solver": "", "nonlinear_solver": "", "children": [{"name": "W", "type": "param", "dtype": "ndarray"}, {"name": "Cd", "type": "param", "dtype": "ndarray"}, {"name": "Cl", "type": "param", "dtype": "ndarray"}, {"name": "AR", "type": "param", "dtype": "ndarray"}, {"name": "S", "type": "param", "dtype": "ndarray"}, {"name": "V", "type": "param", "dtype": "ndarray"}, {"name": "P_C", "type": "unknown", "implicit": false, "dtype": "ndarray"}]}]}, "connections_list": [{"src": "ivc.TS", "tgt": "FOM.TS"}, {"src": "weight.W0", "tgt": "FOM.W"}, {"src": "ivc.cd0", "tgt": "FOM.cd0"}, {"src": "ivc.r", "tgt": "FOM.r"}, {"src": "ivc.rho", "tgt": "FOM.rho"}, {"src": "ivc.AR", "tgt": "cruiseP.AR"}, {"src": "ivc.Cd", "tgt": "cruiseP.Cd"}, {"src": "ivc.Cl", "tgt": "cruiseP.Cl"}, {"src": "ivc.S", "tgt": "cruiseP.S"}, {"src": "ivc.V", "tgt": "cruiseP.V"}, {"src": "weight.W0", "tgt": "cruiseP.W"}, {"src": "ivc.Wb", "tgt": "range.B_W"}, {"src": "cruiseP.P_C", "tgt": "range.P_C"}, {"src": "FOM.PH", "tgt": "range.P_L"}, {"src": "ivc.V", "tgt": "range.V"}, {"src": "ivc.Wb", "tgt": "weight.Wb"}, {"src": "ivc.We/W0", "tgt": "weight.We/W0"}, {"src": "ivc.Wp", "tgt": "weight.Wp"}], "abs2prom": {"input": {"weight.Wp": "weight.Wp", "weight.Wb": "weight.Wb", "weight.We/W0": "weight.We/W0", "FOM.W": "FOM.W", "FOM.cd0": "FOM.cd0", "FOM.rho": "FOM.rho", "FOM.TS": "FOM.TS", "FOM.r": "FOM.r", "range.B_W": "range.B_W", "range.P_L": "range.P_L", "range.P_C": "range.P_C", "range.V": "range.V", "cruiseP.W": "cruiseP.W", "cruiseP.Cd": "cruiseP.Cd", "cruiseP.Cl": "cruiseP.Cl", "cruiseP.AR": "cruiseP.AR", "cruiseP.S": "cruiseP.S", "cruiseP.V": "cruiseP.V"}, "output": {"ivc.Wb": "Wb", "ivc.Wp": "Wp", "ivc.We/W0": "We/W0", "ivc.m": "m", "ivc.r": "r", "ivc.TS": "TS", "ivc.cd0": "cd0", "ivc.rho": "rho", "ivc.V": "V", "ivc.Cd": "Cd", "ivc.Cl": "Cl", "ivc.S": "S", "ivc.AR": "AR", "weight.W0": "weight.W0", "FOM.FM": "FOM.FM", "FOM.PH": "FOM.PH", "range.R": "range.R", "range.t": "range.t", "cruiseP.P_C": "cruiseP.P_C"}}}
var modelData = {"tree": {"name": "root", "type": "root", "subsystem_type": "group", "linear_solver": "LN: RUNONCE", "nonlinear_solver": "NL: RUNONCE", "children": [{"name": "ivc", "type": "subsystem", "subsystem_type": "component", "linear_solver": "", "nonlinear_solver": "", "children": [{"name": "Wb", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "Wp", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "We/W0", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "m", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "r", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "TS", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "cd0", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "rho", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "V", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "Cd", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "Cl", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "S", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "AR", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "G", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "n", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "e", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "W_S", "type": "unknown", "implicit": false, "dtype": "ndarray"}]}, {"name": "weight", "type": "subsystem", "subsystem_type": "component", "linear_solver": "", "nonlinear_solver": "", "children": [{"name": "Wp", "type": "param", "dtype": "ndarray"}, {"name": "Wb", "type": "param", "dtype": "ndarray"}, {"name": "We/W0", "type": "param", "dtype": "ndarray"}, {"name": "W0", "type": "unknown", "implicit": false, "dtype": "ndarray"}]}, {"name": "FOM", "type": "subsystem", "subsystem_type": "component", "linear_solver": "", "nonlinear_solver": "", "children": [{"name": "W", "type": "param", "dtype": "ndarray"}, {"name": "cd0", "type": "param", "dtype": "ndarray"}, {"name": "rho", "type": "param", "dtype": "ndarray"}, {"name": "TS", "type": "param", "dtype": "ndarray"}, {"name": "r", "type": "param", "dtype": "ndarray"}, {"name": "FM", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "PH", "type": "unknown", "implicit": false, "dtype": "ndarray"}]}, {"name": "range", "type": "subsystem", "subsystem_type": "component", "linear_solver": "", "nonlinear_solver": "", "children": [{"name": "B_W", "type": "param", "dtype": "ndarray"}, {"name": "P_L", "type": "param", "dtype": "ndarray"}, {"name": "P_C", "type": "param", "dtype": "ndarray"}, {"name": "V", "type": "param", "dtype": "ndarray"}, {"name": "R", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "t", "type": "unknown", "implicit": false, "dtype": "ndarray"}]}, {"name": "cruiseP", "type": "subsystem", "subsystem_type": "component", "linear_solver": "", "nonlinear_solver": "", "children": [{"name": "W", "type": "param", "dtype": "ndarray"}, {"name": "Cd", "type": "param", "dtype": "ndarray"}, {"name": "Cl", "type": "param", "dtype": "ndarray"}, {"name": "AR", "type": "param", "dtype": "ndarray"}, {"name": "S", "type": "param", "dtype": "ndarray"}, {"name": "V", "type": "param", "dtype": "ndarray"}, {"name": "cd0", "type": "param", "dtype": "ndarray"}, {"name": "P_C", "type": "unknown", "implicit": false, "dtype": "ndarray"}]}, {"name": "T_W", "type": "subsystem", "subsystem_type": "component", "linear_solver": "", "nonlinear_solver": "", "children": [{"name": "G", "type": "param", "dtype": "ndarray"}, {"name": "n", "type": "param", "dtype": "ndarray"}, {"name": "e", "type": "param", "dtype": "ndarray"}, {"name": "AR", "type": "param", "dtype": "ndarray"}, {"name": "cd0", "type": "param", "dtype": "ndarray"}, {"name": "rho", "type": "param", "dtype": "ndarray"}, {"name": "W_S", "type": "param", "dtype": "ndarray"}, {"name": "Vc", "type": "param", "dtype": "ndarray"}, {"name": "T_W_climb", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "T_W_cruise", "type": "unknown", "implicit": false, "dtype": "ndarray"}, {"name": "T_W_maneuver", "type": "unknown", "implicit": false, "dtype": "ndarray"}]}]}, "connections_list": [{"src": "ivc.TS", "tgt": "FOM.TS"}, {"src": "weight.W0", "tgt": "FOM.W"}, {"src": "ivc.cd0", "tgt": "FOM.cd0"}, {"src": "ivc.r", "tgt": "FOM.r"}, {"src": "ivc.rho", "tgt": "FOM.rho"}, {"src": "ivc.AR", "tgt": "T_W.AR"}, {"src": "ivc.G", "tgt": "T_W.G"}, {"src": "ivc.V", "tgt": "T_W.Vc"}, {"src": "ivc.W_S", "tgt": "T_W.W_S"}, {"src": "ivc.cd0", "tgt": "T_W.cd0"}, {"src": "ivc.e", "tgt": "T_W.e"}, {"src": "ivc.n", "tgt": "T_W.n"}, {"src": "ivc.rho", "tgt": "T_W.rho"}, {"src": "ivc.AR", "tgt": "cruiseP.AR"}, {"src": "ivc.Cd", "tgt": "cruiseP.Cd"}, {"src": "ivc.Cl", "tgt": "cruiseP.Cl"}, {"src": "ivc.S", "tgt": "cruiseP.S"}, {"src": "ivc.V", "tgt": "cruiseP.V"}, {"src": "weight.W0", "tgt": "cruiseP.W"}, {"src": "ivc.cd0", "tgt": "cruiseP.cd0"}, {"src": "ivc.Wb", "tgt": "range.B_W"}, {"src": "cruiseP.P_C", "tgt": "range.P_C"}, {"src": "FOM.PH", "tgt": "range.P_L"}, {"src": "ivc.V", "tgt": "range.V"}, {"src": "ivc.Wb", "tgt": "weight.Wb"}, {"src": "ivc.We/W0", "tgt": "weight.We/W0"}, {"src": "ivc.Wp", "tgt": "weight.Wp"}], "abs2prom": {"input": {"weight.Wp": "weight.Wp", "weight.Wb": "weight.Wb", "weight.We/W0": "weight.We/W0", "FOM.W": "FOM.W", "FOM.cd0": "FOM.cd0", "FOM.rho": "FOM.rho", "FOM.TS": "FOM.TS", "FOM.r": "FOM.r", "range.B_W": "range.B_W", "range.P_L": "range.P_L", "range.P_C": "range.P_C", "range.V": "range.V", "cruiseP.W": "cruiseP.W", "cruiseP.Cd": "cruiseP.Cd", "cruiseP.Cl": "cruiseP.Cl", "cruiseP.AR": "cruiseP.AR", "cruiseP.S": "cruiseP.S", "cruiseP.V": "cruiseP.V", "cruiseP.cd0": "cruiseP.cd0", "T_W.G": "T_W.G", "T_W.n": "T_W.n", "T_W.e": "T_W.e", "T_W.AR": "T_W.AR", "T_W.cd0": "T_W.cd0", "T_W.rho": "T_W.rho", "T_W.W_S": "T_W.W_S", "T_W.Vc": "T_W.Vc"}, "output": {"ivc.Wb": "Wb", "ivc.Wp": "Wp", "ivc.We/W0": "We/W0", "ivc.m": "m", "ivc.r": "r", "ivc.TS": "TS", "ivc.cd0": "cd0", "ivc.rho": "rho", "ivc.V": "V", "ivc.Cd": "Cd", "ivc.Cl": "Cl", "ivc.S": "S", "ivc.AR": "AR", "ivc.G": "G", "ivc.n": "n", "ivc.e": "e", "ivc.W_S": "W_S", "weight.W0": "weight.W0", "FOM.FM": "FOM.FM", "FOM.PH": "FOM.PH", "range.R": "range.R", "range.t": "range.t", "cruiseP.P_C": "cruiseP.P_C", "T_W.T_W_climb": "T_W.T_W_climb", "T_W.T_W_cruise": "T_W.T_W_cruise", "T_W.T_W_maneuver": "T_W.T_W_maneuver"}}}
</script>

<script type="text/javascript">
Expand Down
19 changes: 18 additions & 1 deletion solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from Model.Propulsion.range_comp import RangeComp
from Model.Propulsion.cruise_comp import CruiseComp
from Model.Weight.gross_weight_comp import GrossWeightComp
from Model.Weight.thrust_weight_comp import ThrustWeightComp


prob = Problem(model=Group())
Expand All @@ -27,17 +28,33 @@
ivc.add_output('S',val=13.2)
ivc.add_output('AR',val=7)

ivc.add_output('G',val=5) #climb gradient
ivc.add_output('n',val=1) # load factor
ivc.add_output('e',val=0) # oswald efficiency
ivc.add_output('W_S',val=0) # wind loading

# adding subsystems
model.add_subsystem('weight',GrossWeightComp())
model.add_subsystem('FOM',PowerComp())
model.add_subsystem('range',RangeComp())
model.add_subsystem('cruiseP',CruiseComp()) # cruise power
model.add_subsystem('T_W',ThrustWeightComp())

# conencting to weights comp
# conencting to gross_weights comp
model.connect('Wb','weight.Wb')
model.connect('Wp','weight.Wp')
model.connect('We/W0','weight.We/W0')

# connecting to thrustWeightComp
model.connect('G','T_W.G')
model.connect('n','T_W.n')
model.connect('e','T_W.e')
model.connect('AR','T_W.AR')
model.connect('cd0','T_W.cd0')
model.connect('rho','T_W.rho')
model.connect('W_S','T_W.W_S')
model.connect('V','T_W.Vc')

# connecting to Props comp
model.connect('weight.W0','FOM.W')
model.connect('cd0','FOM.cd0')
Expand Down
32 changes: 0 additions & 32 deletions thrustWeightComp.py

This file was deleted.

0 comments on commit ee49ca7

Please sign in to comment.