From f6c8c0c8504fcc809945f0c9f225b6ef87e63436 Mon Sep 17 00:00:00 2001 From: Eytan Adler Date: Fri, 19 Jan 2024 17:42:12 -0500 Subject: [PATCH 1/3] Fix connections in ImplicitCompressibleDuct --- openconcept/thermal/ducts.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/openconcept/thermal/ducts.py b/openconcept/thermal/ducts.py index 5d23b0ea..6a1abb76 100644 --- a/openconcept/thermal/ducts.py +++ b/openconcept/thermal/ducts.py @@ -968,6 +968,7 @@ class ImplicitCompressibleDuct(Group): def initialize(self): self.options.declare("num_nodes", default=1, desc="Number of analysis points") + self.options.declare("cfg", default=0.98, desc="Gross thrust coefficient") def setup(self): nn = self.options["num_nodes"] @@ -981,6 +982,7 @@ def setup(self): iv.add_output("delta_p_1", val=np.zeros((nn,)), units="Pa") iv.add_output("heat_in_1", val=np.zeros((nn,)), units="W") iv.add_output("pressure_recovery_1", val=np.ones((nn,))) + iv.add_output("loss_factor_1", val=0.0) iv.add_output("delta_p_2", val=np.ones((nn,)) * 0.0, units="Pa") iv.add_output("heat_in_2", val=np.ones((nn,)) * 0.0, units="W") @@ -991,6 +993,8 @@ def setup(self): iv.add_output("area_nozzle", val=58 * np.ones((nn,)), units="inch**2") iv.add_output("convergence_hack", val=-20, units="Pa") + self.add_subsystem("mdotguess", FlowMatcher(num_nodes=nn), promotes=["*"]) + self.add_subsystem("inlet", Inlet(num_nodes=nn), promotes_inputs=[("p", "p_inf"), ("T", "T_inf"), "Utrue"]) self.add_subsystem( @@ -1007,6 +1011,7 @@ def setup(self): ) self.connect("inlet.pt", "sta1.pt_in") self.connect("inlet.Tt", "sta1.Tt_in") + self.connect("loss_factor_1", "sta1.dynamic_pressure_loss_factor") self.add_subsystem( "sta2", @@ -1059,14 +1064,16 @@ def setup(self): self.add_subsystem( "nozzle", OutletNozzle(num_nodes=nn), - promotes_inputs=["p_exit", ("area", "area_nozzle")], - promotes_outputs=["mdot"], + promotes_inputs=["mdot", "p_exit", ("area", "area_nozzle")], + promotes_outputs=["mdot_actual"], ) - self.connect("sta3.pt_out", "nozzle.pt") + self.connect("sta3.pt_out", "nozzle.pt_in") self.connect("sta3.Tt_out", "nozzle.Tt") self.add_subsystem( - "force", NetForce(num_nodes=nn), promotes_inputs=["mdot", "p_inf", ("Utrue_inf", "Utrue"), "area_nozzle"] + "force", + NetForce(num_nodes=nn, cfg=self.options["cfg"]), + promotes_inputs=["mdot", "p_inf", ("Utrue_inf", "Utrue"), "area_nozzle"], ) self.connect("nozzle.p", "force.p_nozzle") self.connect("nozzle.rho", "force.rho_nozzle") From 6e886e32944c953c487f359110580039c09db9e5 Mon Sep 17 00:00:00 2001 From: Eytan Adler Date: Mon, 22 Jan 2024 09:16:46 -0500 Subject: [PATCH 2/3] Fix ducts and their tests --- .github/workflows/openconcept.yaml | 4 ++-- openconcept/thermal/tests/test_ducts.py | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/openconcept.yaml b/.github/workflows/openconcept.yaml index c36622fc..fc4ceaed 100644 --- a/.github/workflows/openconcept.yaml +++ b/.github/workflows/openconcept.yaml @@ -56,12 +56,12 @@ jobs: run: | conda config --set always_yes yes python -m pip install pip==${{ matrix.PIP_VERSION_OLDEST }} setuptools==${{ matrix.SETUPTOOLS_VERSION_OLDEST }} --upgrade wheel - pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_VERSION_OLDEST }} + pip install numpy==${{ matrix.NUMPY_VERSION_OLDEST }} scipy==${{ matrix.SCIPY_VERSION_OLDEST }} openmdao==${{ matrix.OPENMDAO_VERSION_OLDEST }} om-pycycle - name: Install dependencies (latest versions) if: ${{ matrix.dep-versions == 'latest' }} run: | conda config --set always_yes yes - pip install numpy scipy openmdao + pip install numpy scipy openmdao om-pycycle - name: Install OpenConcept run: | diff --git a/openconcept/thermal/tests/test_ducts.py b/openconcept/thermal/tests/test_ducts.py index d1f51aac..ee0ede92 100644 --- a/openconcept/thermal/tests/test_ducts.py +++ b/openconcept/thermal/tests/test_ducts.py @@ -7,8 +7,8 @@ try: import pycycle - pyc_version = float(pycycle.__version__) - if pyc_version >= 3.0: + pyc_major_version = int(pycycle.__version__.split(".")[0]) + if pyc_major_version >= 4: HAS_PYCYCLE = True import pycycle.api as pyc @@ -114,9 +114,6 @@ def viewer(prob, pt): class MPDuct(pyc.MPCycle): def setup(self): - self.options["thermo_method"] = "CEA" - self.options["thermo_data"] = pyc.species_data.janaf - self.pyc_add_pnt("design", PyCycleDuct(design=True, thermo_method="CEA")) # define the off-design conditions we want to run From 16ad416cab6e0c3df337ff9199e4fb67a3e851b4 Mon Sep 17 00:00:00 2001 From: Eytan Adler Date: Mon, 5 Feb 2024 13:22:54 -0500 Subject: [PATCH 3/3] Bump patch version --- openconcept/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openconcept/__init__.py b/openconcept/__init__.py index 6849410a..a82b376d 100644 --- a/openconcept/__init__.py +++ b/openconcept/__init__.py @@ -1 +1 @@ -__version__ = "1.1.0" +__version__ = "1.1.1"