DLR-SR / ThermofluidStream

The DLR Thermofluid Stream Library
BSD 3-Clause "New" or "Revised" License
65 stars 27 forks source link

PartialNTU outlet enthalpy filter fix #206

Open RaphaelGebhart opened 3 months ago

RaphaelGebhart commented 3 months ago

ThermofluidStream.HeatExchangers.Internal.PartialNTU filters outlet enthalpy:

  if noEvent(C_A < C_B) then

    ...

    der(h_out_A)*TC = h_in_A - dh_A - h_out_A;
    der(h_out_B)*TC = h_in_B - dh_B - h_out_B;

  else

    ...

    der(h_out_A)*TC = h_in_A - dh_A - h_out_A;
    der(h_out_B)*TC = h_in_B - dh_B - h_out_B;

  end if;
  if noEvent(C_A < C_B) then
    ...
  else
    ...
  end if;
  der(h_out_A)*TC = h_in_A - dh_A - h_out_A;
  der(h_out_B)*TC = h_in_B - dh_B - h_out_B;  
  q_flowA = q_flow;
  q_flowB = -q_flowA;

  if noEvent(inletA.m_flow < m_flow_reg) and noEvent(inletB.m_flow < m_flow_reg) then
      dh_A = 0;
      dh_B = 0;
  else
    if noEvent(C_A < C_B) then
      dh_A = Delta_T_max*cp_A*effectiveness;
      dh_B = (m_flow_B*q_flowB)/(m_flow_B^2 + (m_flow_reg/10)^2);
    else
      dh_B = -Delta_T_max*cp_B*effectiveness;
      dh_A = (m_flow_A*q_flowA)/(m_flow_A^2 + (m_flow_reg/10)^2);
    end if;
  end if;

but for my tests this caused no obvious improvements.

I would personally only apply the first change der(h_out_A)*TC ..., since for me it seems to solve the issue with slow simulation.

RaphaelGebhart commented 3 months ago

Currently it seems like this is not the main issue.