Skip to content

Commit

Permalink
Added link to Michael Tiller's online book.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter committed May 16, 2014
1 parent b1058f6 commit 6671a99
Show file tree
Hide file tree
Showing 25 changed files with 93 additions and 70 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: c5c1a76244935dc4aebc6d8e813b07fe
config: f6195d180470600d4136a7b79dbae646
tags: 645f666f9bcd5a90fca523b33c5a78b7
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Organization of packages
------------------------

When developing models, one should distinguish between a library which contains widely applicable models, such as the `Buildings` library, and an application-specific model which may be created for a specific building and is of limited use for other applications.
We recommend storing application-specific models outside of the `Buildings` library. This will allow replacing the `Buildings` library with a new version without having to change the application-specific model.
It is recommended that users store application-specific models outside of the `Buildings` library. This will allow users to replace the `Buildings` library with a new version without having to change the application-specific model.
If during the course of the development of application-specific models, some models turn out to be of interest for other applications, then they can be contributed to the development of the `Buildings` library, as described in the section :ref:`Development`.


Expand Down Expand Up @@ -278,7 +278,7 @@ However, when the medium model is changed to a model that models
`Buildings.Media.ConstantPropertyLiquidWater <http://simulationresearch.lbl.gov/modelica/releases/latest/help/Buildings_Media_ConstantPropertyLiquidWater.html#Buildings.Media.ConstantPropertyLiquidWater>`_,
then the density is constant. Consequently, there is no equation that
can be used to compute the pressure based on the volume.
In this situation, trying to translate the model leads, in Dymola, to the following error message:
In this situation, attempting to translate the model leads, in Dymola, to the following error message:

.. code-block:: none

Expand All @@ -288,16 +288,16 @@ In this situation, trying to translate the model leads, in Dymola, to the follow
The number of scalar Real unknown elements are 58.
The number of scalar Real equation elements are 58.

Similarly, if the medium model `Modelica.Media.Water.WaterIF97OnePhase_ph <http://simulationresearch.lbl.gov/modelica/releases/msl/3.2/help/Modelica_Media_Water_WaterIF97OnePhase_ph.html#Modelica.Media.Water.WaterIF97OnePhase_ph>`_ is used,
which models density as a function of pressure and enthalpy, then
Similarly, if the medium model `Modelica.Media.Water.WaterIF97OnePhase_ph <http://simulationresearch.lbl.gov/modelica/releases/msl/3.2/help/Modelica_Media_Water_WaterIF97OnePhase_ph.html#Modelica.Media.Water.WaterIF97OnePhase_ph>`_,
which models density as a function of pressure and enthalpy, is used, then
the model is well-defined, but the pressure increases the longer the pump runs.
The reason is that the pump adds heat to the water. When the water temperature
increases from :math:`20^\circ \mathrm C` to :math:`40^\circ \mathrm C`,
the pressure increases from :math:`1 \, \mathrm{bars}` to :math:`150 \, \mathrm{bars}`.

To avoid this singularity or increase in pressure,
a model that imposes a pressure source and that can account for the expansion of the fluid needs to be used.
For example, you may use
use a model that imposes a pressure source and that accounts for the expansion of the fluid.
For example, use
`Buildings.Fluid.Storage.ExpansionVessel <http://simulationresearch.lbl.gov/modelica/releases/latest/help/Buildings_Fluid_Storage.html#Buildings.Fluid.Storage.ExpansionVessel>`_
to form the system model shown below.

Expand Down Expand Up @@ -345,8 +345,9 @@ Nominal Values
~~~~~~~~~~~~~~

Most components have a parameters for the nominal operating conditions.
These parameters have names that end in ``_nominal`` and they should be set to the values that the component typically
have if they are run at full load or design conditions. Depending on the model, these
These parameters have names that end in ``_nominal`` and they should be set to the values that
the component typically
has if it is operated at full load or design conditions. Depending on the model, these
parameters are used differently, and the respective model documentation or code
should be consulted for details. However, the table below shows typical use of
parameters in various model to help the user understand how they are used.
Expand Down Expand Up @@ -494,12 +495,13 @@ Adding dynamics may be achieved using a formulation such as
m_flow_nominal*1E-4);
der(T)=(TMed-T)/tau;

