Skip to content

Color valve and resistance#252

Closed
tobiasreischl wants to merge 7 commits intoDLR-SR:mainfrom
tobiasreischl:ColorValveandResistance
Closed

Color valve and resistance#252
tobiasreischl wants to merge 7 commits intoDLR-SR:mainfrom
tobiasreischl:ColorValveandResistance

Conversation

@tobiasreischl
Copy link
Contributor

Added coloring to all valve and resistance for one way flow
Added dp as live display in bar for those components
New Icon Style for valves

Copy link
Collaborator

@RaphaelGebhart RaphaelGebhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Tobi. Here are some suggestions.

parameter Real k_min(unit="1", min = 1e-5, max = 1) = 0.03 "Remaining flow at actuation signal u = 0";

Modelica.Blocks.Interfaces.RealInput u_in(unit="1") "Valve control input signal []"
annotation (Placement(transformation(extent={{-20,-20},{20,20}},rotation=270,origin={0,80})));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should be reverted.

Boundaries.Sink sink(redeclare package Medium=Medium, p0_par=200000)
annotation (Placement(transformation(extent={{52,-10},{72,10}})));
ThermofluidStream.FlowControl.CheckValve checkValve(redeclare package Medium=Medium, L=
ThermofluidStream.FlowControl.CheckValve checkValve(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

displayInstanceName=true is not required. The modifier can be removed.

offset=1e5)
annotation (Placement(transformation(extent={{-96,-4},{-76,16}})));
Processes.FlowResistance flowResistance(redeclare package Medium=Medium,
Processes.FlowResistance flowResistance(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

displayInstanceName=true is not required. The modifier can be removed.

ThermofluidStream.Boundaries.Sink sink(redeclare package Medium = Medium, p0_par=100000)
annotation (Placement(transformation(extent={{50,20},{70,40}})));
ThermofluidStream.FlowControl.MCV mCV(
displayInstanceName=true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

displayInstanceName=true is not required. The modifier can be removed.

ThermofluidStream.Boundaries.Sink sink1(redeclare package Medium = Medium, p0_par=100000)
annotation (Placement(transformation(extent={{50,-10},{70,10}})));
ThermofluidStream.FlowControl.MCV mCV1(
displayInstanceName=true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

displayInstanceName=true is not required. The modifier can be removed.

rotation=180),
Text(
visible=displayParameters,
extent={{-100,96},{100,66}},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted elsewhere.


annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={
Line(
points={{0,4},{0,106}},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted elsewhere

// Adding color to the icon
// Normalize pressure ratio into [0,1]
phi = max(0, min(1, abs(dp) / (abs(dp_ref) + p_min)));

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p_min is not required. I would suggest a different normalization.


k_u = valveCharacteristics(u, k_min);

// Adding color to the icon
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment.

annotation(Dialog(group = "Valve parameters",enable = (flowCoefficient ==FlowCoeffType.m_flow_set)));

Real phi(min = 0, max = 1) "Normalized pressure";

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove blank lines.

@RaphaelGebhart RaphaelGebhart marked this pull request as draft January 29, 2026 09:15
@tobiasreischl tobiasreischl deleted the ColorValveandResistance branch February 13, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants