Modelica Training Workshop 8 Wangda Zuo Michael Wetter

  • Slides: 10
Download presentation
Modelica Training Workshop 8 Wangda Zuo, Michael Wetter Simulation Research Group Energy and Environmental

Modelica Training Workshop 8 Wangda Zuo, Michael Wetter Simulation Research Group Energy and Environmental Technologies Division Lawrence Berkeley National Laboratory, USA 6/11/2012

Outline • Avoid Step Change • Breaking Algebraic Loops • Reducing Nonlinear Equations •

Outline • Avoid Step Change • Breaking Algebraic Loops • Reducing Nonlinear Equations • Prescribed Mass Flow Rate • Avoiding Overspecified Initialization Problems • Pre- and Post Process 2

Avoiding Step Change Problem: Step changes can lead to high computing time or to

Avoiding Step Change Problem: Step changes can lead to high computing time or to convergence problems in large systems. Solution: The control input signal of components is sent to a 2 nd order low pass filter that changes a step signal to a smooth signal. • Flow machines (fans and pumps): boolean parameter filtered. Speed in dynamics • Actuators: boolean parameter filtered. Opening in dynamics Note: When changing filtered. Speed (or filtered. Opening), or when changing the value ofrise. Time, the dynamic response of the closed loop control changes. Therefore, control gains may need to be retuned to ensure satisfactory closed loop control performance. 3

Breaking Algebraic Loops Problem: In fluid flow systems, flow junctions where mass flow rates

Breaking Algebraic Loops Problem: In fluid flow systems, flow junctions where mass flow rates separate and mix can couple non-linear systems of equations. This leads to larger systems of coupled equations that need to be solved, which often causes larger computing time and can sometimes cause convergence problems. Solution: Adds a control volume at the fluid junction that can decouple the system of equations. Set the parameter dynamic. Balance to true for • model of a flow splitter or mixer • fans or pumps 4

Reduce Nonlinear Equations (1) Problem: Computing pressure drop due to flow friction in a

Reduce Nonlinear Equations (1) Problem: Computing pressure drop due to flow friction in a serial of components can lead to coupled nonlinear systems of equations that need higher computing time to solve. Pressure drop & Mass flow rate or Solution: • Set parameter res 2(dp_nominal=0) and add pressure drop in res 1(dp_nominal) • Set from_dp=false in all components (default setting). 5

Reduce Nonlinear Equations (2) Problem: Solution: Buildings. Fluid. Fixed. Resistances. Fixed. Resistance Dp. M

Reduce Nonlinear Equations (2) Problem: Solution: Buildings. Fluid. Fixed. Resistances. Fixed. Resistance Dp. M res( redeclare package Medium = Medium, m_flow_nominal=0. 2, dp_nominal=10000); Buildings. Fluid. Actuators. Valves. Two. Way. Linear val( redeclare package Medium = Medium, m_flow_nominal=0. 2, dp. Valve_nominal=5000, dp. Fixed_nominal=10000); 6

Prescribed Mass Flow Rate Problem: Computing the mass flow rate using the fan/pump curve

Prescribed Mass Flow Rate Problem: Computing the mass flow rate using the fan/pump curve leads to interaction with flow resistance. In some situations, this can lead to slower simulation or convergence problem. Solution: User prescribed mass flow rate • Fan/Pump: Buildings. Fluid. Movers. Flow. Machine_m_flow • Source Element: Buildings. Fluid. Sources. Mass. Flow. Source_T 7

Overspecified Initialization Problem: In thermal flow systems, Dymola error message for overspecified problem: Error:

Overspecified Initialization Problem: In thermal flow systems, Dymola error message for overspecified problem: Error: The initialization problem is overspecified for variables of element type Real The initial equation. . . refers to variables, which are all knowns. To correct it you can remove this equation. Solution: To avoid this: energy. Dynamics = Modelica. Fluid. Types. Dynamics. Free. Initial; mass. Dynamics = Modelica. Fluid. Types. Dynamics. Free. Initial; 8

Pre- and Post Processing Background • Modelica does not specify the scripting format and

Pre- and Post Processing Background • Modelica does not specify the scripting format and format of result file • Dymola and Open. Modelica generate. mat file Useful Tools • Buildings library provides the Buildings. Py Python library http: //simulationresearch. lbl. gov/modelica/buildingspy/ • to run Modelica simulations using Dymola, • to process *. mat output files • to run unit tests as part of the library development. • Dymola provides MATLAB scripts to process data • Gen. Opt to optimize the cost functions computed by Dymola 9

What is Next Workshops We will look at the details of Modelica programming following

What is Next Workshops We will look at the details of Modelica programming following the Fritzon’s slides. June 13 3: 30 -5: 00 pm in 90 -1099 Join the Google group if you haven’t. https: //groups. google. com/group/modelica-buildings Use it and ask questions. 10