where ``tau``>0 is a time constant. See for example
where ``tau``>0 is a time constant. See, for example,
`Buildings.Fluid.Sensors.TemperatureTwoPort <http://simulationresearch.lbl.gov/modelica/releases/latest/help/Buildings_Fluid_Sensors.html#Buildings.Fluid.Sensors.TemperatureTwoPort>`_
for a robust implementation.

.. note::
In the package `Buildings.Utilities.Math <http://simulationresearch.lbl.gov/modelica/releases/latest/help/Buildings_Utilities_Math.html#Buildings.Utilities.Math>`_ the functions and blocks whose names start with ``smooth`` can be used to avoid events.
In the package `Buildings.Utilities.Math <http://simulationresearch.lbl.gov/modelica/releases/latest/help/Buildings_Utilities_Math.html#Buildings.Utilities.Math>`_
the functions and blocks whose names start with ``smooth`` can be used to avoid events.

Controls
--------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ This section describes the development of the `Buildings` library.

Contributing
------------
We welcome contributions of new models and suggestions for how to improve the library.
Models that are contributed need to follow the following guidelines, as this is needed to integrate them in the library, make them accessible to users and further maintain them:
Contributions of new models and suggestions for how to improve the library are
welcome.
Models that are contributed need to adhere to the following guidelines, as this is needed to integrate them in the library, make them accessible to users and further maintain them:

* They should be of general interest to other users and well documented and tested.
* They need to follow the coding conventions described in
Expand Down Expand Up @@ -93,9 +94,9 @@ the equation by a linear model of the form
When implementing the pressure drop model, also provide means to

1. use homotopy, which should be used by default, and
2. disable the pressure drop model.
2. disable the pressure-drop model.

Disabling the pressure drop model allows, for example, a user to
Disabling the pressure-drop model allows, for example, a user to
set in a series connection of a heating coil and a cooling coil
the pressure drop of the heating coil to zero, and
to lump the pressure drop of the heating coil into the pressure drop model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ Getting Started

Literature for Users
--------------------
We recommend new users of Modelica to study the books by Michael Tiller [Til2001]_ and Peter Fritzson ([Fri2011]_ and [Fri2004]_), and the tutorials that are listed at https://www.modelica.org/publications.
The following books are useful for new users to get started:

* The online book with interactive examples of Michael Tiller at http://book.xogeny.com/.
* The books by Michael Tiller [Til2001]_ and Peter Fritzson ([Fri2011]_ and [Fri2004]_).
* The tutorials that are listed at https://www.modelica.org/publications.

Although the `Modelica Language Tutorial <https://www.modelica.org/documents/ModelicaTutorial14.pdf>`_ is for an older version (Modelica 1.4), it is still instructive and relevant to understand the concepts of the language.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This library can be used
* to process ``*.mat`` output files that were generated by Dymola or OpenModelica, and
* to run unit tests as part of the library development.

See the separate documentation at http://simulationresearch.lbl.gov/modelica/buildingspy/ for how to use this library.
See the separate documentation at http://simulationresearch.lbl.gov/modelica/buildingspy/ for information on how to use this library.

In addition, Dymola provides MATLAB scripts that can be used to process ``*.mat`` output files that were generated by Dymola. See the Dymola documentation for how to use these scripts.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,22 @@ The configuration of ``fanS`` causes the fan speed to instantly change from 0 to

.. figure:: img/fanStepSchematics.png

Schematic diagram of fans that are configured with ``filterSpeed=false`` (``fanS``) and ``filterSpeed=true`` (``fanC``).
Schematic diagram of fans that are configured with ``filteredSpeed=false`` (``fanS``) and ``filteredSpeed=true`` (``fanC``).

