Skip to content

Commit

Permalink
Fix incorrect automatic pulling of fan_duct_core_cowl_slope in `Tur…
Browse files Browse the repository at this point in the history
…bofan` (#88)

* fix inward fan_duct_core_slop bug def
refactor structure folder

* rename module duct instead of fan_duct

* update HISTORY

---------

Co-authored-by: Guy De Spiegeleer <[email protected]>
Co-authored-by: Adrien DELSALLE <[email protected]>
  • Loading branch information
3 people authored Feb 21, 2023
1 parent a0a57ae commit 81ede7b
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 24 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

- Fix `TurbineAero` exit total pressure computation from polytropic efficiency
- Fix some descriptions, especially related to gas models
- Fix incorrectly automatic pulling of `fan_duct_core_cowl_slope` in `Turbofan`

## 0.1.0 (2022-10-18)

Expand Down
6 changes: 6 additions & 0 deletions pyturbo/systems/channel/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from pyturbo.systems.channel.channel_aero import ChannelAero
from pyturbo.systems.channel.channel_geom import ChannelGeom

from pyturbo.systems.channel.channel import Channel # isort: skip

__all__ = ["ChannelAero", "ChannelGeom", "Channel"]
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from cosapp.systems import System

from pyturbo.systems.structures.channel_aero import ChannelAero
from pyturbo.systems.structures.channel_geom import ChannelGeom
from pyturbo.systems.channel import ChannelAero, ChannelGeom


class Channel(System):
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions pyturbo/systems/duct/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from pyturbo.systems.duct.fan_duct import FanDuct

__all__ = ["FanDuct"]
16 changes: 16 additions & 0 deletions pyturbo/systems/duct/fan_duct.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (C) 2022, twiinIT
# SPDX-License-Identifier: BSD-3-Clause


from cosapp.base import System

from pyturbo.systems.channel import ChannelAero
from pyturbo.systems.duct.fan_duct_geom import FanDuctGeom


class FanDuct(System):
"""Fan duct assembly system."""

def setup(self):
self.add_child(FanDuctGeom("geom"), pulling=["kp", "core_cowl_slope"])
self.add_child(ChannelAero("aero"), pulling=["fl_in", "fl_out"])
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from pyoccad.create import CreateAxis, CreateBezier, CreateEdge, CreateRevolution, CreateTopology

from pyturbo.systems.generic import GenericSimpleGeom
from pyturbo.systems.structures.channel import Channel
from pyturbo.systems.structures.channel_aero import ChannelAero
from pyturbo.utils import rz_to_3d, slope_to_3d


Expand Down Expand Up @@ -55,13 +53,3 @@ def _to_occt(self) -> Dict[str, TopoDS_Shape]:
outer_shell = CreateRevolution.surface_from_curve(e2, CreateAxis.oz())

return CreateTopology.make_compound(inner_shell, outer_shell)


class FanDuct(Channel):
"""Fan duct assembly system."""

def setup(self, geom_class=FanDuctGeom, aero_class=ChannelAero):
if geom_class is not None:
self.add_child(geom_class("geom"), pulling=["kp", "core_cowl_slope"])
if aero_class is not None:
self.add_child(aero_class("aero"), pulling=["fl_in", "fl_out"])
2 changes: 1 addition & 1 deletion pyturbo/systems/fan_module/fan_module.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import numpy as np
from cosapp.systems import System

from pyturbo.systems.channel import Channel
from pyturbo.systems.compressor import Booster, Fan
from pyturbo.systems.fan_module.fan_module_geom import FanModuleGeom
from pyturbo.systems.fan_module.spinner import SpinnerGeom
from pyturbo.systems.mixers import MixerFluid, MixerShaft
from pyturbo.systems.structures import IntermediateCasing
from pyturbo.systems.structures.channel import Channel
from pyturbo.utils import JupyterViewable


Expand Down
6 changes: 1 addition & 5 deletions pyturbo/systems/structures/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
from pyturbo.systems.structures.channel import Channel
from pyturbo.systems.structures.channel_aero import ChannelAero
from pyturbo.systems.structures.channel_geom import ChannelGeom
from pyturbo.systems.structures.core_cowl import CoreCowl
from pyturbo.systems.structures.fan_duct import FanDuct
from pyturbo.systems.structures.intermediate_casing import IntermediateCasing

__all__ = ["ChannelAero", "ChannelGeom", "Channel", "IntermediateCasing", "FanDuct", "CoreCowl"]
__all__ = ["IntermediateCasing", "CoreCowl"]
2 changes: 1 addition & 1 deletion pyturbo/systems/structures/intermediate_casing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from cosapp.systems import System

from pyturbo.systems.channel import ChannelAero
from pyturbo.systems.generic import GenericSimpleGeom
from pyturbo.systems.structures.channel_aero import ChannelAero


class IntermediateCasing(System):
Expand Down
6 changes: 4 additions & 2 deletions pyturbo/systems/turbofan/turbofan.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
from OCC.Core.TopoDS import TopoDS_Shape

from pyturbo.systems.atmosphere import Atmosphere
from pyturbo.systems.channel import Channel
from pyturbo.systems.duct import FanDuct
from pyturbo.systems.fan_module import FanModule
from pyturbo.systems.gas_generator import GasGenerator
from pyturbo.systems.inlet import Inlet
from pyturbo.systems.nacelle import Nacelle, Plug
from pyturbo.systems.nozzle import Nozzle
from pyturbo.systems.structures import Channel, CoreCowl, FanDuct
from pyturbo.systems.structures import CoreCowl
from pyturbo.systems.turbine import LPT
from pyturbo.systems.turbofan.turbofan_aero import TurbofanAero
from pyturbo.systems.turbofan.turbofan_geom import TurbofanGeom
Expand Down Expand Up @@ -157,7 +159,7 @@ def setup(self):
self.connect(self.trf.kp, self.plug.inwards, {"exit_hub": "trf_exit_hub_kp"})
self.connect(self.geom.secondary_nozzle_kp, self.fan_duct.kp)

self.connect(self.geom, self.fan_duct, ["core_cowl_slope"])
self.connect(self.geom, self.fan_duct, {"fan_duct_core_cowl_slope": "core_cowl_slope"})

self.connect(
self.geom,
Expand Down
4 changes: 4 additions & 0 deletions pyturbo/systems/turbofan/turbofan_geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def setup(self):
self.add_outward("sec_nozzle_exit_kp", np.ones(2), unit="m")

self.add_outward("sec_nozzle_exit_hub_kp", C1Keypoint())
self.add_outward("fan_duct_core_cowl_slope", unit="deg")

self.add_outward("frd_mount", np.r_[0.9, 0.5], desc="forward engine mount")
self.add_outward("aft_mount", np.r_[0.5, 3.0], desc="aftward engine mount")
Expand Down Expand Up @@ -414,6 +415,9 @@ def compute(self):
self.turbine_exit_tip_kp = self.turbine_kp.exit_tip
self.sec_nozzle_exit_kp = self.secondary_nozzle_kp.exit_tip

# fan_duct
self.fan_duct_core_cowl_slope = self.core_cowl_slope

# mounts
r = self.frd_mount_relative
self.frd_mount = (1 - r) * self.fanmodule_kp.inlet_tip + r * self.fanmodule_kp.exit_tip
Expand Down
2 changes: 1 addition & 1 deletion tests/test_structures.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import numpy as np
from cosapp.drivers import NonLinearSolver

from pyturbo.systems.channel import Channel
from pyturbo.systems.structures import IntermediateCasing
from pyturbo.systems.structures.channel import Channel


class TestChannel:
Expand Down

0 comments on commit 81ede7b

Please sign in to comment.