Skip to content

Comments

>> Use SI.* where possible#288

Open
tobiasreischl wants to merge 2 commits intoDLR-SR:mainfrom
tobiasreischl:TFS_MediumChange
Open

>> Use SI.* where possible#288
tobiasreischl wants to merge 2 commits intoDLR-SR:mainfrom
tobiasreischl:TFS_MediumChange

Conversation

@tobiasreischl
Copy link
Contributor

Changed from Medium.* to SI.* - closes Issue #16
keep SI.PressureDifference
SI.Pressure -> SI.AbsolutePressure only for p, not for r
Modelica.Units.SI. changed to SI.

IMPORTANT: Media not changed (for now)

> Changed from Medium.* to SI.*
> keep SI.PressureDifference
> SI.Pressure -> SI.AbsolutePressure only for p, not for r
> Modelica.Units.SI. changed to SI.

> IMPORTANT: Media not changed (for now)

protected
SI.Pressure p_env "Environmental pressure";
SI.AbsolutePressure p_env "Environmental pressure";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Keep SI.AbsolutePressure. Do not change to Medium.AbsolutePressure.

parameter Boolean pEnvFromInput = false "=true, if environmental pressure input connector is enabled"
annotation(Dialog(group="Environmental pressure"),Evaluate=true, HideResult=true, choices(checkBox=true));
parameter SI.Pressure p_env_par=1e5 "Environmental pressure set value"
parameter SI.AbsolutePressure p_env_par=1e5 "Environmental pressure set value"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do not change to Medium.AbsolutePressure.


protected
SI.Pressure p_env "Environmental pressure";
SI.AbsolutePressure p_env "Environmental pressure";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do not change to Medium.AbsolutePressure.

@RaphaelGebhart
Copy link
Collaborator

RaphaelGebhart commented Feb 24, 2026

