-
Notifications
You must be signed in to change notification settings - Fork 82
Type Declarations
Declare all public parameters before protected ones. Declare variables and final parameters that are not of interest to users as protected.
Set default parameter values as follows:
-
If a parameter value can range over a large region, do not provide a default value. Examples are nominal mass flow rates.
-
If a parameter value does not vary significantly but need to be verified by the user, provide a default value by using its start attribute. For example, for a heat exchanger, use
parameter Real eps(start=0.8, min=0, max=1, unit="1") "Heat exchanger effectiveness";
Do not use
parameter Real eps=0.8
as this can lead to errors that are difficult to detect if a modeller forgets to overwrite the default value of0.8
with the actual value. The model will simulate, but gives wrong results due to unsuited parameter values and there will be no warning. On the other hand, usingparameter Real eps(start=0.8)
will give a warning and hence users can assign better values. -
If a parameter value can be precomputed based on other parameters, set its value to this equation. For example,
parameter Medium.MassFlowRate m_flow_small(min=0) = 1E-4*m_flow_nominal ...
If a parameter value should not be changed by a user,
use the final
keyword.
For parameters and variables, provide values for the min
and
max
attribute where applicable.
Be aware, that these bounds are not enforced by the simulator.
If the min
and max
attribute are set, each violation of these bounds
during the simulation may raise a warning.
Simulators may allow to supress these warnings. In Dymola, violation of bounds can be checked using
Advanced.AssertAllInsideMinMax=true;
For any variable or parameter that may need to be solved numerically,
provide a value for the start
and nominal
attribute.
All variables that have a physical correspondence, including physical ratios, must have a unit. Use (derived) SI units, and where possible, use types from Modelica.SIunits
. Non-SI units are to be kept at an absolute minimum, and they must be declared as protected
.
- Getting started
-
Modeling and simulation guide
- Modelica guidelines
- How to Modelica
- Important tools around AixLib
- Move from HeatPump to ModularReversible
-
Contribution guide
- Git Workflow
- Structure of Repository
- Behind the Scenes
- Contribute to AixLib
- Testing and model quality management
- Requirements
- Test Management
- Continuous Integration