Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug] Phase separator material balance error #933

@bnizamov

Description

@bnizamov

Bug Location: Vessel.vb, RunDynamicModel(),
this is code that needs to be fixed

        For i = 0 To 5
            If Me.GraphicObject.InputConnectors(i).IsAttached Then
                Dim imsx = GetInletMaterialStream(i)
                If imsmix Is Nothing Then imsmix = imsx.CloneXML
                imsmix = imsmix.Add(imsx)
            End If
        Next

Problem: The first inlet stream is added twice:

  1. First: imsmix = imsx.CloneXML (contains stream 1)
  2. Then: imsmix = imsmix.Add(imsx) (adds stream 1 AGAIN)

Evidence: Material balance around separator consistently shows
outlet/inlet ratio of 2.00xxx (within numerical tolerance).

Fix: Add Else clause to only Add() subsequent streams, not the first one.

I noticed the recent commit (10 days ago) attempted to address this but
accidentally made it worse by adding a third addition. The fix is
straightforward - happy to submit a PR if helpful.

This bug affects all dynamic separator simulations and breaks fundamental
material balance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions