Skip to content

Commit

Permalink
final version of article to Modelica Conference 2014
Browse files Browse the repository at this point in the history
default Dymola directory in Win8 to install non-SI units
  • Loading branch information
MarekMatejak committed Jan 26, 2014
1 parent b409c34 commit c71dd2d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 37 deletions.
23 changes: 12 additions & 11 deletions Physiolibrary/Chemical.mo
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,8 @@ package Chemical "Domain with Molar Concentration and Molar Flow"
Simulation=SimulationType.SteadyState);

parameter GasSolubility alpha = 0.0105 * 1e-3
"oxygen solubility in plasma"; // by Siggaard Andersen: 0.0105 (mmol/l)/kPa
"oxygen solubility in plasma";
// by Siggaard Andersen: 0.0105 (mmol/l)/kPa
parameter Fraction L = 7.0529*10^6
"=[T0]/[R0] .. dissociation constant of relaxed <-> tensed change of deoxyhemoglobin tetramer";
parameter Fraction c = 0.00431555
Expand Down Expand Up @@ -565,11 +566,11 @@ package Chemical "Domain with Molar Concentration and Molar Flow"
Modelica.Blocks.Math.Add add annotation (Placement(transformation(
extent={{-4,-4},{4,4}},
rotation=270,
origin={-54,-54})));
origin={-66,-54})));
Modelica.Blocks.Math.Add add1 annotation (Placement(transformation(
extent={{-4,-4},{4,4}},
rotation=270,
origin={62,-54})));
origin={52,-54})));
Sources.UnlimitedGasStorage oxygen_in_air(
Simulation=Physiolibrary.Types.SimulationType.SteadyState,
usePartialPressureInput=true,
Expand Down Expand Up @@ -650,29 +651,29 @@ package Chemical "Domain with Molar Concentration and Molar Flow"
smooth=Smooth.None));
connect(add.y, R0_in_R.totalSubunitAmount[1])
annotation (Line(
points={{-54,-58.4},{-54,-66},{-54,-80},{-58,-80}},
points={{-66,-58.4},{-66,-80},{-58,-80}},
color={0,0,127},
smooth=Smooth.None));

