Skip to content

Commit

Permalink
Improve incompressible media assert
Browse files Browse the repository at this point in the history
  • Loading branch information
nieweber committed Dec 4, 2023
1 parent c108e09 commit 50734a7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ThermofluidStream/Boundaries/Volume.mo
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ model Volume "Model of a vessel with fixed volume"
annotation(Dialog(enable = ((k_volume_damping > 0) and not density_derp_h_from_media), tab="Advanced", group="Damping"));

equation
assert(abs(Medium.density_derp_h(medium.state)) > 1e-12, "The simple Volume model should not be used with incompressible or nearly incompressible media. Consider using the FlexVolume instead.");
assert(abs(density_derp_h) > 1e-12, "The simple Volume model should not be used with incompressible or nearly incompressible media. Consider using the FlexVolume instead.", dropOfCommons.assertionLevel);

if density_derp_h_from_media then
density_derp_h = Medium.density_derp_h(medium.state);
Expand Down
2 changes: 1 addition & 1 deletion ThermofluidStream/Boundaries/VolumeMix.mo
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ model VolumeMix "Volume with N inlets that allows mixing"
annotation(Dialog(enable = ((k_volume_damping > 0) and not density_derp_h_from_media), tab="Advanced", group="Damping"));

equation
assert(abs(Medium.density_derp_h(medium.state)) > 1e-12, "The simple Volume model should not be used with incompressible or nearly incompressible media. Consider using the FlexVolume instead.");
assert(abs(density_derp_h) > 1e-12, "The simple Volume model should not be used with incompressible or nearly incompressible media. Consider using the FlexVolume instead.", dropOfCommons.assertionLevel);

if density_derp_h_from_media then
density_derp_h = Medium.density_derp_h(medium.state);
Expand Down
2 changes: 1 addition & 1 deletion ThermofluidStream/Undirected/Boundaries/Volume.mo
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ model Volume "Model of a vessel with fixed volume"
annotation(Dialog(enable = ((k_volume_damping > 0) and not density_derp_h_from_media), tab="Advanced", group="Damping"));

equation
assert(abs(Medium.density_derp_h(medium.state)) > 1e-12, "The simple Volume model should not be used with incompressible or nearly incompressible media. Consider using the FlexVolume instead.");
assert(abs(density_derp_h) > 1e-12, "The simple Volume model should not be used with incompressible or nearly incompressible media. Consider using the FlexVolume instead.", dropOfCommons.assertionLevel);

if density_derp_h_from_media then
density_derp_h = Medium.density_derp_h(medium.state);
Expand Down
2 changes: 1 addition & 1 deletion ThermofluidStream/Undirected/Boundaries/VolumeMix.mo
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ model VolumeMix "Volume with N_fore fores and N_rear rears that allows mixing"
annotation(Dialog(enable = ((k_volume_damping > 0) and not density_derp_h_from_media), tab="Advanced", group="Damping"));

equation
assert(abs(Medium.density_derp_h(medium.state)) > 1e-12, "The simple Volume model should not be used with incompressible or nearly incompressible media. Consider using the FlexVolume instead.");
assert(abs(density_derp_h) > 1e-12, "The simple Volume model should not be used with incompressible or nearly incompressible media. Consider using the FlexVolume instead.", dropOfCommons.assertionLevel);

if density_derp_h_from_media then
density_derp_h = Medium.density_derp_h(medium.state);
Expand Down

0 comments on commit 50734a7

Please sign in to comment.