Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermediate Variable Access for temporary solver states #546

Open
robbr48 opened this Issue Mar 8, 2019 · 2 comments

Comments

Projects
None yet
5 participants
@robbr48
Copy link

robbr48 commented Mar 8, 2019

The following suggested changes are required for, but not limited to,
supporting TLM connections between FMUs.

An FMU should be able to request input variables or expose available
output variables for the master at any intermediate time during the step.
This should be achieved by calling the fmi3IntermediateStepFinished
callback function.

The following flags, among others, should be included in the callback.

typedef struct{
    fmi3Real intermediateStepTime; 
    [...]
    fmi3Boolean intermediateGetVariablesAllowed;
    fmi3Boolean intermediateSetVariablesAllowed;
    fmi3Boolean internalStepFinished;
    [...]
} fmi3IntermediateStepInfo;`
  • intermediateGetVariablesAllowed:
    If true, the master is allowed to call getReal at this intermediate state.
  • intermediateSetVariablesAllowed:
    If true, the master is allowed to call setReal at this intermediate state.
  • internalStepFinisherd:
    If true, the internal solver in the FMU has completed a successful
    integration step. Hence, outputs variables are valid and can be
    forwarded to other FMUs or written result files. If false, output
    variables are only temporary and should only be used for
    computation of temporary input variables.

Motivation

In the TLM case, it is desirable to let the master handle computation
of effort variables (force,pressure,voltage, etc) from flow variables
(speed,fluid flow,current etc). This requires the master to read the
flow variable from the FMU using getReal before writing the effort
variable using setReal. If the FMU requires an updated effort
variable at a temporary solver state, e.g. inside a rhs() function,
there must be a way to inform the master that the outputs are
temporary and should not be forwarded anywhere.

In conclusion

If the FMU requires updated inputs at a temporary solver state, it
should call fmi3IntermediateStepFinished with the following flags:

  • intermediateGetVariablesAllowed=true
  • intermediateSetVariablesAllowed=true
  • internalStepFinished=false.

The master should then read intermediate outputs, but only use
them to compute intermediate inputs.

After a completed integration step, the FMU should call the
fmi3IntermediateStepFinished with the following flags:

  • intermediateGetVariablesAllowed=true
  • intermediateSetVariablesAllowed=true
  • internalStepFinished=true

The master should then read intermediate outputs and forward them
to other FMUs/result files, and also write updated intermediate inputs.

@chrbertsch chrbertsch added the FCP label Mar 10, 2019

@chrbertsch chrbertsch added this to the v3.0 milestone Mar 10, 2019

@jbernalr

This comment has been minimized.

Copy link

jbernalr commented Mar 11, 2019

are these changes independent of (now closed) issue #534 ?

@KarlWernersson

This comment has been minimized.

Copy link
Collaborator

KarlWernersson commented Mar 11, 2019

@jbernalr Yes they are completely unrelated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.