connect(add1.y, T0_in_T.totalSubunitAmount[1])
annotation (Line(
points={{62,-58.4},{62,-66},{62,-80},{58,-80}},
points={{52,-58.4},{52,-80},{58,-80}},
color={0,0,127},
smooth=Smooth.None));
connect(OxyTHm.solute, add1.u2) annotation (Line(
points={{32,-36},{32,-42},{59.6,-42},{59.6,-49.2}},
points={{32,-36},{32,-42},{49.6,-42},{49.6,-49.2}},
color={0,0,127},
smooth=Smooth.None));
connect(add1.u1, DeoxyTHm.solute) annotation (Line(
points={{64.4,-49.2},{64.4,-42},{88,-42},{88,-36}},
points={{54.4,-49.2},{54.4,-42},{88,-42},{88,-36}},
color={0,0,127},
smooth=Smooth.None));
connect(DeoxyRHm.solute, add.u1) annotation (Line(
points={{-32,-36},{-32,-36},{-32,-44},{-51.6,-44},{-51.6,-49.2}},
points={{-32,-36},{-32,-44},{-63.6,-44},{-63.6,-49.2}},
color={0,0,127},
smooth=Smooth.None));
connect(OxyRHm.solute, add.u2) annotation (Line(
points={{-88,-36},{-88,-44},{-56.4,-44},{-56.4,-49.2}},
points={{-88,-36},{-88,-44},{-68.4,-44},{-68.4,-49.2}},
color={0,0,127},
smooth=Smooth.None));
connect(partialPressure1.q_out, oxygen_in_air.q_out)
Expand Down Expand Up @@ -1921,7 +1922,7 @@ It works in two modes:
lineColor={107,45,134},
fillColor={107,45,134},
fillPattern=FillPattern.Solid),
Text(extent= {{-160,110},{40,50}}, lineColor= {107,45,134}, textString= "%name")}),
Text(extent = {{-160,110},{40,50}}, lineColor = {107,45,134}, textString = "%name")}),
Documentation(info="<html>
<p>
Connector with one flow signal of type Real.
Expand Down Expand Up @@ -1955,7 +1956,7 @@ Connector with one flow signal of type Real.
lineColor={107,45,134},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Text(extent= {{-160,110},{40,50}}, lineColor= {107,45,134}, textString= "%name")}),
Text(extent = {{-160,110},{40,50}}, lineColor = {107,45,134}, textString = "%name")}),
Documentation(info="<html>
<p>
Connector with one flow signal of type Real.
Expand Down
Binary file modified Physiolibrary/Resources/Documentation/Physiolibrary.pdf
Binary file not shown.
12 changes: 10 additions & 2 deletions Physiolibrary/Resources/DymolaSettings/installDisplayUnits.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
@echo off
@echo on

for /F delims^=^"^ tokens^=2 %%s in ('ftype mofile') DO set x=%%s
set suffix=%x:*bin=%
call set DEFAULT_DYMOLADIR=%%x:bin%suffix%=%%
set suffix=
set x=

set DYMOLADIR=%1
if "%DYMOLADIR%"=="" set DYMOLADIR=%programfiles(x86)%\Dymola 2014

if "%1"=="" set DYMOLADIR=%DEFAULT_DYMOLADIR%

echo Chosen Dymola directory is "%DYMOLADIR%".

Expand Down
2 changes: 1 addition & 1 deletion Physiolibrary/Types.mo
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ package Types "Physiological units with nominals"
concentration=1,
osmolarity=1,
gasSTP(displayUnit="litre_STP") = 0.0440316172572,
mass(displayUnit="ug") = 1e-09,
temperature=274.15,
heat=4186.8,
pressure=133.322387415,
Expand All @@ -64,7 +65,6 @@ package Types "Physiological units with nominals"
electricCurrent=1.6080889983333,
time_=60,
energy=4186.8,
mass(displayUnit="ug") = 1e-09,
electricalPotential=0.001,
massFlowRate=1.6666666666667e-08,
density=1000,
Expand Down
31 changes: 8 additions & 23 deletions Physiolibrary/package.mo
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ package Physiolibrary "Physiological domains library (version v2.0)"
extends Modelica.Icons.Information;

annotation (Documentation(info="<html>
<p>ThePhysiolibrary defines the most important <b>elementary connectors</b> in various domains. If any possible, a user should utilize these connectors in order that components from the Physiolibrary and from other libraries can be combined without problems. The following elementary connectors are defined (the meaning of potential, flow, and stream variables is explained in section &QUOT;Connector Equations&QUOT; below): </p>
<p>The Physiolibrary defines the most important <b>elementary connectors</b> in various domains. If any possible, a user should utilize these connectors in order that components from the Physiolibrary and from other libraries can be combined without problems. The following elementary connectors are defined (the meaning of potential, flow, and stream variables is explained in section &QUOT;Connector Equations&QUOT; below): </p>
<table cellspacing=\"0\" cellpadding=\"1\" border=\"1\"><tr>
<td valign=\"top\"><p><h4>domain</h4></p></td>
<td valign=\"top\"><p><h4>potential</h4></p><p>variables</p></td>
Expand All @@ -57,42 +57,43 @@ package Physiolibrary "Physiological domains library (version v2.0)"
<td valign=\"top\"><p>molar concentration</p></td>
<td valign=\"top\"><p>molar flow</p></td>
<td valign=\"top\"></td>
<td valign=\"top\"><p><a href=\"Physiolibrary.Chemical.Interfaces\">Physiolibrary.Chemical.Interfaces</a> </p><p>ChemicalPort, ChemicalPort_a, ChemicalPort_b</p></td>
<td valign=\"top\"><p><br/><a href=\"Physiolibrary.Chemical.Interfaces\">Physiolibrary.Chemical.Interfaces</a> </p><p>ChemicalPort, ChemicalPort_a, ChemicalPort_b</p></td>
<td valign=\"top\"><p><img src=\"modelica://Physiolibrary/Resources/Images/UserGuide/ChemicalPorts.png\"/></p></td>
</tr>
<tr>
<td valign=\"top\"><p><h4>hydraulic</h4></p></td>
<td valign=\"top\"><p>pressure</p></td>
<td valign=\"top\"><p>volumetric flow</p></td>
<td valign=\"top\"></td>
<td valign=\"top\"><p><a href=\"Physiolibrary.Hydraulic.Interfaces\">Physiolibrary.Hydraulic.Interfaces</a> </p><p>HydraulicPort, HydraulicPort_a, HydraulicPort_b</p></td>
<td valign=\"top\"><p><br/><a href=\"Physiolibrary.Hydraulic.Interfaces\">Physiolibrary.Hydraulic.Interfaces</a> </p><p>HydraulicPort, HydraulicPort_a, HydraulicPort_b</p></td>
<td valign=\"top\"><p><img src=\"modelica://Physiolibrary/Resources/Images/UserGuide/HydraulicPorts.png\"/></p></td>
</tr>
<tr>
<td valign=\"top\"><p><h4>osmotic</h4></p></td>
<td valign=\"top\"><p>osmolarity</p></td>
<td valign=\"top\"><p>permeable liquid volumetric flow </p></td>
<td valign=\"top\"></td>
<td valign=\"top\"><p><a href=\"Physiolibrary.Osmotic.Interfaces\">Physiolibrary.Osmotic.Interfaces</a> </p><p>OsmoticPort, OsmoticPort_a, OsmoticPort_b</p></td>
<td valign=\"top\"><p><br/><a href=\"Physiolibrary.Osmotic.Interfaces\">Physiolibrary.Osmotic.Interfaces</a> </p><p>OsmoticPort, OsmoticPort_a, OsmoticPort_b</p></td>
<td valign=\"top\"><p><img src=\"modelica://Physiolibrary/Resources/Images/UserGuide/OsmoticPorts.png\"/></p></td>
</tr>
<tr>
<td valign=\"top\"><p><h4>thermal</h4></p></td>
<td valign=\"top\"><p>temperature</p></td>
<td valign=\"top\"><p>heat flow rate</p></td>
<td valign=\"top\"></td>
<td valign=\"top\"><p><a href=\"modelica://Modelica.Thermal.HeatTransfer.Interfaces\">Modelica.Thermal.HeatTransfer.Interfaces</a> </p><p>HeatPort, HeatPort_a, HeatPort_b</p><p><a href=\"Physiolibrary.Thermal.Interfaces\">Physiolibrary.Thermal.Interfaces</a> </p><p>HeatPort, HeatPort_a, HeatPort_b</p></td>
<td valign=\"top\"><p><br/><a href=\"modelica://Modelica.Thermal.HeatTransfer.Interfaces\">Modelica.Thermal.HeatTransfer.Interfaces</a> </p><p>HeatPort, HeatPort_a, HeatPort_b</p><p><a href=\"Physiolibrary.Thermal.Interfaces\">Physiolibrary.Thermal.Interfaces</a> </p><p>HeatPort, HeatPort_a, HeatPort_b</p></td>
<td valign=\"top\"><p><br/><img src=\"modelica://Physiolibrary/Resources/Images/UserGuide/ThermalPorts.png\"/></p></td>
</tr>
<tr>
<td valign=\"top\"><p><h4>block</h4></p><p>diagram</p></td>
<td valign=\"top\"><p>Real unit-typed variables</p></td>
<td valign=\"top\"></td>
<td valign=\"top\"></td>
<td valign=\"top\"><p><a href=\"Physiolibrary.Types.RealIO\">Physiolibrary.Types.RealIO</a> </p><p>EnergyInput, EnergyOutput, TimeInput, TimeOutput, MassInput, MassOutput, MassFlowRateInput, MassFlowRateOutput, HeightInput, HeightOutput, AccelerationInput, AccelerationOutput, PressureInput, PressureOutput, VolumeInput, VolumeOutput, VolumeFlowRateInput, VolumeFlowRateOutput, ConcentrationInput, ConcentrationOutput, OsmolarityInput, OsmolarityOutput, AmountOfSubstanceInput, AmountOfSubstanceOutput, MolarFlowRateInput, MolarFlowRateOutput, DiffusionPermeabilityInput, DiffusionPermeabilityOutput, HeatInput, HeatOutput, TemperatureInput, TemperatureOutput, HeatFlowRateInput, HeatFlowRateOutput, ThermalConductanceInput, ThermalConductanceOutput, ElectricCurrentInput, ElectricCurrentOutput, ElectricChargeInput, ElectricChargeOutput, ElectricPotentialInput, ElectricPotentialOutput, FractionInput, FractionOutput, FrequencyInput, FrequencyOutput, OsmoticPermeabilityInput, OsmoticPermeabilityOutput, HydraulicConductanceInput, HydraulicConductanceOutput, HydraulicComplianceInput, HydraulicComplianceOutput, HydraulicInertanceInput, HydraulicInertanceOutput, GasSolubilityInput, GasSolubilityOutput, DensityInput, SpecificEnergyInput, SpecificEnergyOutput, SpecificHeatCapacityInput, SpecificHeatCapacityOutput</p></td>
<td valign=\"top\"><p><br/><br/><a href=\"Physiolibrary.Types.RealIO\">Physiolibrary.Types.RealIO</a> </p><p>EnergyInput, EnergyOutput, TimeInput, TimeOutput, MassInput, MassOutput, MassFlowRateInput, MassFlowRateOutput, HeightInput, HeightOutput, AccelerationInput, AccelerationOutput, PressureInput, PressureOutput, VolumeInput, VolumeOutput, VolumeFlowRateInput, VolumeFlowRateOutput, ConcentrationInput, ConcentrationOutput, OsmolarityInput, OsmolarityOutput, AmountOfSubstanceInput, AmountOfSubstanceOutput, MolarFlowRateInput, MolarFlowRateOutput, DiffusionPermeabilityInput, DiffusionPermeabilityOutput, HeatInput, HeatOutput, TemperatureInput, TemperatureOutput, HeatFlowRateInput, HeatFlowRateOutput, ThermalConductanceInput, ThermalConductanceOutput, ElectricCurrentInput, ElectricCurrentOutput, ElectricChargeInput, ElectricChargeOutput, ElectricPotentialInput, ElectricPotentialOutput, FractionInput, FractionOutput, FrequencyInput, FrequencyOutput, OsmoticPermeabilityInput, OsmoticPermeabilityOutput, HydraulicConductanceInput, HydraulicConductanceOutput, HydraulicComplianceInput, HydraulicComplianceOutput, HydraulicInertanceInput, HydraulicInertanceOutput, GasSolubilityInput, GasSolubilityOutput, DensityInput, SpecificEnergyInput, SpecificEnergyOutput, SpecificHeatCapacityInput, SpecificHeatCapacityOutput</p></td>
<td valign=\"top\"><p><img src=\"modelica://Physiolibrary/Resources/Images/UserGuide/Signals.png\"/></p></td>
</tr>
</table>
<p><br/><br/>In all domains, usually 2 connectors are defined. The variable declarations are <b>identical</b>, only the icons are different in order that it is easy to distinguish connectors of the same domain that are attached at the same component. </p>
<p><br/><br/><br/>In all domains, usually 2 connectors are defined. The variable declarations are <b>identical</b>, only the icons are different in order that it is easy to distinguish connectors of the same domain that are attached at the same component. </p>
</html>"));
end Connectors;

Expand Down Expand Up @@ -226,15 +227,6 @@ package Physiolibrary "Physiological domains library (version v2.0)"
package ReleaseNotes "Release notes"
extends Modelica.Icons.ReleaseNotes;










class Version_2_0 "Version 2.0 (Jan. 26, 2014)"
extends Modelica.Icons.ReleaseNotes;

Expand Down Expand Up @@ -355,13 +347,6 @@ package Physiolibrary "Physiological domains library (version v2.0)"
end UsersGuide;









annotation (preferredView="info",
version="2.0",
versionBuild=1,
Expand Down

0 comments on commit c71dd2d

Please sign in to comment.