Question-and-Answer Resource for the Building Energy Modeling Community
Get s tarted with the Help page
Ask Your Question
2

FMU Dymola variable input

asked 2019-06-03 06:30:14 -0500

Giorgio gravatar image

updated 2019-06-03 20:25:49 -0500

Hi, I want to cosimulate E+ in Dymola, basically I want to model the energy system (GSHP PV etc...) in Dymola and use the FMU to simulate the flats. To do this I need to send the temperature and the mass flow of the water coming from the GSHP in Dymola to the FMU as an input, in other words the temperature of water in node after the HP in E+ must be defined with Dymola. I'm trying to use the actuator but I can only modify the setpoint, what I have to do to modify a variable in E+ with a signal from Dymola?

Hope that someone can help.

Regards Giorgio

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-06-06 08:44:30 -0500

updated 2019-06-06 08:44:59 -0500

I have done this with other systems and found the best method is through the use of a plant loop with a PlantComponent:TemperatureSource that acts as a pseudo source of fluid. In your case, it would match the GSHP outlet temperatures.

You would set the PlantComponent:TemperatureSource to follow a schedule, which is controlled by a snippet like:

PlantComponent:TemperatureSource,
    GSHP Plant Component Temperature Source,    !- Name of water component in below loop
    Node xxx,                 !- Inlet Node
    Node xxx,                 !- Outlet Node
    Autosize,                 !- Design Volume Flow Rate
    Scheduled,                !- Temperature Specification Type
    8.0,                      !- Source Temperature
    GSHP Water Temperature Schedule;    !- Source Temperature Schedule Name

EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:TO:SCHEDULE,
    GSHP Water Temperature Schedule, !- Match the Schedule Name above
    Any Number,
    <Fluid Temp Variable from GSHP>, !- Variable from Dymola
    0; !- Initial value

You will also want to modulate the Setpoint Manager so that the system operates:

SetpointManager:Scheduled,
    Scheduled GSHP Temp, !- Name of Setpoint Manager in below loop
    Temperature,
    GSHP Water Temperature Schedule, !- Same schedule as above.
    Node xxx;

The pump would be actuated like:

EXTERNALINTERFACE:FUNCTIONALMOCKUPUNITEXPORT:TO:ACTUATOR, !- Use a variable speed pump component
    VarSpdPumpMassFlowActuator, !- This can be any name without spaces
    Var Spd Pump Name, !- This is the name of pump in below loop
    Pump,
    Pump Mass Flow Rate,
    <Fluid mass flow rate from GSHP>, !- This is the name of the variable from Dymola
    0; !- Initial value

The loop will look something like:

Pseudo Plant Loop

edit flag offensive delete link more

Comments

Hi Justin, thank you very much for the answer, I did as you suggested and the I have the FMU with the two interfaces. I uploaded it in Dymola and connected two simple values to the FMU to try if it works (45 connected to the temperature and 2 kg/s to the mass flow). When I start the simulation it arrives to the point

...for Sizing Period: #2 WINTER DEIGN DAY IN (MY LOCATION) Initializing Simulation _

And stays stuck at this point. What do you think might be the problem?

Regards Giorgio

Giorgio gravatar image Giorgio  ( 2019-06-07 12:10:26 -0500 )edit

Hi Giorgio, troubleshooting that kind of problem becomes more challenging without additional information. I would recommend checking your starting values and hardsize your systems (instead of autosizing) where you can. Co-simulation variables are not transferred during Sizing Period.

JustinShultz gravatar image JustinShultz  ( 2019-06-11 13:58:21 -0500 )edit

Hi Justin, the problem was in the node definition for the setpoint manager. Now the FMU is working and responding to all the inputs. Thank you very much for your help Justin. Much appreciated!!

Giorgio

Giorgio gravatar image Giorgio  ( 2019-06-12 04:15:07 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

 

Question Tools

2 followers

Stats

Asked: 2019-06-03 06:30:14 -0500

Seen: 158 times

Last updated: Jun 06 '19