Issue with Mixer Pressure

オープン
#84 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
backend

調査の方向性

Start with the supplied mixer test case and inspect the Mixer design branch, especially Fl_I1_stat_calc, Fl_I2_stat_calc, and MixImpulse.compute. Trace how each subsystem's Ps input is connected to Fl_I1:stat:P or Fl_I2:stat:P, then compare the calculated pressures with the configured inputs. Done means establishing whether the connection is intentional and documenting or testing the expected behavior.

索引モデルが issue の本文から書いたものです。

説明

Hi,

I've been working on building a mixed turbofan model and encountered some issues with the mixer.
While investigating the mixer module, I noticed something unusual when printing the incoming flow properties.

Consider the following test case:

def test_mix_air_with_airfuel(self):
    p = Problem()

    cycle = p.model = Cycle()
    cycle.options['thermo_method'] = 'CEA'
    cycle.options['thermo_data'] = janaf

    cycle.set_input_defaults('start1.P', 22.838, units='psi')
    cycle.set_input_defaults('start1.T', 1718.825, units='degR')
    cycle.set_input_defaults('start1.MN', 0.800)
    cycle.set_input_defaults('start1.W', 187.893, units='lbm/s')

    cycle.set_input_defaults('start2.P', 11.708, units='psi')
    cycle.set_input_defaults('start2.T', 522.821, units='degR')
    cycle.set_input_defaults('start2.MN', 0.600)
    cycle.set_input_defaults('start2.W', 66.176, units='lbm/s')

    cycle.add_subsystem('start1', FlowStart(composition=CEA_AIR_FUEL_COMPOSITION))
    cycle.add_subsystem('start2', FlowStart(composition=CEA_AIR_COMPOSITION))

    cycle.add_subsystem('mixer', Mixer(design=True, designed_stream=1))

    cycle.pyc_connect_flow('start1.Fl_O', 'mixer.Fl_I1')
    cycle.pyc_connect_flow('start2.Fl_O', 'mixer.Fl_I2')

    p.setup(force_alloc_complex=True)
    p.set_solver_print(level=-1)
    p.run_model()

    tol = 1e-6
    print(p['mixer.Fl_O:stat:area'])
    print(p['mixer.Fl_O:tot:P'])
    print(p['mixer.ER'])
    print(p['mixer.Fl_O:stat:MN'])

When printing the variables used in the MixImpulse class compute function:

def compute(self, inputs, outputs):
    outputs['impulse_mix'] = (inputs['Fl_I1:stat:P'] * inputs['Fl_I1:stat:area'] + inputs['Fl_I1:stat:W'] * inputs['Fl_I1:stat:V']) + \
                             (inputs['Fl_I2:stat:P'] * inputs['Fl_I2:stat:area'] + inputs['Fl_I2:stat:W'] * inputs['Fl_I2:stat:V'])

    print("Mix Impulse computations:")
    print('Fl_I1:stat:W', inputs['Fl_I1:stat:W'])
    print('Fl_I1:stat:P', inputs['Fl_I1:stat:P'])
    print('Fl_I1:stat:V', inputs['Fl_I1:stat:V'])
    print('Fl_I1:stat:area', inputs['Fl_I1:stat:area'])
    print('Fl_I2:stat:W', inputs['Fl_I2:stat:W'])
    print('Fl_I2:stat:P', inputs['Fl_I2:stat:P'])
    print('Fl_I2:stat:V', inputs['Fl_I2:stat:V'])
    print('Fl_I2:stat:area', inputs['Fl_I2:stat:area'])

I get the following output:

Mix Impulse computations:
Fl_I1:stat:W [85.22683118]
Fl_I1:stat:P [63282.44448509]
Fl_I1:stat:V [461.46240572]
Fl_I1:stat:area [0.43591669]
Fl_I2:stat:W [30.01692868]
Fl_I2:stat:P [63282.44448509]
Fl_I2:stat:V [198.01842072]
Fl_I2:stat:area [0.18629003]
[964.42234196]
[19.03367286]
[1.95063205]
[0.90091354]

Both incoming flows have the same pressure. I'm not sure if this is expected, but I don't fully understand the physics behind it.

Looking further into the Mixer class code, I found this:

if design:
    ...
    self.add_subsystem('Fl_I1_stat_calc', Fl1_stat,
                       promotes_inputs=[('composition', 'Fl_I1:tot:composition'), ('S', 'Fl_I1:tot:S'),
                                        ('ht', 'Fl_I1:tot:h'), ('W', 'Fl_I1:stat:W'), ('Ps', 'Fl_I2:stat:P')],
                       promotes_outputs=['Fl_I1_calc:stat*'])
    ...
else:
    ...
    self.add_subsystem('Fl_I2_stat_calc', Fl2_stat,
                       promotes_inputs=[('composition', 'Fl_I2:tot:composition'), ('S', 'Fl_I2:tot:S'),
                                        ('ht', 'Fl_I2:tot:h'), ('W', 'Fl_I2:stat:W'), ('Ps', 'Fl_I1:stat:P')],
                       promotes_outputs=['Fl_I2_calc:stat:*'])
    ...

After modifying the connections between Ps and Fl_Ix:stat:P, I obtained the following output:

Mix Impulse computations:
Fl_I1:stat:W [85.22683118]
Fl_I1:stat:P [104599.90621965]
Fl_I1:stat:V [461.46240572]
Fl_I1:stat:area [0.43591669]
Fl_I2:stat:W [30.01692868]
Fl_I2:stat:P [63282.44448509]
Fl_I2:stat:V [198.01842072]
Fl_I2:stat:area [0.18629003]
[964.42234196]
[19.03367286]
[1.95063205]
[0.90091354]

Now, the pressure of flow_1 is nearly twice that of flow_2, which matches the input values I initially set.

Is this a potential issue, or am I simply misunderstanding something?

Thanks! :)

主要言語
Python
スター
212
フォーク
101
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OpenMDAO/pyCycle のほかの issue

OpenMDAO/pyCycle の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。