From ae1d52e7bc780ff22f65feb4fba6ca475ceeb0ed Mon Sep 17 00:00:00 2001 From: Eytan Adler <63426601+eytanadler@users.noreply.github.com> Date: Tue, 1 Nov 2022 10:07:03 -0400 Subject: [PATCH] Fixed heat exchanger coefficient used for pressure drop (#44) * Fixed hx pressure drop hot side coefficient bug * Fixed desc string for PressureDrop options * Version bump to 1.0.1 --- openconcept/__init__.py | 2 +- openconcept/thermal/heat_exchanger.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/openconcept/__init__.py b/openconcept/__init__.py index 5becc17c..5c4105cd 100644 --- a/openconcept/__init__.py +++ b/openconcept/__init__.py @@ -1 +1 @@ -__version__ = "1.0.0" +__version__ = "1.0.1" diff --git a/openconcept/thermal/heat_exchanger.py b/openconcept/thermal/heat_exchanger.py index e22a7502..cd261d38 100644 --- a/openconcept/thermal/heat_exchanger.py +++ b/openconcept/thermal/heat_exchanger.py @@ -1277,9 +1277,9 @@ class PressureDrop(ExplicitComponent): def initialize(self): self.options.declare("num_nodes", default=1, desc="Number of flight/control conditions") self.options.declare("Kc_cold", default=0.3, desc="Irreversible contraction loss coefficient") - self.options.declare("Ke_cold", default=-0.1, desc="Irreversible contraction loss coefficient") + self.options.declare("Ke_cold", default=-0.1, desc="Irreversible expansion loss coefficient") self.options.declare("Kc_hot", default=0.3, desc="Irreversible contraction loss coefficient") - self.options.declare("Ke_hot", default=-0.1, desc="Irreversible contraction loss coefficient") + self.options.declare("Ke_hot", default=-0.1, desc="Irreversible expansion loss coefficient") def setup(self): nn = self.options["num_nodes"] @@ -1322,11 +1322,13 @@ def compute(self, inputs, outputs): dyn_press_hot = (1 / 2) * (inputs["mdot_hot"] / inputs["xs_area_hot"]) ** 2 / inputs["rho_hot"] Kec = self.options["Ke_cold"] Kcc = self.options["Kc_cold"] + Keh = self.options["Ke_hot"] + Kch = self.options["Kc_hot"] outputs["delta_p_cold"] = dyn_press_cold * ( -Kec - Kcc - 4 * inputs["length_overall"] * inputs["f_cold"] / inputs["dh_cold"] ) outputs["delta_p_hot"] = dyn_press_hot * ( - -Kec - Kcc - 4 * inputs["width_overall"] * inputs["f_hot"] / inputs["dh_hot"] + -Keh - Kch - 4 * inputs["width_overall"] * inputs["f_hot"] / inputs["dh_hot"] ) def compute_partials(self, inputs, J): @@ -1334,8 +1336,10 @@ def compute_partials(self, inputs, J): dyn_press_hot = (1 / 2) * (inputs["mdot_hot"] / inputs["xs_area_hot"]) ** 2 / inputs["rho_hot"] Kec = self.options["Ke_cold"] Kcc = self.options["Kc_cold"] + Keh = self.options["Ke_hot"] + Kch = self.options["Kc_hot"] losses_cold = -Kec - Kcc - 4 * inputs["length_overall"] * inputs["f_cold"] / inputs["dh_cold"] - losses_hot = -Kec - Kcc - 4 * inputs["width_overall"] * inputs["f_hot"] / inputs["dh_hot"] + losses_hot = -Keh - Kch - 4 * inputs["width_overall"] * inputs["f_hot"] / inputs["dh_hot"] J["delta_p_cold", "mdot_cold"] = ( (inputs["mdot_cold"] / inputs["xs_area_cold"] ** 2) / inputs["rho_cold"] * losses_cold