Skip to content

Commit

Permalink
Fixed heat exchanger coefficient used for pressure drop (#44)
Browse files Browse the repository at this point in the history
* Fixed hx pressure drop hot side coefficient bug

* Fixed desc string for PressureDrop options

* Version bump to 1.0.1
  • Loading branch information
eytanadler committed Nov 1, 2022
1 parent 805ebd2 commit ae1d52e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion openconcept/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.0"
__version__ = "1.0.1"
12 changes: 8 additions & 4 deletions openconcept/thermal/heat_exchanger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -1322,20 +1322,24 @@ 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):
dyn_press_cold = (1 / 2) * (inputs["mdot_cold"] / inputs["xs_area_cold"]) ** 2 / inputs["rho_cold"]
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
Expand Down

0 comments on commit ae1d52e

Please sign in to comment.