.. figure:: img/fanStepResponse.png

Mass flow rate of the two fans for a step input signal at 0 seconds.


For fans and pumps, the dynamics introduced by the filter can be thought of as approximating the rotational inertia of the fan rotor and the inertia of the fluid in the duct or piping network.
For fans and pumps, the dynamics introduced by the filter can be thought of as approximating
the rotational inertia of the fan rotor and the inertia of the fluid in the duct or piping network.
The default value is ``raiseTime=30`` seconds.

For actuators, the rise time approximates the travel time of the valve lift.
For actuators, the raise time approximates the travel time of the valve lift.
The default value is ``raiseTime=120`` seconds.

.. note:: When changing ``filteredSpeed`` (or ``filteredOpening``),
or when changing the value of ``riseTime``, the dynamic
or when changing the value of ``raiseTime``, the dynamic
response of the closed loop control changes. Therefore,
control gains may need to be retuned to ensure satisfactory
closed loop control performance.
Expand All @@ -66,14 +67,14 @@ While this is no problem for small models, the iterative solution can lead to hi
be part of the residual function.

For illustration, consider the simple system shown below in which the flow resistances ``res1`` and ``res2`` compute the mass flow rate as
:math:`\dot m = k \, \sqrt{\Delta p}` if the parameter ``from_dp`` is set to ``true``, or otherwise the pressure drop between their inlet and outlet as :math:`\Delta p = (\dot m / k)^2`. (Both formulations are implemented using :term:`regularization` near zero.)
:math:`\dot m = k \, \sqrt{\Delta p}` if the parameter ``from_dp`` is set to ``true``, or otherwise compute the pressure drop between their inlet and outlet as :math:`\Delta p = (\dot m / k)^2`. (Both formulations are implemented using :term:`regularization` near zero.)

.. figure:: img/resistancesSeries.png

Schematic diagram of two flow resistances in series that connect a source and a volume.

Depending on the configuration of the individual component models, simulating this system model may require the iterative solution of a nonlinear equation to compute the mass flow rate or the pressure drop.
To avoid a nonlinear equation, you could do any of the below measures.
To avoid a nonlinear equation, use any of the measures below.

- Set the parameter ``res2(dp_nominal=0)``, and add the pressure drop to the parameter ``dp_nominal`` of the model ``res1``. This will eliminate the equation that computes the flow friction in ``res2``, thereby avoiding a nonlinear equation. The same applies if there are multiple components in series, such as a pre-heat coil, a heating coil and a cooling coil.
- Set ``from_dp=false`` in all components, which is the default setting. This will cause Modelica to use a function that computes the pressure drop as a function of the mass flow rate. Therefore, a code translator is likely to generate an equation that solves for the mass flow rate, and it then uses the mass flow rate to compute the pressure drop of the components that are connected in series.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for all documentation.
*
* :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down Expand Up @@ -168,6 +168,9 @@ var Documentation = {
var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
if (terms.length) {
var body = $('div.body');
if (!body.length) {
body = $('body');
}
window.setTimeout(function() {
$.each(terms, function() {
body.highlightText(this.toLowerCase(), 'highlighted');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilties for the full-text search.
*
* :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down Expand Up @@ -330,13 +330,13 @@ var Search = {
objectterms.push(tmp[i].toLowerCase());
}

if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
tmp[i] === "") {
// skip this "word"
continue;
}
// stem the word
var word = stemmer.stemWord(tmp[i]).toLowerCase();
var word = stemmer.stemWord(tmp[i].toLowerCase());
var toAppend;
// select the correct list
if (word[0] == '-') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* sphinx.websupport utilties for all documentation.
*
* :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h3>Navigation</h3>
</div>
<div class="footer">
&copy; Copyright 2012-2013, The Regents of the University of California (through Lawrence Berkeley National Laboratory).
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2b3.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>

0 comments on commit 6671a99

Please sign in to comment.