aboutsummaryrefslogtreecommitdiffstats
path: root/engine.c
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-03-01 18:53:29 -0500
committerSam Anthony <sam@samanthony.xyz>2025-03-01 18:53:29 -0500
commitf7970f9b769369220ed3c607a27081b8ea93e409 (patch)
treed36fd0f30ef43f6ca1976307fe189f6b1e18dacd /engine.c
parent29a720e61568d6a9b215e804bb4ef999d9f7a7a5 (diff)
downloadvolute-f7970f9b769369220ed3c607a27081b8ea93e409.zip
add pressure ratio output
Diffstat (limited to 'engine.c')
-rw-r--r--engine.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/engine.c b/engine.c
index 1817180..5c1568d 100644
--- a/engine.c
+++ b/engine.c
@@ -13,6 +13,21 @@ init_engine(Engine *e) {
memset(e, 0, sizeof(*e));
}
+/* Pressure ratio across the compressor. */
+double
+pressure_ratio(const Engine *e) {
+ Pressure p1, p2;
+
+ p1 = e->ambient_pressure;
+ p2 = comp_outlet_pressure(e);
+ return p2 / p1;
+}
+
+Pressure
+comp_outlet_pressure(const Engine *e) {
+ return e->map + e->intercooler_deltap;
+}
+
VolumeFlowRate
volume_flow_rate(const Engine *e) {
double n = as_rpm(e->rpm);