Можем ли мы смоделировать компрессор без граничного условия на выходе?

Я моделирую компрессор с входом от источника ( p = 1 атм, T =25 C). Я хочу, чтобы компрессор рассчитывал давление на выходе (учитывая, что отношение давления rp = 6); Код прикреплен здесь. Может кто-нибудь помочь мне?

      model Compressor332 "Generic volumetric compressor model"
 /****************************************** FLUID ******************************************/
replaceable package Medium =
      Modelica.Media.Air.DryAirNasa                                                                    constrainedby 
    Modelica.Media.Interfaces.PartialMedium "Medium model" annotation (choicesAllMatching = true);
 /*Ports */
  ThermoCycle.Interfaces.Fluid.FlangeA InFlow(redeclare package Medium = Medium)
    annotation (Placement(transformation(extent={{-78,68},{-58,88}}),
        iconTransformation(extent={{-78,68},{-58,88}})));
  ThermoCycle.Interfaces.Fluid.FlangeB OutFlow(redeclare package Medium =
        Medium) annotation (Placement(transformation(extent={{76,-50},{96,-30}}),
        iconTransformation(extent={{76,-50},{96,-30}})));
/****************************************** SELECT TYPE OF EXPANDER ******************************************/
parameter Real epsilon_s=0.7 "Isentropic Efficiency"
    annotation (Dialog(enable=(ExpType == ExpTypes.UD)));
                                                                                                                           annotation (Dialog(tab="Initialization"));

  /****************************************** VARIABLES ******************************************/
  Medium.ThermodynamicState vaporIn
    "Thermodynamic state of the fluid at the inlet";
  Medium.ThermodynamicState vaporOut
    "Thermodynamic state of the fluid at the outlet - isentropic";
  Modelica.Units.SI.Power W_dot;
  parameter Modelica.Units.SI.MassFlowRate M_dot = 0.01;
  Medium.SpecificEntropy s_su;
  Medium.SpecificEnthalpy h_su;
  Medium.SpecificEnthalpy h_ex;
  Medium.AbsolutePressure p_su;
  parameter Medium.AbsolutePressure p_ex = 20e5;
  Medium.SpecificEnthalpy h_ex_s;
  parameter Real rp = 6;
equation 
  /* Fluid Properties */
  vaporIn = Medium.setState_ph(p_su,h_su);
  s_su = Medium.specificEntropy(vaporIn);
  vaporOut = Medium.setState_ps(p_ex,s_su);
  h_ex_s = Medium.specificEnthalpy(vaporOut);
  /*equations */

  h_ex = h_su + (h_ex_s - h_su)/epsilon_s;
  W_dot = M_dot*(h_ex - h_su) "Consumed Power";

   //BOUNDARY CONDITIONS //
   /* Enthalpies */
  h_su = if noEvent(InFlow.m_flow <= 0) then h_ex else inStream(InFlow.h_outflow);
  OutFlow.h_outflow = if noEvent(-M_dot <= 0) then h_ex else inStream(
    OutFlow.h_outflow);

   /*Mass flows */

   OutFlow.m_flow = -M_dot;
   /*pressures */
  //flange.p = vapor_su.p;
  InFlow.p = p_su;
  OutFlow.p = p_ex;
  p_ex /p_su = rp;


  annotation (Diagram(coordinateSystem(preserveAspectRatio=true,  extent={{-100,
            -100},{100,100}}), graphics), Icon(coordinateSystem(
          preserveAspectRatio=false,extent={{-120,-120},{120,120}}), graphics={
          Text(
          extent={{-62,-56},{80,-84}},
          lineColor={0,0,0},
          fillPattern=FillPattern.Solid,
          fillColor={0,0,0},
          textString="Compressor"),
                              Polygon(
          points={{-60,80},{-60,-60},{80,-40},{80,40},{-60,80}},
          lineColor={0,0,255},
          smooth=Smooth.None,
          fillColor={0,0,255},
          fillPattern=FillPattern.Solid)}),Documentation(info="<html>
<p>The <i>Compressor</i> model represents the expansion of a fluid in a volumetric machine. It is a lumped model based on performance curves. It is characterized by two flow connector for the fluid inlet and outlet and by a mechanical connector for the connection with the generator.</p>
<p>The assumptions for this model are:</p>
<p><ul>
<li>No dynamics ( it is considered negligible when compared to the one characterizing the heat exchanger).</li>
<li>No thermal energy losses to the environment</li>
<li>Isentropic efficiency based on empirical performance curve</li>
<li>Filling factor based on empirical performance curve</li>
</ul></p>
<p><h4>Modelling options</h4></p>
<p>In this model, the user has the choice of providing constant isentropic and volumetric efficiencies, or providing performance curves for these two variables.</p>
</html>"));
end Compressor332;

Это для многоступенчатого сжатия. Когда я перевел модель, я получаю следующую ошибку, упомянутую на рисунке. Я уже дал массовый расход для компрессора, но все же, он не учитывается.

1.Возможно ли моделирование без граничного условия на выходе с использованием компонентов библиотеки жидкостей? 2. Можно ли получить массовый расход на выходе из данных, которые я даю. 3. Можно ли изменить порядок решения уравнений? (Здесь, исходя из массового расхода, уравнения решаются в обратном порядке. Я хочу, чтобы модель решалась сверху вниз, есть ли возможность изменить порядок уравнений?)

1 ответ

В вашей модели компрессора вы смешиваете уравнения модели с граничными условиями , что не является хорошей практикой, если только модель не должна быть «автономной» симуляцией. Поскольку у него также есть жидкостные соединители, я предполагаю, что последнее не так.

В вашей ситуации вы должны удалить ключевое слово из обоих M_flowи поскольку они должны быть заданы контекстом, в котором используется компрессор, например, путем подключения его к двум границам давления (таким образом обеспечивая rp) или подключение его к одной границе давления и одному источнику потока.

Удаление двух parameterключевые слова, вашей модели компрессора не хватает двух уравнений. Я считаю, что эти два недостающих уравнения даны (отсутствующей) «картой компрессора», связывающей перепад давления (или отношение) с расходом и скоростью вращения.

Другие вопросы по тегам