Issue with Mixer Pressure

Abierto
#84 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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! :)

Lenguaje dominante
Python
Estrellas
212
Forks
101
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de OpenMDAO/pyCycle

Todos los issues de OpenMDAO/pyCycle

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.