Search code examples
modelicaopenmodelica

Difference between m_flow_start and m_flow in ´´initialize´´ section for Valve - Modelica


I have a valve in Modelica which has m_flow_start(Guess value of m_flow) and m_flow as initializion value . I can`t understand what is the difference between these values. Could you explain the difference between them?

Thanks.


Solution

  • In general if you have a parameter m_flow_start (or similarly) it means that the model contains

    Medium.MassFlowRate m_flow(start=m_flow_start ... );
    

    The initialization value for m_flow is also called m_flow.start and is as normally as default equal to m_flow_start.

    So if you set (or have set) the initialization value of m_flow the parameter m_flow_start normally becomes meaningless.

    So, the procedure is:

    1. If m_flow.start (initialization value of m_flow) is set, you should modify that and ignore m_flow_start.
    2. Otherwise set m_flow_start, and don't modify m_flow.start - possibly unless you are changing parameters after translation.

    Clearly this is confusing, and for Modelica.Mechanics the models are changed to remove those extra _start variables.

    Note that in a valve m_flow is normally not a state, so any value is just a guess-value. If you set fixed=true for m_flow it becomes a fixed start-value, but then the initialization is more complicated.