The requested changes always refer to the last line of the preview.

  • Modelica.Units.SI.* -> SI.*
  • Pressure -> AbsolutePressure for p_in, p_out, etc. Not for dp, r
  • Apply requested changes.
  • SI.* -> Medium.* whenever possible (AbsolutePressure, Temperature, etc., see Modelica.Media.Interfaces.Types (ThermofluidStream.Media.myMedia.Interfaces.Types). Currently, the change was applied in the opposite direction, i.e. Medium.* was replaced by SI.*.

Medium.AbsolutePressure staticHeadOutlets_Pa_relative[M_outlets] "relative pressure to liquid surface, 0 if above surface";
SI.Length staticHeadInlets[N_inlets] "distance perpendicular to liquid surface, 0 if above surface";
SI.Length staticHeadOutlets[M_outlets] "distance perpendicular to liquid surface, 0 if above surface";
SI.AbsolutePressure staticHeadInlets_Pa_relative[N_inlets] "relative pressure to liquid surface, 0 if above surface";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.AbsolutePressure staticHeadInlets_Pa_relative[N_inlets] "relative pressure to liquid surface, 0 if above surface";
SI.Pressure staticHeadInlets_Pa_relative[N_inlets] "relative pressure to liquid surface, 0 if above surface";

SI.Length staticHeadInlets[N_inlets] "distance perpendicular to liquid surface, 0 if above surface";
SI.Length staticHeadOutlets[M_outlets] "distance perpendicular to liquid surface, 0 if above surface";
SI.AbsolutePressure staticHeadInlets_Pa_relative[N_inlets] "relative pressure to liquid surface, 0 if above surface";
SI.AbsolutePressure staticHeadOutlets_Pa_relative[M_outlets] "relative pressure to liquid surface, 0 if above surface";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.AbsolutePressure staticHeadOutlets_Pa_relative[M_outlets] "relative pressure to liquid surface, 0 if above surface";
SI.Pressure staticHeadOutlets_Pa_relative[M_outlets] "relative pressure to liquid surface, 0 if above surface";

Comment on lines +100 to +101
SI.SpecificEnthalpy
h_in[N_inlets];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.SpecificEnthalpy
h_in[N_inlets];
SI.SpecificEnthalpy h_in[N_inlets];

Comment on lines +105 to +106
SI.SpecificEnthalpy
h_out[M_outlets];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.SpecificEnthalpy
h_out[M_outlets];
SI.SpecificEnthalpy h_out[M_outlets];

Comment on lines +111 to +112
SI.DerDensityByPressure
density_derp_h=(V_ref*medium.d)/(V*K) "Partial derivative of density by pressure";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.DerDensityByPressure
density_derp_h=(V_ref*medium.d)/(V*K) "Partial derivative of density by pressure";
SI.DerDensityByPressure density_derp_h=(V_ref*medium.d)/(V*K) "Partial derivative of density by pressure";

Comment on lines +118 to +119
SI.Temperature
T_heatPort;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.Temperature
T_heatPort;
SI.Temperature T_heatPort;


Real u(unit="1") "Actuation input for flow calculation";
parameter Modelica.Units.SI.Pressure dp_ref=1e5
parameter SI.Pressure dp_ref=1e5
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
parameter SI.Pressure dp_ref=1e5
parameter SI.AbsolutePressure dp_ref=1e5

Real friction_factor(unit="1");
SI.Pressure pressureLossLaminar "Laminar pressure loss";
SI.Pressure pressureLossTurbulent "Turbulent pressure loss";
SI.AbsolutePressure pressureLossLaminar "Laminar pressure loss";
Copy link
Collaborator

@RaphaelGebhart RaphaelGebhart Feb 24, 2026

Choose a reason for hiding this comment

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

Suggested change
SI.AbsolutePressure pressureLossLaminar "Laminar pressure loss";
SI.PressureDifference pressureLossLaminar "Laminar pressure loss";

SI.Pressure pressureLossLaminar "Laminar pressure loss";
SI.Pressure pressureLossTurbulent "Turbulent pressure loss";
SI.AbsolutePressure pressureLossLaminar "Laminar pressure loss";
SI.AbsolutePressure pressureLossTurbulent "Turbulent pressure loss";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.AbsolutePressure pressureLossTurbulent "Turbulent pressure loss";
SI.PressureDifference pressureLossTurbulent "Turbulent pressure loss";

input SI.Length l(min=0) "Length";

output SI.Pressure pressureLoss "pressure loss (dp)";
output SI.AbsolutePressure pressureLoss "pressure loss (dp)";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
output SI.AbsolutePressure pressureLoss "pressure loss (dp)";
output SI.PressureDifference pressureLoss "pressure loss (dp)";

Comment on lines +9 to +10
parameter SI.Temperature
T_0 = Medium.T_default "Initial Temperature"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
parameter SI.Temperature
T_0 = Medium.T_default "Initial Temperature"
parameter SI.Temperature T_0 = Medium.T_default "Initial Temperature"

Comment on lines +11 to +12
annotation(
Dialog(tab="Initialization", group="Specific enthalpy", enable=(init == Internal.InitializationMethodsCondElement.T)));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
annotation(
Dialog(tab="Initialization", group="Specific enthalpy", enable=(init == Internal.InitializationMethodsCondElement.T)));
annotation(Dialog(tab="Initialization", group="Specific enthalpy", enable=(init == Internal.InitializationMethodsCondElement.T)));

input SI.Length Delta(min = 0) "Relaitiv roughness";
input SI.Density rho "Inlet density";
input SI.DynamicViscosity mu "Dynamic viscosity";
input Real Re1 "Lower boundary Re for laminar-turbulent transition regime";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
input Real Re1 "Lower boundary Re for laminar-turbulent transition regime";
input SI.ReynoldsNumber Re1 "Lower boundary Re for laminar-turbulent transition regime";

input SI.Density rho "Inlet density";
input SI.DynamicViscosity mu "Dynamic viscosity";
input Real Re1 "Lower boundary Re for laminar-turbulent transition regime";
input Real Re2 "Upper boundary Re for laminar-turbulent transition regime";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
input Real Re2 "Upper boundary Re for laminar-turbulent transition regime";
input SI.ReynoldsNumber Re2 "Upper boundary Re for laminar-turbulent transition regime";

SI.AbsolutePressure p_branching "Total pressure branching inlet";
SI.AbsolutePressure p[2] = {p_straight, p_branching} "Total pressure inlets [straight branching]";

SI.Pressure dq_straight "Dynamic pressure difference straight inlet - outlet";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.Pressure dq_straight "Dynamic pressure difference straight inlet - outlet";
SI.PressureDifference dq_straight "Dynamic pressure difference straight inlet - outlet";

SI.AbsolutePressure p[2] = {p_straight, p_branching} "Total pressure inlets [straight branching]";

SI.Pressure dq_straight "Dynamic pressure difference straight inlet - outlet";
SI.Pressure dq_branching "Dynamic pressure difference straight inlet - outlet";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.Pressure dq_branching "Dynamic pressure difference straight inlet - outlet";
SI.PressureDifference dq_branching "Dynamic pressure difference straight inlet - outlet";

input SI.Length Delta(min = 0) "Relaitiv roughness";
input SI.Density rho "Inlet density";
input SI.DynamicViscosity mu "Dynamic viscosity";
input Real Re1 "Lower boundary Re for laminar-turbulent transition regime";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
input Real Re1 "Lower boundary Re for laminar-turbulent transition regime";
input SI.ReynoldsNumber Re1 "Lower boundary Re for laminar-turbulent transition regime";

input SI.Density rho "Inlet density";
input SI.DynamicViscosity mu "Dynamic viscosity";
input Real Re1 "Lower boundary Re for laminar-turbulent transition regime";
input Real Re2 "Upper boundary Re for laminar-turbulent transition regime";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
input Real Re2 "Upper boundary Re for laminar-turbulent transition regime";
input SI.ReynoldsNumber Re2 "Upper boundary Re for laminar-turbulent transition regime";

SI.AbsolutePressure p_branching "Total pressure branching inlet";
SI.AbsolutePressure p[2] = {p_straight, p_branching} "Total pressure inlets [straight branching]";

SI.Pressure dq_straight "Dynamic pressure difference straight inlet - outlet";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.Pressure dq_straight "Dynamic pressure difference straight inlet - outlet";
SI.PressureDifference dq_straight "Dynamic pressure difference straight inlet - outlet";

SI.AbsolutePressure p[2] = {p_straight, p_branching} "Total pressure inlets [straight branching]";

SI.Pressure dq_straight "Dynamic pressure difference straight inlet - outlet";
SI.Pressure dq_branching "Dynamic pressure difference straight inlet - outlet";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.Pressure dq_branching "Dynamic pressure difference straight inlet - outlet";
SI.PressureDifference dq_branching "Dynamic pressure difference straight inlet - outlet";

Comment on lines +30 to +31
SI.Temperature
T = Medium.temperature(center_state) "Temperature at center state";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.Temperature
T = Medium.temperature(center_state) "Temperature at center state";
SI.Temperature T = Medium.temperature(center_state) "Temperature at center state";

Comment on lines +26 to +27
parameter SI.Temperature
T_start=Medium.T_default
Copy link
Collaborator

@RaphaelGebhart RaphaelGebhart Feb 24, 2026

Choose a reason for hiding this comment

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

Suggested change
parameter SI.Temperature
T_start=Medium.T_default
parameter SI.Temperature T_start = Medium.T_default

Comment on lines +33 to +34
parameter SI.SpecificEnthalpy
h_start=Medium.h_default
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
parameter SI.SpecificEnthalpy
h_start=Medium.h_default
parameter SI.SpecificEnthalpy h_start=Medium.h_default

SI.Length staticHeadFores[N_fores]
"distance perpendicular to liquid surface";
Medium.AbsolutePressure staticHeadInlets_Pa_relative[N_inlets]
SI.AbsolutePressure staticHeadInlets_Pa_relative[N_inlets]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.AbsolutePressure staticHeadInlets_Pa_relative[N_inlets]
SI.Pressure staticHeadInlets_Pa_relative[N_inlets]

SI.AbsolutePressure staticHeadInlets_Pa_relative[N_inlets]
"relative pressure to liquid surface";
Medium.AbsolutePressure staticHeadOutlets_Pa_relative[N_outlets]
SI.AbsolutePressure staticHeadOutlets_Pa_relative[N_outlets]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.AbsolutePressure staticHeadOutlets_Pa_relative[N_outlets]
SI.Pressure staticHeadOutlets_Pa_relative[N_outlets]

SI.AbsolutePressure staticHeadOutlets_Pa_relative[N_outlets]
"relative pressure to liquid surface";
Medium.AbsolutePressure staticHeadRears_Pa_relative[N_rears]
SI.AbsolutePressure staticHeadRears_Pa_relative[N_rears]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.AbsolutePressure staticHeadRears_Pa_relative[N_rears]
SI.Pressure staticHeadRears_Pa_relative[N_rears]

SI.AbsolutePressure staticHeadRears_Pa_relative[N_rears]
"relative pressure to liquid surface";
Medium.AbsolutePressure staticHeadFores_Pa_relative[N_fores]
SI.AbsolutePressure staticHeadFores_Pa_relative[N_fores]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.AbsolutePressure staticHeadFores_Pa_relative[N_fores]
SI.Pressure staticHeadFores_Pa_relative[N_fores]

Comment on lines +159 to +160
SI.SpecificEnthalpy
h_in[N_inlets];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.SpecificEnthalpy
h_in[N_inlets];
SI.SpecificEnthalpy h_in[N_inlets];

Comment on lines +164 to +165
SI.SpecificEnthalpy
h_out[N_outlets];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.SpecificEnthalpy
h_out[N_outlets];
SI.SpecificEnthalpy h_out[N_outlets];

Comment on lines +173 to +174
SI.SpecificEnthalpy
h_rear[N_rears];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.SpecificEnthalpy
h_rear[N_rears];
SI.SpecificEnthalpy h_rear[N_rears];

Comment on lines +175 to +176
SI.SpecificEnthalpy
h_fore[N_fores];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.SpecificEnthalpy
h_fore[N_fores];
SI.SpecificEnthalpy h_fore[N_fores];

Comment on lines +183 to +184
SI.DerDensityByPressure
density_derp_h=(V_ref*medium.d)/(V*K)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SI.DerDensityByPressure
density_derp_h=(V_ref*medium.d)/(V*K)
SI.DerDensityByPressure density_derp_h=(V_ref*medium.d)/(V*K)

…directed.mo

Co-authored-by: RaphaelGebhart <159274394+RaphaelGebhart@users.noreply.github.com>
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