Skip to content

Commit

Permalink
Merge pull request modelica#4081 from tobolar/issue4080_gasForce2
Browse files Browse the repository at this point in the history
Introduce molar mass for better balance of SI units
  • Loading branch information
MartinOtter committed May 17, 2023
2 parents 620ece5 + e2ce981 commit 2c7116c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ model GasForce2 "Rough approximation of gas force in a combustion engine's cylin
parameter Real k=1;
*/
Real x "Normalized position of cylinder (= 1 - s_rel/L)";
SI.Density dens;
SI.AbsolutePressure press "Cylinder pressure";
SI.Volume V;
SI.Temperature T;
SI.Velocity v_rel "Relative piston velocity (<0: compression; >0: expansion)";

protected
constant SI.SpecificHeatCapacity R_air = Modelica.Constants.R/0.0289651159;
equation
x = 1 - s_rel/L;
v_rel = der(s_rel);
Expand All @@ -40,7 +37,6 @@ equation
f = -press*pi*d^2/4;

V = k0 + k1*(1 - x);
dens = press/(R_air*T);
press*V = k*T;

assert(s_rel >= -1e-12, "flange_b.s - flange_a.s (= " + String(s_rel,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
time
gasForce.dens
gasForce.f
gasForce.T
gasForce.V
Expand Down

0 comments on commit 2c7116c

Please sign in to comment.