Skip to content

Performance improvement for IDEAS.Airflow.Multizone.BaseClasses.TwoWayFlowElement #2043

@kldjonge

Description

@kldjonge

I noticed some discrepencies in the simulation results between mBA_flow and VBA_flow*rho_a1_inflow at low flows when using the operable door model (IDEAS.Airflow.Multizone.DoorDiscretizedOperable). If VAB_flow was exactly zero, mAB_flow wasn't while it should be. So somehow mBA fluctuated around zero while it should have been zero and, consequently, the 'error control' on that flow limited the stepsize a lot.

Upon further investigation, this was fixed by explicitly linking Vflow*rho to the port:

port_a1.m_flow = VAB_flow*rho_a1_inflow;
port_a2.m_flow = VBA_flow*rho_a2_inflow;

For me, this decreased simulation time significantly. Since the door models all actually calculate volume flows at top level, it will most-likely improve the performance in general for all models using this class.

A larger snippet:

  mAB_flow=VAB_flow*rho_a1_inflow;
  mBA_flow=VBA_flow*rho_a2_inflow;
  // Average velocity (using the whole orifice area)
  vAB = VAB_flow/A;
  vBA = VBA_flow/A;

  port_a1.m_flow = VAB_flow*rho_a1_inflow;
  port_a2.m_flow = VBA_flow*rho_a2_inflow;

  // Energy balance (no storage, no heat loss/gain)
  port_a1.h_outflow = inStream(port_b1.h_outflow);
  port_b1.h_outflow = inStream(port_a1.h_outflow);``

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions