Skip to content

Commit 536a95c

Browse files
committed
ADD lymph related components
1 parent b9e793b commit 536a95c

File tree

13 files changed

+90
-4
lines changed

13 files changed

+90
-4
lines changed

Pharmacolibrary/Interfaces/FlowPort_a.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ within Pharmacolibrary.Interfaces;
22
connector FlowPort_a
33
extends Pharmacolibrary.Interfaces.FlowPort;
44
annotation(
5-
defaultComponentName = "fport_in",
6-
Icon(coordinateSystem(initialScale = 0.1), graphics = {Polygon(lineColor = {204, 0, 0}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, lineThickness = 0.5, points = {{-100, 0}, {0, 100}, {100, 0}, {0, -100}, {-100, 0}})}),
5+
defaultComponentName = "fin",
6+
Icon(coordinateSystem(initialScale = 0.1), graphics = {Polygon(lineColor = {204, 0, 0}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, lineThickness = 4, points = {{-100, 0}, {0, 100}, {100, 0}, {0, -100}, {-100, 0}})}),
77
Diagram(coordinateSystem(initialScale = 0.1)),
88
Documentation(info = "<html><head></head><body><span style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\">The external&nbsp;</span><code style=\"font-size: 12px;\">FlowPort</code><span style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\">&nbsp;connector defines an acausal interface for&nbsp;</span><span style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\">usual output&nbsp;</span><span style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\">transporting both fluid volume and dissolved substance (drug) concentration between components.</span><div style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\"></div><div><span style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\"><br></span></div></body></html>"));
99
end FlowPort_a;

Pharmacolibrary/Interfaces/FlowPort_b.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ within Pharmacolibrary.Interfaces;
22
connector FlowPort_b
33
extends Pharmacolibrary.Interfaces.FlowPort;
44
annotation(
5-
defaultComponentName = "fport_in",
5+
defaultComponentName = "fout",
66
Icon(coordinateSystem(initialScale = 0.1), graphics = {Polygon(lineColor = {204, 0, 0}, fillColor = {204, 0, 0}, fillPattern = FillPattern.Solid, lineThickness = 0.5, points = {{-100, 0}, {0, 100}, {100, 0}, {0, -100}, {-100, 0}})}),
77
Diagram(coordinateSystem(initialScale = 0.1)),
88
Documentation(info = "<html><head></head><body><span style=\"font-size: 12px; font-family: 'DejaVu Sans Mono';\">The internal&nbsp;</span><code style=\"font-size: 12px;\">FlowPort</code><span style=\"font-size: 12px; font-family: 'DejaVu Sans Mono';\">&nbsp;connector defines an acausal interface for&nbsp;</span><span style=\"font-size: 12px; font-family: 'DejaVu Sans Mono';\">usual input&nbsp;</span><span style=\"font-size: 12px; font-family: 'DejaVu Sans Mono';\">transporting both fluid volume and dissolved substance (drug) concentration between components.</span></body></html>"));
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
within Pharmacolibrary.Interfaces;
2+
3+
connector FlowPort_la
4+
extends Pharmacolibrary.Interfaces.FlowPort;
5+
annotation(
6+
Icon(graphics = {Polygon(lineColor = {46, 194, 126}, fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, lineThickness = 4, points = {{-100, 0}, {0, 100}, {100, 0}, {0, -100}, {-100, 0}})}));
7+
end FlowPort_la;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
within Pharmacolibrary.Interfaces;
2+
3+
connector FlowPort_lb
4+
extends Interfaces.FlowPort;
5+
annotation(
6+
Icon(graphics = {Polygon(lineColor = {46, 194, 126}, fillColor = {46, 194, 126}, fillPattern = FillPattern.Solid, lineThickness = 4, points = {{-100, 0}, {0, 100}, {100, 0}, {0, -100}, {-100, 0}})}));
7+
end FlowPort_lb;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
within Pharmacolibrary.Interfaces;
2+
partial model PartialLymphConcThrough
3+
extends Interfaces.PartialLymphTwoPort;
4+
equation
5+
port_a.c = inStream(port_b.c);
6+
inStream(port_a.c) = port_b.c;
7+
annotation(
8+
Documentation(info = "<html><head></head><body><p style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\">This partial model defines an interface for components with two flow ports where concentration strem is ideal and goes through this component without any other effect. Proper drug mixing is ensured.</p><p style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\">An extending model providing direct access to mass flow and mass concentration of the port should define appropriate relation.&nbsp;</p></body></html>"));
9+
end PartialLymphConcThrough;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
within Pharmacolibrary.Interfaces;
2+
partial model PartialLymphFlowThrough
3+
extends Interfaces.PartialLymphTwoPort;
4+
equation
5+
port_a.qv + port_b.qv = 0;
6+
port_a.p = port_b.p;
7+
annotation(
8+
Documentation(info = "<html><head></head><body><p style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\">This partial model defines an interface for components with two flow ports where volumetric flow is ideal through this component without any other effect.&nbsp;</p><p style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\">An extending model providing direct access to mass flow and mass concentration of the port should define appropriate relation.&nbsp;</p></body></html>"));
9+
end PartialLymphFlowThrough;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
within Pharmacolibrary.Interfaces;
2+
partial model PartialLymphTwoPort
3+
Interfaces.FlowPort_la port_a annotation(
4+
Placement(transformation(origin = {-94, 0}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {-100, 0}, extent = {{-30, -30}, {30, 30}})));
5+
Interfaces.FlowPort_lb port_b annotation(
6+
Placement(transformation(origin = {96, 0}, extent = {{-10, -10}, {10, 10}}), iconTransformation(origin = {100, 0}, extent = {{-30, -30}, {30, 30}})));
7+
annotation(
8+
Documentation(info = "<html><head></head><body><p style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\">This partial model defines an interface for components with two flow ports.&nbsp;</p><p style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\">An extending model providing direct access to flow and concentration of both ports should define appropriate relation.</p></body></html>"));
9+
end PartialLymphTwoPort;

Pharmacolibrary/Interfaces/package.order

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ PharmaBus
2424
PartialOneConcPort_obsolete
2525
PartialBloodTissueCompartment
2626
PartialBTCompartment
27+
FlowPort_la
28+
FlowPort_lb
29+
PartialLymphTwoPort
30+
PartialLymphConcThrough
31+
PartialLymphFlowThrough
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
within Pharmacolibrary.Pharmacokinetic;
2+
3+
model LymphFlow
4+
extends Interfaces.PartialLymphConcThrough;
5+
extends Interfaces.PartialLymphTwoPort;
6+
parameter Types.VolumeFlowRate Q(displayUnit = "l/min") "fixed flow rate";
7+
equation
8+
assert(abs(port_a.qv + port_b.qv) < Modelica.Constants.eps, "some flow is lost", level = AssertionLevel.error);
9+
port_a.qv = Q;
10+
port_a.qv + port_b.qv = 0;
11+
// port_a.p = 1;
12+
annotation(
13+
Icon(graphics = {Polygon(rotation = 180, lineColor = {38, 162, 105}, fillColor = {143, 240, 164}, fillPattern = FillPattern.Solid, lineThickness = 4, points = {{-80, 0}, {80, 40}, {80, -40}, {-80, 0}, {-80, 0}}), Text(origin = {0, -59}, extent = {{260, -11}, {-260, 11}}, textString = "Q=%Q")}, coordinateSystem(initialScale = 0.1)),
14+
Documentation(info = "<html><head></head><body><h1>FixedFlow</h1><div><span style=\"font-family: 'DejaVu Sans Mono'; font-size: 12px;\">determines the blood/plasma flow. The flow (perfusion) part of a model should be supplied with appropriet number of FixedFlow components so that the flow in each branch may be determined.</span></div><h2>Parameter</h2><div><font face=\"DejaVu Sans Mono\">Q - fixed flow rate</font></div></body></html>"));
15+
end LymphFlow;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
within Pharmacolibrary.Pharmacokinetic;
2+
model LymphNode "Lymph node compartment"
3+
extends Pharmacokinetic.GenericTissueCompartment(final kTB = 1, redeclare Pharmacolibrary.Interfaces.FlowPort_lb port_b);
4+
extends Icons.BloodPlasma;
5+
equation
6+
7+
annotation(
8+
defaultComponentName = "systemic",
9+
Icon,
10+
Documentation(info = "<html><head></head><body>
11+
<h1>SystemicCompartment</h1><div>Systemic compartment is same as TissueCompartment, but the kTB is always 1, so that the concentration in tissue is not considered and is always same as blood/plasma concentration.</div></body></html>"));
12+
end LymphNode;

0 commit comments

Comments
 (0)